From gerrit-no-reply at lists.osmocom.org Mon Apr 1 00:19:00 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 1 Apr 2019 00:19:00 +0000 Subject: Change in osmo-bts[master]: common/oml.c: fix: properly push abis_nm_ipa_magic Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13471 Change subject: common/oml.c: fix: properly push abis_nm_ipa_magic ...................................................................... common/oml.c: fix: properly push abis_nm_ipa_magic In oml_send_msg() we optionally push the A-bis IPA magic string ("com.ipaccess") to a given message buffer as LV (Length Value), including the terminating null byte ('\0'). There was a mix of both sizeof() and strlen() calls, and worse luck, memcpy() has been used in a wrong way, skipping the '\0': memcpy(dest, src, strlen(src)); In general, this is not critical because the headroom of a given message buffer would most likely be zero-initialized, so the '\0' is already there. However, msgb_push() gives no such guarantee. Let's use the libosmocore's TLV API (in particular, lv_put()), and stick to sizeof(), so the null byte will always be included. Change-Id: I0c7f8776d0caec40f9ed992db541f43b732e47ae Closes: OS#3022 --- M src/common/oml.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/71/13471/1 diff --git a/src/common/oml.c b/src/common/oml.c index c96a893..80d424f 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -94,9 +95,8 @@ if (is_manuf) { /* length byte, string + 0 termination */ - uint8_t *manuf = msgb_push(msg, 1 + sizeof(abis_nm_ipa_magic)); - manuf[0] = strlen(abis_nm_ipa_magic)+1; - memcpy(manuf+1, abis_nm_ipa_magic, strlen(abis_nm_ipa_magic)); + uint8_t *manuf = msgb_push(msg, LV_GROSS_LEN(sizeof(abis_nm_ipa_magic))); + lv_put(manuf, sizeof(abis_nm_ipa_magic), (const uint8_t *) abis_nm_ipa_magic); } /* Push the main OML header and send it off */ -- To view, visit https://gerrit.osmocom.org/13471 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0c7f8776d0caec40f9ed992db541f43b732e47ae Gerrit-Change-Number: 13471 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 00:20:15 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 1 Apr 2019 00:20:15 +0000 Subject: Change in osmo-msc[master]: MT-forwardSM Message Reference fix. In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13464 ) Change subject: MT-forwardSM Message Reference fix. ...................................................................... Patch Set 1: > How would it break MO-SMS? The methods where trans->sms.msg_ref_gsup > is used are used only for MT-SMS. Do I miss something? Oh, yes, you're right! I was wrong here. -- To view, visit https://gerrit.osmocom.org/13464 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia50fd0e6c7ba7876522f49a00c55f8499c164331 Gerrit-Change-Number: 13464 Gerrit-PatchSet: 1 Gerrit-Owner: Mykola Shchetinin Gerrit-Assignee: fixeria Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: fixeria Gerrit-Comment-Date: Mon, 01 Apr 2019 00:20:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 01:16:18 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 1 Apr 2019 01:16:18 +0000 Subject: Change in osmo-trx[master]: multi-ARFCN: fix maximum number of carriers limitation Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13472 Change subject: multi-ARFCN: fix maximum number of carriers limitation ...................................................................... multi-ARFCN: fix maximum number of carriers limitation Maximum number of carriers is fixed to 3 channels on a single physical RF channel in multi-ARFCN mode. For some reason, it was limited to 5. Let's fix this, and also follow this limitation in the following VTY command handlers: - cfg_multi_arfcn_cmd, - cfg_chan_cmd. Change-Id: I66a1462f368458afd313ee6f0bc0abc496dde817 --- M CommonLibs/trx_vty.c M CommonLibs/trx_vty.h M Transceiver52M/osmo-trx.cpp 3 files changed, 16 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/72/13472/1 diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c index 3b1b979..e219d5e 100644 --- a/CommonLibs/trx_vty.c +++ b/CommonLibs/trx_vty.c @@ -236,12 +236,16 @@ if (strcmp("disable", argv[0]) == 0) { trx->cfg.multi_arfcn = false; - } else if (strcmp("enable", argv[0]) == 0) { - trx->cfg.multi_arfcn = true; - } else { + return CMD_SUCCESS; + } + + if (trx->cfg.num_chans > TRX_MCHAN_MAX) { + vty_out(vty, "Up to %i channels is supported for multi-TRX mode%s", + TRX_MCHAN_MAX, VTY_NEWLINE); return CMD_WARNING; } + trx->cfg.multi_arfcn = true; return CMD_SUCCESS; } @@ -354,7 +358,12 @@ if (idx >= TRX_CHAN_MAX) { vty_out(vty, "Chan list full.%s", VTY_NEWLINE); return CMD_WARNING; + } else if (trx->cfg.multi_arfcn && trx->cfg.num_chans >= TRX_MCHAN_MAX) { + vty_out(vty, "Up to %i channels is supported for multi-TRX mode%s", + TRX_MCHAN_MAX, VTY_NEWLINE); + return CMD_WARNING; } + if (trx->cfg.num_chans < idx) { /* Unexisting or creating non-consecutive */ vty_out(vty, "Non-existent or non-consecutive chan %d.%s", idx, VTY_NEWLINE); diff --git a/CommonLibs/trx_vty.h b/CommonLibs/trx_vty.h index 8d251ee..8e91113 100644 --- a/CommonLibs/trx_vty.h +++ b/CommonLibs/trx_vty.h @@ -6,7 +6,10 @@ extern struct vty_app_info g_vty_info; +/* Maximum number of physical RF channels */ #define TRX_CHAN_MAX 8 +/* Maximum number of carriers in multi-ARFCN mode */ +#define TRX_MCHAN_MAX 3 /* Samples-per-symbol for downlink path * 4 - Uses precision modulator (more computation, less distortion) diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 0141810..220972f 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -369,7 +369,7 @@ int trx_validate_config(struct trx_ctx *trx) { - if (trx->cfg.multi_arfcn && trx->cfg.num_chans > 5) { + if (trx->cfg.multi_arfcn && trx->cfg.num_chans > TRX_MCHAN_MAX) { LOG(ERROR) << "Unsupported number of channels"; return -1; } -- To view, visit https://gerrit.osmocom.org/13472 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I66a1462f368458afd313ee6f0bc0abc496dde817 Gerrit-Change-Number: 13472 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Tom Tsou -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 01:16:19 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 1 Apr 2019 01:16:19 +0000 Subject: Change in osmo-trx[master]: doc/configuration.adoc: fix incorrect number of physical RF channels ... Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13473 Change subject: doc/configuration.adoc: fix incorrect number of physical RF channels for B210 ...................................................................... doc/configuration.adoc: fix incorrect number of physical RF channels for B210 Change-Id: I58e2bf5dd99e1655ebd2ad80f6ed2bb178f0e88d --- M doc/manuals/chapters/configuration.adoc 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/73/13473/1 diff --git a/doc/manuals/chapters/configuration.adoc b/doc/manuals/chapters/configuration.adoc index 87d7903..ad6742d 100644 --- a/doc/manuals/chapters/configuration.adoc +++ b/doc/manuals/chapters/configuration.adoc @@ -46,7 +46,7 @@ added specifically in commit `76764278169d252980853251daeb9f1ba0c246e1`. This feature is useful for instance if you want to run more than 1 TRX with an -Ettus B200 device, or 3 TRX with an Ettus B210 device, since they support only 1 +Ettus B200 device, or 2 TRX with an Ettus B210 device, since they support only 1 and 2 physical RF channels respectively. No device from other providers or even other devices than B200 and B210 from Ettus are known to support this feature. -- To view, visit https://gerrit.osmocom.org/13473 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I58e2bf5dd99e1655ebd2ad80f6ed2bb178f0e88d Gerrit-Change-Number: 13473 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 07:43:45 2019 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Mon, 1 Apr 2019 07:43:45 +0000 Subject: Change in gr-gsm[master]: Improve slightly interface of plotting so it's easier to use it Message-ID: Piotr Krysik has uploaded this change for review. ( https://gerrit.osmocom.org/13474 Change subject: Improve slightly interface of plotting so it's easier to use it ...................................................................... Improve slightly interface of plotting so it's easier to use it Change-Id: Ia70ab45a8beb81512a9f83e316ad2d2bc385ef19 --- M include/grgsm/plotting.hpp 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/74/13474/1 diff --git a/include/grgsm/plotting.hpp b/include/grgsm/plotting.hpp index 21890e4..d4e6933 100644 --- a/include/grgsm/plotting.hpp +++ b/include/grgsm/plotting.hpp @@ -31,7 +31,7 @@ boost::shared_ptr current_figure; -void imagesc(arma::mat & x){ +void imagesc(const arma::mat & x){ Gnuplot gp; gp << "set palette rgb 3,2,2;"; gp << "plot "; @@ -39,7 +39,7 @@ gp << std::endl; } -void plot(arma::cx_mat & x, std::string title){ +void plot(const arma::cx_mat & x, std::string title){ arma::mat y = arma::abs(x); if(current_figure.get()==NULL){ current_figure = boost::make_shared(); @@ -50,7 +50,7 @@ (*current_figure) << std::endl; } -void replot(arma::cx_mat & x, std::string title){ +void replot(const arma::cx_mat & x, std::string title){ arma::mat y = arma::abs(x); if(current_figure.get()==NULL){ current_figure = boost::make_shared(); @@ -61,19 +61,19 @@ } template -void plot(std::vector & x){ +void plot(const std::vector & x){ arma::cx_mat y = arma::conv_to::from(x); plot(y,""); } template -void plot(std::vector & x, std::string title){ +void plot(const std::vector & x, std::string title){ arma::cx_mat y = arma::conv_to::from(x); plot(y,title); } template -void replot(std::vector & x, std::string title){ +void replot(const std::vector & x, std::string title){ arma::cx_mat y = arma::conv_to::from(x); replot(y,title); } -- To view, visit https://gerrit.osmocom.org/13474 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia70ab45a8beb81512a9f83e316ad2d2bc385ef19 Gerrit-Change-Number: 13474 Gerrit-PatchSet: 1 Gerrit-Owner: Piotr Krysik -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 07:50:19 2019 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Mon, 1 Apr 2019 07:50:19 +0000 Subject: Change in gr-gsm[master]: Improve slightly interface of plotting so it's easier to use it In-Reply-To: References: Message-ID: Piotr Krysik has posted comments on this change. ( https://gerrit.osmocom.org/13474 ) Change subject: Improve slightly interface of plotting so it's easier to use it ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13474 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia70ab45a8beb81512a9f83e316ad2d2bc385ef19 Gerrit-Change-Number: 13474 Gerrit-PatchSet: 1 Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Piotr Krysik Gerrit-Comment-Date: Mon, 01 Apr 2019 07:50:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 07:50:21 2019 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Mon, 1 Apr 2019 07:50:21 +0000 Subject: Change in gr-gsm[master]: Improve slightly interface of plotting so it's easier to use it In-Reply-To: References: Message-ID: Piotr Krysik has submitted this change and it was merged. ( https://gerrit.osmocom.org/13474 ) Change subject: Improve slightly interface of plotting so it's easier to use it ...................................................................... Improve slightly interface of plotting so it's easier to use it Change-Id: Ia70ab45a8beb81512a9f83e316ad2d2bc385ef19 --- M include/grgsm/plotting.hpp 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Piotr Krysik: Looks good to me, approved; Verified diff --git a/include/grgsm/plotting.hpp b/include/grgsm/plotting.hpp index 21890e4..d4e6933 100644 --- a/include/grgsm/plotting.hpp +++ b/include/grgsm/plotting.hpp @@ -31,7 +31,7 @@ boost::shared_ptr current_figure; -void imagesc(arma::mat & x){ +void imagesc(const arma::mat & x){ Gnuplot gp; gp << "set palette rgb 3,2,2;"; gp << "plot "; @@ -39,7 +39,7 @@ gp << std::endl; } -void plot(arma::cx_mat & x, std::string title){ +void plot(const arma::cx_mat & x, std::string title){ arma::mat y = arma::abs(x); if(current_figure.get()==NULL){ current_figure = boost::make_shared(); @@ -50,7 +50,7 @@ (*current_figure) << std::endl; } -void replot(arma::cx_mat & x, std::string title){ +void replot(const arma::cx_mat & x, std::string title){ arma::mat y = arma::abs(x); if(current_figure.get()==NULL){ current_figure = boost::make_shared(); @@ -61,19 +61,19 @@ } template -void plot(std::vector & x){ +void plot(const std::vector & x){ arma::cx_mat y = arma::conv_to::from(x); plot(y,""); } template -void plot(std::vector & x, std::string title){ +void plot(const std::vector & x, std::string title){ arma::cx_mat y = arma::conv_to::from(x); plot(y,title); } template -void replot(std::vector & x, std::string title){ +void replot(const std::vector & x, std::string title){ arma::cx_mat y = arma::conv_to::from(x); replot(y,title); } -- To view, visit https://gerrit.osmocom.org/13474 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia70ab45a8beb81512a9f83e316ad2d2bc385ef19 Gerrit-Change-Number: 13474 Gerrit-PatchSet: 1 Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Piotr Krysik -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 08:26:36 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 1 Apr 2019 08:26:36 +0000 Subject: Change in osmo-bts[master]: common/oml.c: fix: properly push abis_nm_ipa_magic In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13471 ) Change subject: common/oml.c: fix: properly push abis_nm_ipa_magic ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13471 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0c7f8776d0caec40f9ed992db541f43b732e47ae Gerrit-Change-Number: 13471 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 01 Apr 2019 08:26:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 08:29:17 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 1 Apr 2019 08:29:17 +0000 Subject: Change in osmo-trx[master]: multi-ARFCN: fix maximum number of carriers limitation In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13472 ) Change subject: multi-ARFCN: fix maximum number of carriers limitation ...................................................................... Patch Set 1: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/13472/1/CommonLibs/trx_vty.c File CommonLibs/trx_vty.c: https://gerrit.osmocom.org/#/c/13472/1/CommonLibs/trx_vty.c at 243 PS1, Line 243: vty_out(vty, "Up to %i channels is supported for multi-TRX mode%s", are supported https://gerrit.osmocom.org/#/c/13472/1/CommonLibs/trx_vty.c at 362 PS1, Line 362: vty_out(vty, "Up to %i channels is supported for multi-TRX mode%s", are supported -- To view, visit https://gerrit.osmocom.org/13472 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I66a1462f368458afd313ee6f0bc0abc496dde817 Gerrit-Change-Number: 13472 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Tom Tsou Gerrit-Comment-Date: Mon, 01 Apr 2019 08:29:17 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 08:29:44 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 1 Apr 2019 08:29:44 +0000 Subject: Change in osmo-trx[master]: doc/configuration.adoc: fix incorrect number of physical RF channels ... In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13473 ) Change subject: doc/configuration.adoc: fix incorrect number of physical RF channels for B210 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13473 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I58e2bf5dd99e1655ebd2ad80f6ed2bb178f0e88d Gerrit-Change-Number: 13473 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 01 Apr 2019 08:29:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 09:11:26 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 1 Apr 2019 09:11:26 +0000 Subject: Change in osmo-trx[master]: osmo-trx: Use signalfd to serialize signals in main thread ctx In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13468 ) Change subject: osmo-trx: Use signalfd to serialize signals in main thread ctx ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13468 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9b9d9793be9af11dbe433e0ce09b7ac57a3bdfb5 Gerrit-Change-Number: 13468 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 01 Apr 2019 09:11:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 09:11:27 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 1 Apr 2019 09:11:27 +0000 Subject: Change in osmo-trx[master]: osmo-trx: Use signalfd to serialize signals in main thread ctx In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13468 ) Change subject: osmo-trx: Use signalfd to serialize signals in main thread ctx ...................................................................... osmo-trx: Use signalfd to serialize signals in main thread ctx This should avoid prolematic scenarios where different signal handlers are running on different thread in parallel. Furthermore, we make sure those signals are always run by main loop thread. Change-Id: I9b9d9793be9af11dbe433e0ce09b7ac57a3bdfb5 --- M Transceiver52M/osmo-trx.cpp 1 file changed, 46 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 0141810..88b9de0 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -66,6 +67,7 @@ static char* config_file = (char*)DEFAULT_CONFIG_FILE; +struct osmo_fd signal_ofd; volatile bool gshutdown = false; static void *tall_trx_ctx; @@ -185,20 +187,57 @@ case SIGUSR2: talloc_report_full(tall_trx_ctx, stderr); break; + case SIGHUP: + log_targets_reopen(); default: break; } + +} + +static int signalfd_callback(struct osmo_fd *ofd, unsigned int what) +{ + struct signalfd_siginfo fdsi; + ssize_t s; + + s = read(ofd->fd, &fdsi, sizeof(struct signalfd_siginfo)); + if (s < 0) { + LOG(FATAL) << "Failed to read from signalfd ("<< ofd->fd << "): " << errno; + gshutdown = true; + return 0; + } + sig_handler(fdsi.ssi_signo); + return 0; } static void setup_signal_handlers() { - /* Handle keyboard interrupt SIGINT */ - signal(SIGINT, &sig_handler); - signal(SIGTERM, &sig_handler); + sigset_t set; + int sfd; + signal(SIGABRT, &sig_handler); - signal(SIGUSR1, &sig_handler); - signal(SIGUSR2, &sig_handler); osmo_init_ignore_signals(); + + /* Other threads created by this thread (main) will inherit a copy of the + signal mask. */ + sigemptyset(&set); + sigaddset(&set, SIGINT); + sigaddset(&set, SIGTERM); + sigaddset(&set, SIGUSR1); + sigaddset(&set, SIGUSR2); + sigaddset(&set, SIGHUP); + if (pthread_sigmask(SIG_BLOCK, &set, NULL)) { + fprintf(stderr, "pthread_sigmask() failed.\n"); + exit(EXIT_FAILURE); + } + + if ((sfd = signalfd(-1, &set, 0)) == -1) { + fprintf(stderr, "signalfd() failed (%d).\n", errno); + exit(EXIT_FAILURE); + } + + osmo_fd_setup(&signal_ofd, sfd, OSMO_FD_READ, signalfd_callback, NULL, 0); + osmo_fd_register(&signal_ofd); } static void print_help() @@ -594,5 +633,7 @@ trx_stop(); + osmo_fd_unregister(&signal_ofd); + osmo_fd_close(&signal_ofd); return 0; } -- To view, visit https://gerrit.osmocom.org/13468 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9b9d9793be9af11dbe433e0ce09b7ac57a3bdfb5 Gerrit-Change-Number: 13468 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 09:26:12 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Mon, 1 Apr 2019 09:26:12 +0000 Subject: Change in osmo-msc[master]: MT-forwardSM Message Reference fix. In-Reply-To: References: Message-ID: Mykola Shchetinin has posted comments on this change. ( https://gerrit.osmocom.org/13464 ) Change subject: MT-forwardSM Message Reference fix. ...................................................................... Patch Set 1: > there is still a risk of collision: imagine SMSC initiating a MT SMS with e.g. 0xde, and at the same time the same subscriber initiates MO SMS with 0xde! This would result in an unexpected behaviour as on the SMSC's side, as on the subscriber's side. Hmm. Would it? I don't see how it affects the subscriber's side as the Message References between the subscriber and MSC are sort of private and allocated only by MSC. And the GSUP-server side should be responsible for mapping invokeIds (if it uses MAP) with message references then, right? I mean if message references for MO and MT coincide, then there is still a way to differentiate between them because GSUP messages are different for MOs and MTs. What do you think? I don't see yet what other resolution there could be... -- To view, visit https://gerrit.osmocom.org/13464 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia50fd0e6c7ba7876522f49a00c55f8499c164331 Gerrit-Change-Number: 13464 Gerrit-PatchSet: 1 Gerrit-Owner: Mykola Shchetinin Gerrit-Assignee: fixeria Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: fixeria Gerrit-Comment-Date: Mon, 01 Apr 2019 09:26:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 09:57:13 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 1 Apr 2019 09:57:13 +0000 Subject: Change in osmo-trx[master]: multi-ARFCN: fix maximum number of carriers limitation In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Tom Tsou, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13472 to look at the new patch set (#2). Change subject: multi-ARFCN: fix maximum number of carriers limitation ...................................................................... multi-ARFCN: fix maximum number of carriers limitation Maximum number of carriers is fixed to 3 channels on a single physical RF channel in multi-ARFCN mode. For some reason, it was limited to 5. Let's fix this, and also follow this limitation in the following VTY command handlers: - cfg_multi_arfcn_cmd, - cfg_chan_cmd. Change-Id: I66a1462f368458afd313ee6f0bc0abc496dde817 --- M CommonLibs/trx_vty.c M CommonLibs/trx_vty.h M Transceiver52M/osmo-trx.cpp 3 files changed, 16 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/72/13472/2 -- To view, visit https://gerrit.osmocom.org/13472 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I66a1462f368458afd313ee6f0bc0abc496dde817 Gerrit-Change-Number: 13472 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Tom Tsou -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 09:57:36 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 1 Apr 2019 09:57:36 +0000 Subject: Change in osmo-trx[master]: multi-ARFCN: fix maximum number of carriers limitation In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13472 ) Change subject: multi-ARFCN: fix maximum number of carriers limitation ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13472 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I66a1462f368458afd313ee6f0bc0abc496dde817 Gerrit-Change-Number: 13472 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Tom Tsou Gerrit-Comment-Date: Mon, 01 Apr 2019 09:57:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 11:50:30 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 1 Apr 2019 11:50:30 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: fix incorrect SMS UD length truncation In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13470 ) Change subject: libmsc/db.c: fix incorrect SMS UD length truncation ...................................................................... Patch Set 1: Code-Review+1 (1 comment) makes sense from the type safety angle. Not sure whether truncating SMS data is what we should do, but this patch is definitely an improvement. https://gerrit.osmocom.org/#/c/13470/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13470/1//COMMIT_MSG at 28 PS1, Line 28: 'sms->user_data_len' is of type 'uint8_t', these warnings make sense. until now the commit log reads like a verbose version of "fix compiler warning" ... the interesting part starts below, "fix integer overflow". It's fine, leave it, maybe next time start with the interesting bit :) -- To view, visit https://gerrit.osmocom.org/13470 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibbd588545e1a4817504c806a3d02cf59d5938ee2 Gerrit-Change-Number: 13470 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Mon, 01 Apr 2019 11:50:30 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 11:55:36 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 1 Apr 2019 11:55:36 +0000 Subject: Change in osmo-msc[master]: libmsc/sms_queue.c: fix memleak in smsq_take_next_sms() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13450 ) Change subject: libmsc/sms_queue.c: fix memleak in smsq_take_next_sms() ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13450 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iad5e4d84d8d410ea43d5907e9ddf6e5fdb55bc7a Gerrit-Change-Number: 13450 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 01 Apr 2019 11:55:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 12:02:58 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 1 Apr 2019 12:02:58 +0000 Subject: Change in osmo-msc[master]: libmsc/sms_queue.c: fix memleak in smsq_take_next_sms() In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13450 ) Change subject: libmsc/sms_queue.c: fix memleak in smsq_take_next_sms() ...................................................................... libmsc/sms_queue.c: fix memleak in smsq_take_next_sms() A memleak has been noticed after executing some of TTCN-3 test cases. For example, the following ones: - MSC_Tests.TC_lu_and_mo_sms, - MSC_Tests.TC_lu_and_mt_sms. The key point is that MSC_Tests.TC_lu_and_mo_sms basically sends a MO SMS to a non-attached subscriber with MSISDN 12345, so this message is getting stored in the SMSC's database. As soon as the SMSC's queue is triggered, sms_submit_pending() would retrieve pending messages from the database by calling function smsq_take_next_sms() in loop and attempt to deliver them. This function in it's turn checks whether the subscriber is attached or not. If not, the allocated 'gsm_sms' structure would not be free()ed! Therefore, every time smsq_take_next_sms() is called, one 'gsm_sms' structure for an unattached subscriber is leaked. Furthermore, there is a unit test called 'sms_queue_test', that actually does cover smsq_take_next_sms() and was designed to catch some potential memory leaks, but... In order to avoid emulating the low-level SQLite API, the unit test by design overwrites some functions of libmsc, including db_sms_get_next_unsent_rr_msisdn(), that is being called by smsq_take_next_sms(). The problem is that the original function in libmsc does allocate a 'gsm_sms' structure on heap (using talloc), while the overwriting function did this statically, returning a pointer to stack. This critical difference made it impossible to spot the memleak in smsq_take_next_sms() during the unit test execution. Let's refactor 'sms_queue_test' to use dynamic memory allocation, and finally fix the evil memleak in smsq_take_next_sms(). Change-Id: Iad5e4d84d8d410ea43d5907e9ddf6e5fdb55bc7a Closes: OS#3860 --- M src/libmsc/sms_queue.c M tests/sms_queue/sms_queue_test.c 2 files changed, 37 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Neels Hofmeyr: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index c924dde..274c712 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -226,8 +226,13 @@ osmo_strlcpy(last_msisdn, sms->dst.addr, last_msisdn_buflen); /* Is the subscriber attached? If not, go to next SMS */ - if (!sms->receiver || !sms->receiver->lu_complete) + if (!sms->receiver || !sms->receiver->lu_complete) { + LOGP(DLSMS, LOGL_DEBUG, + "Subscriber %s is not attached, skipping SMS %llu\n", + vlr_subscr_msisdn_or_name(sms->receiver), sms->id); + sms_free(sms); continue; + } return sms; } diff --git a/tests/sms_queue/sms_queue_test.c b/tests/sms_queue/sms_queue_test.c index e426377..f64f715 100644 --- a/tests/sms_queue/sms_queue_test.c +++ b/tests/sms_queue/sms_queue_test.c @@ -26,8 +26,10 @@ #include #include #include +#include static void *talloc_ctx = NULL; +extern void *tall_gsms_ctx; struct gsm_sms *smsq_take_next_sms(struct gsm_network *net, char *last_msisdn, @@ -45,8 +47,6 @@ printf(" (last_msisdn='%s')\n", last_msisdn? last_msisdn : "NULL"); } -static struct gsm_sms fake_sms = { 0 }; - struct { const char *msisdn; int nr_of_sms; @@ -91,11 +91,19 @@ const char *last_msisdn, unsigned int max_failed) { - static struct vlr_subscr arbitrary_vsub = { .lu_complete = true }; + static struct vlr_subscr arbitrary_vsub; + struct gsm_sms *sms; int i; printf(" hitting database: looking for MSISDN > '%s', failed_attempts <= %d\n", last_msisdn, max_failed); + /* Every time we call sms_free(), the internal logic of libmsc + * may call vlr_subscr_put() on our arbitrary_vsub, what would + * lead to a segfault if its use_count <= 0. To prevent this, + * let's ensure a big enough initial value. */ + arbitrary_vsub.use_count = 1000; + arbitrary_vsub.lu_complete = true; + for (i = 0; i < ARRAY_SIZE(fake_sms_db); i++) { if (!fake_sms_db[i].nr_of_sms) continue; @@ -103,14 +111,19 @@ continue; if (fake_sms_db[i].failed_attempts > max_failed) continue; - osmo_strlcpy(fake_sms.dst.addr, fake_sms_db[i].msisdn, - sizeof(fake_sms.dst.addr)); - fake_sms.receiver = fake_sms_db[i].vsub_attached? &arbitrary_vsub : NULL; - osmo_strlcpy(fake_sms.text, fake_sms_db[i].msisdn, sizeof(fake_sms.text)); + + sms = sms_alloc(); + OSMO_ASSERT(sms); + + osmo_strlcpy(sms->dst.addr, fake_sms_db[i].msisdn, + sizeof(sms->dst.addr)); + sms->receiver = fake_sms_db[i].vsub_attached? &arbitrary_vsub : NULL; + osmo_strlcpy(sms->text, fake_sms_db[i].msisdn, sizeof(sms->text)); if (fake_sms_db[i].vsub_attached) fake_sms_db[i].nr_of_sms--; - return &fake_sms; + return sms; } + return NULL; } @@ -127,6 +140,10 @@ printf("-->\n"); } +/* sms_free() is not safe against NULL */ +#define sms_free_safe(sms) \ + if (sms != NULL) sms_free(sms) + static void test_next_sms() { int i; @@ -141,6 +158,7 @@ struct gsm_sms *sms = smsq_take_next_sms(NULL, last_msisdn, sizeof(last_msisdn)); _test_take_next_sms_print(i, sms, last_msisdn); OSMO_ASSERT(i >= 4 || sms); + sms_free_safe(sms); } printf("\n- SMS are pending at various nr failed attempts (cutoff at >= 10)\n"); @@ -156,6 +174,7 @@ struct gsm_sms *sms = smsq_take_next_sms(NULL, last_msisdn, sizeof(last_msisdn)); _test_take_next_sms_print(i, sms, last_msisdn); OSMO_ASSERT(i >= 2 || sms); + sms_free_safe(sms); } printf("\n- iterate the SMS DB at most once\n"); @@ -206,6 +225,10 @@ logging_ctx = talloc_named_const(talloc_ctx, 0, "logging"); osmo_init_logging2(logging_ctx, &info); + /* Share our talloc context with libmsc's GSM 04.11 code, + * so sms_alloc() would use it instead of NULL. */ + tall_gsms_ctx = talloc_ctx; + OSMO_ASSERT(osmo_stderr_target); log_set_use_color(osmo_stderr_target, 0); log_set_print_timestamp(osmo_stderr_target, 0); -- To view, visit https://gerrit.osmocom.org/13450 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iad5e4d84d8d410ea43d5907e9ddf6e5fdb55bc7a Gerrit-Change-Number: 13450 Gerrit-PatchSet: 5 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 12:02:59 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 1 Apr 2019 12:02:59 +0000 Subject: Change in osmo-msc[master]: tests/sms_queue: track the use of NULL talloc memory contexts In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13469 ) Change subject: tests/sms_queue: track the use of NULL talloc memory contexts ...................................................................... tests/sms_queue: track the use of NULL talloc memory contexts As we don't initialize all talloc contects of libmsc, let's make sure that there is nothing left in the NULL context after the unit test execution is finished. Change-Id: I99fd82750aff376e4d90eaa2402ec41f4d59ef86 --- M tests/sms_queue/sms_queue_test.c M tests/sms_queue/sms_queue_test.err 2 files changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/sms_queue/sms_queue_test.c b/tests/sms_queue/sms_queue_test.c index f64f715..84ca6b5 100644 --- a/tests/sms_queue/sms_queue_test.c +++ b/tests/sms_queue/sms_queue_test.c @@ -220,6 +220,9 @@ void *msgb_ctx; void *logging_ctx; + /* Track the use of talloc NULL memory contexts */ + talloc_enable_null_tracking(); + talloc_ctx = talloc_named_const(NULL, 0, "sms_queue_test"); msgb_ctx = msgb_talloc_ctx_init(talloc_ctx, 0); logging_ctx = talloc_named_const(talloc_ctx, 0, "logging"); @@ -258,6 +261,9 @@ OSMO_ASSERT(talloc_total_size(talloc_ctx) == 0); talloc_free(talloc_ctx); + talloc_report_full(NULL, stderr); + talloc_disable_null_tracking(); + return 0; } diff --git a/tests/sms_queue/sms_queue_test.err b/tests/sms_queue/sms_queue_test.err index e69de29..bfc1aff 100644 --- a/tests/sms_queue/sms_queue_test.err +++ b/tests/sms_queue/sms_queue_test.err @@ -0,0 +1 @@ +full talloc report on 'null_context' (total 0 bytes in 1 blocks) -- To view, visit https://gerrit.osmocom.org/13469 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I99fd82750aff376e4d90eaa2402ec41f4d59ef86 Gerrit-Change-Number: 13469 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 12:08:50 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 1 Apr 2019 12:08:50 +0000 Subject: Change in osmo-msc[master]: a_iface_bssap: check bssmap length field In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13307 ) Change subject: a_iface_bssap: check bssmap length field ...................................................................... Patch Set 5: Code-Review-2 In current osmo-msc refactoring, I have the same checks in place, except my version discards the messages completely. http://git.osmocom.org/osmo-msc/tree/src/libmsc/nas_a.c?h=neels/ho#n555 Maybe we should truncate if extra bytes are present, and discard if too few bytes are present? What do you think? Either way let's avoid the merge conflict and not merge this version. Rather apply to branch neels/ho file nas_a.c. -- To view, visit https://gerrit.osmocom.org/13307 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3b89dd5a66ec83b03860b58b6b8eb58007f433a4 Gerrit-Change-Number: 13307 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 01 Apr 2019 12:08:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 12:12:54 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 1 Apr 2019 12:12:54 +0000 Subject: Change in osmo-msc[master]: a_iface_bssap: add context information to log output In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13319 ) Change subject: a_iface_bssap: add context information to log output ...................................................................... Patch Set 5: Code-Review-2 I completely agree with the intent, that's why I have added context to the logging in the current refactoring of osmo-msc, on branch neels/ho. If anything is still missing on that branch, let's apply it there instead of introducing merge conflicts. I'm sorry to block your work, but I think the osmo-msc status has been clear? -- To view, visit https://gerrit.osmocom.org/13319 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I704954edc8677688fc7cccd2b23d2aff958ebf32 Gerrit-Change-Number: 13319 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Mon, 01 Apr 2019 12:12:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 12:14:49 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 1 Apr 2019 12:14:49 +0000 Subject: Change in osmo-msc[master]: Log protocol for which transaction is allocated In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13420 ) Change subject: Log protocol for which transaction is allocated ...................................................................... Patch Set 2: Code-Review-2 this patch is obsoleted by the patch called "add LOG_TRANS, proper context for all transactions" on my current osmo-msc refactoring branch 'neels/ho' -- To view, visit https://gerrit.osmocom.org/13420 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If4a5f3ecaec568b3f8d5a57d864184d7af2b95cc Gerrit-Change-Number: 13420 Gerrit-PatchSet: 2 Gerrit-Owner: Max Gerrit-Assignee: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-CC: Harald Welte Gerrit-Comment-Date: Mon, 01 Apr 2019 12:14:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 13:01:36 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 1 Apr 2019 13:01:36 +0000 Subject: Change in pysim[master]: cards: sysmo-usim-sjs1: add programming of EF.PLMNsel, EF.PLMNwAcT an... In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13340 ) Change subject: cards: sysmo-usim-sjs1: add programming of EF.PLMNsel, EF.PLMNwAcT and EF.OPLMNwAcT ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13340 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0cac3041f1902383d98d6dc211cf31ae6e3a610b Gerrit-Change-Number: 13340 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: K?vin Redon Gerrit-Reviewer: dexter Gerrit-CC: Max Gerrit-Comment-Date: Mon, 01 Apr 2019 13:01:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 13:10:05 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 1 Apr 2019 13:10:05 +0000 Subject: Change in pysim[master]: cards: sysmo-usim-sjs1: add programming of EF.PLMNsel, EF.PLMNwAcT an... In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/13340 ) Change subject: cards: sysmo-usim-sjs1: add programming of EF.PLMNsel, EF.PLMNwAcT and EF.OPLMNwAcT ...................................................................... cards: sysmo-usim-sjs1: add programming of EF.PLMNsel, EF.PLMNwAcT and EF.OPLMNwAcT The files EF.PLMNsel, EF.PLMNwAcT and EF.OPLMNwAcT are currently not programmed for sysmo-usim-sjs1, lets add them. Change-Id: I0cac3041f1902383d98d6dc211cf31ae6e3a610b Related: OS#3850 --- M pySim/cards.py 1 file changed, 20 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Daniel Willmann: Looks good to me, but someone else must approve diff --git a/pySim/cards.py b/pySim/cards.py index 3a25040..1012cfd 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -536,7 +536,7 @@ def __init__(self, ssc): super(SysmoUSIMSJS1, self).__init__(ssc) self._scc.cla_byte = "00" - self._scc.sel_ctrl = "000C" + self._scc.sel_ctrl = "0004" #request an FCP @classmethod def autodetect(kls, scc): @@ -575,6 +575,25 @@ # write EF.IMSI data, sw = self._scc.update_binary('6f07', enc_imsi(p['imsi'])) + # EF.PLMNsel + if p.get('mcc') and p.get('mnc'): + sw = self.update_plmnsel(p['mcc'], p['mnc']) + if sw != '9000': + print("Programming PLMNsel failed with code %s"%sw) + + # EF.PLMNwAcT + if p.get('mcc') and p.get('mnc'): + sw = self.update_plmn_act(p['mcc'], p['mnc']) + if sw != '9000': + print("Programming PLMNwAcT failed with code %s"%sw) + + # EF.OPLMNwAcT + if p.get('mcc') and p.get('mnc'): + sw = self.update_oplmn_act(p['mcc'], p['mnc']) + if sw != '9000': + print("Programming OPLMNwAcT failed with code %s"%sw) + + # EF.SMSP r = self._scc.select_file(['3f00', '7f10']) data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 104), force_len=True) -- To view, visit https://gerrit.osmocom.org/13340 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0cac3041f1902383d98d6dc211cf31ae6e3a610b Gerrit-Change-Number: 13340 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: K?vin Redon Gerrit-Reviewer: dexter Gerrit-CC: Max -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 13:50:37 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 1 Apr 2019 13:50:37 +0000 Subject: Change in pysim[master]: fixup Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13475 Change subject: fixup ...................................................................... fixup Change-Id: Iecec05aeaca4ab4578a5a240802c01a24cd52597 --- M pySim/cards.py 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/75/13475/1 diff --git a/pySim/cards.py b/pySim/cards.py index 6a26dc7..fb84a8d 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -119,9 +119,16 @@ return sw def update_ad(self, mnc): + #See also: 3GPP TS 31.102, chapter 4.2.18 + mnclen = len(str(mnc)) + if mnclen == 1: + mnclen = 2 + if mnclen > 3: + raise RuntimeError('unable to calculate proper mnclen') + data = self._scc.read_binary(EF['AD'], length=None, offset=0) size = len(data[0])/2 - content = data[0][0:6] + "%02X" % len(str(mnc)) + content = data[0][0:6] + "%02X" % mnclen data, sw = self._scc.update_binary(EF['AD'], content) return sw -- To view, visit https://gerrit.osmocom.org/13475 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iecec05aeaca4ab4578a5a240802c01a24cd52597 Gerrit-Change-Number: 13475 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 13:50:38 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 1 Apr 2019 13:50:38 +0000 Subject: Change in pysim[master]: cosmetic: fix sourecode formatting Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13476 Change subject: cosmetic: fix sourecode formatting ...................................................................... cosmetic: fix sourecode formatting Change-Id: I4836826811ffb0aeb103d32eb874f5fa52af4186 --- M pySim/cards.py 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/76/13476/1 diff --git a/pySim/cards.py b/pySim/cards.py index fb84a8d..d912a7a 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -338,12 +338,12 @@ # Set first entry entry = ( - '81' + # 1b Status: Valid & Active + '81' + # 1b Status: Valid & Active rpad(b2h(p['name'][0:14]), 28) + # 14b Entry Name - enc_iccid(p['iccid']) + # 10b ICCID - enc_imsi(p['imsi']) + # 9b IMSI_len + id_type(9) + IMSI - p['ki'] + # 16b Ki - lpad(p['smsp'], 80) # 40b SMSP (padded with ff if needed) + enc_iccid(p['iccid']) + # 10b ICCID + enc_imsi(p['imsi']) + # 9b IMSI_len + id_type(9) + IMSI + p['ki'] + # 16b Ki + lpad(p['smsp'], 80) # 40b SMSP (padded with ff if needed) ) self._scc.update_record('000c', 1, entry) -- To view, visit https://gerrit.osmocom.org/13476 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4836826811ffb0aeb103d32eb874f5fa52af4186 Gerrit-Change-Number: 13476 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 13:51:12 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 1 Apr 2019 13:51:12 +0000 Subject: Change in pysim[master]: fixup In-Reply-To: References: Message-ID: dexter has abandoned this change. ( https://gerrit.osmocom.org/13475 ) Change subject: fixup ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/13475 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Iecec05aeaca4ab4578a5a240802c01a24cd52597 Gerrit-Change-Number: 13475 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-CC: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 13:51:27 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 1 Apr 2019 13:51:27 +0000 Subject: Change in pysim[master]: sysmo-usim-sjs1: update EF.AD with correct MNC length 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/13366 to look at the new patch set (#4). Change subject: sysmo-usim-sjs1: update EF.AD with correct MNC length ...................................................................... sysmo-usim-sjs1: update EF.AD with correct MNC length At the moment EF.AD, which contains the length of the MNC is not updated. For two digit MNC (the usual case) this is fine since the length is set to 2 by default. However, when one wants to set an MNC with 3 digit length the file must be updated, otherwise the third digit of the MNC is recognized as part of the MSIN. Change-Id: I827092b2c7f7952f54b2d9f8dbda419a0dbfaf65 Related: OS#3850 --- M pySim-read.py M pySim/cards.py 2 files changed, 26 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/66/13366/4 -- To view, visit https://gerrit.osmocom.org/13366 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I827092b2c7f7952f54b2d9f8dbda419a0dbfaf65 Gerrit-Change-Number: 13366 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 13:51:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 1 Apr 2019 13:51:57 +0000 Subject: Change in libosmo-sccp[master]: sccp_scoc: Add more comments describing conn_id and local_ref members Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13477 Change subject: sccp_scoc: Add more comments describing conn_id and local_ref members ...................................................................... sccp_scoc: Add more comments describing conn_id and local_ref members Change-Id: I85cabc42621103de1a83282baf210fbc117b63db --- M src/sccp_scoc.c 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/77/13477/1 diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index cb1d567..e58251f 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -83,7 +83,15 @@ /* local/remote addresses and identiies */ struct osmo_sccp_addr calling_addr; struct osmo_sccp_addr called_addr; + /* SCCP connection identifier. Only relevant across the SCCP User SAP, + * i.e. between the local application using the SCCP stack provided by + * libosmo-sccp. Never transmitted over the wire! */ uint32_t conn_id; + /* SCCP Remote Connection Reference. Allocated by the remote + * SCCP stack to uniquely identify a SCCP connection on its end. + * We don't interpret it, but simply cache it here so we can use + * it whever sending data to the peer. Only relevant over the + * wire, not to be used across the SCCP user SAP */ uint32_t remote_ref; uint32_t importance; -- To view, visit https://gerrit.osmocom.org/13477 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I85cabc42621103de1a83282baf210fbc117b63db Gerrit-Change-Number: 13477 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 13:55:56 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 1 Apr 2019 13:55:56 +0000 Subject: Change in libosmo-sccp[master]: sccp_scoc: Add more comments describing conn_id and local_ref members In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13477 ) Change subject: sccp_scoc: Add more comments describing conn_id and local_ref members ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13477 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I85cabc42621103de1a83282baf210fbc117b63db Gerrit-Change-Number: 13477 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 01 Apr 2019 13:55:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 14:08:42 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 1 Apr 2019 14:08:42 +0000 Subject: Change in libosmo-abis[master]: Add IPA keep-alive FSM implementation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13196 ) Change subject: Add IPA keep-alive FSM implementation ...................................................................... Add IPA keep-alive FSM implementation The IPA keep-alive FSM code takes care of periodically transmitting and IPA CCM PING and expecting an IPA CCM PONG in return. Change-Id: I2763da49a74de85046ac07d53592c89973314ca6 --- M include/osmocom/abis/ipa.h M src/Makefile.am A src/input/ipa_keepalive.c 3 files changed, 327 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved diff --git a/include/osmocom/abis/ipa.h b/include/osmocom/abis/ipa.h index a738156..4f6081f 100644 --- a/include/osmocom/abis/ipa.h +++ b/include/osmocom/abis/ipa.h @@ -5,6 +5,7 @@ #include #include #include +#include #include struct e1inp_line; @@ -99,4 +100,39 @@ void ipa_msg_push_header(struct msgb *msg, uint8_t proto); + +/*********************************************************************** + * IPA Keep-Alive FSM + ***********************************************************************/ + +/*! parameters describing the keep-alive FSM (timeouts). */ +struct ipa_keepalive_params { + /*! interval in which to send IPA CCM PING requests to the peer. */ + unsigned int interval; + /*! time to wait for an IPA CCM PONG in response to a IPA CCM PING before giving up. */ + unsigned int wait_for_resp; +}; + +typedef void ipa_keepalive_timeout_cb_t(struct osmo_fsm_inst *fi, void *conn); + +struct osmo_fsm_inst *ipa_client_conn_alloc_keepalive_fsm(struct ipa_client_conn *client, + const struct ipa_keepalive_params *params, + const char *id); + +struct osmo_fsm_inst *ipa_server_conn_alloc_keepalive_fsm(struct ipa_server_conn *server, + const struct ipa_keepalive_params *params, + const char *id); + +struct osmo_fsm_inst *ipa_keepalive_alloc_server(struct ipa_server_conn *server, + const struct ipa_keepalive_params *params, + const char *id); + +void ipa_keepalive_fsm_set_timeout_cb(struct osmo_fsm_inst *fi, ipa_keepalive_timeout_cb_t *cb); + +void ipa_keepalive_fsm_start(struct osmo_fsm_inst *fi); + +void ipa_keepalive_fsm_stop(struct osmo_fsm_inst *fi); + +void ipa_keepalive_fsm_pong_received(struct osmo_fsm_inst *fi); + #endif diff --git a/src/Makefile.am b/src/Makefile.am index 9566617..2d2424d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,6 +21,7 @@ trau_frame.c \ input/dahdi.c \ input/ipa.c \ + input/ipa_keepalive.c \ input/ipaccess.c \ input/lapd.c \ input/lapd_pcap.c \ diff --git a/src/input/ipa_keepalive.c b/src/input/ipa_keepalive.c new file mode 100644 index 0000000..1aae096 --- /dev/null +++ b/src/input/ipa_keepalive.c @@ -0,0 +1,290 @@ +/* IPA keep-alive FSM; Periodically transmit IPA_PING and expect IPA_PONG in return. + * + * (C) 2019 by Harald Welte + * + * All Rights Reserved + * + * SPDX-License-Identifier: GPL-2.0+ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include + +#include + +#include + +#define S(x) (1 << (x)) + + +/* generate a msgb containing an IPA CCM PING message */ +static struct msgb *gen_ipa_ping(void) +{ + struct msgb *msg = msgb_alloc_headroom(64, 32, "IPA PING"); + if (!msg) + return NULL; + + msgb_put_u8(msg, IPAC_MSGT_PING); + ipa_msg_push_header(msg, IPAC_PROTO_IPACCESS); + + return msg; +} + +enum osmo_ipa_keepalive_state { + OSMO_IPA_KA_S_INIT, + OSMO_IPA_KA_S_IDLE, /* waiting for next interval */ + OSMO_IPA_KA_S_WAIT_RESP, /* waiting for response to keepalive */ +}; + +enum osmo_ipa_keepalive_event { + OSMO_IPA_KA_E_START, + OSMO_IPA_KA_E_STOP, + OSMO_IPA_KA_E_PONG, +}; + +static const struct value_string ipa_keepalive_event_names[] = { + OSMO_VALUE_STRING(OSMO_IPA_KA_E_START), + OSMO_VALUE_STRING(OSMO_IPA_KA_E_STOP), + OSMO_VALUE_STRING(OSMO_IPA_KA_E_PONG), + { 0, NULL } +}; + +enum ipa_fsm_timer { + T_SEND_NEXT_PING = 1, + T_PONG_NOT_RECEIVED = 2, +}; + +struct ipa_fsm_priv { + struct ipa_keepalive_params params; + + struct ipa_server_conn *srv_conn; + struct ipa_client_conn *client_conn; + ipa_keepalive_timeout_cb_t *timeout_cb; +}; + +static void ipa_ka_init(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct ipa_fsm_priv *ifp = fi->priv; + + switch (event) { + case OSMO_IPA_KA_E_START: + osmo_fsm_inst_state_chg(fi, OSMO_IPA_KA_S_WAIT_RESP, + ifp->params.wait_for_resp, T_PONG_NOT_RECEIVED); + break; + default: + OSMO_ASSERT(0); + break; + } +} + +static void ipa_ka_wait_resp_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct ipa_fsm_priv *ifp = fi->priv; + struct msgb *msg; + + /* Send an IPA PING to the peer */ + msg = gen_ipa_ping(); + OSMO_ASSERT(msg); + + if (ifp->srv_conn) + ipa_server_conn_send(ifp->srv_conn, msg); + else { + OSMO_ASSERT(ifp->client_conn); + ipa_client_conn_send(ifp->client_conn, msg); + } +} + +static void ipa_ka_wait_resp(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct ipa_fsm_priv *ifp = fi->priv; + + switch (event) { + case OSMO_IPA_KA_E_PONG: + osmo_fsm_inst_state_chg(fi, OSMO_IPA_KA_S_IDLE, + ifp->params.interval, T_SEND_NEXT_PING); + break; + default: + OSMO_ASSERT(0); + } +} + +static int ipa_ka_fsm_timer_cb(struct osmo_fsm_inst *fi) +{ + struct ipa_fsm_priv *ifp = fi->priv; + void *conn; + + switch (fi->T) { + case T_SEND_NEXT_PING: + /* send another PING */ + osmo_fsm_inst_state_chg(fi, OSMO_IPA_KA_S_WAIT_RESP, + ifp->params.wait_for_resp, T_PONG_NOT_RECEIVED); + return 0; + case T_PONG_NOT_RECEIVED: + /* PONG not received within time */ + if (ifp->srv_conn) + conn = ifp->srv_conn; + else + conn = ifp->client_conn; + if (ifp->timeout_cb) + ifp->timeout_cb(fi, conn); + /* ask fsm core to terminate us */ + return 1; + default: + OSMO_ASSERT(0); + } +} + +static void ipa_ka_allstate_action(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + case OSMO_IPA_KA_E_STOP: + osmo_fsm_inst_state_chg(fi, OSMO_IPA_KA_S_INIT, 0, 0); + break; + default: + OSMO_ASSERT(0); + break; + } +} + +static const struct osmo_fsm_state ipa_keepalive_states[] = { + [OSMO_IPA_KA_S_INIT] = { + .name = "INIT", + .in_event_mask = S(OSMO_IPA_KA_E_START), + .out_state_mask = S(OSMO_IPA_KA_S_WAIT_RESP), + .action = ipa_ka_init, + }, + [OSMO_IPA_KA_S_IDLE] = { + .name = "IDLE", + .out_state_mask = S(OSMO_IPA_KA_S_WAIT_RESP) | S(OSMO_IPA_KA_S_INIT), + /* no permitted events aside from E_START, which is handled in allstate_events */ + }, + [OSMO_IPA_KA_S_WAIT_RESP] = { + .name = "WAIT_RESP", + .in_event_mask = S(OSMO_IPA_KA_E_PONG), + .out_state_mask = S(OSMO_IPA_KA_S_IDLE) | S(OSMO_IPA_KA_S_INIT), + .action = ipa_ka_wait_resp, + .onenter = ipa_ka_wait_resp_onenter, + }, +}; + +static struct osmo_fsm ipa_keepalive_fsm = { + .name = "IPA-KEEPALIVE", + .states = ipa_keepalive_states, + .num_states = ARRAY_SIZE(ipa_keepalive_states), + .log_subsys = DLINP, + .allstate_action = ipa_ka_allstate_action, + .event_names = ipa_keepalive_event_names, + .timer_cb = ipa_ka_fsm_timer_cb, +}; + +static __attribute__((constructor)) void on_dso_load(void) +{ + osmo_fsm_register(&ipa_keepalive_fsm); +} + + +static struct osmo_fsm_inst * +__ipa_conn_alloc_keepalive_fsm(void *ctx, const struct ipa_keepalive_params *params, const char *id) +{ + struct osmo_fsm_inst *fi; + struct ipa_fsm_priv *ifp; + + fi = osmo_fsm_inst_alloc(&ipa_keepalive_fsm, ctx, NULL, LOGL_DEBUG, id); + if (!fi) + return NULL; + ifp = talloc_zero(fi, struct ipa_fsm_priv); + if (!ifp) { + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return NULL; + } + memcpy(&ifp->params, params, sizeof(ifp->params)); + fi->priv = ifp; + + return fi; +} + +/*! Create a new instance of an IPA keepalive FSM: Periodically transmit PING and expect PONG. + * \param[in] client The client connection for which to crate the FSM. Used as talloc context. + * \param[in] params Parameters describing the keepalive FSM time-outs. + * \param[in] id String used as identifier for the FSM. + * \returns pointer to the newly-created FSM instance; NULL in case of error. */ +struct osmo_fsm_inst *ipa_client_conn_alloc_keepalive_fsm(struct ipa_client_conn *client, + const struct ipa_keepalive_params *params, + const char *id) +{ + struct osmo_fsm_inst *fi; + struct ipa_fsm_priv *ifp; + + fi = __ipa_conn_alloc_keepalive_fsm(client, params, id); + if (!fi) + return NULL; + ifp = fi->priv; + ifp->client_conn = client; + return fi; +} + +/*! Create a new instance of an IPA keepalive FSM: Periodically transmit PING and expect PONG. + * \param[in] server The server connection for which to crate the FSM. Used as talloc context. + * \param[in] params Parameters describing the keepalive FSM time-outs. + * \param[in] id String used as identifier for the FSM. + * \returns pointer to the newly-created FSM instance; NULL in case of error. */ +struct osmo_fsm_inst *ipa_server_conn_alloc_keepalive_fsm(struct ipa_server_conn *server, + const struct ipa_keepalive_params *params, + const char *id) +{ + struct osmo_fsm_inst *fi; + struct ipa_fsm_priv *ifp; + + fi = __ipa_conn_alloc_keepalive_fsm(server, params, id); + if (!fi) + return NULL; + ifp = fi->priv; + ifp->srv_conn = server; + return fi; +} + +/*! Set a timeout call-back which is to be called once the peer doesn't respond anymore */ +void ipa_keepalive_fsm_set_timeout_cb(struct osmo_fsm_inst *fi, ipa_keepalive_timeout_cb_t *cb) +{ + struct ipa_fsm_priv *ifp = fi->priv; + OSMO_ASSERT(fi->fsm == &ipa_keepalive_fsm); + ifp->timeout_cb = cb; +} + +/*! Inform IPA Keepalive FSM that a PONG has been received. */ +void ipa_keepalive_fsm_pong_received(struct osmo_fsm_inst *fi) +{ + OSMO_ASSERT(fi->fsm == &ipa_keepalive_fsm); + osmo_fsm_inst_dispatch(fi, OSMO_IPA_KA_E_PONG, NULL); +} + +/*! Start the ping/pong procedure of the IPA Keepalive FSM. */ +void ipa_keepalive_fsm_start(struct osmo_fsm_inst *fi) +{ + OSMO_ASSERT(fi->fsm == &ipa_keepalive_fsm); + osmo_fsm_inst_dispatch(fi, OSMO_IPA_KA_E_START, NULL); +} + +/*! Stop the ping/pong procedure of the IPA Keepalive FSM. */ +void ipa_keepalive_fsm_stop(struct osmo_fsm_inst *fi) +{ + OSMO_ASSERT(fi->fsm == &ipa_keepalive_fsm); + osmo_fsm_inst_dispatch(fi, OSMO_IPA_KA_E_STOP, NULL); +} -- To view, visit https://gerrit.osmocom.org/13196 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2763da49a74de85046ac07d53592c89973314ca6 Gerrit-Change-Number: 13196 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 14:09:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 1 Apr 2019 14:09:12 +0000 Subject: Change in libosmo-sccp[master]: sccp_scoc: Add more comments describing conn_id and local_ref members In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13477 ) Change subject: sccp_scoc: Add more comments describing conn_id and local_ref members ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13477 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I85cabc42621103de1a83282baf210fbc117b63db Gerrit-Change-Number: 13477 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 01 Apr 2019 14:09:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 14:09:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 1 Apr 2019 14:09:13 +0000 Subject: Change in libosmo-sccp[master]: sccp_scoc: Add more comments describing conn_id and local_ref members In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13477 ) Change subject: sccp_scoc: Add more comments describing conn_id and local_ref members ...................................................................... sccp_scoc: Add more comments describing conn_id and local_ref members Change-Id: I85cabc42621103de1a83282baf210fbc117b63db --- M src/sccp_scoc.c 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index cb1d567..e58251f 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -83,7 +83,15 @@ /* local/remote addresses and identiies */ struct osmo_sccp_addr calling_addr; struct osmo_sccp_addr called_addr; + /* SCCP connection identifier. Only relevant across the SCCP User SAP, + * i.e. between the local application using the SCCP stack provided by + * libosmo-sccp. Never transmitted over the wire! */ uint32_t conn_id; + /* SCCP Remote Connection Reference. Allocated by the remote + * SCCP stack to uniquely identify a SCCP connection on its end. + * We don't interpret it, but simply cache it here so we can use + * it whever sending data to the peer. Only relevant over the + * wire, not to be used across the SCCP user SAP */ uint32_t remote_ref; uint32_t importance; -- To view, visit https://gerrit.osmocom.org/13477 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I85cabc42621103de1a83282baf210fbc117b63db Gerrit-Change-Number: 13477 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 14:35:44 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 1 Apr 2019 14:35:44 +0000 Subject: Change in pysim[master]: wavemobile-sim: write mnc-length field ine EF.AD Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13478 Change subject: wavemobile-sim: write mnc-length field ine EF.AD ...................................................................... wavemobile-sim: write mnc-length field ine EF.AD The length field in wavemobile sim cards is not set, so that the field stays at its initial value, which is 0xFF. Lets write the correct mnc length here. Change-Id: Ieda0ce864bf3e8c7b92f062eaa3a5482c98507e2 Related: OS#3850 --- M pySim/cards.py 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/78/13478/1 diff --git a/pySim/cards.py b/pySim/cards.py index d912a7a..a341b71 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -896,6 +896,12 @@ if sw != '9000': print("Programming OPLMNwAcT failed with code %s"%sw) + # EF.AD + if p.get('mcc') and p.get('mnc'): + sw = self.update_ad(p['mnc']) + if sw != '9000': + print("Programming AD failed with code %s"%sw) + return None def erase(self): -- To view, visit https://gerrit.osmocom.org/13478 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ieda0ce864bf3e8c7b92f062eaa3a5482c98507e2 Gerrit-Change-Number: 13478 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 14:43:27 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 1 Apr 2019 14:43:27 +0000 Subject: Change in pysim[master]: sysmo-usim-sjs1: update EF.AD with correct MNC length In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/13366 ) Change subject: sysmo-usim-sjs1: update EF.AD with correct MNC length ...................................................................... Patch Set 3: (2 comments) > Build Successful > > https://jenkins.osmocom.org/jenkins/job/gerrit-pysim/67/ : SUCCESS' > --verified 1 --code-review 0 https://gerrit.osmocom.org/#/c/13366/3/pySim/cards.py File pySim/cards.py: https://gerrit.osmocom.org/#/c/13366/3/pySim/cards.py at 121 PS3, Line 121: def update_ad(self, mnc): > so this is part of the generic "card" class... Done https://gerrit.osmocom.org/#/c/13366/3/pySim/cards.py at 603 PS3, Line 603: # EF.AD > but it's used only from the sysmoUSIM-SJS1 specicic code. [?] The file is specified by 3GPP TS 31.102, chapter 4.2.18. However this is an USIM spec. That probably also explains why fakemagicsim and sysmo-usim-gr1 have short files. (I have now also added the writing EF.AD for wavemobile-sim in #13478.) -- To view, visit https://gerrit.osmocom.org/13366 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I827092b2c7f7952f54b2d9f8dbda419a0dbfaf65 Gerrit-Change-Number: 13366 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: dexter Gerrit-Comment-Date: Mon, 01 Apr 2019 14:43:27 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 15:12:31 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 1 Apr 2019 15:12:31 +0000 Subject: Change in osmo-msc[master]: a_iface_bssap: check bssmap length field In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/13307 ) Change subject: a_iface_bssap: check bssmap length field ...................................................................... Patch Set 5: (3 comments) > In current osmo-msc refactoring, I have the same checks in place, > except my version discards the messages completely. > http://git.osmocom.org/osmo-msc/tree/src/libmsc/nas_a.c?h=neels/ho#n555 > > Maybe we should truncate if extra bytes are present, and discard if > too few bytes are present? What do you think? I had a look at your code. To me it looks ok to discard the whole message if there is excess data as it either means that the message was damaged of the receiving end has some significant problems. However, the ticket that is related to the task says that the message should only be truncated: http://osmocom.org/issues/3806 > Either way let's avoid the merge conflict and not merge this > version. Rather apply to branch neels/ho file nas_a.c. I am fine with abandoning this, if it avoids merge conflicts. https://gerrit.osmocom.org/#/c/13307/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13307/1//COMMIT_MSG at 7 PS1, Line 7: bssmap > bssmap Done https://gerrit.osmocom.org/#/c/13307/1/src/libmsc/a_iface_bssap.c File src/libmsc/a_iface_bssap.c: https://gerrit.osmocom.org/#/c/13307/1/src/libmsc/a_iface_bssap.c at 721 PS1, Line 721: _header = (struct bssmap_header *)msg->l2h; : > on the MSC side we cannot have log messages without any context. [?] Done https://gerrit.osmocom.org/#/c/13307/1/src/libmsc/a_iface_bssap.c at 722 PS1, Line 722: > Same as other patch: "extraneous". Better use "extra". Done -- To view, visit https://gerrit.osmocom.org/13307 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3b89dd5a66ec83b03860b58b6b8eb58007f433a4 Gerrit-Change-Number: 13307 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-Comment-Date: Mon, 01 Apr 2019 15:12:31 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 15:18:02 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 1 Apr 2019 15:18:02 +0000 Subject: Change in osmo-ci[master]: build-old-tags: build libosmo-legacy-mgcp In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13454 ) Change subject: build-old-tags: build libosmo-legacy-mgcp ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13454 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I63d16f8e44c14dee46e2ef3fd050a421017c56b0 Gerrit-Change-Number: 13454 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 01 Apr 2019 15:18:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 15:25:32 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Mon, 1 Apr 2019 15:25:32 +0000 Subject: Change in osmo-msc[master]: MT-forwardSM Message Reference fix. In-Reply-To: References: Message-ID: Mykola Shchetinin has abandoned this change. ( https://gerrit.osmocom.org/13464 ) Change subject: MT-forwardSM Message Reference fix. ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/13464 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Ia50fd0e6c7ba7876522f49a00c55f8499c164331 Gerrit-Change-Number: 13464 Gerrit-PatchSet: 1 Gerrit-Owner: Mykola Shchetinin Gerrit-Assignee: fixeria Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: fixeria -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 15:46:50 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 1 Apr 2019 15:46:50 +0000 Subject: Change in osmo-msc[master]: a_iface_bssap: add context information to log output In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/13319 ) Change subject: a_iface_bssap: add context information to log output ...................................................................... Patch Set 5: (2 comments) > I completely agree with the intent, that's why I have added context > to the logging in the current refactoring of osmo-msc, on branch > neels/ho. If anything is still missing on that branch, let's apply > it there instead of introducing merge conflicts. I'm sorry to block > your work, but I think the osmo-msc status has been clear? I see, then we probably abandon this as well. https://gerrit.osmocom.org/#/c/13319/2/src/libmsc/a_iface_bssap.c File src/libmsc/a_iface_bssap.c: https://gerrit.osmocom.org/#/c/13319/2/src/libmsc/a_iface_bssap.c at 167 PS2, Line 167: return; > That seems redundant: it'll be printed as part of the prefix anyway. Done https://gerrit.osmocom.org/#/c/13319/2/src/libmsc/a_iface_bssap.c at 167 PS2, Line 167: return; > the point here was that the %s / osmo_sccp_addr_name() is redundant. Not the enitre log line. [?] Done -- To view, visit https://gerrit.osmocom.org/13319 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I704954edc8677688fc7cccd2b23d2aff958ebf32 Gerrit-Change-Number: 13319 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-CC: Harald Welte Gerrit-Comment-Date: Mon, 01 Apr 2019 15:46:50 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 16:57:55 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 1 Apr 2019 16:57:55 +0000 Subject: Change in osmo-msc[master]: a_iface_bssap: add context information to log output In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13319 ) Change subject: a_iface_bssap: add context information to log output ...................................................................... Patch Set 5: please don't abandon but revisit/rebase on top of neels' work. Doesn't have to be right now, could also wait until it's in master. As your schedule permits. -- To view, visit https://gerrit.osmocom.org/13319 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I704954edc8677688fc7cccd2b23d2aff958ebf32 Gerrit-Change-Number: 13319 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-CC: Harald Welte Gerrit-Comment-Date: Mon, 01 Apr 2019 16:57:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 16:58:16 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 1 Apr 2019 16:58:16 +0000 Subject: Change in osmo-ci[master]: build-old-tags: build libosmo-legacy-mgcp In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13454 ) Change subject: build-old-tags: build libosmo-legacy-mgcp ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13454 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I63d16f8e44c14dee46e2ef3fd050a421017c56b0 Gerrit-Change-Number: 13454 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 01 Apr 2019 16:58:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 16:59:27 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 1 Apr 2019 16:59:27 +0000 Subject: Change in pysim[master]: sysmo-usim-sjs1: update EF.AD with correct MNC length In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13366 ) Change subject: sysmo-usim-sjs1: update EF.AD with correct MNC length ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13366 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I827092b2c7f7952f54b2d9f8dbda419a0dbfaf65 Gerrit-Change-Number: 13366 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: dexter Gerrit-Comment-Date: Mon, 01 Apr 2019 16:59:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 16:59:34 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 1 Apr 2019 16:59:34 +0000 Subject: Change in pysim[master]: cosmetic: fix sourecode formatting In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13476 ) Change subject: cosmetic: fix sourecode formatting ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13476 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4836826811ffb0aeb103d32eb874f5fa52af4186 Gerrit-Change-Number: 13476 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 01 Apr 2019 16:59:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 16:59:40 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 1 Apr 2019 16:59:40 +0000 Subject: Change in pysim[master]: wavemobile-sim: write mnc-length field ine EF.AD In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13478 ) Change subject: wavemobile-sim: write mnc-length field ine EF.AD ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13478 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieda0ce864bf3e8c7b92f062eaa3a5482c98507e2 Gerrit-Change-Number: 13478 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 01 Apr 2019 16:59:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 17:00:44 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 1 Apr 2019 17:00:44 +0000 Subject: Change in osmo-bts[master]: common/oml.c: fix: properly push abis_nm_ipa_magic In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13471 ) Change subject: common/oml.c: fix: properly push abis_nm_ipa_magic ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13471 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0c7f8776d0caec40f9ed992db541f43b732e47ae Gerrit-Change-Number: 13471 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 01 Apr 2019 17:00:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 1 17:00:46 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 1 Apr 2019 17:00:46 +0000 Subject: Change in osmo-bts[master]: common/oml.c: fix: properly push abis_nm_ipa_magic In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13471 ) Change subject: common/oml.c: fix: properly push abis_nm_ipa_magic ...................................................................... common/oml.c: fix: properly push abis_nm_ipa_magic In oml_send_msg() we optionally push the A-bis IPA magic string ("com.ipaccess") to a given message buffer as LV (Length Value), including the terminating null byte ('\0'). There was a mix of both sizeof() and strlen() calls, and worse luck, memcpy() has been used in a wrong way, skipping the '\0': memcpy(dest, src, strlen(src)); In general, this is not critical because the headroom of a given message buffer would most likely be zero-initialized, so the '\0' is already there. However, msgb_push() gives no such guarantee. Let's use the libosmocore's TLV API (in particular, lv_put()), and stick to sizeof(), so the null byte will always be included. Change-Id: I0c7f8776d0caec40f9ed992db541f43b732e47ae Closes: OS#3022 --- M src/common/oml.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/common/oml.c b/src/common/oml.c index c96a893..80d424f 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -94,9 +95,8 @@ if (is_manuf) { /* length byte, string + 0 termination */ - uint8_t *manuf = msgb_push(msg, 1 + sizeof(abis_nm_ipa_magic)); - manuf[0] = strlen(abis_nm_ipa_magic)+1; - memcpy(manuf+1, abis_nm_ipa_magic, strlen(abis_nm_ipa_magic)); + uint8_t *manuf = msgb_push(msg, LV_GROSS_LEN(sizeof(abis_nm_ipa_magic))); + lv_put(manuf, sizeof(abis_nm_ipa_magic), (const uint8_t *) abis_nm_ipa_magic); } /* Push the main OML header and send it off */ -- To view, visit https://gerrit.osmocom.org/13471 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0c7f8776d0caec40f9ed992db541f43b732e47ae Gerrit-Change-Number: 13471 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 02:34:52 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 2 Apr 2019 02:34:52 +0000 Subject: Change in osmo-hlr[master]: fix USSD routing to multiple MSC Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13479 Change subject: fix USSD routing to multiple MSC ...................................................................... fix USSD routing to multiple MSC hlr_ussd.c so far hardcoded osmo-msc's default IPA-name and hence was only able to negotiate USSD sessions to - a single osmo-msc - that has no custom IPA-name set. Fix: correctly route USSD to any number of MSC with any custom IPA names. Resolve the right MSC's IPA name from the USSD session's IMSI, using hlr_subscriber->vlr_number to determine the right GSUP peer. Add ss_session->subscr, so that if a code path already knows the subscriber data, setting a pointer to it avoids another database lookup. Related: OS#3710 Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 --- M src/hlr_ussd.c 1 file changed, 40 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/79/13479/1 diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index cc6aa8a..906b129 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -166,6 +166,10 @@ const struct hlr_iuse *iuse; } u; + /* Reference to the HLR subscriber for this session, to avoid looking it up in the database too often. + * Still, this should be refreshed in due time, e.g. once per received message. */ + struct hlr_subscriber *subscr; + /* we don't keep a pointer to the osmo_gsup_{route,conn} towards the MSC/VLR here, * as this might change during inter-VLR hand-over, and we simply look-up the serving MSC/VLR * every time we receive an USSD component from the EUSE */ @@ -222,6 +226,34 @@ * handling functions for encoding SS messages + wrapping them in GSUP ***********************************************************************/ +/* Resolve the target MSC by ss->imsi and send GSUP message. */ +static int ss_gsup_send(struct ss_session *ss, struct osmo_gsup_server *gs, struct msgb *msg) +{ + struct hlr_subscriber _subscr = {}; + struct hlr_subscriber *subscr = ss->subscr; + int rc; + + /* Use subscr as looked up by the caller, or look up now. */ + if (!subscr) { + rc = db_subscr_get_by_imsi(g_hlr->dbc, ss->imsi, &_subscr); + if (rc < 0) { + LOGPSS(ss, LOGL_ERROR, "Cannot find subscriber for IMSI %s, cannot route GSUP message\n", + ss->imsi); + return -EINVAL; + } + subscr = &_subscr; + } + + if (!subscr->vlr_number[0]) { + LOGP(DLGSUP, LOGL_ERROR, "Cannot send GSUP message, no VLR number stored for subscriber %s\n", + subscr->imsi); + return -EINVAL; + } + + LOGPSS(ss, LOGL_DEBUG, "Tx USSD for IMSI %s to VLR '%s'\n", subscr->imsi, subscr->vlr_number); + return osmo_gsup_addr_send(gs, (uint8_t *)subscr->vlr_number, strlen(subscr->vlr_number), msg); +} + static int ss_tx_to_ms(struct ss_session *ss, enum osmo_gsup_message_type gsup_msg_type, bool final, struct msgb *ss_msg) @@ -246,8 +278,7 @@ osmo_gsup_encode(resp_msg, &resp); msgb_free(ss_msg); - /* FIXME: resolve this based on the database vlr_addr */ - return osmo_gsup_addr_send(g_hlr->gs, (uint8_t *)"MSC-00-00-00-00-00-00", 22, resp_msg); + return ss_gsup_send(ss, g_hlr->gs, resp_msg); } #if 0 @@ -298,7 +329,9 @@ snprintf(buf, sizeof(buf), "You have no MSISDN!"); else snprintf(buf, sizeof(buf), "Your extension is %s", subscr.msisdn); + ss->subscr = &subscr; ss_tx_ussd_7bit(ss, true, req->invoke_id, buf); + ss->subscr = NULL; break; case -ENOENT: ss_tx_error(ss, true, GSM0480_ERR_CODE_UNKNOWN_SUBSCRIBER); @@ -433,8 +466,7 @@ OSMO_ASSERT(msg_out); /* Received from EUSE, Forward to VLR */ osmo_gsup_encode(msg_out, gsup); - /* FIXME: resolve this based on the database vlr_addr */ - osmo_gsup_addr_send(conn->server, (uint8_t *)"MSC-00-00-00-00-00-00", 22, msg_out); + ss_gsup_send(ss, conn->server, msg_out); } else { /* Received from VLR (MS) */ if (ss->is_external) { @@ -557,6 +589,10 @@ gsup->imsi, gsup->session_id); goto out_err; } + + /* Make sure we refresh any subscriber data */ + ss->subscr = NULL; + if (ss_op_is_ussd(req.opcode)) { /* dispatch unstructured SS to routing */ handle_ussd(conn, ss, gsup, &req); -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 02:39:55 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 2 Apr 2019 02:39:55 +0000 Subject: Change in osmo-hlr[master]: fix USSD routing to multiple MSC In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13479 to look at the new patch set (#2). Change subject: fix USSD routing to multiple MSC ...................................................................... fix USSD routing to multiple MSC hlr_ussd.c so far hardcoded osmo-msc's default IPA-name and hence was only able to negotiate USSD sessions to - a single osmo-msc - that has no custom IPA-name set. Fix: correctly route USSD to any number of MSC with any custom IPA names. Resolve the right MSC's IPA name from the USSD session's IMSI, using hlr_subscriber->vlr_number to determine the right GSUP peer. Add ss_session->subscr, so that if a code path already knows the subscriber data, setting a pointer to it avoids another database lookup. Related: OS#3710 Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 --- M src/hlr_ussd.c 1 file changed, 41 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/79/13479/2 -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 02:46:37 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 2 Apr 2019 02:46:37 +0000 Subject: Change in osmo-hlr[master]: fix USSD routing to multiple MSC In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13479 to look at the new patch set (#3). Change subject: fix USSD routing to multiple MSC ...................................................................... fix USSD routing to multiple MSC hlr_ussd.c so far hardcoded osmo-msc's default IPA-name and hence was only able to negotiate USSD sessions to - a single osmo-msc - that has no custom IPA-name set. Fix: correctly route USSD to any number of MSC with any custom IPA names. Resolve the right MSC's IPA name from the USSD session's IMSI, using hlr_subscriber->vlr_number to determine the right GSUP peer. Add ss_session->subscr, so that if a code path already knows the subscriber data, setting a pointer to it avoids another database lookup. Related: OS#3710 Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 --- M src/hlr_ussd.c 1 file changed, 38 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/79/13479/3 -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 02:47:22 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 2 Apr 2019 02:47:22 +0000 Subject: Change in osmo-hlr[master]: fix USSD routing to multiple MSC In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13479 to look at the new patch set (#4). Change subject: fix USSD routing to multiple MSC ...................................................................... fix USSD routing to multiple MSC hlr_ussd.c so far hardcoded osmo-msc's default IPA-name and hence was only able to negotiate USSD sessions to - a single osmo-msc - that has no custom IPA-name set. Fix: correctly route USSD to any number of MSC with any custom IPA names. Resolve the right MSC's IPA name from the USSD session's IMSI, using hlr_subscriber->vlr_number to determine the right GSUP peer. Add ss_session->subscr, so that if a code path already knows the subscriber data, setting a pointer to it avoids another database lookup. Related: OS#3710 Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 --- M src/hlr_ussd.c 1 file changed, 37 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/79/13479/4 -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 02:50:23 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 2 Apr 2019 02:50:23 +0000 Subject: Change in osmo-hlr[master]: fix USSD routing to multiple MSC In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13479 ) Change subject: fix USSD routing to multiple MSC ...................................................................... Patch Set 4: (1 comment) This is an improvement, but... https://gerrit.osmocom.org/#/c/13479/4/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13479/4/src/hlr_ussd.c at 338 PS4, Line 338: ss_tx_error(ss, true, GSM0480_ERR_CODE_UNKNOWN_SUBSCRIBER); well. If we can't find a subscriber, then we also can't send an error back to it. so should probably also somehow remember which MSC initiated the session? For entirely MT USSD, we still need to resolve the VLR from IMSI alone, but for MO USSD we can use the name of the VLR that contacted the HLR. -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 02 Apr 2019 02:50:23 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 03:30:23 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 2 Apr 2019 03:30:23 +0000 Subject: Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13392 ) Change subject: fsm: support graceful osmo_fsm_inst_term() cascades ...................................................................... Patch Set 4: (1 comment) (one stray remark...) https://gerrit.osmocom.org/#/c/13392/4//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13392/4//COMMIT_MSG at 33 PS4, Line 33: Note: at least osmo-msc's msc_vlr_tests' expected output needs to be adjusted : after merging this, because of logging changes for FSM deallocations > this is *very* bad. [?] The main cause is that the order of deallocation changes. Before, we took care to first deallocate the child before dispatching the parent_term_event. Now, to be safe, I have to deallocate after the parent_term_event instead. -- To view, visit https://gerrit.osmocom.org/13392 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 Gerrit-Change-Number: 13392 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 02 Apr 2019 03:30:23 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 03:48:17 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 2 Apr 2019 03:48:17 +0000 Subject: Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13392 ) Change subject: fsm: support graceful osmo_fsm_inst_term() cascades ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/13392/4//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13392/4//COMMIT_MSG at 33 PS4, Line 33: Note: at least osmo-msc's msc_vlr_tests' expected output needs to be adjusted : after merging this, because of logging changes for FSM deallocations > The main cause is that the order of deallocation changes. [?] and actually also, what was a simple "Deallocated" logging before, may now become "Listing for deallocation with [other FSM inst id]", and there is s/"Terminating"/"Terminating in cascade". see http://git.osmocom.org/osmo-msc/commit/?h=neels/ho&id=0a5bd401af092019cdf65aa1a1131cebefe96b76 I think it is only mildly bad, the bad thing rather that this deallocation logging is in that osmo-msc test output in the first place. We've had a number of occasions where something affected that test output and adjusted it. But since I want to log state transitions, I also have to include deallocation logging, no way around it in the current FSM instance log category and level scheme (besides grepping output maybe) I have also considered a number of times to detach those tests from osmo-msc.git, or even lose them entirely; because they continuously introduce a bit of work like this on and off, and considerably blow up the git diffs, and also you don't like them ;) ... But in my reckoning the benefits still outweigh the drawbacks: it is often quite useful to track exactly how the logging in osmo-msc changes, which the ttcn3 tests don't (and can't) provide, and the fake time that ttcn3 can't provide makes for an ultra short dev cycle when hunting bugs. Minuses are complex hacks to make them work in a dry-run way, blown up git diffs, test failures from trivial logging changes. Am open to discussion there. -- To view, visit https://gerrit.osmocom.org/13392 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 Gerrit-Change-Number: 13392 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 02 Apr 2019 03:48:17 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 06:24:35 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 06:24:35 +0000 Subject: Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13392 ) Change subject: fsm: support graceful osmo_fsm_inst_term() cascades ...................................................................... Patch Set 4: The point is not about whether I like the tests or not. The point is that users should be able to do a "make check" or "make distcheck" in order to get an idea whether the given program passes its internal unit tests. And that we maintain backwards compatibility of our libraries, i.e. new libraries should always run old programs fine. How exactly we achieve this is an implementation detail, but those are the general rules by which (I think) we should work in our development. -- To view, visit https://gerrit.osmocom.org/13392 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 Gerrit-Change-Number: 13392 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 02 Apr 2019 06:24:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 06:26:08 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 2 Apr 2019 06:26:08 +0000 Subject: Change in osmo-hlr[master]: fix USSD routing to multiple MSC In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13479 ) Change subject: fix USSD routing to multiple MSC ...................................................................... Patch Set 4: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/13479/4/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13479/4/src/hlr_ussd.c at 335 PS4, Line 335: ss->subscr = NULL; I think doing this manually is not a good idea... Instead, you could extend struct 'ss_session' with a kind of counter, and decrease it right in ss_gsup_send(). As soon as the counter reaches 0, we do the database lookup again. Alternatively, you can measure the time spent since the last response, so if time > X => we do the database lookup. https://gerrit.osmocom.org/#/c/13479/4/src/hlr_ussd.c at 338 PS4, Line 338: ss_tx_error(ss, true, GSM0480_ERR_CODE_UNKNOWN_SUBSCRIBER); > should probably also somehow remember which MSC initiated the session? ACK. -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 02 Apr 2019 06:26:08 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 06:28:17 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 2 Apr 2019 06:28:17 +0000 Subject: Change in osmo-hlr[master]: fix USSD routing to multiple MSC In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13479 ) Change subject: fix USSD routing to multiple MSC ...................................................................... Patch Set 4: Also, would be great to cover this with a TTCN-3 test case ;) -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 02 Apr 2019 06:28:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 07:05:27 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 2 Apr 2019 07:05:27 +0000 Subject: Change in osmo-hlr[master]: gsup_router.c: gsup_route_find(): support blob In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13048 ) Change subject: gsup_router.c: gsup_route_find(): support blob ...................................................................... Patch Set 2: (3 comments) https://gerrit.osmocom.org/#/c/13048/2/src/gsup_router.c File src/gsup_router.c: https://gerrit.osmocom.org/#/c/13048/2/src/gsup_router.c at 43 PS2, Line 43: talloc_total_size You could alternatively extend struct 'gsup_route' with 'addr_len', and modify gsup_route_add() to store the address length there. Calling talloc_total_size() comes at a higher price... https://gerrit.osmocom.org/#/c/13048/2/src/gsup_router.c at 45 PS2, Line 45: a lot of code assumes that addr is also nul-terminated Wait, your previous comment also states that "gr->addr is a nul-terminated string" o_O. https://gerrit.osmocom.org/#/c/13048/2/src/gsup_router.c at 49 PS2, Line 49: Compare addr as non-nul-terminated blob Wouldn't this cause a collision when e.g. both (read in hex): - 0xff, 0x00, 0x00, 0xbb, 0xaa, 0xff, - 0xff, 0x00, 0x00, 0xbb, 0xaa, 0x77, are considered as equal? -- To view, visit https://gerrit.osmocom.org/13048 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I01a45900e14d41bcd338f50ad85d9fabf2c61405 Gerrit-Change-Number: 13048 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 02 Apr 2019 07:05:27 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 08:03:22 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 08:03:22 +0000 Subject: Change in osmo-ci[master]: build-old-tags: build libosmo-legacy-mgcp In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13454 ) Change subject: build-old-tags: build libosmo-legacy-mgcp ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/13454 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I63d16f8e44c14dee46e2ef3fd050a421017c56b0 Gerrit-Change-Number: 13454 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 02 Apr 2019 08:03:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 08:03:24 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 08:03:24 +0000 Subject: Change in osmo-ci[master]: build-old-tags: build libosmo-legacy-mgcp In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13454 ) Change subject: build-old-tags: build libosmo-legacy-mgcp ...................................................................... build-old-tags: build libosmo-legacy-mgcp Build osmo-mgw 1.4.0 (which provides libosmo-legacy-mgcp) and install it into a different temp dir. Allows properly building osmo-bsc 1.2.x, as soon as a new release is tagged, which makes it use LIBOSMOLEGACYMGCP_CFLAGS and therefore pick up the include path properly [1]. osmo-mgw 1.4.0's "make check" doesn't pass right now, so add a check parameter to build_repo() and disable them when building libosmo-legacy-mgcp. The checks will get executed later, when the depends are installed and we are building various tags of Osmocom repos, including osmo-mgw 1.4.0. While at it, slightly refactor build_repo() to put all arguments into descriptive variable names (as it is getting a bit longer now). [1]: Change-Id: Ibd7948f12da710f8ca2b8fde8870f134308eb908 Related: OS#3867 Change-Id: I63d16f8e44c14dee46e2ef3fd050a421017c56b0 --- M scripts/osmocom-build-old-tags-against-master.sh 1 file changed, 44 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Daniel Willmann: Looks good to me, but someone else must approve osmith: Verified diff --git a/scripts/osmocom-build-old-tags-against-master.sh b/scripts/osmocom-build-old-tags-against-master.sh index 0ac220e..c5e9685 100755 --- a/scripts/osmocom-build-old-tags-against-master.sh +++ b/scripts/osmocom-build-old-tags-against-master.sh @@ -2,6 +2,7 @@ # Environment variables: # * PARALLEL_MAKE: -jN argument for make (default: -j5). # * SKIP_MASTER: don't build REPOS_MASTER (assume that they were just built and keep _temp). +# * SKIP_LEGACY: don't build libosmo-legacy-mgcp (assume that it was just built and keep _temp). # # Latest result: # https://jenkins.osmocom.org/jenkins/job/Osmocom-build-tags-against-master/lastBuild/console @@ -53,7 +54,9 @@ echo "1.0.0" # testsuite ;; osmo-bsc) - echo "1.2.1" # depends on libosmo-legacy-mgcp + # Depends on libosmo-legacy-mgcp, but missing LIBOSMOLEGACYMGCP_CFLAGS so we can't build it with + # this script (we put that legacy lib into a different temp install dir). Fixed in 1.2.2. + echo "1.2.1" echo "1.4.0" # testsuite ;; osmo-bts) @@ -97,9 +100,9 @@ # Delete existing temp dir and create a new one, output the path. prepare_temp_dir() { TEMP="$(cd ..; pwd)/_temp" - if [ -n "$SKIP_MASTER" ]; then + if [ -n "$SKIP_MASTER" ] || [ -n "$SKIP_LEGACY" ]; then if ! [ -d "$TEMP" ]; then - echo "ERROR: SKIP_MASTER is set, but temp dir not found: $TEMP" + echo "ERROR: SKIP_MASTER or SKIP_LEGACY is set, but temp dir not found: $TEMP" exit 1 fi else @@ -136,20 +139,27 @@ # $1: installation path (either $TEMP/inst_master or $TEMP/inst) # $2: repository # $3: branch, tag or commit +# $4: run tests (set to 0 to disable tests, default is 1) # returns: 0 on sucessful build, 1 on error build_repo() { - local log="$TEMP/log/$2-$3.txt" + local inst="$1" + local repo="$2" + local branch="$3" + local check="" + if [ "$4" != "0" ]; then + check="1" + fi if ! PATH="$PWD:$PATH"\ - PKG_CONFIG_PATH="$TEMP/inst_master/lib/pkgconfig:$PKG_CONFIG_PATH" \ - LD_LIBRARY_PATH="$TEMP/inst_master/lib:$LD_LIBRARY_PATH" \ + PKG_CONFIG_PATH="$TEMP/inst_master/lib/pkgconfig:$TEMP/inst_legacy/lib/pkgconfig:$PKG_CONFIG_PATH" \ + LD_LIBRARY_PATH="$TEMP/inst_master/lib:$TEMP/inst_legacy/lib:$LD_LIBRARY_PATH" \ MAKE="make" \ PARALLEL_MAKE="$PARALLEL_MAKE" \ - CHECK="1" \ + CHECK="$check" \ deps="../_deps" \ - inst="$1" \ - ./osmo-build-dep.sh "$2" "$3" \ - > "$log" 2>&1 + inst="$inst" \ + ./osmo-build-dep.sh "$repo" "$branch" \ + > "$TEMP/log/$repo-$branch.txt" 2>&1 then return 1 fi @@ -183,6 +193,29 @@ done } +# Build libosmo-legacy-mgcp and install to $TEMP/inst_legacy (osmo-bsc 1.2.1 depends on it). +build_legacy_mgcp() { + echo "Building legacy libraries..." + + if [ -n "$SKIP_LEGACY" ]; then + echo "=> SKIPPED (SKIP_LEGACY is set)" + return + fi + + local repo="osmo-mgw" + local tag="1.4.0" + + # Don't run "make check" here. The script tries it during build_repos_tags() instead. + local check="0" + printf "%-21s %10s %s" " * $repo" "$tag" "(provides libosmo-legacy-mgcp)" + if ! build_repo "$TEMP/inst_legacy" "$repo" "$tag" "$check"; then + printf "\n" + ERROR_LOGS="$ERROR_LOGS $TEMP/log/$repo-$tag.txt" + show_errors_exit + fi + printf "\n" +} + # $1: repository # $2: tag # returns: 0 when the error should be ignored, 1 otherwise @@ -231,5 +264,6 @@ prepare_temp_dir build_repos_master +build_legacy_mgcp build_repos_tags show_errors_exit -- To view, visit https://gerrit.osmocom.org/13454 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I63d16f8e44c14dee46e2ef3fd050a421017c56b0 Gerrit-Change-Number: 13454 Gerrit-PatchSet: 3 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 09:37:18 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 09:37:18 +0000 Subject: Change in docker-playground[master]: jenkins-common.sh: pull upstream base images Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13480 Change subject: jenkins-common.sh: pull upstream base images ...................................................................... jenkins-common.sh: pull upstream base images Prevent building docker images on top of outdated Debian images, where the package download feeds have been disabled. Use 'docker build --pull' instead of 'docker build', whenever the "FROM" line in the Dockerfile does not contain '$USER' (meaning this is an upstream image). Related: OS#3869 Change-Id: I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6 --- M jenkins-common.sh M make/Makefile 2 files changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/80/13480/1 diff --git a/jenkins-common.sh b/jenkins-common.sh index 2c4288e..a703a05 100644 --- a/jenkins-common.sh +++ b/jenkins-common.sh @@ -3,11 +3,21 @@ } docker_images_require() { + local from_line + local pull_arg + for i in $@; do # Trigger image build (cache will be used when up-to-date) if [ -z "$NO_DOCKER_IMAGE_BUILD" ]; then + # Pull upstream base images + pull_arg="--pull" + from_line="$(grep '^FROM' ../$i/Dockerfile)" + if echo "$from_line" | grep -q '$USER'; then + pull_arg="" + fi + echo "Building image: $i (export NO_DOCKER_IMAGE_BUILD=1 to prevent this)" - make -C "../$i" || exit 1 + PULL="$pull_arg" make -C "../$i" || exit 1 fi # Detect missing images (build skipped) diff --git a/make/Makefile b/make/Makefile index 2321fcf..d4e3c22 100644 --- a/make/Makefile +++ b/make/Makefile @@ -17,6 +17,7 @@ USERNAME?=$(USER) NAME?=$(shell basename $(CURDIR)) OSMO_TTCN3_BRANCH?=master +PULL?=$(PULL) RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support IMAGE?=$(REGISTRY_HOST)/$(USER)/$(NAME) @@ -41,7 +42,7 @@ docker-build: .release docker build --build-arg USER=$(USERNAME) --build-arg OSMO_TTCN3_BRANCH=$(OSMO_TTCN3_BRANCH) \ - -t $(IMAGE):latest . + $(PULL) -t $(IMAGE):latest . @DOCKER_MAJOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f1) ; \ DOCKER_MINOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f2) ; \ -- To view, visit https://gerrit.osmocom.org/13480 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6 Gerrit-Change-Number: 13480 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 09:37:18 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 09:37:18 +0000 Subject: Change in docker-playground[master]: gitignore: add .release Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13481 Change subject: gitignore: add .release ...................................................................... gitignore: add .release Ignore .release files generated by make/Makefile. Change-Id: I9ea8e4326f6da2ff95cf45999637c89f884a9e19 --- A .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/81/13481/1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a16a1a0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.release -- To view, visit https://gerrit.osmocom.org/13481 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9ea8e4326f6da2ff95cf45999637c89f884a9e19 Gerrit-Change-Number: 13481 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 09:39:29 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 09:39:29 +0000 Subject: Change in docker-playground[master]: jenkins-common.sh: pull upstream base images In-Reply-To: References: Message-ID: osmith has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13480 ) Change subject: jenkins-common.sh: pull upstream base images ...................................................................... jenkins-common.sh: pull upstream base images Prevent building docker images on top of outdated Debian images, where the package download feeds have been disabled. Use 'docker build --pull' instead of 'docker build', whenever the "FROM" line in the Dockerfile does not contain '$USER' (meaning this is an upstream image). Checking the FROM line is necessary, as downloading '$USER' images will fail (we never upload those). Related: OS#3869 Change-Id: I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6 --- M jenkins-common.sh M make/Makefile 2 files changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/80/13480/2 -- To view, visit https://gerrit.osmocom.org/13480 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6 Gerrit-Change-Number: 13480 Gerrit-PatchSet: 2 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 09:39:29 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 09:39:29 +0000 Subject: Change in docker-playground[master]: gitignore: add .release In-Reply-To: References: Message-ID: osmith has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13481 ) Change subject: gitignore: add .release ...................................................................... gitignore: add .release Ignore .release files generated by make/Makefile. Change-Id: I9ea8e4326f6da2ff95cf45999637c89f884a9e19 --- A .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/81/13481/2 -- To view, visit https://gerrit.osmocom.org/13481 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9ea8e4326f6da2ff95cf45999637c89f884a9e19 Gerrit-Change-Number: 13481 Gerrit-PatchSet: 2 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 09:45:42 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 2 Apr 2019 09:45:42 +0000 Subject: Change in osmo-trx[master]: osmo-trx: Check return code of osmo_fd_register Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13482 Change subject: osmo-trx: Check return code of osmo_fd_register ...................................................................... osmo-trx: Check return code of osmo_fd_register Fixes Coverity CID 197513. Change-Id: I93fbcb062439a547379aaecba283d107fdc9cb59 --- M Transceiver52M/osmo-trx.cpp 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/82/13482/1 diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 88b9de0..b252d0c 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -237,7 +237,10 @@ } osmo_fd_setup(&signal_ofd, sfd, OSMO_FD_READ, signalfd_callback, NULL, 0); - osmo_fd_register(&signal_ofd); + if (osmo_fd_register(&signal_ofd) < 0) { + fprintf(stderr, "osmo_fd_register() failed.\n"); + exit(EXIT_FAILURE); + } } static void print_help() -- To view, visit https://gerrit.osmocom.org/13482 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I93fbcb062439a547379aaecba283d107fdc9cb59 Gerrit-Change-Number: 13482 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 09:46:01 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 2 Apr 2019 09:46:01 +0000 Subject: Change in osmo-msc[master]: msc/gsm_data.h: drop unused SMS_HDR_SIZE macro Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13483 Change subject: msc/gsm_data.h: drop unused SMS_HDR_SIZE macro ...................................................................... msc/gsm_data.h: drop unused SMS_HDR_SIZE macro Change-Id: Iea32a26673ebb57b18dc7e86ad321d9ed48e0948 --- M include/osmocom/msc/gsm_data.h 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/83/13483/1 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 7d3a1e7..1a0d144 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -239,7 +239,6 @@ SMS_SOURCE_SMPP, /* received via SMPP */ }; -#define SMS_HDR_SIZE 128 #define SMS_TEXT_SIZE 256 struct gsm_sms_addr { -- To view, visit https://gerrit.osmocom.org/13483 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iea32a26673ebb57b18dc7e86ad321d9ed48e0948 Gerrit-Change-Number: 13483 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 09:46:01 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 2 Apr 2019 09:46:01 +0000 Subject: Change in osmo-msc[master]: msc/gsm_data.h: fix and clarify GSM 03.40 TP-UD Length Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13484 Change subject: msc/gsm_data.h: fix and clarify GSM 03.40 TP-UD Length ...................................................................... msc/gsm_data.h: fix and clarify GSM 03.40 TP-UD Length As per 3GPP TS 03.40, section 9.2.3.16 "TP-User-Data-Length (TP-UDL)", if the TP-User-Data is coded using the GSM 7-bit default alphabet, the TP-User-Data-Length field indicates the *number of septets* within the TP-User-Data field to follow. Otherwise, e.g. in case of 8-bit or UCS-2 encoded data, the *number of octets* is indicated. It's a good question from where does this value come from: #define SMS_TEXT_SIZE 256 Let's replace it with two new definitions: #define GSM340_UDL_OCT_MAX 140 #define GSM340_UDL_SPT_MAX 160 which correspond to the maximum TP-UD field length indicated in octets and septets respectively. Change-Id: I2a49f9d24cd075234190b3b92999256bce01ca77 --- M include/osmocom/msc/gsm_data.h 1 file changed, 14 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/84/13484/1 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 1a0d144..77f76b7 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -239,7 +239,9 @@ SMS_SOURCE_SMPP, /* received via SMPP */ }; -#define SMS_TEXT_SIZE 256 +/* TODO: Move these defines to libosmogsm (gsm/protocol/gsm_03_40.h) */ +#define GSM340_UDL_OCT_MAX 140 /*!< Maximum TP-UD length (in octets) for 7-bit encoding */ +#define GSM340_UDL_SPT_MAX 160 /*!< Maximum TP-UD length (in seplets) for 8-bit and UCS-2 encoding */ struct gsm_sms_addr { uint8_t ton; @@ -274,10 +276,18 @@ uint8_t protocol_id; uint8_t data_coding_scheme; uint8_t msg_ref; - uint8_t user_data_len; - uint8_t user_data[SMS_TEXT_SIZE]; - char text[SMS_TEXT_SIZE]; + /* Depending on DCS value in use, TP-UDL may indicate the length of + * TP-UD either in septets, or in octets. See 3GPP TS 03.40, + * section 9.2.3.16 "TP-User-Data-Length (TP-UDL)" for details. */ + uint8_t user_data_len; + /* Since we always store TP-UD in octets, even if it does contain + * data encoded in septets (i.e. 7-bit default encoding), this + * buffer is limited to 140 bytes. */ + uint8_t user_data[GSM340_UDL_OCT_MAX]; + + /* Up to 160 symbols decoded from TP-UD + '\0' */ + char text[GSM340_UDL_SPT_MAX + 1]; }; /* control interface handling */ -- To view, visit https://gerrit.osmocom.org/13484 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2a49f9d24cd075234190b3b92999256bce01ca77 Gerrit-Change-Number: 13484 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 09:56:29 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 2 Apr 2019 09:56:29 +0000 Subject: Change in osmo-msc[master]: msc/gsm_data.h: drop unused SMS_HDR_SIZE macro In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13483 ) Change subject: msc/gsm_data.h: drop unused SMS_HDR_SIZE macro ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13483 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iea32a26673ebb57b18dc7e86ad321d9ed48e0948 Gerrit-Change-Number: 13483 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 02 Apr 2019 09:56:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 09:59:49 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 09:59:49 +0000 Subject: Change in docker-playground[master]: jenkins-common.sh: pull upstream base images In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13480 ) Change subject: jenkins-common.sh: pull upstream base images ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13480 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6 Gerrit-Change-Number: 13480 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 02 Apr 2019 09:59:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 10:00:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 10:00:08 +0000 Subject: Change in osmo-msc[master]: msc/gsm_data.h: drop unused SMS_HDR_SIZE macro In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13483 ) Change subject: msc/gsm_data.h: drop unused SMS_HDR_SIZE macro ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13483 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iea32a26673ebb57b18dc7e86ad321d9ed48e0948 Gerrit-Change-Number: 13483 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 02 Apr 2019 10:00:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 10:00:52 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 10:00:52 +0000 Subject: Change in osmo-msc[master]: msc/gsm_data.h: fix and clarify GSM 03.40 TP-UD Length In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13484 ) Change subject: msc/gsm_data.h: fix and clarify GSM 03.40 TP-UD Length ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13484 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2a49f9d24cd075234190b3b92999256bce01ca77 Gerrit-Change-Number: 13484 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 02 Apr 2019 10:00:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 10:01:25 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 2 Apr 2019 10:01:25 +0000 Subject: Change in osmo-msc[master]: msc/gsm_data.h: fix and clarify GSM 03.40 TP-UD Length In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13484 ) Change subject: msc/gsm_data.h: fix and clarify GSM 03.40 TP-UD Length ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/13484/1/include/osmocom/msc/gsm_data.h File include/osmocom/msc/gsm_data.h: https://gerrit.osmocom.org/#/c/13484/1/include/osmocom/msc/gsm_data.h at 242 PS1, Line 242: /* TODO: Move these defines to libosmogsm (gsm/protocol/gsm_03_40.h) */ Can you add "3GPP TS 03.40, section 9.2.3.16" or whatever reference you got these numbers from? https://gerrit.osmocom.org/#/c/13484/1/include/osmocom/msc/gsm_data.h at 287 PS1, Line 287: uint8_t user_data[GSM340_UDL_OCT_MAX]; iiuc, we use 1 octet for each 7bit-digit, which means we still need more space than we should use GSM340_UDL_SPT_MAX instead of GSM340_UDL_OCT_MAX here. Or does it mean we always use the octet encoding? -- To view, visit https://gerrit.osmocom.org/13484 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2a49f9d24cd075234190b3b92999256bce01ca77 Gerrit-Change-Number: 13484 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Assignee: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Neels Hofmeyr Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 02 Apr 2019 10:01:25 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 10:11:59 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 2 Apr 2019 10:11:59 +0000 Subject: Change in osmo-msc[master]: msc/gsm_data.h: fix and clarify GSM 03.40 TP-UD Length In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13484 ) Change subject: msc/gsm_data.h: fix and clarify GSM 03.40 TP-UD Length ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/13484/1/include/osmocom/msc/gsm_data.h File include/osmocom/msc/gsm_data.h: https://gerrit.osmocom.org/#/c/13484/1/include/osmocom/msc/gsm_data.h at 242 PS1, Line 242: /* TODO: Move these defines to libosmogsm (gsm/protocol/gsm_03_40.h) */ > Can you add "3GPP TS 03.40, section 9.2.3. [?] Sure! https://gerrit.osmocom.org/#/c/13484/1/include/osmocom/msc/gsm_data.h at 287 PS1, Line 287: uint8_t user_data[GSM340_UDL_OCT_MAX]; > iiuc, we use 1 octet for each 7bit-digit, which means we still need more space than we should use GS [?] No, we don't use 1 octet for each 7bit-digit. Check out the definition of sms_from_text() for example: sms->user_data_len = gsm_7bit_encode_n(sms->user_data, sizeof(sms->user_data), sms->text, NULL); -- To view, visit https://gerrit.osmocom.org/13484 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2a49f9d24cd075234190b3b92999256bce01ca77 Gerrit-Change-Number: 13484 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Assignee: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Neels Hofmeyr Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 02 Apr 2019 10:11:59 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 10:15:40 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 10:15:40 +0000 Subject: Change in osmo-ci[master]: docker/rebuild_osmocom_jenkins_image.sh: remove jessie Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13485 Change subject: docker/rebuild_osmocom_jenkins_image.sh: remove jessie ...................................................................... docker/rebuild_osmocom_jenkins_image.sh: remove jessie Don't build the debian jessie image anymore, and don't try to add jessie-backports to the sources.list, since it does not exist anymore. My understanding is, that we are moving away from the jessie images anyway, and everything can be done with the strech images. Related: OS#3894 Change-Id: Iba033e64876b7ed9d329c2a636a0ee5eb3af946e --- M docker/Dockerfile_osmocom_jenkins.amd64 M docker/rebuild_osmocom_jenkins_image.sh 2 files changed, 3 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/85/13485/1 diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64 index c365380..7a279d4 100644 --- a/docker/Dockerfile_osmocom_jenkins.amd64 +++ b/docker/Dockerfile_osmocom_jenkins.amd64 @@ -1,8 +1,7 @@ -ARG DEBIAN_VERSION=jessie +ARG DEBIAN_VERSION=stretch FROM debian:${DEBIAN_VERSION} RUN \ - echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list && \ dpkg --add-architecture i386 && \ DEBIAN_FRONTEND=noninteractive apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \ @@ -29,7 +28,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libortp-dev libpcsclite-dev libsctp-dev libfftw3-dev libsnmp-dev libusb-1.0-0-dev libtalloc-dev libgnutls28-dev # OsmocomBB -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc-arm-none-eabi liblua5.3-dev/jessie-backports +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc-arm-none-eabi liblua5.3-dev # building RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf diff --git a/docker/rebuild_osmocom_jenkins_image.sh b/docker/rebuild_osmocom_jenkins_image.sh index 3dcca39..a2fae2e 100755 --- a/docker/rebuild_osmocom_jenkins_image.sh +++ b/docker/rebuild_osmocom_jenkins_image.sh @@ -19,6 +19,5 @@ build_once "-t" "${tag_name}" "--build-arg" DEBIAN_VERSION="${debian_version}" } -# Create containers using jessie (Debian 8.0) and stretch (Debian 9.0) as base. -build_container osmocom:amd64 jessie +# Create containers using stretch (Debian 9.0) as base. build_container osmocom:deb9_amd64 stretch -- To view, visit https://gerrit.osmocom.org/13485 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iba033e64876b7ed9d329c2a636a0ee5eb3af946e Gerrit-Change-Number: 13485 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 10:15:41 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 10:15:41 +0000 Subject: Change in osmo-ci[master]: docker/rebuild_osmocom_jenkins_image.sh: pull images Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13486 Change subject: docker/rebuild_osmocom_jenkins_image.sh: pull images ...................................................................... docker/rebuild_osmocom_jenkins_image.sh: pull images Prevent building docker images on top of outdated Debian images, where the package download feeds have been disabled. Related: Change-Id I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6 (docker-playground.git) Related: OS#3869 Change-Id: Id840094aec51bf51d920aaa017a2f99fcb866f55 --- M docker/rebuild_osmocom_jenkins_image.sh 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/86/13486/1 diff --git a/docker/rebuild_osmocom_jenkins_image.sh b/docker/rebuild_osmocom_jenkins_image.sh index a2fae2e..2554529 100755 --- a/docker/rebuild_osmocom_jenkins_image.sh +++ b/docker/rebuild_osmocom_jenkins_image.sh @@ -15,6 +15,9 @@ local tag_name=${1} local debian_version=${2} + echo "Pulling ${debian_version} image" + docker pull "debian:${debian_version}" + echo "Building for ${debian_version} and setting tag ${tag_name}" build_once "-t" "${tag_name}" "--build-arg" DEBIAN_VERSION="${debian_version}" } -- To view, visit https://gerrit.osmocom.org/13486 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id840094aec51bf51d920aaa017a2f99fcb866f55 Gerrit-Change-Number: 13486 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 10:15:42 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 10:15:42 +0000 Subject: Change in osmo-ci[master]: docker/rebuild_osmocom_jenkins_image.sh: set -e Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13487 Change subject: docker/rebuild_osmocom_jenkins_image.sh: set -e ...................................................................... docker/rebuild_osmocom_jenkins_image.sh: set -e Exit with error if one of the docker commands is failing, for example when pulling the debian image. Change-Id: I6faaf9303b4facb0965131615bc73541dd309c51 --- M docker/rebuild_osmocom_jenkins_image.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/87/13487/1 diff --git a/docker/rebuild_osmocom_jenkins_image.sh b/docker/rebuild_osmocom_jenkins_image.sh index 2554529..60c516b 100755 --- a/docker/rebuild_osmocom_jenkins_image.sh +++ b/docker/rebuild_osmocom_jenkins_image.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e # Executes docker build with the given parameters and retry in case of error. function build_once() { -- To view, visit https://gerrit.osmocom.org/13487 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6faaf9303b4facb0965131615bc73541dd309c51 Gerrit-Change-Number: 13487 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 10:22:53 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 2 Apr 2019 10:22:53 +0000 Subject: Change in osmo-ci[master]: docker/rebuild_osmocom_jenkins_image.sh: remove jessie In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/13485 ) Change subject: docker/rebuild_osmocom_jenkins_image.sh: remove jessie ...................................................................... Patch Set 1: Make sure to delete the jessie image from the registry and hosts first. Or install a broken container as "osmocom jessie". jessie-backports was moved to archive.debian.org: https://unix.stackexchange.com/questions/508724/failed-to-fetch-jessie-backports-repository -- To view, visit https://gerrit.osmocom.org/13485 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iba033e64876b7ed9d329c2a636a0ee5eb3af946e Gerrit-Change-Number: 13485 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 02 Apr 2019 10:22:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 10:23:28 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 10:23:28 +0000 Subject: Change in docker-playground[master]: jenkins-common.sh: pull upstream base images In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13480 ) Change subject: jenkins-common.sh: pull upstream base images ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/13480 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6 Gerrit-Change-Number: 13480 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 02 Apr 2019 10:23:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 10:23:33 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 10:23:33 +0000 Subject: Change in docker-playground[master]: jenkins-common.sh: pull upstream base images In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13480 ) Change subject: jenkins-common.sh: pull upstream base images ...................................................................... jenkins-common.sh: pull upstream base images Prevent building docker images on top of outdated Debian images, where the package download feeds have been disabled. Use 'docker build --pull' instead of 'docker build', whenever the "FROM" line in the Dockerfile does not contain '$USER' (meaning this is an upstream image). Checking the FROM line is necessary, as downloading '$USER' images will fail (we never upload those). Related: OS#3869 Change-Id: I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6 --- M jenkins-common.sh M make/Makefile 2 files changed, 13 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved osmith: Verified diff --git a/jenkins-common.sh b/jenkins-common.sh index 2c4288e..a703a05 100644 --- a/jenkins-common.sh +++ b/jenkins-common.sh @@ -3,11 +3,21 @@ } docker_images_require() { + local from_line + local pull_arg + for i in $@; do # Trigger image build (cache will be used when up-to-date) if [ -z "$NO_DOCKER_IMAGE_BUILD" ]; then + # Pull upstream base images + pull_arg="--pull" + from_line="$(grep '^FROM' ../$i/Dockerfile)" + if echo "$from_line" | grep -q '$USER'; then + pull_arg="" + fi + echo "Building image: $i (export NO_DOCKER_IMAGE_BUILD=1 to prevent this)" - make -C "../$i" || exit 1 + PULL="$pull_arg" make -C "../$i" || exit 1 fi # Detect missing images (build skipped) diff --git a/make/Makefile b/make/Makefile index 2321fcf..d4e3c22 100644 --- a/make/Makefile +++ b/make/Makefile @@ -17,6 +17,7 @@ USERNAME?=$(USER) NAME?=$(shell basename $(CURDIR)) OSMO_TTCN3_BRANCH?=master +PULL?=$(PULL) RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support IMAGE?=$(REGISTRY_HOST)/$(USER)/$(NAME) @@ -41,7 +42,7 @@ docker-build: .release docker build --build-arg USER=$(USERNAME) --build-arg OSMO_TTCN3_BRANCH=$(OSMO_TTCN3_BRANCH) \ - -t $(IMAGE):latest . + $(PULL) -t $(IMAGE):latest . @DOCKER_MAJOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f1) ; \ DOCKER_MINOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f2) ; \ -- To view, visit https://gerrit.osmocom.org/13480 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6 Gerrit-Change-Number: 13480 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 10:49:01 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 10:49:01 +0000 Subject: Change in osmo-ci[master]: docker/rebuild_osmocom_jenkins_image.sh: remove jessie In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13485 ) Change subject: docker/rebuild_osmocom_jenkins_image.sh: remove jessie ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13485/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13485/1//COMMIT_MSG at 12 PS1, Line 12: My understanding is, that we are moving away from the jessie images This is not entirely correct. It still makes sense to do build testing ("make check") on debian8/jessie, as some users may very well be using old distros. I just moved the TTCN-3 tests over to stretch, as there's no reason to run the TTCN3 tests on any specific (old) distribution. -- To view, visit https://gerrit.osmocom.org/13485 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iba033e64876b7ed9d329c2a636a0ee5eb3af946e Gerrit-Change-Number: 13485 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 02 Apr 2019 10:49:01 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 11:32:01 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 2 Apr 2019 11:32:01 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: introduce and use parse_sm_ud_from_result() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13488 Change subject: libmsc/db.c: introduce and use parse_sm_ud_from_result() ...................................................................... libmsc/db.c: introduce and use parse_sm_ud_from_result() The following functions: - sms_from_result(), - sms_from_result_v3(), - sms_from_result_v4(), do retrieve the TP-UD, TP-UDL and text in the same way, so let's avoid code duplication. Change-Id: If67dfb9f7d2a55fa3d45dc4689a2acff9909faf6 --- M src/libmsc/db.c 1 file changed, 35 insertions(+), 48 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/88/13488/1 diff --git a/src/libmsc/db.c b/src/libmsc/db.c index ae9b114..bf57ec8 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -225,6 +225,32 @@ return 0; } +static void parse_tp_ud_from_result(struct gsm_sms *sms, dbi_result result) +{ + const unsigned char *user_data; + unsigned int user_data_len; + const char *text; + + /* Retrieve TP-UDL (User-Data-Length) in octets (regardless of DCS) */ + user_data_len = dbi_result_get_field_length(result, "user_data"); + if (user_data_len > sizeof(sms->user_data)) { + LOGP(DDB, LOGL_ERROR, + "SMS TP-UD length %u is too big, truncating to %zu\n", + user_data_len, sizeof(sms->user_data)); + user_data_len = (uint8_t) sizeof(sms->user_data); + } + sms->user_data_len = user_data_len; + + /* Retrieve the TP-UD (User-Data) itself */ + user_data = dbi_result_get_binary(result, "user_data"); + memcpy(sms->user_data, user_data, user_data_len); + + /* Retrieve the text parsed from TP-UD (User-Data) */ + text = dbi_result_get_string(result, "text"); + if (text) + OSMO_STRLCPY_ARRAY(sms->text, text); +} + /** * Copied from the normal sms_from_result_v3 to avoid having * to make sure that the real routine will remain backward @@ -234,9 +260,7 @@ { struct gsm_sms *sms = sms_alloc(); long long unsigned int sender_id; - const char *text, *daddr; - const unsigned char *user_data; - unsigned int user_data_len; + const char *daddr; char buf[32]; char *quoted; dbi_result result2; @@ -274,20 +298,9 @@ if (daddr) OSMO_STRLCPY_ARRAY(sms->dst.addr, daddr); - user_data_len = dbi_result_get_field_length(result, "user_data"); - user_data = dbi_result_get_binary(result, "user_data"); - if (user_data_len > sizeof(sms->user_data)) { - LOGP(DDB, LOGL_ERROR, - "SMS TP-UD length %u is too big, truncating to %zu\n", - user_data_len, sizeof(sms->user_data)); - user_data_len = (uint8_t) sizeof(sms->user_data); - } - sms->user_data_len = user_data_len; - memcpy(sms->user_data, user_data, sms->user_data_len); + /* Parse TP-UD, TP-UDL and decoded text */ + parse_tp_ud_from_result(sms, result); - text = dbi_result_get_string(result, "text"); - if (text) - OSMO_STRLCPY_ARRAY(sms->text, text); return sms; } @@ -400,9 +413,7 @@ static struct gsm_sms *sms_from_result_v4(dbi_result result) { struct gsm_sms *sms = sms_alloc(); - const unsigned char *user_data; - unsigned int user_data_len; - const char *text, *addr; + const char *addr; if (!sms) return NULL; @@ -426,20 +437,9 @@ sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton"); sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi"); - user_data_len = dbi_result_get_field_length(result, "user_data"); - user_data = dbi_result_get_binary(result, "user_data"); - if (user_data_len > sizeof(sms->user_data)) { - LOGP(DDB, LOGL_ERROR, - "SMS TP-UD length %u is too big, truncating to %zu\n", - user_data_len, sizeof(sms->user_data)); - user_data_len = (uint8_t) sizeof(sms->user_data); - } - sms->user_data_len = user_data_len; - memcpy(sms->user_data, user_data, sms->user_data_len); + /* Parse TP-UD, TP-UDL and decoded text */ + parse_tp_ud_from_result(sms, result); - text = dbi_result_get_string(result, "text"); - if (text) - OSMO_STRLCPY_ARRAY(sms->text, text); return sms; } @@ -754,9 +754,7 @@ static struct gsm_sms *sms_from_result(struct gsm_network *net, dbi_result result) { struct gsm_sms *sms = sms_alloc(); - const char *text, *daddr, *saddr; - const unsigned char *user_data; - unsigned int user_data_len; + const char *daddr, *saddr; time_t validity_timestamp; if (!sms) @@ -790,20 +788,9 @@ if (saddr) OSMO_STRLCPY_ARRAY(sms->src.addr, saddr); - user_data_len = dbi_result_get_field_length(result, "user_data"); - user_data = dbi_result_get_binary(result, "user_data"); - if (user_data_len > sizeof(sms->user_data)) { - LOGP(DDB, LOGL_ERROR, - "SMS TP-UD length %u is too big, truncating to %zu\n", - user_data_len, sizeof(sms->user_data)); - user_data_len = (uint8_t) sizeof(sms->user_data); - } - sms->user_data_len = user_data_len; - memcpy(sms->user_data, user_data, sms->user_data_len); + /* Parse TP-UD, TP-UDL and decoded text */ + parse_tp_ud_from_result(sms, result); - text = dbi_result_get_string(result, "text"); - if (text) - OSMO_STRLCPY_ARRAY(sms->text, text); return sms; } -- To view, visit https://gerrit.osmocom.org/13488 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If67dfb9f7d2a55fa3d45dc4689a2acff9909faf6 Gerrit-Change-Number: 13488 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 11:32:01 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 2 Apr 2019 11:32:01 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: warn user about SMS text truncation Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13489 Change subject: libmsc/db.c: warn user about SMS text truncation ...................................................................... libmsc/db.c: warn user about SMS text truncation In general, neither TP-User-Data nor decoded text should be truncated. If the SMSC's database for some reason does contain such weird messages, let's at least let the user know about it. Change-Id: I75e852ebe44ba4784572cbffa029e13f0d3c430c --- M src/libmsc/db.c 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/89/13489/1 diff --git a/src/libmsc/db.c b/src/libmsc/db.c index bf57ec8..6cd8493 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -229,6 +229,7 @@ { const unsigned char *user_data; unsigned int user_data_len; + unsigned int text_len; const char *text; /* Retrieve TP-UDL (User-Data-Length) in octets (regardless of DCS) */ @@ -245,6 +246,15 @@ user_data = dbi_result_get_binary(result, "user_data"); memcpy(sms->user_data, user_data, user_data_len); + /* Retrieve the text length (excluding '\0') */ + text_len = dbi_result_get_field_length(result, "text"); + if (text_len >= sizeof(sms->text)) { + LOGP(DDB, LOGL_ERROR, + "SMS text length %u is too big, truncating to %zu\n", + text_len, sizeof(sms->text) - 1); + /* OSMO_STRLCPY_ARRAY() does truncation for us */ + } + /* Retrieve the text parsed from TP-UD (User-Data) */ text = dbi_result_get_string(result, "text"); if (text) -- To view, visit https://gerrit.osmocom.org/13489 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I75e852ebe44ba4784572cbffa029e13f0d3c430c Gerrit-Change-Number: 13489 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 11:34:26 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 2 Apr 2019 11:34:26 +0000 Subject: Change in osmo-trx[master]: osmo-trx: Check return code of osmo_fd_register In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13482 ) Change subject: osmo-trx: Check return code of osmo_fd_register ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13482 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I93fbcb062439a547379aaecba283d107fdc9cb59 Gerrit-Change-Number: 13482 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 02 Apr 2019 11:34:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 11:35:05 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 2 Apr 2019 11:35:05 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: fix potential integer overflow In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13470 ) Change subject: libmsc/db.c: fix potential integer overflow ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13470 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibbd588545e1a4817504c806a3d02cf59d5938ee2 Gerrit-Change-Number: 13470 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 02 Apr 2019 11:35:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 11:37:10 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 11:37:10 +0000 Subject: Change in osmo-ci[master]: docker/rebuild_osmocom_jenkins_image.sh: remove jessie In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13485 ) Change subject: docker/rebuild_osmocom_jenkins_image.sh: remove jessie ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13485/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13485/1//COMMIT_MSG at 12 PS1, Line 12: My understanding is, that we are moving away from the jessie images > This is not entirely correct. [?] Understood. And by searching where osmocom:amd64 is used, I realize that we use it in the master-builds.yml and gerrit-verifications.yml jenkins jobs. I'll change the patch to fetch jessie-backports from debian archive (as in the link that Holger found), instead of deleting the jessie image. -- To view, visit https://gerrit.osmocom.org/13485 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iba033e64876b7ed9d329c2a636a0ee5eb3af946e Gerrit-Change-Number: 13485 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 02 Apr 2019 11:37:10 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 11:53:59 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 2 Apr 2019 11:53:59 +0000 Subject: Change in osmo-msc[master]: msc/gsm_data.h: fix and clarify GSM 03.40 TP-UD Length In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13484 ) Change subject: msc/gsm_data.h: fix and clarify GSM 03.40 TP-UD Length ...................................................................... Patch Set 2: (2 comments) osmo-msc merge wise this should be fine to be merged. https://gerrit.osmocom.org/#/c/13484/2/include/osmocom/msc/gsm_data.h File include/osmocom/msc/gsm_data.h: https://gerrit.osmocom.org/#/c/13484/2/include/osmocom/msc/gsm_data.h at 242 PS2, Line 242: /* TODO: Move these defines to libosmogsm (gsm/protocol/gsm_03_40.h) */ (why not add them there then from the start?) https://gerrit.osmocom.org/#/c/13484/2/include/osmocom/msc/gsm_data.h at 284 PS2, Line 284: /* Since we always store TP-UD in octets, even if it does contain ("we store in octets" to me sounds like we store each septet in an octet. I'd call it "this stores raw packed septets"?) -- To view, visit https://gerrit.osmocom.org/13484 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2a49f9d24cd075234190b3b92999256bce01ca77 Gerrit-Change-Number: 13484 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Assignee: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Neels Hofmeyr Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 02 Apr 2019 11:53:59 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 12:05:46 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 2 Apr 2019 12:05:46 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: properly get / set TP-UD length (octets vs septets) Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13490 Change subject: libmsc/db.c: properly get / set TP-UD length (octets vs septets) ...................................................................... libmsc/db.c: properly get / set TP-UD length (octets vs septets) According to 3GPP TS 03.40, section 9.2.3.16, the TP-UDL field indicates the length of TP-UD (User-Data, including TP-UDH) either in septets, or in octets, depending on DSC in use. When retrieving the TP-UD from the database, we get the length in octets (bytes), regardless of the DCS value. Before this patch, it was merely copied to struct 'gsm_sms', without any conversion from octets to septets. The same problem was in db_sms_store(), which could run into a buffer overflow, using the amount of septets (e.g. 160) to store some 8-bit or UCS-2 encoded data (up to 140 octets). Change-Id: I84f973bc6561a9822b4b26975a781abd2b6e026a --- M src/libmsc/db.c 1 file changed, 25 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/90/13490/1 diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 6cd8493..f48384e 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -227,6 +228,7 @@ static void parse_tp_ud_from_result(struct gsm_sms *sms, dbi_result result) { + enum sms_alphabet dcs_alphabet; const unsigned char *user_data; unsigned int user_data_len; unsigned int text_len; @@ -240,12 +242,20 @@ user_data_len, sizeof(sms->user_data)); user_data_len = (uint8_t) sizeof(sms->user_data); } - sms->user_data_len = user_data_len; /* Retrieve the TP-UD (User-Data) itself */ user_data = dbi_result_get_binary(result, "user_data"); memcpy(sms->user_data, user_data, user_data_len); + /* We may need to convert the length in octets to a value in septets, + * if 7-bit default alphabet is used (see 3GPP TS 03.40, + * section 9.2.3.16 for details). */ + dcs_alphabet = gsm338_get_sms_alphabet(sms->data_coding_scheme); + if (dcs_alphabet == DCS_7BIT_DEFAULT) + sms->user_data_len = user_data_len * 8 / 7; + else + sms->user_data_len = user_data_len; + /* Retrieve the text length (excluding '\0') */ text_len = dbi_result_get_field_length(result, "text"); if (text_len >= sizeof(sms->text)) { @@ -716,12 +726,24 @@ char *q_text, *q_daddr, *q_saddr; unsigned char *q_udata; time_t now, validity_timestamp; + enum sms_alphabet dcs_alphabet; + unsigned int user_data_len; + + /* We may need to convert the length in septets to a value in octets, + * if 7-bit default alphabet is used (see 3GPP TS 03.40, + * section 9.2.3.16 for details). */ + dcs_alphabet = gsm338_get_sms_alphabet(sms->data_coding_scheme); + if (dcs_alphabet == DCS_7BIT_DEFAULT) { + user_data_len = sms->user_data_len * 7 / 8; + if (sms->user_data_len * 7 % 8 != 0) + user_data_len++; + } else + user_data_len = sms->user_data_len; dbi_conn_quote_string_copy(conn, (char *)sms->text, &q_text); dbi_conn_quote_string_copy(conn, (char *)sms->dst.addr, &q_daddr); dbi_conn_quote_string_copy(conn, (char *)sms->src.addr, &q_saddr); - dbi_conn_quote_binary_copy(conn, sms->user_data, sms->user_data_len, - &q_udata); + dbi_conn_quote_binary_copy(conn, sms->user_data, user_data_len, &q_udata); now = time(NULL); validity_timestamp = now + sms->validity_minutes * 60; -- To view, visit https://gerrit.osmocom.org/13490 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I84f973bc6561a9822b4b26975a781abd2b6e026a Gerrit-Change-Number: 13490 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 12:16:35 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 12:16:35 +0000 Subject: Change in osmo-ci[master]: Change jessie-backports URL to debian archive In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13485 to look at the new patch set (#2). Change subject: Change jessie-backports URL to debian archive ...................................................................... Change jessie-backports URL to debian archive Fix docker/Dockerfile_osmocom_jenkins.amd64 by fetching jessie-backports from debian archive. The jessie image is still being used by various jenkins jobs generated by master-builds.yml and gerrit-verifications.yml. We want to keep using it for some more time, to make sure that build testing ("make check") passes on debian8/jessie, as some users may very well be using old distros. See also: * https://lists.debian.org/debian-devel-announce/2019/03/msg00006.html * https://unix.stackexchange.com/q/508724 Related: OS#3894 Change-Id: Iba033e64876b7ed9d329c2a636a0ee5eb3af946e --- M docker/Dockerfile_osmocom_jenkins.amd64 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/85/13485/2 -- To view, visit https://gerrit.osmocom.org/13485 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba033e64876b7ed9d329c2a636a0ee5eb3af946e Gerrit-Change-Number: 13485 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 12:16:35 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 12:16:35 +0000 Subject: Change in osmo-ci[master]: docker/rebuild_osmocom_jenkins_image.sh: set -e In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Daniel Willmann, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13487 to look at the new patch set (#2). Change subject: docker/rebuild_osmocom_jenkins_image.sh: set -e ...................................................................... docker/rebuild_osmocom_jenkins_image.sh: set -e Exit with error if one of the docker commands is failing (i.e. don't exit with 0 when building the jessie image failed, but the stretch image got built properly). Change-Id: I6faaf9303b4facb0965131615bc73541dd309c51 --- M docker/rebuild_osmocom_jenkins_image.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/87/13487/2 -- To view, visit https://gerrit.osmocom.org/13487 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6faaf9303b4facb0965131615bc73541dd309c51 Gerrit-Change-Number: 13487 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 12:17:07 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 12:17:07 +0000 Subject: Change in osmo-ci[master]: Change jessie-backports URL to debian archive In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13485 ) Change subject: Change jessie-backports URL to debian archive ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/13485 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iba033e64876b7ed9d329c2a636a0ee5eb3af946e Gerrit-Change-Number: 13485 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 02 Apr 2019 12:17:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 12:17:16 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 12:17:16 +0000 Subject: Change in osmo-ci[master]: docker/rebuild_osmocom_jenkins_image.sh: pull images In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13486 ) Change subject: docker/rebuild_osmocom_jenkins_image.sh: pull images ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/13486 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id840094aec51bf51d920aaa017a2f99fcb866f55 Gerrit-Change-Number: 13486 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 02 Apr 2019 12:17:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 12:17:24 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 12:17:24 +0000 Subject: Change in osmo-ci[master]: docker/rebuild_osmocom_jenkins_image.sh: set -e In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13487 ) Change subject: docker/rebuild_osmocom_jenkins_image.sh: set -e ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/13487 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6faaf9303b4facb0965131615bc73541dd309c51 Gerrit-Change-Number: 13487 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 02 Apr 2019 12:17:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 12:55:18 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 2 Apr 2019 12:55:18 +0000 Subject: Change in osmo-hlr[master]: gsup_router.c: gsup_route_find(): support blob In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13048 ) Change subject: gsup_router.c: gsup_route_find(): support blob ...................................................................... Patch Set 2: (3 comments) > I am not fully decided which way to go, but I lean towards: now always send the terminating nul from GSUP clients as contained in destination addresses (counted in the addr_len), i.e. we contain the nul in the BLOB, but the code should ignore that fact as much as currently possible -- towards a future where no code depends on the nul. This sounds like a good solution to me. The patch only seems to make it more complex. I'll update the follow up patch to not depend on this one anymore, and just send the \0 at the end: https://gerrit.osmocom.org/#/c/osmo-hlr/+/13006/ ("hlr.c: forward GSUP messages between clients") Then I'll abandon this one. https://gerrit.osmocom.org/#/c/13048/2/src/gsup_router.c File src/gsup_router.c: https://gerrit.osmocom.org/#/c/13048/2/src/gsup_router.c at 43 PS2, Line 43: talloc_total_size > You could alternatively extend struct 'gsup_route' with 'addr_len', and modify gsup_route_add() to s [?] Ack https://gerrit.osmocom.org/#/c/13048/2/src/gsup_router.c at 45 PS2, Line 45: a lot of code assumes that addr is also nul-terminated > Wait, your previous comment also states that "gr->addr is a nul-terminated string" o_O. Yes, that is redundant. https://gerrit.osmocom.org/#/c/13048/2/src/gsup_router.c at 49 PS2, Line 49: Compare addr as non-nul-terminated blob > Wouldn't this cause a collision when e.g. both (read in hex): [?] IIRC it would work, because gs->routes would always have \0 at the end ("gr->addr is a nul-terminated string"). So it would look like this: - 0xff, 0x00, 0x00, 0xbb, 0xaa, 0xff, 0x00 (gr->addr) - 0xff, 0x00, 0x00, 0xbb, 0xaa, 0x77 (addr) addrlen would be 6, the check would return false. -- To view, visit https://gerrit.osmocom.org/13048 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I01a45900e14d41bcd338f50ad85d9fabf2c61405 Gerrit-Change-Number: 13048 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 02 Apr 2019 12:55:18 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 14:58:42 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 2 Apr 2019 14:58:42 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: add testcase TC_sgsap_impl_imsi_det_noneps 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/13351 to look at the new patch set (#3). Change subject: MSC_Tests: add testcase TC_sgsap_impl_imsi_det_noneps ...................................................................... MSC_Tests: add testcase TC_sgsap_impl_imsi_det_noneps We have a testcase that sends an explicit (UE-Initiated) imsi detach from non EPS services. Lets also cover the case for an implicit (Network-initated) detach. Change-Id: I76049e6717680c54c18f97b7cd51944901a81ae7 Related: OS#3614 --- M msc/MSC_Tests.ttcn M msc/expected-results.xml 2 files changed, 29 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/51/13351/3 -- To view, visit https://gerrit.osmocom.org/13351 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I76049e6717680c54c18f97b7cd51944901a81ae7 Gerrit-Change-Number: 13351 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 14:58:42 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 2 Apr 2019 14:58:42 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: add testcase TC_sgsap_impl_imsi_det_eps 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/13352 to look at the new patch set (#3). Change subject: MSC_Tests: add testcase TC_sgsap_impl_imsi_det_eps ...................................................................... MSC_Tests: add testcase TC_sgsap_impl_imsi_det_eps We have a testcase that sends an explicit (UE-Initiated) imsi detach from EPS services. Lets also cover the case for an implicit (Network-initated) detach. Change-Id: I63ebc32ae457dd74214d4abee4f511cde28de4a7 Related: OS#3614 --- M msc/MSC_Tests.ttcn M msc/expected-results.xml 2 files changed, 26 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/52/13352/3 -- To view, visit https://gerrit.osmocom.org/13352 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I63ebc32ae457dd74214d4abee4f511cde28de4a7 Gerrit-Change-Number: 13352 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 14:58:44 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 2 Apr 2019 14:58:44 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: add function to check if a subscriber is in VLR Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13491 Change subject: MSC_Tests: add function to check if a subscriber is in VLR ...................................................................... MSC_Tests: add function to check if a subscriber is in VLR The control interface of osmo-msc is able to return a list with all active subscribers from the VLR. Lets add a function, so that we can check from TTCN3 if a specified subscriber is known by the VLR or not. Change-Id: I7661ae55afe34795c3701d59795331b32d64c988 Related: OS#3614 --- M msc/MSC_Tests.ttcn 1 file changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/91/13491/1 diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 6b2b259..a15fa57 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -63,6 +63,8 @@ import from USSD_Helpers all; import from DNS_Helpers all; +import from TCCConversion_Functions all; + const integer NUM_BSC := 2; type record of BSSAP_Configuration BSSAP_Configurations; @@ -3540,6 +3542,21 @@ * too long / short TLV values */ +/* Check if a subscriber exists in the VLR */ +private function f_ctrl_subscr_in_vlr(charstring imsi_or_msisdn) runs on BSC_ConnHdlr return boolean { + + var CtrlValue active_subsribers; + var integer rc; + active_subsribers := f_ctrl_get(IPA_CTRL, "subscriber-list-active-v1"); + + rc := f_strstr(active_subsribers, imsi_or_msisdn); + if (rc < 0) { + return false; + } + + return true; +} + /* Perform a location updatye at the A-Interface and run some checks to confirm * that everything is back to normal. */ private function f_sgsap_bssmap_screening() runs on BSC_ConnHdlr { -- To view, visit https://gerrit.osmocom.org/13491 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7661ae55afe34795c3701d59795331b32d64c988 Gerrit-Change-Number: 13491 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 14:58:44 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 2 Apr 2019 14:58:44 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: fix TC_sgsap_expl_imsi_det_noneps Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13492 Change subject: MSC_Tests: fix TC_sgsap_expl_imsi_det_noneps ...................................................................... MSC_Tests: fix TC_sgsap_expl_imsi_det_noneps When a subscriber is detached from non eps services, it gets fully detached from 2G, which means that the VLR is supposed to remove the subscriber. Lets check if the subscriber is in deed no longer known by the VLR. Change-Id: I2ec3f548dfcf5a9b99f10214a8bfd0c6978e253b Related: OS#3614 --- M msc/MSC_Tests.ttcn 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/92/13492/1 diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 3b9ea40..c7c61eb 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -3862,8 +3862,10 @@ var octetstring mme_name := f_enc_dns_hostname(mp_mme_name); SGsAP.send(ts_SGsAP_IMSI_DETACH_IND(g_pars.imsi, mme_name, combined_UE_initiated)); SGsAP.receive(tr_SGsAP_IMSI_DETACH_ACK(g_pars.imsi)); - f_ctrl_get_exp(IPA_CTRL, "fsm.SGs-UE.id.imsi:" & hex2str(g_pars.imsi) & ".state", "SGs-NULL"); - /* FIXME: How to verify that VLR has removed MM context? */ + + if (f_ctrl_subscr_in_vlr(hex2str(g_pars.imsi))) { + setverdict(fail, "subscriber not removed from VLR"); + } f_sgsap_bssmap_screening(); -- To view, visit https://gerrit.osmocom.org/13492 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2ec3f548dfcf5a9b99f10214a8bfd0c6978e253b Gerrit-Change-Number: 13492 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 15:01:11 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 2 Apr 2019 15:01:11 +0000 Subject: Change in osmo-msc[master]: vlr_sgs: fix SGs IMSI detech from non EPS services Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13493 Change subject: vlr_sgs: fix SGs IMSI detech from non EPS services ...................................................................... vlr_sgs: fix SGs IMSI detech from non EPS services When the subscriber is detached from non EPS services while the SGs-association is not SGs-NULL, it needs to be removed from the VLR database. Change-Id: I575cf6036ad39468f590b2d57a06cd3512a4c31c Related: OS#3614 --- M src/libvlr/vlr_sgs.c 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/93/13493/1 diff --git a/src/libvlr/vlr_sgs.c b/src/libvlr/vlr_sgs.c index 8614892..538c9f2 100644 --- a/src/libvlr/vlr_sgs.c +++ b/src/libvlr/vlr_sgs.c @@ -131,10 +131,17 @@ { struct vlr_subscr *vsub; enum sgs_ue_fsm_event evt; + vsub = vlr_subscr_find_by_imsi(vlr, imsi); if (!vsub) return; + /* See also: 3GPP TS 29.118, 5.6.3 Procedures in the VLR: In case of + * an implicit detach, we are supposed to check if the state of the + * SGs-association, and only when it is not SGs-NULL, we may proceed. */ + if (vsub->sgs_fsm->state == SGS_UE_ST_NULL && type == SGSAP_ID_NONEPS_T_IMPLICIT_UE_EPS_NONEPS) + return; + switch (type) { case SGSAP_ID_NONEPS_T_EXPLICIT_UE_NONEPS: evt = SGS_UE_E_RX_DETACH_IND_FROM_UE; @@ -153,6 +160,11 @@ osmo_fsm_inst_dispatch(vsub->sgs_fsm, evt, NULL); vlr_subscr_put(vsub); + + /* Detaching from non EPS services essentially means that the + * subscriber is detached from 2G. In any case the VLR will + * get rid of the subscriber. */ + vlr_subscr_expire(vsub); } /*! Perform an SGs EPS detach. -- To view, visit https://gerrit.osmocom.org/13493 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I575cf6036ad39468f590b2d57a06cd3512a4c31c Gerrit-Change-Number: 13493 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 15:01:11 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 2 Apr 2019 15:01:11 +0000 Subject: Change in osmo-msc[master]: vlr_sgs: start lu expiration timer on sgs eps detach Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13494 Change subject: vlr_sgs: start lu expiration timer on sgs eps detach ...................................................................... vlr_sgs: start lu expiration timer on sgs eps detach When the subscriber is detached from SGs services (but not from 2g services). Then the subscriber essentially becomes a regular 2g subscriber, which means thet the lu expiration timer needs to be started. Change-Id: If95c63706dc1c5a537f7cd1b6481252427cbf234 Related: OS#3614 --- M src/libvlr/vlr_sgs.c 1 file changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/94/13494/1 diff --git a/src/libvlr/vlr_sgs.c b/src/libvlr/vlr_sgs.c index 538c9f2..06737db 100644 --- a/src/libvlr/vlr_sgs.c +++ b/src/libvlr/vlr_sgs.c @@ -101,6 +101,11 @@ vsub->cgi.lai = *new_lai; vsub->cs.lac = vsub->sgs.lai.lac; + /* Subscribers that are created by the SGs location update will not + * expire automatically, however a 2G LU or an implicit IMSI detach + * from EPS services may change this. */ + vsub->expire_lu = VLR_SUBSCRIBER_NO_EXPIRATION; + return 0; } @@ -197,6 +202,15 @@ } osmo_fsm_inst_dispatch(vsub->sgs_fsm, evt, NULL); + + /* See also 3GPP TS 29.118, 5.4.3 Procedures in the VLR. Detaching from + * EPS services essentially means that the subscriber leaves the 4G RAN + * but continues to live on 2G, this basically turns the subscriber into + * a normal 2G subscriber and we need to make sure that the lu- + * expiration timer is running. */ + if (vsub->expire_lu == VLR_SUBSCRIBER_NO_EXPIRATION) + vlr_subscr_enable_expire_lu(vsub); + vlr_subscr_put(vsub); } -- To view, visit https://gerrit.osmocom.org/13494 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If95c63706dc1c5a537f7cd1b6481252427cbf234 Gerrit-Change-Number: 13494 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 15:08:22 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 15:08:22 +0000 Subject: Change in osmo-ci[master]: Change jessie-backports URL to debian archive In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13485 ) Change subject: Change jessie-backports URL to debian archive ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13485 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iba033e64876b7ed9d329c2a636a0ee5eb3af946e Gerrit-Change-Number: 13485 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 02 Apr 2019 15:08:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 15:08:32 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 15:08:32 +0000 Subject: Change in osmo-ci[master]: docker/rebuild_osmocom_jenkins_image.sh: pull images In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13486 ) Change subject: docker/rebuild_osmocom_jenkins_image.sh: pull images ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13486 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id840094aec51bf51d920aaa017a2f99fcb866f55 Gerrit-Change-Number: 13486 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 02 Apr 2019 15:08:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 15:08:39 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 15:08:39 +0000 Subject: Change in osmo-ci[master]: docker/rebuild_osmocom_jenkins_image.sh: set -e In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13487 ) Change subject: docker/rebuild_osmocom_jenkins_image.sh: set -e ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13487 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6faaf9303b4facb0965131615bc73541dd309c51 Gerrit-Change-Number: 13487 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 02 Apr 2019 15:08:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 15:09:22 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 15:09:22 +0000 Subject: Change in osmo-msc[master]: vlr_sgs: fix SGs IMSI detech from non EPS services In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13493 ) Change subject: vlr_sgs: fix SGs IMSI detech from non EPS services ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13493 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I575cf6036ad39468f590b2d57a06cd3512a4c31c Gerrit-Change-Number: 13493 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 02 Apr 2019 15:09:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 15:09:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 15:09:45 +0000 Subject: Change in osmo-msc[master]: vlr_sgs: start lu expiration timer on sgs eps detach In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13494 ) Change subject: vlr_sgs: start lu expiration timer on sgs eps detach ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13494 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If95c63706dc1c5a537f7cd1b6481252427cbf234 Gerrit-Change-Number: 13494 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 02 Apr 2019 15:09:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 15:10:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 15:10:08 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: add function to check if a subscriber is in VLR In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13491 ) Change subject: MSC_Tests: add function to check if a subscriber is in VLR ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13491 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7661ae55afe34795c3701d59795331b32d64c988 Gerrit-Change-Number: 13491 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 02 Apr 2019 15:10:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 15:10:26 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 15:10:26 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: add testcase TC_sgsap_impl_imsi_det_noneps In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13351 ) Change subject: MSC_Tests: add testcase TC_sgsap_impl_imsi_det_noneps ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13351 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I76049e6717680c54c18f97b7cd51944901a81ae7 Gerrit-Change-Number: 13351 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 02 Apr 2019 15:10:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 15:10:41 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 15:10:41 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: add testcase TC_sgsap_impl_imsi_det_eps In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13352 ) Change subject: MSC_Tests: add testcase TC_sgsap_impl_imsi_det_eps ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13352 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I63ebc32ae457dd74214d4abee4f511cde28de4a7 Gerrit-Change-Number: 13352 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 02 Apr 2019 15:10:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 15:10:55 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 15:10:55 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: fix TC_sgsap_expl_imsi_det_noneps In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13492 ) Change subject: MSC_Tests: fix TC_sgsap_expl_imsi_det_noneps ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13492 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2ec3f548dfcf5a9b99f10214a8bfd0c6978e253b Gerrit-Change-Number: 13492 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 02 Apr 2019 15:10:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 15:12:24 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Apr 2019 15:12:24 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: properly get / set TP-UD length (octets vs septets) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13490 ) Change subject: libmsc/db.c: properly get / set TP-UD length (octets vs septets) ...................................................................... Patch Set 1: Code-Review+1 this sounds like something that can and should be tested in MSC_Tests.ttcn -- To view, visit https://gerrit.osmocom.org/13490 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I84f973bc6561a9822b4b26975a781abd2b6e026a Gerrit-Change-Number: 13490 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 02 Apr 2019 15:12:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 15:28:22 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 2 Apr 2019 15:28:22 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: properly get / set TP-UD length (octets vs septets) In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13490 ) Change subject: libmsc/db.c: properly get / set TP-UD length (octets vs septets) ...................................................................... Patch Set 1: > this sounds like something that can and should be tested in MSC_Tests.ttcn Yep, definitely. Marking as WIP for now... -- To view, visit https://gerrit.osmocom.org/13490 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I84f973bc6561a9822b4b26975a781abd2b6e026a Gerrit-Change-Number: 13490 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 02 Apr 2019 15:28:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 2 19:11:12 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 2 Apr 2019 19:11:12 +0000 Subject: Change in osmo-ci[master]: ansible: osmo-gsm-tester: Make modem net ifaces persistent Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13495 Change subject: ansible: osmo-gsm-tester: Make modem net ifaces persistent ...................................................................... ansible: osmo-gsm-tester: Make modem net ifaces persistent Currently ofono doesn't catch network interface renaming (takes the name at ofono startup time). If a modem crashes, its net iface is unregistered and registered again, and it can happen that the new name is not the same as before (for instance, wwan8->wwan0 if wwan0 is located on another netns). These udev rules allow creating persistent unique names to prevent modem crashes resulting on interface name changing. dhcpcd is known to race against udev when managing dev interfaces, bringing them up before udev sometimes, and then udev is unable to rename it. By denying dhcpcd from managing modem ifaces (ww* and r* according to kernel/our rules), we get rid of this issue. Related: OS#3881 Change-Id: Ic3ef75285aa84f9aa606562cd2f6166de186c1a6 --- A ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules M ansible/roles/gsm-tester/tasks/main.yml 2 files changed, 22 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/95/13495/1 diff --git a/ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules b/ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules new file mode 100644 index 0000000..a9826e2 --- /dev/null +++ b/ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules @@ -0,0 +1,10 @@ +SUBSYSTEM!="net", GOTO="net_setup_link_end" +ACTION!="add", GOTO="net_setup_link_end" + +IMPORT{builtin}="net_id" + +# If dev paths are too long (too many usb hubs in the path) (>IFNAMSIZ), ID_NET_NAME_PATH is not populated. +ENV{DEVTYPE}=="wwan", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}" +ENV{DEVTYPE}=="wwan", ENV{ID_NET_NAME_PATH}=="", PROGRAM="/bin/sh -ec 'echo ${DEVPATH} | sha1sum | head -c14'", NAME="r$result" + +LABEL="net_setup_link_end" diff --git a/ansible/roles/gsm-tester/tasks/main.yml b/ansible/roles/gsm-tester/tasks/main.yml index 8a854bd..c9b7429 100644 --- a/ansible/roles/gsm-tester/tasks/main.yml +++ b/ansible/roles/gsm-tester/tasks/main.yml @@ -274,3 +274,15 @@ src: 64-limesuite.rules dest: /etc/udev/rules.d/ notify: restart udev + +- name: use persistent naming for modem network interfaces + copy: + src: 70-net-setup-link-modems.rules + dest: /etc/udev/rules.d/ + notify: restart udev + +- name: avoid dhcpcd managing modem interfaces and racing with udev rename + lineinfile: + path: /etc/dhcpcd.conf + regexp: '^denyinterfaces' + line: 'denyinterfaces ww* r*' -- To view, visit https://gerrit.osmocom.org/13495 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic3ef75285aa84f9aa606562cd2f6166de186c1a6 Gerrit-Change-Number: 13495 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 00:13:22 2019 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Wed, 3 Apr 2019 00:13:22 +0000 Subject: Change in libosmocore[master]: Add code coverage support Message-ID: Vasil Velichkov has uploaded this change for review. ( https://gerrit.osmocom.org/13496 Change subject: Add code coverage support ...................................................................... Add code coverage support Configure with --enable-code-coverage then execute make check-code-coverage and then open the resulting HTML report in your browser Closes: OS#1987 Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c --- M Makefile.am M configure.ac M src/Makefile.am M src/codec/Makefile.am M src/coding/Makefile.am M src/ctrl/Makefile.am M src/gb/Makefile.am M src/gsm/Makefile.am M src/pseudotalloc/Makefile.am M src/sim/Makefile.am M src/vty/Makefile.am 11 files changed, 43 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/96/13496/1 diff --git a/Makefile.am b/Makefile.am index 332ce65..5f8c46f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,6 +8,9 @@ libosmogb.pc libosmoctrl.pc libosmocoding.pc libosmosim.pc @RELMAKE@ + at CODE_COVERAGE_RULES@ +# Exclude some system headers from the code coverage report +CODE_COVERAGE_IGNORE_PATTERN="/usr/include/*" "/usr/lib*" relengdir = $(includedir) releng_DATA = osmo-release.mk diff --git a/configure.ac b/configure.ac index 4a00e69..e88de21 100644 --- a/configure.ac +++ b/configure.ac @@ -334,6 +334,8 @@ AM_CONDITIONAL(HAVE_SSE4_1, false) fi +AX_CODE_COVERAGE + dnl Check if the compiler supports specified GCC's built-in function AC_DEFUN([CHECK_BUILTIN_SUPPORT], [ AC_CACHE_CHECK( diff --git a/src/Makefile.am b/src/Makefile.am index 27ab702..4d28f8d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,8 +3,8 @@ # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html LIBVERSION=12:1:0 -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -AM_CFLAGS = -Wall $(TALLOC_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(CODE_COVERAGE_CPPFLAGS) +AM_CFLAGS = -Wall $(TALLOC_CFLAGS) $(CODE_COVERAGE_CFLAGS) if ENABLE_PSEUDOTALLOC AM_CPPFLAGS += -I$(top_srcdir)/src/pseudotalloc @@ -12,7 +12,7 @@ lib_LTLIBRARIES = libosmocore.la -libosmocore_la_LIBADD = $(BACKTRACE_LIB) $(TALLOC_LIBS) $(LIBRARY_RT) +libosmocore_la_LIBADD = $(BACKTRACE_LIB) $(TALLOC_LIBS) $(LIBRARY_RT) $(CODE_COVERAGE_LIBS) libosmocore_la_SOURCES = timer.c timer_gettimeofday.c timer_clockgettime.c \ select.c signal.c msgb.c bits.c \ bitvec.c bitcomp.c counter.c fsm.c \ diff --git a/src/codec/Makefile.am b/src/codec/Makefile.am index b522d43..f11ff04 100644 --- a/src/codec/Makefile.am +++ b/src/codec/Makefile.am @@ -3,8 +3,8 @@ # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html LIBVERSION=1:1:1 -AM_CPPFLAGS = -I$(top_srcdir)/include $(TALLOC_CFLAGS) -AM_CFLAGS = -Wall +AM_CPPFLAGS = -I$(top_srcdir)/include $(TALLOC_CFLAGS) $(CODE_COVERAGE_CPPFLAGS) +AM_CFLAGS = -Wall $(CODE_COVERAGE_CFLAGS) if ENABLE_PSEUDOTALLOC AM_CPPFLAGS += -I$(top_srcdir)/src/pseudotalloc @@ -15,4 +15,4 @@ libosmocodec_la_SOURCES = gsm610.c gsm620.c gsm660.c gsm690.c ecu_fr.c libosmocodec_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined -libosmocodec_la_LIBADD = $(top_builddir)/src/libosmocore.la +libosmocodec_la_LIBADD = $(top_builddir)/src/libosmocore.la $(CODE_COVERAGE_LIBS) diff --git a/src/coding/Makefile.am b/src/coding/Makefile.am index c001c13..f179159 100644 --- a/src/coding/Makefile.am +++ b/src/coding/Makefile.am @@ -6,8 +6,9 @@ AM_CPPFLAGS = \ -I"$(top_srcdir)/include" \ -I"$(top_builddir)/include" \ - $(TALLOC_CFLAGS) -AM_CFLAGS = -Wall + $(TALLOC_CFLAGS) \ + $(CODE_COVERAGE_CPPFLAGS) +AM_CFLAGS = -Wall $(CODE_COVERAGE_CFLAGS) if ENABLE_PSEUDOTALLOC AM_CPPFLAGS += -I$(top_srcdir)/src/pseudotalloc @@ -30,6 +31,7 @@ libosmocoding_la_LIBADD = \ ../libosmocore.la \ ../gsm/libosmogsm.la \ - ../codec/libosmocodec.la + ../codec/libosmocodec.la \ + $(CODE_COVERAGE_LIBS) EXTRA_DIST = libosmocoding.map diff --git a/src/ctrl/Makefile.am b/src/ctrl/Makefile.am index fe7c47d..537ea7c 100644 --- a/src/ctrl/Makefile.am +++ b/src/ctrl/Makefile.am @@ -3,7 +3,9 @@ # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html LIBVERSION=3:0:3 -AM_CFLAGS = -Wall $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) +AM_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) +AM_CFLAGS = -Wall $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) \ + $(CODE_COVERAGE_CFLAGS) if ENABLE_CTRL lib_LTLIBRARIES = libosmoctrl.la @@ -14,7 +16,8 @@ libosmoctrl_la_LIBADD = $(TALLOC_LIBS) \ $(top_builddir)/src/libosmocore.la \ $(top_builddir)/src/gsm/libosmogsm.la \ - $(top_builddir)/src/vty/libosmovty.la + $(top_builddir)/src/vty/libosmovty.la \ + $(CODE_COVERAGE_LIBS) if ENABLE_VTY libosmoctrl_la_SOURCES += control_vty.c diff --git a/src/gb/Makefile.am b/src/gb/Makefile.am index 3180f9c..530c8e1 100644 --- a/src/gb/Makefile.am +++ b/src/gb/Makefile.am @@ -2,8 +2,10 @@ # Please read Chapter 6 "Library interface versions" of the libtool documentation before making any modification LIBVERSION=8:0:2 -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -AM_CFLAGS = -Wall ${GCC_FVISIBILITY_HIDDEN} -fno-strict-aliasing $(TALLOC_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include \ + $(CODE_COVERAGE_CPPFLAGS) +AM_CFLAGS = -Wall ${GCC_FVISIBILITY_HIDDEN} -fno-strict-aliasing $(TALLOC_CFLAGS) \ + $(CODE_COVERAGE_CFLAGS) # FIXME: this should eventually go into a milenage/Makefile.am noinst_HEADERS = common_vty.h gb_internal.h @@ -15,7 +17,8 @@ libosmogb_la_LIBADD = $(TALLOC_LIBS) \ $(top_builddir)/src/libosmocore.la \ $(top_builddir)/src/vty/libosmovty.la \ - $(top_builddir)/src/gsm/libosmogsm.la + $(top_builddir)/src/gsm/libosmogsm.la \ + $(CODE_COVERAGE_LIBS) libosmogb_la_SOURCES = gprs_ns.c gprs_ns_frgre.c gprs_ns_vty.c gprs_ns_sns.c \ gprs_bssgp.c gprs_bssgp_util.c gprs_bssgp_vty.c \ diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 9066500..010e5d9 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -3,8 +3,9 @@ # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html LIBVERSION=11:0:0 -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) -AM_CFLAGS = -Wall ${GCC_FVISIBILITY_HIDDEN} +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) \ + $(CODE_COVERAGE_CPPFLAGS) +AM_CFLAGS = -Wall ${GCC_FVISIBILITY_HIDDEN} $(CODE_COVERAGE_CFLAGS) if ENABLE_PSEUDOTALLOC AM_CPPFLAGS += -I$(top_srcdir)/src/pseudotalloc diff --git a/src/pseudotalloc/Makefile.am b/src/pseudotalloc/Makefile.am index 3c78bba..f7a1ffc 100644 --- a/src/pseudotalloc/Makefile.am +++ b/src/pseudotalloc/Makefile.am @@ -1,4 +1,6 @@ -AM_CFLAGS = -Wall -I. $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include +AM_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) +AM_CFLAGS = -Wall -I. $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include \ + $(CODE_COVERAGE_CFLAGS) if ENABLE_PSEUDOTALLOC @@ -6,6 +8,7 @@ libpseudotalloc_la_SOURCES = pseudotalloc.c libpseudotalloc_la_LDFLAGS = -no-undefined +libpseudotalloc_la_LIBADD = $(CODE_COVERAGE_LIBS) nobase_include_HEADERS = talloc.h diff --git a/src/sim/Makefile.am b/src/sim/Makefile.am index ebf4739..cca5e23 100644 --- a/src/sim/Makefile.am +++ b/src/sim/Makefile.am @@ -3,9 +3,9 @@ # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html LIBVERSION=0:2:0 -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include -AM_CFLAGS = -fPIC -Wall $(PCSC_CFLAGS) $(TALLOC_CFLAGS) -AM_LDFLAGS = $(COVERAGE_LDFLAGS) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include \ + $(CODE_COVERAGE_CPPFLAGS) +AM_CFLAGS = -fPIC -Wall $(PCSC_CFLAGS) $(TALLOC_CFLAGS) $(CODE_COVERAGE_CFLAGS) if ENABLE_PCSC # FIXME: only build the PC/SC dependent part conditional, but always build other parts @@ -22,6 +22,7 @@ $(top_builddir)/src/libosmocore.la \ $(top_builddir)/src/gsm/libosmogsm.la \ $(TALLOC_LIBS) \ - $(PCSC_LIBS) + $(PCSC_LIBS) \ + $(CODE_COVERAGE_LIBS) endif diff --git a/src/vty/Makefile.am b/src/vty/Makefile.am index cdde0fa..4e2e5a5 100644 --- a/src/vty/Makefile.am +++ b/src/vty/Makefile.am @@ -3,8 +3,9 @@ # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html LIBVERSION=6:0:2 -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -AM_CFLAGS = -Wall $(TALLOC_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include \ + $(CODE_COVERAGE_CPPFLAGS) +AM_CFLAGS = -Wall $(TALLOC_CFLAGS) $(CODE_COVERAGE_CFLAGS) if ENABLE_VTY lib_LTLIBRARIES = libosmovty.la @@ -14,5 +15,5 @@ fsm_vty.c talloc_ctx_vty.c \ tdef_vty.c libosmovty_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined -libosmovty_la_LIBADD = $(top_builddir)/src/libosmocore.la $(TALLOC_LIBS) +libosmovty_la_LIBADD = $(top_builddir)/src/libosmocore.la $(TALLOC_LIBS) $(CODE_COVERAGE_LIBS) endif -- To view, visit https://gerrit.osmocom.org/13496 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c Gerrit-Change-Number: 13496 Gerrit-PatchSet: 1 Gerrit-Owner: Vasil Velichkov -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:04:48 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Wed, 3 Apr 2019 07:04:48 +0000 Subject: Change in osmo-ci[master]: Change jessie-backports URL to debian archive In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13485 ) Change subject: Change jessie-backports URL to debian archive ...................................................................... Change jessie-backports URL to debian archive Fix docker/Dockerfile_osmocom_jenkins.amd64 by fetching jessie-backports from debian archive. The jessie image is still being used by various jenkins jobs generated by master-builds.yml and gerrit-verifications.yml. We want to keep using it for some more time, to make sure that build testing ("make check") passes on debian8/jessie, as some users may very well be using old distros. See also: * https://lists.debian.org/debian-devel-announce/2019/03/msg00006.html * https://unix.stackexchange.com/q/508724 Related: OS#3894 Change-Id: Iba033e64876b7ed9d329c2a636a0ee5eb3af946e --- M docker/Dockerfile_osmocom_jenkins.amd64 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: osmith: Verified Harald Welte: Looks good to me, approved diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64 index c365380..f87d80d 100644 --- a/docker/Dockerfile_osmocom_jenkins.amd64 +++ b/docker/Dockerfile_osmocom_jenkins.amd64 @@ -2,9 +2,9 @@ FROM debian:${DEBIAN_VERSION} RUN \ - echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list && \ + echo "deb http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list && \ dpkg --add-architecture i386 && \ - DEBIAN_FRONTEND=noninteractive apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Check-Valid-Until=false update && \ DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends wget make -- To view, visit https://gerrit.osmocom.org/13485 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iba033e64876b7ed9d329c2a636a0ee5eb3af946e Gerrit-Change-Number: 13485 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:04:48 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Wed, 3 Apr 2019 07:04:48 +0000 Subject: Change in osmo-ci[master]: docker/rebuild_osmocom_jenkins_image.sh: pull images In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13486 ) Change subject: docker/rebuild_osmocom_jenkins_image.sh: pull images ...................................................................... docker/rebuild_osmocom_jenkins_image.sh: pull images Prevent building docker images on top of outdated Debian images, where the package download feeds have been disabled. Related: Change-Id I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6 (docker-playground.git) Related: OS#3869 Change-Id: Id840094aec51bf51d920aaa017a2f99fcb866f55 --- M docker/rebuild_osmocom_jenkins_image.sh 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: osmith: Verified Harald Welte: Looks good to me, approved diff --git a/docker/rebuild_osmocom_jenkins_image.sh b/docker/rebuild_osmocom_jenkins_image.sh index 3dcca39..6cf2f15 100755 --- a/docker/rebuild_osmocom_jenkins_image.sh +++ b/docker/rebuild_osmocom_jenkins_image.sh @@ -15,6 +15,9 @@ local tag_name=${1} local debian_version=${2} + echo "Pulling ${debian_version} image" + docker pull "debian:${debian_version}" + echo "Building for ${debian_version} and setting tag ${tag_name}" build_once "-t" "${tag_name}" "--build-arg" DEBIAN_VERSION="${debian_version}" } -- To view, visit https://gerrit.osmocom.org/13486 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id840094aec51bf51d920aaa017a2f99fcb866f55 Gerrit-Change-Number: 13486 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:04:49 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Wed, 3 Apr 2019 07:04:49 +0000 Subject: Change in osmo-ci[master]: docker/rebuild_osmocom_jenkins_image.sh: set -e In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13487 ) Change subject: docker/rebuild_osmocom_jenkins_image.sh: set -e ...................................................................... docker/rebuild_osmocom_jenkins_image.sh: set -e Exit with error if one of the docker commands is failing (i.e. don't exit with 0 when building the jessie image failed, but the stretch image got built properly). Change-Id: I6faaf9303b4facb0965131615bc73541dd309c51 --- M docker/rebuild_osmocom_jenkins_image.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: osmith: Verified Harald Welte: Looks good to me, approved diff --git a/docker/rebuild_osmocom_jenkins_image.sh b/docker/rebuild_osmocom_jenkins_image.sh index 6cf2f15..c4e3b10 100755 --- a/docker/rebuild_osmocom_jenkins_image.sh +++ b/docker/rebuild_osmocom_jenkins_image.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e # Executes docker build with the given parameters and retry in case of error. function build_once() { -- To view, visit https://gerrit.osmocom.org/13487 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6faaf9303b4facb0965131615bc73541dd309c51 Gerrit-Change-Number: 13487 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:45:41 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 07:45:41 +0000 Subject: Change in osmo-remsim[master]: Add libosmo-rspro.pc.in for pkg-config integration Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13497 Change subject: Add libosmo-rspro.pc.in for pkg-config integration ...................................................................... Add libosmo-rspro.pc.in for pkg-config integration Change-Id: Ic8bbf27bdb5ce7c810ede307a35ad4dc10338912 --- M Makefile.am M configure.ac A libosmo-rspro.pc.in 3 files changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/97/13497/1 diff --git a/Makefile.am b/Makefile.am index ec76bff..4843641 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,9 @@ SUBDIRS = src include doc +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libosmo-rspro.pc + EXTRA_DIST = asn1 .version README.md pkgcofigdir = $(libdir)/pkgconfig diff --git a/configure.ac b/configure.ac index 7281196..1d2ccc2 100644 --- a/configure.ac +++ b/configure.ac @@ -129,6 +129,7 @@ AC_OUTPUT( Makefile + libosmo-rspro.pc doc/Makefile doc/manuals/Makefile src/Makefile diff --git a/libosmo-rspro.pc.in b/libosmo-rspro.pc.in new file mode 100644 index 0000000..e810d42 --- /dev/null +++ b/libosmo-rspro.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Osmocom RSPRO library +Description: Osmocom Remote SIM Protocol library +Version: @VERSION@ +Libs: -L${libdir} -losmo-rspro +Cflags: -I${includedir}/ -- To view, visit https://gerrit.osmocom.org/13497 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic8bbf27bdb5ce7c810ede307a35ad4dc10338912 Gerrit-Change-Number: 13497 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:45:41 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 07:45:41 +0000 Subject: Change in osmo-remsim[master]: rename executables to include osmo- name prefix Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13498 Change subject: rename executables to include osmo- name prefix ...................................................................... rename executables to include osmo- name prefix Change-Id: I4498a004519499cc4b897a68c7f33efe29a63425 --- M doc/manuals/chapters/remsim-bankd.adoc M doc/manuals/chapters/remsim-client.adoc M doc/manuals/chapters/remsim-server.adoc M src/Makefile.am M src/server/Makefile.am 5 files changed, 86 insertions(+), 82 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/98/13498/1 diff --git a/doc/manuals/chapters/remsim-bankd.adoc b/doc/manuals/chapters/remsim-bankd.adoc index 7e83621..317abf4 100644 --- a/doc/manuals/chapters/remsim-bankd.adoc +++ b/doc/manuals/chapters/remsim-bankd.adoc @@ -1,18 +1,18 @@ -== remsim-bankd +== osmo-remsim-bankd -The `remsim-bankd` (SIM Bank Daemon) manages one given SIM bank. The -initial implementation supports a PC/SC driver to expose any PC/SC +The `osmo-remsim-bankd` (SIM Bank Daemon) manages one given SIM bank. +The initial implementation supports a PC/SC driver to expose any PC/SC compatible card readers as SIM bank. -`remsim-bankd` initially connects via a RSPRO control connection to -`remsim-server` at startup, and will in turn receive a set of initial -[client,slot]:[bankd,slot] mappings. These mappings determine which -slot on the client (corresponding to a modem) is mapped to which slot on -the SIM bank. Mappings can be updated by `remsim-server` at any given -point in time. +`osmo-remsim-bankd` initially connects via a RSPRO control connection to +`osmo-remsim-server` at startup, and will in turn receive a set of +initial [client,slot]:[bankd,slot] mappings. These mappings determine +which slot on the client (corresponding to a modem) is mapped to which +slot on the SIM bank. Mappings can be updated by `osmo-remsim-server` +at any given point in time. -`remsim-bankd` implements a RSPRO server, where it listens to connections -from `remsim-clients`. +`osmo-remsim-bankd` implements a RSPRO server, where it listens to +connections from `osmo-remsim-clients`. As PC/SC only offers a blocking API, there is one thread per PC/SC slot. This thread will perform blocking I/O on the socket towards the client, @@ -32,10 +32,10 @@ client has identified itself. The advantage is that the entire bankd can live without any non-blocking I/O. -The main thread handles the connection to `remsim-server`, where it can -also use non-blocking I/O. However, re-connection would be required, to -avoid stalling all banks/cards in the event of a connection loss to the -server. +The main thread handles the connection to `osmo-remsim-server`, where it +can also use non-blocking I/O. However, re-connection would be +required, to avoid stalling all banks/cards in the event of a connection +loss to the server. worker threads have the following states: * INIT (just started) @@ -56,39 +56,40 @@ === Running -`remsim-bankd` currently has the following command-line options: +`osmo-remsim-bankd` currently has the following command-line options: ==== SYNOPSIS -*remsim-bankd* [-h] [-i A.B.C.D] [-p <1-65535>] [-b <1-65535>] [-n <1-65535>] [-I A.B.C.D] [-P <1-65535> ] +*osmo-remsim-bankd* [-h] [-i A.B.C.D] [-p <1-65535>] [-b <1-65535>] [-n <1-65535>] [-I A.B.C.D] [-P <1-65535> ] ==== OPTIONS *-h, --help*:: Print a short help message about the supported options *-i, --server-host A.B.C.D*:: - Specify the remote IP address/hostname of the remsim-server to which this bankd - shall establish its RSPRO control connection + Specify the remote IP address/hostname of the `osmo-remsim-server` to + which this bankd shall establish its RSPRO control connection *-p, --server-port <1-65535>*:: - Specify the remote TCP port number of the remsim-server to whihc this bankd - shall establish its RSPRO control connection + Specify the remote TCP port number of the `osmo-remsim-server` to which + this bankd shall establish its RSPRO control connection *-b, --bank-id <1-65535>*:: - Specify the numeric bank identifier of the SIM bank this bankd instance - operates. Must be unique among all banks connecting to the same remsim-server. + Specify the numeric bank identifier of the SIM bank this bankd + instance operates. Must be unique among all banks connecting to the + same `osmo-remsim-server`. *-n, --num-slots <1-65535>*:: Specify the number of slots that this bankd handles. *-I, --bind-IP A.B.C.D*:: Specify the local IP address to which the socket for incoming connections - from remsim-clients is bound to. + from `osmo-remsim-clients` is bound to. *-P, --bind-port <1-65535>*:: Specify the local TCP port to whicc the socket for incoming connections - from remsim-clients is bound to. + from `osmo-remsim-client`s is bound to. === Logging -remsim-bankd currently logs to stdout only, and the logging verbosity -is not yet configurable. However, as the libosmocore logging framework -is used, extending this is an easy modification. +`osmo-remsim-bankd` currently logs to stdout only, and the logging +verbosity is not yet configurable. However, as the libosmocore logging +framework is used, extending this is an easy modification. === `bankd_pcsc_slots.csv` CSV file diff --git a/doc/manuals/chapters/remsim-client.adoc b/doc/manuals/chapters/remsim-client.adoc index 2b67bf0..0526dbb 100644 --- a/doc/manuals/chapters/remsim-client.adoc +++ b/doc/manuals/chapters/remsim-client.adoc @@ -1,18 +1,19 @@ -== simtrace2-remsim-client +== osmo-remsim-client-st2 The client interfaces with GSM phones / modems via dedicated "Card Emulation" devices such as the Osmocom SIMtrace2 or sysmocom sysmoQMOD board + firmware. This hardware implements the ISO7816-3 electrical interface and protocol handling and passes any TPDU headers received -from the phone/modem to `remsim-client` for further processing of the -TPDUs associated to the given APDU transfer. +from the phone/modem to `osmo-remsim-client` for further processing of +the TPDUs associated to the given APDU transfer. -`remsim-client` connects via a RSPRO control connection to remsim-server -at startup and registers itself. It will receive configuration data -such as the `remsim-bankd` IP+Port and the ClientId from remsim-server. +`osmo-remsim-client` connects via a RSPRO control connection to +`osmo-remsim-server` at startup and registers itself. It will receive +configuration data such as the `osmo-remsim-bankd` IP+Port and the +ClientId from `osmo-remsim-server`. -After receiving the configuration, `remsim-client` will establish a RSPRO -data connection to the `remsim-bankd` IP:Port. +After receiving the configuration, `osmo-remsim-client` will establish a +RSPRO data connection to the `osmo-remsim-bankd` IP:Port. As the USB interface for remote SIM in simtrace2.git uses one interface per slot, we can implement the client in blocking mode, i.e. use @@ -21,35 +22,35 @@ === Running -simtrace2-remsim-client currently has the following command-line options: +osmo-remsim-client-st2 currently has the following command-line options: ==== SYNOPSIS -*simtrace2-remsim-client* [...] +*osmo-remsim-client-st2* [...] ==== OPTIONS *-h, --help*:: Print a short help message about the supported options *-s, --server-host A.B.C.D*:: - Specify the remote IP address / hostname of the remsim-server to which - this client shall establish its RSPRO control connection + Specify the remote IP address / hostname of the `osmo-remsim-server` to + which this client shall establish its RSPRO control connection *-p, --server-port <1-65535>*:: - Specify the remote TCP port number of the remsim-server to which this client - shall establish its RSPRO control connection + Specify the remote TCP port number of the `osmo-remsim-server` to which + this client shall establish its RSPRO control connection *-c, --client-id <1-65535>*:: Specify the numeric client identifier of the SIM bank this bankd - instance operates. The tuple of client-id and client-slot must be unique - among all clients connecting to the same remsim-server. + instance operates. The tuple of client-id and client-slot must be + unique among all clients connecting to the same `osmo-remsim-server`. *-n, --client-slot <0-65535>*:: Specify the slot number served within this client. The tuple of client-id and client-slot must be unique among all clients connecting - to the same remsim-server. + to the same `osmo-remsim-server`. *-i, --gsmtap-ip A.B.C.D*:: Specify the IP address (if any) to which APDU traces are sent in GSMTAP format (useful for debugging; supported by wireshark). *-k, --keep-running*:: - Specify if the remsim-client should terminate after handling one + Specify if the `osmo-remsim-client` should terminate after handling one session, or whether it should keep running. Fast respawn (i.e. no --keep-running) is probably the more robust option at this point. *-V, --usb-vendor*:: @@ -79,11 +80,11 @@ SIM emulation device attached to your system. *-a, --atr HEXSTRING*:: Specify the initial ATR to be communicated to the modem/phone. Can - and will later be overridden by the ATR as specified by remsim-bankd - once a card has been mapped to this client. + and will later be overridden by the ATR as specified by + `osmo-remsim-bankd` once a card has been mapped to this client. === Logging -remsim-client currently logs to stdout only, and the logging verbosity -is not yet configurable. However, as the libosmocore logging framework -is used, extending this is an easy modification. +`osmo-remsim-client` currently logs to stdout only, and the logging +verbosity is not yet configurable. However, as the libosmocore logging +framework is used, extending this is an easy modification. diff --git a/doc/manuals/chapters/remsim-server.adoc b/doc/manuals/chapters/remsim-server.adoc index fcb7283..e5ab58d 100644 --- a/doc/manuals/chapters/remsim-server.adoc +++ b/doc/manuals/chapters/remsim-server.adoc @@ -1,12 +1,12 @@ -== remsim-server +== osmo-remsim-server === Running -`remsim-server` currently has no command-line arguments. It will bind to -INADDR_ANY and offer the following TCP ports: +`osmo-remsim-server` currently has no command-line arguments. It will +bind to INADDR_ANY and offer the following TCP ports: -* Port 9998 for the inbound control connections from `remsim-client` - and `remsim-bankd` +* Port 9998 for the inbound control connections from `osmo-remsim-client` + and `osmo-remsim-bankd` * Port 9997 for the RESTful/JSON Web API (role: HTTP server) It is intended to make these settings (IP addresses, ports) configurable @@ -14,13 +14,13 @@ === Logging -`remsim-server` currently logs to stdout only, and the logging verbosity -is not yet configurable. However, as the libosmocore logging framework -is used, extending this is an easy modification. +`osmo-remsim-server` currently logs to stdout only, and the logging +verbosity is not yet configurable. However, as the libosmocore logging +framework is used, extending this is an easy modification. === RESTful/JSON Web API -`remsim-server` provides a RESTful/JSON WEB API for application logic +`osmo-remsim-server` provides a RESTful/JSON WEB API for application logic integration. The purpose of the API is to allow run-time configuration and monitoring of the entire osmo-remsim system. @@ -29,28 +29,28 @@ ==== /api/backend/v1/clients *GET* obtains a JSON list where each element represents one currently -connected `remsim-client`. +connected `osmo-remsim-client`. No other HTTP operation is implemented. ==== /api/backend/v1/clients/:client_id *GET* obtains a single JSON object representing one specific currently -connected `remsim-client`. +connected `osmo-remsim-client`. No other HTTP operation is implemented. ==== /api/backend/v1/bankds *GET* obtains a JSON list where each element represents one currently -connected `remsim-bankd`. +connected `osmo-remsim-bankd`. No other HTTP operation is implemented. ==== /api/backend/v1/bankds/:bank_id *GET* obtains a single JSON object representing one specific currently -connected `remsim-bankd`. +connected `osmo-remsim-bankd`. No other HTTP operation is implemented. @@ -74,5 +74,5 @@ ==== /api/backend/v1/global-reset -*POST* performs a global reset of the `remsim-server` state. This means -all mappings are removed. +*POST* performs a global reset of the `osmo-remsim-server` state. This +means all mappings are removed. diff --git a/src/Makefile.am b/src/Makefile.am index ab77375..d671f37 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,24 +20,25 @@ simtrace2/simtrace_prot.h \ simtrace2/simtrace_usb.h -bin_PROGRAMS = pcsc_test remsim-bankd remsim-client simtrace2-remsim-client +bin_PROGRAMS = osmo-remsim-bankd osmo-remsim-client-st2 +noinst_PROGRAMS = pcsc_test remsim-client pcsc_test_SOURCES = driver_core.c driver_pcsc.c main.c pcsc_test_LDADD = $(OSMOCORE_LIBS) \ $(PCSC_LIBS) libosmo-rspro.la -remsim_bankd_SOURCES = slotmap.c bankd_main.c bankd_pcsc.c rspro_client_fsm.c debug.c -remsim_bankd_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ - $(PCSC_LIBS) libosmo-rspro.la -lcsv +osmo_remsim_bankd_SOURCES = slotmap.c bankd_main.c bankd_pcsc.c rspro_client_fsm.c debug.c +osmo_remsim_bankd_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ + $(PCSC_LIBS) libosmo-rspro.la -lcsv remsim_client_SOURCES = remsim_client.c rspro_client_fsm.c bankd_client_fsm.c debug.c remsim_client_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ libosmo-rspro.la -simtrace2_remsim_client_SOURCES = simtrace2-remsim_client.c \ - bankd_client_fsm.c rspro_client_fsm.c debug.c \ - simtrace2/apdu_dispatch.c \ - simtrace2/simtrace2-discovery.c \ - simtrace2/libusb_util.c -simtrace2_remsim_client_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) $(USB_LIBS) $(OSMOSIM_LIBS)\ - libosmo-rspro.la +osmo_remsim_client_st2_SOURCES = simtrace2-remsim_client.c \ + bankd_client_fsm.c rspro_client_fsm.c debug.c \ + simtrace2/apdu_dispatch.c \ + simtrace2/simtrace2-discovery.c \ + simtrace2/libusb_util.c +osmo_remsim_client_st2_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ + $(USB_LIBS) $(OSMOSIM_LIBS) libosmo-rspro.la diff --git a/src/server/Makefile.am b/src/server/Makefile.am index 5926dee..ce114b6 100644 --- a/src/server/Makefile.am +++ b/src/server/Makefile.am @@ -6,12 +6,13 @@ noinst_HEADERS = rspro_server.h rest_api.h -bin_PROGRAMS = remsim-server +bin_PROGRAMS = osmo-remsim-server -remsim_server_SOURCES = remsim_server.c rspro_server.c rest_api.c ../rspro_util.c ../slotmap.c ../debug.c -remsim_server_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ - $(ULFIUS_LIBS) $(JANSSON_LIBS) \ - $(top_builddir)/src/libosmo-rspro.la +osmo_remsim_server_SOURCES = remsim_server.c rspro_server.c rest_api.c \ + ../rspro_util.c ../slotmap.c ../debug.c +osmo_remsim_server_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ + $(ULFIUS_LIBS) $(JANSSON_LIBS) \ + $(top_builddir)/src/libosmo-rspro.la # as suggested in http://lists.gnu.org/archive/html/automake/2009-03/msg00011.html FORCE: -- To view, visit https://gerrit.osmocom.org/13498 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4498a004519499cc4b897a68c7f33efe29a63425 Gerrit-Change-Number: 13498 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:45:41 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 07:45:41 +0000 Subject: Change in osmo-remsim[master]: Add Debian packaging information Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13499 Change subject: Add Debian packaging information ...................................................................... Add Debian packaging information Change-Id: Id5044b1835190edc948952d207a5196a18669eb1 --- A debian/changelog A debian/compat A debian/control A debian/copyright A debian/libosmo-rspro-dev.install A debian/libosmo-rspro0.install A debian/osmo-remsim-bankd.install A debian/osmo-remsim-client.install A debian/osmo-remsim-server.install A debian/rules 10 files changed, 134 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/99/13499/1 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..ca4d246 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +osmo-remsim (0.1.0) unstable; urgency=medium + + [ Harald Welte ] + * initial release. + + -- Harald Welte Wed, 03 Apr 2019 08:59:40 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..8301a42 --- /dev/null +++ b/debian/control @@ -0,0 +1,69 @@ +Source: osmo-remsim +Maintainer: Harald Welte +Section: net +Priority: optional +Build-Depends: debhelper (>= 9), + pkg-config, + dh-autoreconf, + dh-systemd (>= 1.5), + autotools-dev, + pkg-config, + libosmocore-dev, + libosmo-abis-dev, + libpcsclite-dev, + libusb-1.0-0-dev, + libulfius-dev, + libjansson-dev +Standards-Version: 3.9.8 +Vcs-Browser: http://git.osmocom.org/osmo-remsim/ +Vcs-Git: git://git.osmocom.org/osmo-remsim +Homepage: https://projects.osmocom.org/projects/osmo-remsim + +Package: libosmo-rspro0 +Section: libs +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Description: Osmocom Remote SIM - Shared Library + libosmo-rsrpo is an utility library for encoding/decoding the ASN.1 BER + based RSPRO (Remote SIM Protocol) protocol used between the osmo-remsim + programs. + +Package: libosmo-rspro-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends} +Description: Osmocom Remote SIM - Shared Library Development Haders + libosmo-rsrpo is an utility library for encoding/decoding the ASN.1 BER + based RSPRO (Remote SIM Protocol) protocol used between the osmo-remsim + programs. + +Package: osmo-remsim-server +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Osmocom Remote SIM - Central Server + The remsim-server is the central element of a osmo-remsim deployment, + it maintains a list of clients + bankds connected to it, as well as the + dynamic SIM card mappings between them. + +Package: osmo-remsim-bankd +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Osmocom Remote SIM - Bank Daemon + The remsim-bankd is managing a bank of SIM card readers and their + respective cards. It establishes a control connection to remsim-server + and receives inbound connections from remsim-clients. + +Package: osmo-remsim-client +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Osmocom Remote SIM - Client + The remsim-client is managing a given phone/modem. It attaches to the + 'cardem' firmware of a SIMtrcace2 (or compatible, such as sysmoQMOD) + hardware and forwards the SIM card communication to a remsim-bankd, + under the control of remsim-server. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..8af2d2e --- /dev/null +++ b/debian/copyright @@ -0,0 +1,25 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: osmo-remsim +Source: http://cgit.osmocom.org/osmo-remsim/ + +Files: * +Copyright: 2018-2019 Harald Welte +License: GPL-2+ + + +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". diff --git a/debian/libosmo-rspro-dev.install b/debian/libosmo-rspro-dev.install new file mode 100644 index 0000000..5abeb9c --- /dev/null +++ b/debian/libosmo-rspro-dev.install @@ -0,0 +1,5 @@ +usr/include/osmocom/rspro +usr/lib/*/libosmo-rspro*.a +usr/lib/*/libosmo-rspro*.so +usr/lib/*/libosmo-rspro*.la +usr/lib/*/pkgconfig/libosmo-rspro.pc diff --git a/debian/libosmo-rspro0.install b/debian/libosmo-rspro0.install new file mode 100644 index 0000000..2b3a85d --- /dev/null +++ b/debian/libosmo-rspro0.install @@ -0,0 +1 @@ +usr/lib/*/libosmo-rspro*.so.* diff --git a/debian/osmo-remsim-bankd.install b/debian/osmo-remsim-bankd.install new file mode 100644 index 0000000..d8168d5 --- /dev/null +++ b/debian/osmo-remsim-bankd.install @@ -0,0 +1 @@ +usr/bin/osmo-remsim-bankd diff --git a/debian/osmo-remsim-client.install b/debian/osmo-remsim-client.install new file mode 100644 index 0000000..8e73dc1 --- /dev/null +++ b/debian/osmo-remsim-client.install @@ -0,0 +1 @@ +usr/bin/osmo-remsim-client* diff --git a/debian/osmo-remsim-server.install b/debian/osmo-remsim-server.install new file mode 100644 index 0000000..f6f14a1 --- /dev/null +++ b/debian/osmo-remsim-server.install @@ -0,0 +1 @@ +usr/bin/osmo-remsim-server diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..bbf2626 --- /dev/null +++ b/debian/rules @@ -0,0 +1,24 @@ +#!/usr/bin/make -f + +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 DH_VERBOSE=1 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + + +%: + dh $@ --with=systemd --with autoreconf --fail-missing + +override_dh_auto_configure: + dh_auto_configure -- --with-systemdsystemunitdir=/lib/systemd/system + +#override_dh_clean: +# dh_clean +# $(RM) tests/package.m4 +# $(RM) tests/testsuite + +# Print test results in case of a failure +#override_dh_auto_test: +# dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/13499 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id5044b1835190edc948952d207a5196a18669eb1 Gerrit-Change-Number: 13499 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:50:07 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 07:50:07 +0000 Subject: Change in osmo-remsim[master]: rename executables to include osmo- name prefix In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13498 to look at the new patch set (#2). Change subject: rename executables to include osmo- name prefix ...................................................................... rename executables to include osmo- name prefix Change-Id: I4498a004519499cc4b897a68c7f33efe29a63425 --- M doc/manuals/chapters/overview.adoc M doc/manuals/chapters/remsim-bankd.adoc M doc/manuals/chapters/remsim-client.adoc M doc/manuals/chapters/remsim-server.adoc M src/Makefile.am M src/server/Makefile.am 6 files changed, 104 insertions(+), 100 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/98/13498/2 -- To view, visit https://gerrit.osmocom.org/13498 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4498a004519499cc4b897a68c7f33efe29a63425 Gerrit-Change-Number: 13498 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:51:11 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 07:51:11 +0000 Subject: Change in osmo-remsim[master]: Add Debian packaging information In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13499 ) Change subject: Add Debian packaging information ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13499 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id5044b1835190edc948952d207a5196a18669eb1 Gerrit-Change-Number: 13499 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 03 Apr 2019 07:51:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:51:14 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 07:51:14 +0000 Subject: Change in osmo-remsim[master]: rename executables to include osmo- name prefix In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13498 ) Change subject: rename executables to include osmo- name prefix ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13498 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4498a004519499cc4b897a68c7f33efe29a63425 Gerrit-Change-Number: 13498 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 03 Apr 2019 07:51:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:51:16 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 07:51:16 +0000 Subject: Change in osmo-remsim[master]: Add libosmo-rspro.pc.in for pkg-config integration In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13497 ) Change subject: Add libosmo-rspro.pc.in for pkg-config integration ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13497 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic8bbf27bdb5ce7c810ede307a35ad4dc10338912 Gerrit-Change-Number: 13497 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 03 Apr 2019 07:51:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:51:17 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 07:51:17 +0000 Subject: Change in osmo-remsim[master]: Add libosmo-rspro.pc.in for pkg-config integration In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13497 ) Change subject: Add libosmo-rspro.pc.in for pkg-config integration ...................................................................... Add libosmo-rspro.pc.in for pkg-config integration Change-Id: Ic8bbf27bdb5ce7c810ede307a35ad4dc10338912 --- M Makefile.am M configure.ac A libosmo-rspro.pc.in 3 files changed, 14 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/Makefile.am b/Makefile.am index ec76bff..4843641 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,9 @@ SUBDIRS = src include doc +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libosmo-rspro.pc + EXTRA_DIST = asn1 .version README.md pkgcofigdir = $(libdir)/pkgconfig diff --git a/configure.ac b/configure.ac index 7281196..1d2ccc2 100644 --- a/configure.ac +++ b/configure.ac @@ -129,6 +129,7 @@ AC_OUTPUT( Makefile + libosmo-rspro.pc doc/Makefile doc/manuals/Makefile src/Makefile diff --git a/libosmo-rspro.pc.in b/libosmo-rspro.pc.in new file mode 100644 index 0000000..e810d42 --- /dev/null +++ b/libosmo-rspro.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Osmocom RSPRO library +Description: Osmocom Remote SIM Protocol library +Version: @VERSION@ +Libs: -L${libdir} -losmo-rspro +Cflags: -I${includedir}/ -- To view, visit https://gerrit.osmocom.org/13497 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic8bbf27bdb5ce7c810ede307a35ad4dc10338912 Gerrit-Change-Number: 13497 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:55:01 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 07:55:01 +0000 Subject: Change in osmo-remsim[master]: rename executables to include osmo- name prefix In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13498 ) Change subject: rename executables to include osmo- name prefix ...................................................................... rename executables to include osmo- name prefix Change-Id: I4498a004519499cc4b897a68c7f33efe29a63425 --- M doc/manuals/chapters/overview.adoc M doc/manuals/chapters/remsim-bankd.adoc M doc/manuals/chapters/remsim-client.adoc M doc/manuals/chapters/remsim-server.adoc M src/Makefile.am M src/server/Makefile.am 6 files changed, 104 insertions(+), 100 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/manuals/chapters/overview.adoc b/doc/manuals/chapters/overview.adoc index 0a303b1..842a3c7 100644 --- a/doc/manuals/chapters/overview.adoc +++ b/doc/manuals/chapters/overview.adoc @@ -36,51 +36,51 @@ Development of osmo-remsim software was funded by GSMK and sysmocom. -=== remsim-server +=== osmo-remsim-server -The remsim-server is the central element of the osmo-remsim +The `osmo-remsim-server` is the central element of the osmo-remsim architecture. All other elements connect to it. It maintains the inventory of other network elements, as well as the list of slot-mappings, i.e. the relationship between each given physical card in a bank and each card emulator attached to a phone/modem. -The tasks of remsim-server include: +The tasks of `osmo-remsim-server` include: -* accepting incoming TCP control connections from remsim-client and - remsim-bankd instances +* accepting incoming TCP control connections from `osmo-remsim-client` and + `osmo-remsim-bankd` instances * providing a RESTful JSON interface for external application logic to -=== remsim-client +=== osmo-remsim-client -The remsim-client software is co-located next to a cellular phone/modem. +The `osmo-remsim-client` software is co-located next to a cellular phone/modem. It typically runs on an [embedded] computer next to the phone/modem. -The tasks of remsim-client include: +The tasks of `osmo-remsim-client` include: * interaction over USB with a device supported by the 'SIMtrace2 cardem' firmware, which provides the physical interface to the phone/modem SIM interface -* establishing a TCP connection with the remsim-server, in order to +* establishing a TCP connection with the `osmo-remsim-server`, in order to enable the server to issue control commands -* under control of remsim-server, establishing a TCP connection to a - remsim-bankd in order to connect a card physically located at the +* under control of `osmo-remsim-server`, establishing a TCP connection to a + `osmo-remsim-bankd` in order to connect a card physically located at the bankd. -remsim-client supports at this point only one phone/modem. If you have +`osmo-remsim-client` supports at this point only one phone/modem. If you have multiple phones/modems at one location, you can simply run multiple -instances of remsim-client on the same system, one for each phone/modem. +instances of `osmo-remsim-client` on the same system, one for each phone/modem. -=== remsim-bankd +=== osmo-remsim-bankd -The remsim-bankd software is co-located next to a bank of SIM cards. +The `osmo-remsim-bankd` software is co-located next to a bank of SIM cards. -The tasks of remsim-bankd include: +The tasks of `osmo-remsim-bankd` include: * interaction with the actual card reader hardware. At this point, only PC/SC based readers are supported, with 1 to 255 slots per reader. -* establishing a TCP connection with the remsim-server, in order to +* establishing a TCP connection with the `osmo-remsim-server`, in order to enable the server to issue control commands -* running a TCP server where TCP connections from remsim-client +* running a TCP server where TCP connections from `osmo-remsim-client` instances are accepted and handled. diff --git a/doc/manuals/chapters/remsim-bankd.adoc b/doc/manuals/chapters/remsim-bankd.adoc index 7e83621..317abf4 100644 --- a/doc/manuals/chapters/remsim-bankd.adoc +++ b/doc/manuals/chapters/remsim-bankd.adoc @@ -1,18 +1,18 @@ -== remsim-bankd +== osmo-remsim-bankd -The `remsim-bankd` (SIM Bank Daemon) manages one given SIM bank. The -initial implementation supports a PC/SC driver to expose any PC/SC +The `osmo-remsim-bankd` (SIM Bank Daemon) manages one given SIM bank. +The initial implementation supports a PC/SC driver to expose any PC/SC compatible card readers as SIM bank. -`remsim-bankd` initially connects via a RSPRO control connection to -`remsim-server` at startup, and will in turn receive a set of initial -[client,slot]:[bankd,slot] mappings. These mappings determine which -slot on the client (corresponding to a modem) is mapped to which slot on -the SIM bank. Mappings can be updated by `remsim-server` at any given -point in time. +`osmo-remsim-bankd` initially connects via a RSPRO control connection to +`osmo-remsim-server` at startup, and will in turn receive a set of +initial [client,slot]:[bankd,slot] mappings. These mappings determine +which slot on the client (corresponding to a modem) is mapped to which +slot on the SIM bank. Mappings can be updated by `osmo-remsim-server` +at any given point in time. -`remsim-bankd` implements a RSPRO server, where it listens to connections -from `remsim-clients`. +`osmo-remsim-bankd` implements a RSPRO server, where it listens to +connections from `osmo-remsim-clients`. As PC/SC only offers a blocking API, there is one thread per PC/SC slot. This thread will perform blocking I/O on the socket towards the client, @@ -32,10 +32,10 @@ client has identified itself. The advantage is that the entire bankd can live without any non-blocking I/O. -The main thread handles the connection to `remsim-server`, where it can -also use non-blocking I/O. However, re-connection would be required, to -avoid stalling all banks/cards in the event of a connection loss to the -server. +The main thread handles the connection to `osmo-remsim-server`, where it +can also use non-blocking I/O. However, re-connection would be +required, to avoid stalling all banks/cards in the event of a connection +loss to the server. worker threads have the following states: * INIT (just started) @@ -56,39 +56,40 @@ === Running -`remsim-bankd` currently has the following command-line options: +`osmo-remsim-bankd` currently has the following command-line options: ==== SYNOPSIS -*remsim-bankd* [-h] [-i A.B.C.D] [-p <1-65535>] [-b <1-65535>] [-n <1-65535>] [-I A.B.C.D] [-P <1-65535> ] +*osmo-remsim-bankd* [-h] [-i A.B.C.D] [-p <1-65535>] [-b <1-65535>] [-n <1-65535>] [-I A.B.C.D] [-P <1-65535> ] ==== OPTIONS *-h, --help*:: Print a short help message about the supported options *-i, --server-host A.B.C.D*:: - Specify the remote IP address/hostname of the remsim-server to which this bankd - shall establish its RSPRO control connection + Specify the remote IP address/hostname of the `osmo-remsim-server` to + which this bankd shall establish its RSPRO control connection *-p, --server-port <1-65535>*:: - Specify the remote TCP port number of the remsim-server to whihc this bankd - shall establish its RSPRO control connection + Specify the remote TCP port number of the `osmo-remsim-server` to which + this bankd shall establish its RSPRO control connection *-b, --bank-id <1-65535>*:: - Specify the numeric bank identifier of the SIM bank this bankd instance - operates. Must be unique among all banks connecting to the same remsim-server. + Specify the numeric bank identifier of the SIM bank this bankd + instance operates. Must be unique among all banks connecting to the + same `osmo-remsim-server`. *-n, --num-slots <1-65535>*:: Specify the number of slots that this bankd handles. *-I, --bind-IP A.B.C.D*:: Specify the local IP address to which the socket for incoming connections - from remsim-clients is bound to. + from `osmo-remsim-clients` is bound to. *-P, --bind-port <1-65535>*:: Specify the local TCP port to whicc the socket for incoming connections - from remsim-clients is bound to. + from `osmo-remsim-client`s is bound to. === Logging -remsim-bankd currently logs to stdout only, and the logging verbosity -is not yet configurable. However, as the libosmocore logging framework -is used, extending this is an easy modification. +`osmo-remsim-bankd` currently logs to stdout only, and the logging +verbosity is not yet configurable. However, as the libosmocore logging +framework is used, extending this is an easy modification. === `bankd_pcsc_slots.csv` CSV file diff --git a/doc/manuals/chapters/remsim-client.adoc b/doc/manuals/chapters/remsim-client.adoc index 2b67bf0..0526dbb 100644 --- a/doc/manuals/chapters/remsim-client.adoc +++ b/doc/manuals/chapters/remsim-client.adoc @@ -1,18 +1,19 @@ -== simtrace2-remsim-client +== osmo-remsim-client-st2 The client interfaces with GSM phones / modems via dedicated "Card Emulation" devices such as the Osmocom SIMtrace2 or sysmocom sysmoQMOD board + firmware. This hardware implements the ISO7816-3 electrical interface and protocol handling and passes any TPDU headers received -from the phone/modem to `remsim-client` for further processing of the -TPDUs associated to the given APDU transfer. +from the phone/modem to `osmo-remsim-client` for further processing of +the TPDUs associated to the given APDU transfer. -`remsim-client` connects via a RSPRO control connection to remsim-server -at startup and registers itself. It will receive configuration data -such as the `remsim-bankd` IP+Port and the ClientId from remsim-server. +`osmo-remsim-client` connects via a RSPRO control connection to +`osmo-remsim-server` at startup and registers itself. It will receive +configuration data such as the `osmo-remsim-bankd` IP+Port and the +ClientId from `osmo-remsim-server`. -After receiving the configuration, `remsim-client` will establish a RSPRO -data connection to the `remsim-bankd` IP:Port. +After receiving the configuration, `osmo-remsim-client` will establish a +RSPRO data connection to the `osmo-remsim-bankd` IP:Port. As the USB interface for remote SIM in simtrace2.git uses one interface per slot, we can implement the client in blocking mode, i.e. use @@ -21,35 +22,35 @@ === Running -simtrace2-remsim-client currently has the following command-line options: +osmo-remsim-client-st2 currently has the following command-line options: ==== SYNOPSIS -*simtrace2-remsim-client* [...] +*osmo-remsim-client-st2* [...] ==== OPTIONS *-h, --help*:: Print a short help message about the supported options *-s, --server-host A.B.C.D*:: - Specify the remote IP address / hostname of the remsim-server to which - this client shall establish its RSPRO control connection + Specify the remote IP address / hostname of the `osmo-remsim-server` to + which this client shall establish its RSPRO control connection *-p, --server-port <1-65535>*:: - Specify the remote TCP port number of the remsim-server to which this client - shall establish its RSPRO control connection + Specify the remote TCP port number of the `osmo-remsim-server` to which + this client shall establish its RSPRO control connection *-c, --client-id <1-65535>*:: Specify the numeric client identifier of the SIM bank this bankd - instance operates. The tuple of client-id and client-slot must be unique - among all clients connecting to the same remsim-server. + instance operates. The tuple of client-id and client-slot must be + unique among all clients connecting to the same `osmo-remsim-server`. *-n, --client-slot <0-65535>*:: Specify the slot number served within this client. The tuple of client-id and client-slot must be unique among all clients connecting - to the same remsim-server. + to the same `osmo-remsim-server`. *-i, --gsmtap-ip A.B.C.D*:: Specify the IP address (if any) to which APDU traces are sent in GSMTAP format (useful for debugging; supported by wireshark). *-k, --keep-running*:: - Specify if the remsim-client should terminate after handling one + Specify if the `osmo-remsim-client` should terminate after handling one session, or whether it should keep running. Fast respawn (i.e. no --keep-running) is probably the more robust option at this point. *-V, --usb-vendor*:: @@ -79,11 +80,11 @@ SIM emulation device attached to your system. *-a, --atr HEXSTRING*:: Specify the initial ATR to be communicated to the modem/phone. Can - and will later be overridden by the ATR as specified by remsim-bankd - once a card has been mapped to this client. + and will later be overridden by the ATR as specified by + `osmo-remsim-bankd` once a card has been mapped to this client. === Logging -remsim-client currently logs to stdout only, and the logging verbosity -is not yet configurable. However, as the libosmocore logging framework -is used, extending this is an easy modification. +`osmo-remsim-client` currently logs to stdout only, and the logging +verbosity is not yet configurable. However, as the libosmocore logging +framework is used, extending this is an easy modification. diff --git a/doc/manuals/chapters/remsim-server.adoc b/doc/manuals/chapters/remsim-server.adoc index fcb7283..e5ab58d 100644 --- a/doc/manuals/chapters/remsim-server.adoc +++ b/doc/manuals/chapters/remsim-server.adoc @@ -1,12 +1,12 @@ -== remsim-server +== osmo-remsim-server === Running -`remsim-server` currently has no command-line arguments. It will bind to -INADDR_ANY and offer the following TCP ports: +`osmo-remsim-server` currently has no command-line arguments. It will +bind to INADDR_ANY and offer the following TCP ports: -* Port 9998 for the inbound control connections from `remsim-client` - and `remsim-bankd` +* Port 9998 for the inbound control connections from `osmo-remsim-client` + and `osmo-remsim-bankd` * Port 9997 for the RESTful/JSON Web API (role: HTTP server) It is intended to make these settings (IP addresses, ports) configurable @@ -14,13 +14,13 @@ === Logging -`remsim-server` currently logs to stdout only, and the logging verbosity -is not yet configurable. However, as the libosmocore logging framework -is used, extending this is an easy modification. +`osmo-remsim-server` currently logs to stdout only, and the logging +verbosity is not yet configurable. However, as the libosmocore logging +framework is used, extending this is an easy modification. === RESTful/JSON Web API -`remsim-server` provides a RESTful/JSON WEB API for application logic +`osmo-remsim-server` provides a RESTful/JSON WEB API for application logic integration. The purpose of the API is to allow run-time configuration and monitoring of the entire osmo-remsim system. @@ -29,28 +29,28 @@ ==== /api/backend/v1/clients *GET* obtains a JSON list where each element represents one currently -connected `remsim-client`. +connected `osmo-remsim-client`. No other HTTP operation is implemented. ==== /api/backend/v1/clients/:client_id *GET* obtains a single JSON object representing one specific currently -connected `remsim-client`. +connected `osmo-remsim-client`. No other HTTP operation is implemented. ==== /api/backend/v1/bankds *GET* obtains a JSON list where each element represents one currently -connected `remsim-bankd`. +connected `osmo-remsim-bankd`. No other HTTP operation is implemented. ==== /api/backend/v1/bankds/:bank_id *GET* obtains a single JSON object representing one specific currently -connected `remsim-bankd`. +connected `osmo-remsim-bankd`. No other HTTP operation is implemented. @@ -74,5 +74,5 @@ ==== /api/backend/v1/global-reset -*POST* performs a global reset of the `remsim-server` state. This means -all mappings are removed. +*POST* performs a global reset of the `osmo-remsim-server` state. This +means all mappings are removed. diff --git a/src/Makefile.am b/src/Makefile.am index ab77375..d671f37 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,24 +20,25 @@ simtrace2/simtrace_prot.h \ simtrace2/simtrace_usb.h -bin_PROGRAMS = pcsc_test remsim-bankd remsim-client simtrace2-remsim-client +bin_PROGRAMS = osmo-remsim-bankd osmo-remsim-client-st2 +noinst_PROGRAMS = pcsc_test remsim-client pcsc_test_SOURCES = driver_core.c driver_pcsc.c main.c pcsc_test_LDADD = $(OSMOCORE_LIBS) \ $(PCSC_LIBS) libosmo-rspro.la -remsim_bankd_SOURCES = slotmap.c bankd_main.c bankd_pcsc.c rspro_client_fsm.c debug.c -remsim_bankd_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ - $(PCSC_LIBS) libosmo-rspro.la -lcsv +osmo_remsim_bankd_SOURCES = slotmap.c bankd_main.c bankd_pcsc.c rspro_client_fsm.c debug.c +osmo_remsim_bankd_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ + $(PCSC_LIBS) libosmo-rspro.la -lcsv remsim_client_SOURCES = remsim_client.c rspro_client_fsm.c bankd_client_fsm.c debug.c remsim_client_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ libosmo-rspro.la -simtrace2_remsim_client_SOURCES = simtrace2-remsim_client.c \ - bankd_client_fsm.c rspro_client_fsm.c debug.c \ - simtrace2/apdu_dispatch.c \ - simtrace2/simtrace2-discovery.c \ - simtrace2/libusb_util.c -simtrace2_remsim_client_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) $(USB_LIBS) $(OSMOSIM_LIBS)\ - libosmo-rspro.la +osmo_remsim_client_st2_SOURCES = simtrace2-remsim_client.c \ + bankd_client_fsm.c rspro_client_fsm.c debug.c \ + simtrace2/apdu_dispatch.c \ + simtrace2/simtrace2-discovery.c \ + simtrace2/libusb_util.c +osmo_remsim_client_st2_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ + $(USB_LIBS) $(OSMOSIM_LIBS) libosmo-rspro.la diff --git a/src/server/Makefile.am b/src/server/Makefile.am index 5926dee..ce114b6 100644 --- a/src/server/Makefile.am +++ b/src/server/Makefile.am @@ -6,12 +6,13 @@ noinst_HEADERS = rspro_server.h rest_api.h -bin_PROGRAMS = remsim-server +bin_PROGRAMS = osmo-remsim-server -remsim_server_SOURCES = remsim_server.c rspro_server.c rest_api.c ../rspro_util.c ../slotmap.c ../debug.c -remsim_server_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ - $(ULFIUS_LIBS) $(JANSSON_LIBS) \ - $(top_builddir)/src/libosmo-rspro.la +osmo_remsim_server_SOURCES = remsim_server.c rspro_server.c rest_api.c \ + ../rspro_util.c ../slotmap.c ../debug.c +osmo_remsim_server_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ + $(ULFIUS_LIBS) $(JANSSON_LIBS) \ + $(top_builddir)/src/libosmo-rspro.la # as suggested in http://lists.gnu.org/archive/html/automake/2009-03/msg00011.html FORCE: -- To view, visit https://gerrit.osmocom.org/13498 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4498a004519499cc4b897a68c7f33efe29a63425 Gerrit-Change-Number: 13498 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:55:02 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 07:55:02 +0000 Subject: Change in osmo-remsim[master]: Add Debian packaging information In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13499 ) Change subject: Add Debian packaging information ...................................................................... Add Debian packaging information Change-Id: Id5044b1835190edc948952d207a5196a18669eb1 --- A debian/changelog A debian/compat A debian/control A debian/copyright A debian/libosmo-rspro-dev.install A debian/libosmo-rspro0.install A debian/osmo-remsim-bankd.install A debian/osmo-remsim-client.install A debian/osmo-remsim-server.install A debian/rules 10 files changed, 134 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..ca4d246 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +osmo-remsim (0.1.0) unstable; urgency=medium + + [ Harald Welte ] + * initial release. + + -- Harald Welte Wed, 03 Apr 2019 08:59:40 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..8301a42 --- /dev/null +++ b/debian/control @@ -0,0 +1,69 @@ +Source: osmo-remsim +Maintainer: Harald Welte +Section: net +Priority: optional +Build-Depends: debhelper (>= 9), + pkg-config, + dh-autoreconf, + dh-systemd (>= 1.5), + autotools-dev, + pkg-config, + libosmocore-dev, + libosmo-abis-dev, + libpcsclite-dev, + libusb-1.0-0-dev, + libulfius-dev, + libjansson-dev +Standards-Version: 3.9.8 +Vcs-Browser: http://git.osmocom.org/osmo-remsim/ +Vcs-Git: git://git.osmocom.org/osmo-remsim +Homepage: https://projects.osmocom.org/projects/osmo-remsim + +Package: libosmo-rspro0 +Section: libs +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Description: Osmocom Remote SIM - Shared Library + libosmo-rsrpo is an utility library for encoding/decoding the ASN.1 BER + based RSPRO (Remote SIM Protocol) protocol used between the osmo-remsim + programs. + +Package: libosmo-rspro-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends} +Description: Osmocom Remote SIM - Shared Library Development Haders + libosmo-rsrpo is an utility library for encoding/decoding the ASN.1 BER + based RSPRO (Remote SIM Protocol) protocol used between the osmo-remsim + programs. + +Package: osmo-remsim-server +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Osmocom Remote SIM - Central Server + The remsim-server is the central element of a osmo-remsim deployment, + it maintains a list of clients + bankds connected to it, as well as the + dynamic SIM card mappings between them. + +Package: osmo-remsim-bankd +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Osmocom Remote SIM - Bank Daemon + The remsim-bankd is managing a bank of SIM card readers and their + respective cards. It establishes a control connection to remsim-server + and receives inbound connections from remsim-clients. + +Package: osmo-remsim-client +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Osmocom Remote SIM - Client + The remsim-client is managing a given phone/modem. It attaches to the + 'cardem' firmware of a SIMtrcace2 (or compatible, such as sysmoQMOD) + hardware and forwards the SIM card communication to a remsim-bankd, + under the control of remsim-server. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..8af2d2e --- /dev/null +++ b/debian/copyright @@ -0,0 +1,25 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: osmo-remsim +Source: http://cgit.osmocom.org/osmo-remsim/ + +Files: * +Copyright: 2018-2019 Harald Welte +License: GPL-2+ + + +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". diff --git a/debian/libosmo-rspro-dev.install b/debian/libosmo-rspro-dev.install new file mode 100644 index 0000000..5abeb9c --- /dev/null +++ b/debian/libosmo-rspro-dev.install @@ -0,0 +1,5 @@ +usr/include/osmocom/rspro +usr/lib/*/libosmo-rspro*.a +usr/lib/*/libosmo-rspro*.so +usr/lib/*/libosmo-rspro*.la +usr/lib/*/pkgconfig/libosmo-rspro.pc diff --git a/debian/libosmo-rspro0.install b/debian/libosmo-rspro0.install new file mode 100644 index 0000000..2b3a85d --- /dev/null +++ b/debian/libosmo-rspro0.install @@ -0,0 +1 @@ +usr/lib/*/libosmo-rspro*.so.* diff --git a/debian/osmo-remsim-bankd.install b/debian/osmo-remsim-bankd.install new file mode 100644 index 0000000..d8168d5 --- /dev/null +++ b/debian/osmo-remsim-bankd.install @@ -0,0 +1 @@ +usr/bin/osmo-remsim-bankd diff --git a/debian/osmo-remsim-client.install b/debian/osmo-remsim-client.install new file mode 100644 index 0000000..8e73dc1 --- /dev/null +++ b/debian/osmo-remsim-client.install @@ -0,0 +1 @@ +usr/bin/osmo-remsim-client* diff --git a/debian/osmo-remsim-server.install b/debian/osmo-remsim-server.install new file mode 100644 index 0000000..f6f14a1 --- /dev/null +++ b/debian/osmo-remsim-server.install @@ -0,0 +1 @@ +usr/bin/osmo-remsim-server diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..bbf2626 --- /dev/null +++ b/debian/rules @@ -0,0 +1,24 @@ +#!/usr/bin/make -f + +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 DH_VERBOSE=1 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + + +%: + dh $@ --with=systemd --with autoreconf --fail-missing + +override_dh_auto_configure: + dh_auto_configure -- --with-systemdsystemunitdir=/lib/systemd/system + +#override_dh_clean: +# dh_clean +# $(RM) tests/package.m4 +# $(RM) tests/testsuite + +# Print test results in case of a failure +#override_dh_auto_test: +# dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) -- To view, visit https://gerrit.osmocom.org/13499 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id5044b1835190edc948952d207a5196a18669eb1 Gerrit-Change-Number: 13499 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:55:20 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 07:55:20 +0000 Subject: Change in osmo-ci[master]: osmocom-latest-packages: Enable osmo-sysmon Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13500 Change subject: osmocom-latest-packages: Enable osmo-sysmon ...................................................................... osmocom-latest-packages: Enable osmo-sysmon Since libosmocore 1.0.1 and libosmo-netif 0.4.0 are released, we can address the TOOD and build osmo-sysmon also in our latest feed. Change-Id: I48bd5aff2ae315b6f462facea70222eb2cdd2d58 --- M scripts/osmocom-latest-packages.sh 1 file changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/00/13500/1 diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh index 0e4d655..a2f845a 100755 --- a/scripts/osmocom-latest-packages.sh +++ b/scripts/osmocom-latest-packages.sh @@ -129,8 +129,7 @@ checkout osmo-bsc checkout simtrace2 checkout libosmo-dsp - # TODO: enable once release after libosmocore 1.0.1 and libosmo-netif 0.4.0 are available - # checkout osmo-sysmon + checkout osmo-sysmon build limesuite --git-upstream-tree="$(get_last_tag limesuite)" build libosmocore @@ -156,8 +155,7 @@ build osmo-bsc build simtrace2 build libosmo-dsp - # TODO: enable once release after libosmocore 1.0.1 and libosmo-netif 0.4.0 are available - # build osmo-sysmon + build osmo-sysmon cd "$TOP/$PROJ" osc ci -m "Latest Tagged versions of $DT" -- To view, visit https://gerrit.osmocom.org/13500 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I48bd5aff2ae315b6f462facea70222eb2cdd2d58 Gerrit-Change-Number: 13500 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:55:20 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 07:55:20 +0000 Subject: Change in osmo-ci[master]: osmocom-nightly-packages: build osmo-remsim Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13501 Change subject: osmocom-nightly-packages: build osmo-remsim ...................................................................... osmocom-nightly-packages: build osmo-remsim As of Change-Id Id5044b1835190edc948952d207a5196a18669eb1, osmo-remsim contains Debian packaging information and hence we can build it as part of our nightly feeds. Change-Id: Ic367dc95f46cece4bd769061af860fd82b4bd2e9 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/01/13501/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index ae6c1b5..7e1cede 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -185,6 +185,7 @@ checkout simtrace2 checkout libosmo-dsp checkout osmo-sysmon + checkout osmo-remsim create_osmo_trx_debian8_jessie @@ -217,6 +218,7 @@ build simtrace2 build libosmo-dsp build osmo-sysmon + build osmo-remsim download_bumpversion -- To view, visit https://gerrit.osmocom.org/13501 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic367dc95f46cece4bd769061af860fd82b4bd2e9 Gerrit-Change-Number: 13501 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 07:55:20 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 07:55:20 +0000 Subject: Change in osmo-ci[master]: jenkins-slave: Use "jessie-backports" only on jessie systems Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13502 Change subject: jenkins-slave: Use "jessie-backports" only on jessie systems ...................................................................... jenkins-slave: Use "jessie-backports" only on jessie systems Change-Id: Id62c03b9759367bd5bbe20144e9ad7048d12e61b --- M ansible/roles/osmocom-jenkins-slave/tasks/debian.yml 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/02/13502/1 diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml index 30e4ece..641c6f3 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml @@ -22,6 +22,7 @@ repo: 'deb http://ftp.debian.org/debian jessie-backports main' filename: 'backports' update_cache: yes + when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie' - name: install java for jessie apt: -- To view, visit https://gerrit.osmocom.org/13502 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id62c03b9759367bd5bbe20144e9ad7048d12e61b Gerrit-Change-Number: 13502 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Wed Apr 3 08:02:00 2019 From: admin at opensuse.org (OBS Notification) Date: Wed, 03 Apr 2019 08:02:00 +0000 Subject: Build failure of network:osmocom:nightly/osmo-remsim in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5ca46881d8963_30de115c6002509fe@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-remsim/Debian_9.0/i586 Package network:osmocom:nightly/osmo-remsim failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-remsim Last lines of build log: [ 152s] #define HAVE_STRING_H 1 [ 152s] #define HAVE_MEMORY_H 1 [ 152s] #define HAVE_STRINGS_H 1 [ 152s] #define HAVE_INTTYPES_H 1 [ 152s] #define HAVE_STDINT_H 1 [ 152s] #define HAVE_UNISTD_H 1 [ 152s] #define HAVE_DLFCN_H 1 [ 152s] #define LT_OBJDIR ".libs/" [ 152s] #define PACKAGE "osmo-remsim" [ 152s] #define VERSION "0.1.0.7-08d8" [ 152s] [ 152s] configure: exit 1 [ 152s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --with-systemdsystemunitdir=/lib/systemd/system returned exit code 1 [ 152s] debian/rules:15: recipe for target 'override_dh_auto_configure' failed [ 152s] make[1]: *** [override_dh_auto_configure] Error 2 [ 152s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 152s] debian/rules:12: recipe for target 'build' failed [ 152s] make: *** [build] Error 2 [ 152s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 152s] [ 152s] cloud127 failed "build osmo-remsim_0.1.0.7.08d8.dsc" at Wed Apr 3 08:01:43 UTC 2019. [ 152s] [ 152s] ### VM INTERACTION START ### [ 155s] [ 119.025487] sysrq: SysRq : Power Off [ 155s] [ 119.071089] reboot: Power down [ 156s] ### VM INTERACTION END ### [ 156s] [ 156s] cloud127 failed "build osmo-remsim_0.1.0.7.08d8.dsc" at Wed Apr 3 08:01:48 UTC 2019. [ 156s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Apr 3 08:02:00 2019 From: admin at opensuse.org (OBS Notification) Date: Wed, 03 Apr 2019 08:02:00 +0000 Subject: Build failure of network:osmocom:nightly/osmo-remsim in xUbuntu_17.10/i586 In-Reply-To: References: Message-ID: <5ca46884328b3_30de115c6002511c5@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-remsim/xUbuntu_17.10/i586 Package network:osmocom:nightly/osmo-remsim failed to build in xUbuntu_17.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-remsim Last lines of build log: [ 148s] #define HAVE_STRING_H 1 [ 148s] #define HAVE_MEMORY_H 1 [ 148s] #define HAVE_STRINGS_H 1 [ 148s] #define HAVE_INTTYPES_H 1 [ 148s] #define HAVE_STDINT_H 1 [ 148s] #define HAVE_UNISTD_H 1 [ 148s] #define HAVE_DLFCN_H 1 [ 148s] #define LT_OBJDIR ".libs/" [ 148s] #define PACKAGE "osmo-remsim" [ 148s] #define VERSION "0.1.0.7-08d8" [ 148s] [ 148s] configure: exit 1 [ 148s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/i386-linux-gnu --libexecdir=\${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --with-systemdsystemunitdir=/lib/systemd/system returned exit code 1 [ 148s] debian/rules:15: recipe for target 'override_dh_auto_configure' failed [ 148s] make[1]: *** [override_dh_auto_configure] Error 2 [ 148s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 148s] debian/rules:12: recipe for target 'build' failed [ 148s] make: *** [build] Error 2 [ 148s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 148s] [ 148s] cloud125 failed "build osmo-remsim_0.1.0.7.08d8.dsc" at Wed Apr 3 08:01:52 UTC 2019. [ 148s] [ 148s] ### VM INTERACTION START ### [ 151s] [ 120.551185] sysrq: SysRq : Power Off [ 151s] [ 120.560871] reboot: Power down [ 152s] ### VM INTERACTION END ### [ 152s] [ 152s] cloud125 failed "build osmo-remsim_0.1.0.7.08d8.dsc" at Wed Apr 3 08:01:57 UTC 2019. [ 152s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Apr 3 08:06:00 2019 From: admin at opensuse.org (OBS Notification) Date: Wed, 03 Apr 2019 08:06:00 +0000 Subject: Build failure of network:osmocom:nightly/osmo-remsim in xUbuntu_18.04/i586 In-Reply-To: References: Message-ID: <5ca46975be877_30de115c600254195@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-remsim/xUbuntu_18.04/i586 Package network:osmocom:nightly/osmo-remsim failed to build in xUbuntu_18.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-remsim Last lines of build log: [ 399s] #define HAVE_STRING_H 1 [ 399s] #define HAVE_MEMORY_H 1 [ 399s] #define HAVE_STRINGS_H 1 [ 399s] #define HAVE_INTTYPES_H 1 [ 399s] #define HAVE_STDINT_H 1 [ 399s] #define HAVE_UNISTD_H 1 [ 399s] #define HAVE_DLFCN_H 1 [ 399s] #define LT_OBJDIR ".libs/" [ 399s] #define PACKAGE "osmo-remsim" [ 399s] #define VERSION "0.1.0.7-08d8" [ 399s] [ 399s] configure: exit 1 [ 399s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/i386-linux-gnu --libexecdir=\${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --with-systemdsystemunitdir=/lib/systemd/system returned exit code 1 [ 399s] debian/rules:15: recipe for target 'override_dh_auto_configure' failed [ 399s] make[1]: *** [override_dh_auto_configure] Error 2 [ 399s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 399s] debian/rules:12: recipe for target 'build' failed [ 399s] make: *** [build] Error 2 [ 399s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 399s] [ 399s] lamb59 failed "build osmo-remsim_0.1.0.7.08d8.dsc" at Wed Apr 3 08:05:49 UTC 2019. [ 399s] [ 399s] ### VM INTERACTION START ### [ 403s] [ 389.520640] sysrq: SysRq : Power Off [ 403s] [ 389.561308] reboot: Power down [ 403s] ### VM INTERACTION END ### [ 403s] [ 403s] lamb59 failed "build osmo-remsim_0.1.0.7.08d8.dsc" at Wed Apr 3 08:05:53 UTC 2019. [ 403s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Apr 3 08:08:52 2019 From: admin at opensuse.org (OBS Notification) Date: Wed, 03 Apr 2019 08:08:52 +0000 Subject: Build failure of network:osmocom:nightly/osmo-remsim in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5ca46a257d992_30de115c600257487@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-remsim/Debian_9.0/i586 Package network:osmocom:nightly/osmo-remsim failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-remsim Last lines of build log: [ 82s] #define HAVE_MEMORY_H 1 [ 82s] #define HAVE_STRINGS_H 1 [ 82s] #define HAVE_INTTYPES_H 1 [ 82s] #define HAVE_STDINT_H 1 [ 82s] #define HAVE_UNISTD_H 1 [ 82s] #define HAVE_DLFCN_H 1 [ 82s] #define LT_OBJDIR ".libs/" [ 82s] #define PACKAGE "osmo-remsim" [ 82s] #define VERSION "0.1.0.8-8e04" [ 82s] #define HAVE_CSV_H 1 [ 82s] [ 82s] configure: exit 1 [ 82s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --with-systemdsystemunitdir=/lib/systemd/system returned exit code 1 [ 82s] debian/rules:15: recipe for target 'override_dh_auto_configure' failed [ 82s] make[1]: *** [override_dh_auto_configure] Error 2 [ 82s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 82s] debian/rules:12: recipe for target 'build' failed [ 82s] make: *** [build] Error 2 [ 82s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 82s] [ 82s] lamb09 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 08:08:48 UTC 2019. [ 82s] [ 82s] ### VM INTERACTION START ### [ 85s] [ 73.041114] sysrq: SysRq : Power Off [ 85s] [ 73.047632] reboot: Power down [ 85s] ### VM INTERACTION END ### [ 85s] [ 85s] lamb09 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 08:08:51 UTC 2019. [ 85s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Apr 3 08:08:52 2019 From: admin at opensuse.org (OBS Notification) Date: Wed, 03 Apr 2019 08:08:52 +0000 Subject: Build failure of network:osmocom:nightly/osmo-remsim in xUbuntu_17.10/i586 In-Reply-To: References: Message-ID: <5ca46a292abb4_30de115c6002577bc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-remsim/xUbuntu_17.10/i586 Package network:osmocom:nightly/osmo-remsim failed to build in xUbuntu_17.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-remsim Last lines of build log: [ 87s] #define HAVE_MEMORY_H 1 [ 87s] #define HAVE_STRINGS_H 1 [ 87s] #define HAVE_INTTYPES_H 1 [ 87s] #define HAVE_STDINT_H 1 [ 87s] #define HAVE_UNISTD_H 1 [ 87s] #define HAVE_DLFCN_H 1 [ 87s] #define LT_OBJDIR ".libs/" [ 87s] #define PACKAGE "osmo-remsim" [ 87s] #define VERSION "0.1.0.8-8e04" [ 87s] #define HAVE_CSV_H 1 [ 87s] [ 87s] configure: exit 1 [ 87s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/i386-linux-gnu --libexecdir=\${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --with-systemdsystemunitdir=/lib/systemd/system returned exit code 1 [ 87s] debian/rules:15: recipe for target 'override_dh_auto_configure' failed [ 87s] make[1]: *** [override_dh_auto_configure] Error 2 [ 87s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 87s] debian/rules:12: recipe for target 'build' failed [ 87s] make: *** [build] Error 2 [ 87s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 87s] [ 87s] lamb12 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 08:08:45 UTC 2019. [ 87s] [ 87s] ### VM INTERACTION START ### [ 90s] [ 77.280538] sysrq: SysRq : Power Off [ 90s] [ 77.286344] reboot: Power down [ 90s] ### VM INTERACTION END ### [ 90s] [ 90s] lamb12 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 08:08:49 UTC 2019. [ 90s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Apr 3 08:10:35 2019 From: admin at opensuse.org (OBS Notification) Date: Wed, 03 Apr 2019 08:10:35 +0000 Subject: Build failure of network:osmocom:nightly/osmo-remsim in xUbuntu_18.04/i586 In-Reply-To: References: Message-ID: <5ca46a7f7784b_30de115c600258540@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-remsim/xUbuntu_18.04/i586 Package network:osmocom:nightly/osmo-remsim failed to build in xUbuntu_18.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-remsim Last lines of build log: [ 118s] #define HAVE_MEMORY_H 1 [ 118s] #define HAVE_STRINGS_H 1 [ 118s] #define HAVE_INTTYPES_H 1 [ 118s] #define HAVE_STDINT_H 1 [ 118s] #define HAVE_UNISTD_H 1 [ 118s] #define HAVE_DLFCN_H 1 [ 118s] #define LT_OBJDIR ".libs/" [ 118s] #define PACKAGE "osmo-remsim" [ 118s] #define VERSION "0.1.0.8-8e04" [ 118s] #define HAVE_CSV_H 1 [ 118s] [ 118s] configure: exit 1 [ 118s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/i386-linux-gnu --libexecdir=\${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --with-systemdsystemunitdir=/lib/systemd/system returned exit code 1 [ 118s] debian/rules:15: recipe for target 'override_dh_auto_configure' failed [ 118s] make[1]: *** [override_dh_auto_configure] Error 2 [ 118s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 118s] debian/rules:12: recipe for target 'build' failed [ 118s] make: *** [build] Error 2 [ 118s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 118s] [ 118s] lamb01 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 08:10:26 UTC 2019. [ 118s] [ 118s] ### VM INTERACTION START ### [ 121s] [ 108.736410] sysrq: SysRq : Power Off [ 121s] [ 108.748423] reboot: Power down [ 121s] ### VM INTERACTION END ### [ 121s] [ 121s] lamb01 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 08:10:29 UTC 2019. [ 121s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Apr 3 08:11:43 2019 From: admin at opensuse.org (OBS Notification) Date: Wed, 03 Apr 2019 08:11:43 +0000 Subject: Build failure of network:osmocom:nightly/osmo-remsim in xUbuntu_18.10/x86_64 In-Reply-To: References: Message-ID: <5ca46ad61a6ef_30de115c600259268@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-remsim/xUbuntu_18.10/x86_64 Package network:osmocom:nightly/osmo-remsim failed to build in xUbuntu_18.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-remsim Last lines of build log: [ 92s] #define HAVE_STDLIB_H 1 [ 92s] #define HAVE_STRING_H 1 [ 92s] #define HAVE_MEMORY_H 1 [ 92s] #define HAVE_STRINGS_H 1 [ 92s] #define HAVE_INTTYPES_H 1 [ 92s] #define HAVE_STDINT_H 1 [ 92s] #define HAVE_UNISTD_H 1 [ 92s] #define HAVE_DLFCN_H 1 [ 92s] #define LT_OBJDIR ".libs/" [ 92s] #define PACKAGE "osmo-remsim" [ 92s] #define VERSION "0.1.0.8-8e04" [ 92s] #define HAVE_CSV_H 1 [ 92s] [ 92s] configure: exit 1 [ 92s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --with-systemdsystemunitdir=/lib/systemd/system returned exit code 1 [ 92s] make[1]: *** [debian/rules:15: override_dh_auto_configure] Error 2 [ 92s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 92s] make: *** [debian/rules:12: build] Error 2 [ 92s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 92s] [ 92s] sheep84 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 08:11:22 UTC 2019. [ 92s] [ 92s] ### VM INTERACTION START ### [ 95s] [ 86.102080] sysrq: SysRq : Power Off [ 95s] [ 86.107827] reboot: Power down [ 95s] ### VM INTERACTION END ### [ 95s] [ 95s] sheep84 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 08:11:25 UTC 2019. [ 95s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Apr 3 08:11:43 2019 From: admin at opensuse.org (OBS Notification) Date: Wed, 03 Apr 2019 08:11:43 +0000 Subject: Build failure of network:osmocom:nightly/osmo-remsim in xUbuntu_18.04/x86_64 In-Reply-To: References: Message-ID: <5ca46ad681c4d_30de115c600259387@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-remsim/xUbuntu_18.04/x86_64 Package network:osmocom:nightly/osmo-remsim failed to build in xUbuntu_18.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-remsim Last lines of build log: [ 85s] #define HAVE_MEMORY_H 1 [ 85s] #define HAVE_STRINGS_H 1 [ 85s] #define HAVE_INTTYPES_H 1 [ 85s] #define HAVE_STDINT_H 1 [ 85s] #define HAVE_UNISTD_H 1 [ 85s] #define HAVE_DLFCN_H 1 [ 85s] #define LT_OBJDIR ".libs/" [ 85s] #define PACKAGE "osmo-remsim" [ 85s] #define VERSION "0.1.0.8-8e04" [ 85s] #define HAVE_CSV_H 1 [ 85s] [ 85s] configure: exit 1 [ 85s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --with-systemdsystemunitdir=/lib/systemd/system returned exit code 1 [ 85s] debian/rules:15: recipe for target 'override_dh_auto_configure' failed [ 85s] make[1]: *** [override_dh_auto_configure] Error 2 [ 85s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 85s] debian/rules:12: recipe for target 'build' failed [ 85s] make: *** [build] Error 2 [ 85s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 85s] [ 85s] build71 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 08:11:34 UTC 2019. [ 85s] [ 85s] ### VM INTERACTION START ### [ 88s] [ 77.925292] sysrq: SysRq : Power Off [ 88s] [ 77.927741] reboot: Power down [ 88s] ### VM INTERACTION END ### [ 88s] [ 88s] build71 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 08:11:37 UTC 2019. [ 88s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Apr 3 08:13:09 2019 From: admin at opensuse.org (OBS Notification) Date: Wed, 03 Apr 2019 08:13:09 +0000 Subject: Build failure of network:osmocom:nightly/osmo-remsim in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <5ca46b30e15d3_30de115c600259978@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-remsim/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-remsim failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-remsim Last lines of build log: [ 158s] #define HAVE_MEMORY_H 1 [ 158s] #define HAVE_STRINGS_H 1 [ 158s] #define HAVE_INTTYPES_H 1 [ 158s] #define HAVE_STDINT_H 1 [ 158s] #define HAVE_UNISTD_H 1 [ 158s] #define HAVE_DLFCN_H 1 [ 158s] #define LT_OBJDIR ".libs/" [ 158s] #define PACKAGE "osmo-remsim" [ 158s] #define VERSION "0.1.0.8-8e04" [ 158s] #define HAVE_CSV_H 1 [ 158s] [ 158s] configure: exit 1 [ 158s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --with-systemdsystemunitdir=/lib/systemd/system returned exit code 1 [ 158s] debian/rules:15: recipe for target 'override_dh_auto_configure' failed [ 158s] make[1]: *** [override_dh_auto_configure] Error 2 [ 158s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 158s] debian/rules:12: recipe for target 'build' failed [ 158s] make: *** [build] Error 2 [ 158s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 158s] [ 158s] cloud124 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 08:13:01 UTC 2019. [ 158s] [ 158s] ### VM INTERACTION START ### [ 161s] [ 125.458788] sysrq: SysRq : Power Off [ 161s] [ 125.469234] reboot: Power down [ 163s] ### VM INTERACTION END ### [ 163s] [ 163s] cloud124 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 08:13:06 UTC 2019. [ 163s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Apr 3 08:13:26 2019 From: admin at opensuse.org (OBS Notification) Date: Wed, 03 Apr 2019 08:13:26 +0000 Subject: Build failure of network:osmocom:nightly/osmo-remsim in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5ca46b3374dc9_30de115c6002601d1@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-remsim/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-remsim failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-remsim Last lines of build log: [ 190s] #define HAVE_MEMORY_H 1 [ 190s] #define HAVE_STRINGS_H 1 [ 190s] #define HAVE_INTTYPES_H 1 [ 190s] #define HAVE_STDINT_H 1 [ 190s] #define HAVE_UNISTD_H 1 [ 190s] #define HAVE_DLFCN_H 1 [ 190s] #define LT_OBJDIR ".libs/" [ 190s] #define PACKAGE "osmo-remsim" [ 190s] #define VERSION "0.1.0.8-8e04" [ 190s] #define HAVE_CSV_H 1 [ 190s] [ 190s] configure: exit 1 [ 190s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --with-systemdsystemunitdir=/lib/systemd/system returned exit code 1 [ 190s] debian/rules:15: recipe for target 'override_dh_auto_configure' failed [ 190s] make[1]: *** [override_dh_auto_configure] Error 2 [ 190s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 190s] debian/rules:12: recipe for target 'build' failed [ 190s] make: *** [build] Error 2 [ 190s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 190s] [ 190s] cloud125 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 08:13:20 UTC 2019. [ 190s] [ 190s] ### VM INTERACTION START ### [ 193s] [ 160.863828] sysrq: SysRq : Power Off [ 193s] [ 160.871385] reboot: Power down [ 194s] ### VM INTERACTION END ### [ 194s] [ 194s] cloud125 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 08:13:25 UTC 2019. [ 194s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Wed Apr 3 09:06:14 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 3 Apr 2019 09:06:14 +0000 Subject: Change in libosmocore[master]: Add code coverage support In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13496 ) Change subject: Add code coverage support ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13496/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13496/1//COMMIT_MSG at 7 PS1, Line 7: Add code coverage support Would be great to have more verbose commit description, i.e. why do we need this and how would we benefit from such coverage. The OS#1987 already has quite good description, so it can be copy-pasted ;) -- To view, visit https://gerrit.osmocom.org/13496 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c Gerrit-Change-Number: 13496 Gerrit-PatchSet: 1 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 03 Apr 2019 09:06:14 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Wed Apr 3 09:30:17 2019 From: admin at opensuse.org (OBS Notification) Date: Wed, 03 Apr 2019 09:30:17 +0000 Subject: Build failure of network:osmocom:nightly/osmo-remsim in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5ca47d3d27e73_70a0bc85f451851@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-remsim/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-remsim failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-remsim Last lines of build log: [ 439s] #define HAVE_MEMORY_H 1 [ 439s] #define HAVE_STRINGS_H 1 [ 439s] #define HAVE_INTTYPES_H 1 [ 439s] #define HAVE_STDINT_H 1 [ 439s] #define HAVE_UNISTD_H 1 [ 439s] #define HAVE_DLFCN_H 1 [ 439s] #define LT_OBJDIR ".libs/" [ 439s] #define PACKAGE "osmo-remsim" [ 439s] #define VERSION "0.1.0.8-8e04" [ 439s] #define HAVE_CSV_H 1 [ 439s] [ 439s] configure: exit 1 [ 439s] dh_auto_configure: ./configure --build=arm-linux-gnueabihf --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/arm-linux-gnueabihf --libexecdir=${prefix}/lib/arm-linux-gnueabihf --disable-maintainer-mode --disable-dependency-tracking --with-systemdsystemunitdir=/lib/systemd/system returned exit code 1 [ 439s] debian/rules:15: recipe for target 'override_dh_auto_configure' failed [ 439s] make[1]: *** [override_dh_auto_configure] Error 2 [ 439s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 439s] debian/rules:12: recipe for target 'build' failed [ 439s] make: *** [build] Error 2 [ 439s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 439s] [ 439s] obs-arm-5 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 09:30:02 UTC 2019. [ 439s] [ 439s] ### VM INTERACTION START ### [ 442s] [ 410.164188] sysrq: SysRq : Power Off [ 442s] [ 410.169043] reboot: Power down [ 443s] ### VM INTERACTION END ### [ 443s] [ 443s] obs-arm-5 failed "build osmo-remsim_0.1.0.8.8e04.dsc" at Wed Apr 3 09:30:06 UTC 2019. [ 443s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Wed Apr 3 10:24:39 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 10:24:39 +0000 Subject: Change in osmo-ci[master]: osmocom-nightly-packages: build osmo-remsim In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13501 ) Change subject: osmocom-nightly-packages: build osmo-remsim ...................................................................... osmocom-nightly-packages: build osmo-remsim As of Change-Id Id5044b1835190edc948952d207a5196a18669eb1, osmo-remsim contains Debian packaging information and hence we can build it as part of our nightly feeds. We're not yet enabling 'latest' builds as we need to wait for the next libosmo-abis release for that (requires the IPA keepalive FSM). Change-Id: Ic367dc95f46cece4bd769061af860fd82b4bd2e9 --- M scripts/osmocom-latest-packages.sh M scripts/osmocom-nightly-packages.sh 2 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/01/13501/2 -- To view, visit https://gerrit.osmocom.org/13501 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic367dc95f46cece4bd769061af860fd82b4bd2e9 Gerrit-Change-Number: 13501 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 10:24:39 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 10:24:39 +0000 Subject: Change in osmo-ci[master]: osmocom-latest-packages: Enable osmo-sysmon In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13500 ) Change subject: osmocom-latest-packages: Enable osmo-sysmon ...................................................................... osmocom-latest-packages: Enable osmo-sysmon Since libosmocore 1.0.1 and libosmo-netif 0.4.0 are released, we can address the TOOD and build osmo-sysmon also in our latest feed. Change-Id: I48bd5aff2ae315b6f462facea70222eb2cdd2d58 --- M scripts/osmocom-latest-packages.sh 1 file changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/00/13500/2 -- To view, visit https://gerrit.osmocom.org/13500 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I48bd5aff2ae315b6f462facea70222eb2cdd2d58 Gerrit-Change-Number: 13500 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 10:25:38 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 10:25:38 +0000 Subject: Change in osmo-ci[master]: osmocom-nightly-packages: build osmo-remsim In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13501 ) Change subject: osmocom-nightly-packages: build osmo-remsim ...................................................................... Patch Set 2: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13501 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic367dc95f46cece4bd769061af860fd82b4bd2e9 Gerrit-Change-Number: 13501 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Wed, 03 Apr 2019 10:25:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 10:25:40 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 10:25:40 +0000 Subject: Change in osmo-ci[master]: osmocom-nightly-packages: build osmo-remsim In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13501 ) Change subject: osmocom-nightly-packages: build osmo-remsim ...................................................................... osmocom-nightly-packages: build osmo-remsim As of Change-Id Id5044b1835190edc948952d207a5196a18669eb1, osmo-remsim contains Debian packaging information and hence we can build it as part of our nightly feeds. We're not yet enabling 'latest' builds as we need to wait for the next libosmo-abis release for that (requires the IPA keepalive FSM). Change-Id: Ic367dc95f46cece4bd769061af860fd82b4bd2e9 --- M scripts/osmocom-latest-packages.sh M scripts/osmocom-nightly-packages.sh 2 files changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh index 0e4d655..d647d32 100755 --- a/scripts/osmocom-latest-packages.sh +++ b/scripts/osmocom-latest-packages.sh @@ -131,6 +131,8 @@ checkout libosmo-dsp # TODO: enable once release after libosmocore 1.0.1 and libosmo-netif 0.4.0 are available # checkout osmo-sysmon + # TODO: enable once libosmo-abis > 0.6.0 is available (IPA keepalive FSM) + # checkout osmo-remsim build limesuite --git-upstream-tree="$(get_last_tag limesuite)" build libosmocore @@ -158,6 +160,8 @@ build libosmo-dsp # TODO: enable once release after libosmocore 1.0.1 and libosmo-netif 0.4.0 are available # build osmo-sysmon + # TODO: enable once libosmo-abis > 0.6.0 is available (IPA keepalive FSM) + # build osmo-remsim cd "$TOP/$PROJ" osc ci -m "Latest Tagged versions of $DT" diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index ae6c1b5..7e1cede 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -185,6 +185,7 @@ checkout simtrace2 checkout libosmo-dsp checkout osmo-sysmon + checkout osmo-remsim create_osmo_trx_debian8_jessie @@ -217,6 +218,7 @@ build simtrace2 build libosmo-dsp build osmo-sysmon + build osmo-remsim download_bumpversion -- To view, visit https://gerrit.osmocom.org/13501 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic367dc95f46cece4bd769061af860fd82b4bd2e9 Gerrit-Change-Number: 13501 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 11:16:10 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 11:16:10 +0000 Subject: Change in osmo-remsim[master]: configure.ac: Add --disable-remsim-server Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13503 Change subject: configure.ac: Add --disable-remsim-server ...................................................................... configure.ac: Add --disable-remsim-server This allows builds on small/embedded platforms to avoid all the dependencies required by remsim-server, including ulfius, yder, etc. Closes: OS#3896 Change-Id: I2b1ec8a9a88b931ac56a63df88886e37c580a92b --- M configure.ac M src/Makefile.am 2 files changed, 14 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/03/13503/1 diff --git a/configure.ac b/configure.ac index 1d2ccc2..b369133 100644 --- a/configure.ac +++ b/configure.ac @@ -41,8 +41,16 @@ PKG_CHECK_MODULES(OSMOSIM, libosmosim) PKG_CHECK_MODULES(PCSC, libpcsclite) PKG_CHECK_MODULES(USB, libusb-1.0) -PKG_CHECK_MODULES(ULFIUS, libulfius) -PKG_CHECK_MODULES(JANSSON, jansson) + +AC_ARG_ENABLE([remsim-server],[AS_HELP_STRING([--disable-remsim-server], [Build osmo-remsim-server])], + [osmo_ac_build_server="$enableval"],[osmo_ac_build_server="yes"]) +if test "$osmo_ac_build_server" = "yes"; then + PKG_CHECK_MODULES(ULFIUS, libulfius) + PKG_CHECK_MODULES(JANSSON, jansson) + AC_DEFINE(BUILD_SERVER, 1, [Define if we want to build osmo-remsim-server]) +fi +AM_CONDITIONAL(BUILD_SERVER, test "x$osmo_ac_build_server" = "xyes") +AC_SUBST(BUILD_SERVER) AC_CONFIG_MACRO_DIR([m4]) diff --git a/src/Makefile.am b/src/Makefile.am index d671f37..5b6efb9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,7 @@ -SUBDIRS = rspro server +SUBDIRS = rspro +if BUILD_SERVER +SUBDIRS += server +endif AM_CFLAGS = -Wall -I$(top_srcdir)/include -I$(top_builddir)/include \ $(OSMOCORE_CFLAGS) $(OSMOGSM_CFLAGS) $(OSMOABIS_CFLAGS) \ -- To view, visit https://gerrit.osmocom.org/13503 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2b1ec8a9a88b931ac56a63df88886e37c580a92b Gerrit-Change-Number: 13503 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 11:16:10 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 11:16:10 +0000 Subject: Change in osmo-remsim[master]: configure.ac: Add --disable-remsim-bankd Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13504 Change subject: configure.ac: Add --disable-remsim-bankd ...................................................................... configure.ac: Add --disable-remsim-bankd This allows builds on small/embedded platforms to avoid all the dependencies required by remsim-bankd, including libpcsc-lite Change-Id: I29a1a0131fdfea6742ec12d81228879066b1ff7e --- M configure.ac M doc/Makefile.am R doc/examples/bankd_pcsc_slots.csv M src/Makefile.am A src/bankd/Makefile.am R src/bankd/bankd.h R src/bankd/bankd_main.c R src/bankd/bankd_pcsc.c R src/bankd/driver_core.c R src/bankd/driver_pcsc.c R src/bankd/internal.h R src/bankd/main.c 12 files changed, 41 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/04/13504/1 diff --git a/configure.ac b/configure.ac index b369133..e87c8c8 100644 --- a/configure.ac +++ b/configure.ac @@ -39,7 +39,6 @@ PKG_CHECK_MODULES(OSMOGSM, libosmogsm >= 0.11.0) PKG_CHECK_MODULES(OSMOABIS, libosmoabis) PKG_CHECK_MODULES(OSMOSIM, libosmosim) -PKG_CHECK_MODULES(PCSC, libpcsclite) PKG_CHECK_MODULES(USB, libusb-1.0) AC_ARG_ENABLE([remsim-server],[AS_HELP_STRING([--disable-remsim-server], [Build osmo-remsim-server])], @@ -52,6 +51,16 @@ AM_CONDITIONAL(BUILD_SERVER, test "x$osmo_ac_build_server" = "xyes") AC_SUBST(BUILD_SERVER) +AC_ARG_ENABLE([remsim-bankd],[AS_HELP_STRING([--disable-remsim-bankd], [Build osmo-remsim-bankd])], + [osmo_ac_build_bankd="$enableval"],[osmo_ac_build_bankd="yes"]) +if test "$osmo_ac_build_bankd" = "yes"; then + AC_DEFINE(BUILD_BANKD, 1, [Define if we want to build osmo-remsim-bankd]) +fi +AM_CONDITIONAL(BUILD_BANKD, test "x$osmo_ac_build_bankd" = "xyes") + PKG_CHECK_MODULES(PCSC, libpcsclite) +AC_SUBST(BUILD_BANKD) + + AC_CONFIG_MACRO_DIR([m4]) dnl checks for header files @@ -142,6 +151,7 @@ doc/manuals/Makefile src/Makefile src/rspro/Makefile + src/bankd/Makefile src/server/Makefile include/Makefile include/osmocom/Makefile diff --git a/doc/Makefile.am b/doc/Makefile.am index adfdcf7..dd4a573 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,3 +1,5 @@ SUBDIRS = \ manuals \ $(NULL) + +EXTRA_DIST = examples/bankd_pcsc_slots.csv diff --git a/src/bankd_pcsc_slots.csv b/doc/examples/bankd_pcsc_slots.csv similarity index 100% rename from src/bankd_pcsc_slots.csv rename to doc/examples/bankd_pcsc_slots.csv diff --git a/src/Makefile.am b/src/Makefile.am index 5b6efb9..165c3f7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,7 @@ SUBDIRS = rspro +if BUILD_BANKD +SUBDIRS += bankd +endif if BUILD_SERVER SUBDIRS += server endif @@ -15,7 +18,7 @@ rspro/libosmo-asn1-rspro.la libosmo_rspro_la_SOURCES = rspro_util.c asn1c_helpers.c -noinst_HEADERS = debug.h bankd.h client.h internal.h rspro_util.h slotmap.h rspro_client_fsm.h \ +noinst_HEADERS = debug.h client.h rspro_util.h slotmap.h rspro_client_fsm.h \ asn1c_helpers.h \ simtrace2/apdu_dispatch.h \ simtrace2/libusb_util.h \ @@ -23,16 +26,7 @@ simtrace2/simtrace_prot.h \ simtrace2/simtrace_usb.h -bin_PROGRAMS = osmo-remsim-bankd osmo-remsim-client-st2 -noinst_PROGRAMS = pcsc_test remsim-client - -pcsc_test_SOURCES = driver_core.c driver_pcsc.c main.c -pcsc_test_LDADD = $(OSMOCORE_LIBS) \ - $(PCSC_LIBS) libosmo-rspro.la - -osmo_remsim_bankd_SOURCES = slotmap.c bankd_main.c bankd_pcsc.c rspro_client_fsm.c debug.c -osmo_remsim_bankd_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ - $(PCSC_LIBS) libosmo-rspro.la -lcsv +bin_PROGRAMS = osmo-remsim-client-st2 remsim_client_SOURCES = remsim_client.c rspro_client_fsm.c bankd_client_fsm.c debug.c remsim_client_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ diff --git a/src/bankd/Makefile.am b/src/bankd/Makefile.am new file mode 100644 index 0000000..62ed581 --- /dev/null +++ b/src/bankd/Makefile.am @@ -0,0 +1,23 @@ +AM_CFLAGS = -Wall -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src \ + -I$(top_srcdir)/include/osmocom/rspro \ + $(OSMOCORE_CFLAGS) $(OSMOGSM_CFLAGS) $(OSMOABIS_CFLAGS) $(OSMOSIM_CFLAGS) \ + $(PCSC_CFLAGS) + +noinst_HEADERS = bankd.h internal.h + +bin_PROGRAMS = osmo-remsim-bankd +noinst_PROGRAMS = pcsc_test + +pcsc_test_SOURCES = driver_core.c driver_pcsc.c main.c +pcsc_test_LDADD = $(OSMOCORE_LIBS) \ + $(PCSC_LIBS) $(top_builddir)/src/libosmo-rspro.la + +osmo_remsim_bankd_SOURCES = ../slotmap.c ../rspro_client_fsm.c ../debug.c \ + bankd_main.c bankd_pcsc.c +osmo_remsim_bankd_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) $(OSMOSIM_LIBS) \ + $(PCSC_LIBS) $(top_builddir)/src/libosmo-rspro.la -lcsv + +# as suggested in http://lists.gnu.org/archive/html/automake/2009-03/msg00011.html +FORCE: +$(top_builddir)/src/libosmo-rspro.la: FORCE + (cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) libosmo-rspro.la) diff --git a/src/bankd.h b/src/bankd/bankd.h similarity index 100% rename from src/bankd.h rename to src/bankd/bankd.h diff --git a/src/bankd_main.c b/src/bankd/bankd_main.c similarity index 100% rename from src/bankd_main.c rename to src/bankd/bankd_main.c diff --git a/src/bankd_pcsc.c b/src/bankd/bankd_pcsc.c similarity index 100% rename from src/bankd_pcsc.c rename to src/bankd/bankd_pcsc.c diff --git a/src/driver_core.c b/src/bankd/driver_core.c similarity index 100% rename from src/driver_core.c rename to src/bankd/driver_core.c diff --git a/src/driver_pcsc.c b/src/bankd/driver_pcsc.c similarity index 100% rename from src/driver_pcsc.c rename to src/bankd/driver_pcsc.c diff --git a/src/internal.h b/src/bankd/internal.h similarity index 100% rename from src/internal.h rename to src/bankd/internal.h diff --git a/src/main.c b/src/bankd/main.c similarity index 100% rename from src/main.c rename to src/bankd/main.c -- To view, visit https://gerrit.osmocom.org/13504 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I29a1a0131fdfea6742ec12d81228879066b1ff7e Gerrit-Change-Number: 13504 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 11:16:10 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 11:16:10 +0000 Subject: Change in osmo-remsim[master]: update .gitignore Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13505 Change subject: update .gitignore ...................................................................... update .gitignore Change-Id: I3b58f79b65e552f835f10abedb287d87941d6f9e --- M .gitignore 1 file changed, 20 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/05/13505/1 diff --git a/.gitignore b/.gitignore index 2ec5f9f..00378bc 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ compile depcomp install-sh +libosmo-rspro.pc libtool ltmain.sh missing @@ -29,8 +30,22 @@ m4 gen_rspro.stamp -src/pcsc_test -src/remsim-bankd -src/remsim-client -src/simtrace2-remsim-client -src/server/remsim-server +src/osmo-remsim-client +src/osmo-remsim-client-st2 +src/bankd/pcsc_test +src/bankd/osmo-remsim-bankd +src/server/osmo-remsim-server + +contrib/deps +deps + +debian/tmp +debian/osmo-remsim-* +debian/libosmo-rspro0 +debian/libosmo-rspro-dev +debian/*.substvars +debian/*.debhelper.log +debian/autoreconf.* +debian/.debhelper +debian/debhelper* +debian/files -- To view, visit https://gerrit.osmocom.org/13505 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3b58f79b65e552f835f10abedb287d87941d6f9e Gerrit-Change-Number: 13505 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 12:29:15 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 12:29:15 +0000 Subject: Change in osmo-remsim[master]: configure.ac: Add --disable-remsim-server In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13503 ) Change subject: configure.ac: Add --disable-remsim-server ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13503 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2b1ec8a9a88b931ac56a63df88886e37c580a92b Gerrit-Change-Number: 13503 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 03 Apr 2019 12:29:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 12:29:17 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 12:29:17 +0000 Subject: Change in osmo-remsim[master]: configure.ac: Add --disable-remsim-bankd In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13504 ) Change subject: configure.ac: Add --disable-remsim-bankd ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13504 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I29a1a0131fdfea6742ec12d81228879066b1ff7e Gerrit-Change-Number: 13504 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 03 Apr 2019 12:29:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 12:29:20 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 12:29:20 +0000 Subject: Change in osmo-remsim[master]: update .gitignore In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13505 ) Change subject: update .gitignore ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13505 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3b58f79b65e552f835f10abedb287d87941d6f9e Gerrit-Change-Number: 13505 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 03 Apr 2019 12:29:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 12:29:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 12:29:21 +0000 Subject: Change in osmo-remsim[master]: configure.ac: Add --disable-remsim-server In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13503 ) Change subject: configure.ac: Add --disable-remsim-server ...................................................................... configure.ac: Add --disable-remsim-server This allows builds on small/embedded platforms to avoid all the dependencies required by remsim-server, including ulfius, yder, etc. Closes: OS#3896 Change-Id: I2b1ec8a9a88b931ac56a63df88886e37c580a92b --- M configure.ac M src/Makefile.am 2 files changed, 14 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/configure.ac b/configure.ac index 1d2ccc2..b369133 100644 --- a/configure.ac +++ b/configure.ac @@ -41,8 +41,16 @@ PKG_CHECK_MODULES(OSMOSIM, libosmosim) PKG_CHECK_MODULES(PCSC, libpcsclite) PKG_CHECK_MODULES(USB, libusb-1.0) -PKG_CHECK_MODULES(ULFIUS, libulfius) -PKG_CHECK_MODULES(JANSSON, jansson) + +AC_ARG_ENABLE([remsim-server],[AS_HELP_STRING([--disable-remsim-server], [Build osmo-remsim-server])], + [osmo_ac_build_server="$enableval"],[osmo_ac_build_server="yes"]) +if test "$osmo_ac_build_server" = "yes"; then + PKG_CHECK_MODULES(ULFIUS, libulfius) + PKG_CHECK_MODULES(JANSSON, jansson) + AC_DEFINE(BUILD_SERVER, 1, [Define if we want to build osmo-remsim-server]) +fi +AM_CONDITIONAL(BUILD_SERVER, test "x$osmo_ac_build_server" = "xyes") +AC_SUBST(BUILD_SERVER) AC_CONFIG_MACRO_DIR([m4]) diff --git a/src/Makefile.am b/src/Makefile.am index d671f37..5b6efb9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,7 @@ -SUBDIRS = rspro server +SUBDIRS = rspro +if BUILD_SERVER +SUBDIRS += server +endif AM_CFLAGS = -Wall -I$(top_srcdir)/include -I$(top_builddir)/include \ $(OSMOCORE_CFLAGS) $(OSMOGSM_CFLAGS) $(OSMOABIS_CFLAGS) \ -- To view, visit https://gerrit.osmocom.org/13503 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2b1ec8a9a88b931ac56a63df88886e37c580a92b Gerrit-Change-Number: 13503 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 12:29:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 12:29:21 +0000 Subject: Change in osmo-remsim[master]: configure.ac: Add --disable-remsim-bankd In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13504 ) Change subject: configure.ac: Add --disable-remsim-bankd ...................................................................... configure.ac: Add --disable-remsim-bankd This allows builds on small/embedded platforms to avoid all the dependencies required by remsim-bankd, including libpcsc-lite Change-Id: I29a1a0131fdfea6742ec12d81228879066b1ff7e --- M configure.ac M doc/Makefile.am R doc/examples/bankd_pcsc_slots.csv M src/Makefile.am A src/bankd/Makefile.am R src/bankd/bankd.h R src/bankd/bankd_main.c R src/bankd/bankd_pcsc.c R src/bankd/driver_core.c R src/bankd/driver_pcsc.c R src/bankd/internal.h R src/bankd/main.c 12 files changed, 41 insertions(+), 12 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/configure.ac b/configure.ac index b369133..e87c8c8 100644 --- a/configure.ac +++ b/configure.ac @@ -39,7 +39,6 @@ PKG_CHECK_MODULES(OSMOGSM, libosmogsm >= 0.11.0) PKG_CHECK_MODULES(OSMOABIS, libosmoabis) PKG_CHECK_MODULES(OSMOSIM, libosmosim) -PKG_CHECK_MODULES(PCSC, libpcsclite) PKG_CHECK_MODULES(USB, libusb-1.0) AC_ARG_ENABLE([remsim-server],[AS_HELP_STRING([--disable-remsim-server], [Build osmo-remsim-server])], @@ -52,6 +51,16 @@ AM_CONDITIONAL(BUILD_SERVER, test "x$osmo_ac_build_server" = "xyes") AC_SUBST(BUILD_SERVER) +AC_ARG_ENABLE([remsim-bankd],[AS_HELP_STRING([--disable-remsim-bankd], [Build osmo-remsim-bankd])], + [osmo_ac_build_bankd="$enableval"],[osmo_ac_build_bankd="yes"]) +if test "$osmo_ac_build_bankd" = "yes"; then + AC_DEFINE(BUILD_BANKD, 1, [Define if we want to build osmo-remsim-bankd]) +fi +AM_CONDITIONAL(BUILD_BANKD, test "x$osmo_ac_build_bankd" = "xyes") + PKG_CHECK_MODULES(PCSC, libpcsclite) +AC_SUBST(BUILD_BANKD) + + AC_CONFIG_MACRO_DIR([m4]) dnl checks for header files @@ -142,6 +151,7 @@ doc/manuals/Makefile src/Makefile src/rspro/Makefile + src/bankd/Makefile src/server/Makefile include/Makefile include/osmocom/Makefile diff --git a/doc/Makefile.am b/doc/Makefile.am index adfdcf7..dd4a573 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,3 +1,5 @@ SUBDIRS = \ manuals \ $(NULL) + +EXTRA_DIST = examples/bankd_pcsc_slots.csv diff --git a/src/bankd_pcsc_slots.csv b/doc/examples/bankd_pcsc_slots.csv similarity index 100% rename from src/bankd_pcsc_slots.csv rename to doc/examples/bankd_pcsc_slots.csv diff --git a/src/Makefile.am b/src/Makefile.am index 5b6efb9..165c3f7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,7 @@ SUBDIRS = rspro +if BUILD_BANKD +SUBDIRS += bankd +endif if BUILD_SERVER SUBDIRS += server endif @@ -15,7 +18,7 @@ rspro/libosmo-asn1-rspro.la libosmo_rspro_la_SOURCES = rspro_util.c asn1c_helpers.c -noinst_HEADERS = debug.h bankd.h client.h internal.h rspro_util.h slotmap.h rspro_client_fsm.h \ +noinst_HEADERS = debug.h client.h rspro_util.h slotmap.h rspro_client_fsm.h \ asn1c_helpers.h \ simtrace2/apdu_dispatch.h \ simtrace2/libusb_util.h \ @@ -23,16 +26,7 @@ simtrace2/simtrace_prot.h \ simtrace2/simtrace_usb.h -bin_PROGRAMS = osmo-remsim-bankd osmo-remsim-client-st2 -noinst_PROGRAMS = pcsc_test remsim-client - -pcsc_test_SOURCES = driver_core.c driver_pcsc.c main.c -pcsc_test_LDADD = $(OSMOCORE_LIBS) \ - $(PCSC_LIBS) libosmo-rspro.la - -osmo_remsim_bankd_SOURCES = slotmap.c bankd_main.c bankd_pcsc.c rspro_client_fsm.c debug.c -osmo_remsim_bankd_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ - $(PCSC_LIBS) libosmo-rspro.la -lcsv +bin_PROGRAMS = osmo-remsim-client-st2 remsim_client_SOURCES = remsim_client.c rspro_client_fsm.c bankd_client_fsm.c debug.c remsim_client_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ diff --git a/src/bankd/Makefile.am b/src/bankd/Makefile.am new file mode 100644 index 0000000..62ed581 --- /dev/null +++ b/src/bankd/Makefile.am @@ -0,0 +1,23 @@ +AM_CFLAGS = -Wall -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src \ + -I$(top_srcdir)/include/osmocom/rspro \ + $(OSMOCORE_CFLAGS) $(OSMOGSM_CFLAGS) $(OSMOABIS_CFLAGS) $(OSMOSIM_CFLAGS) \ + $(PCSC_CFLAGS) + +noinst_HEADERS = bankd.h internal.h + +bin_PROGRAMS = osmo-remsim-bankd +noinst_PROGRAMS = pcsc_test + +pcsc_test_SOURCES = driver_core.c driver_pcsc.c main.c +pcsc_test_LDADD = $(OSMOCORE_LIBS) \ + $(PCSC_LIBS) $(top_builddir)/src/libosmo-rspro.la + +osmo_remsim_bankd_SOURCES = ../slotmap.c ../rspro_client_fsm.c ../debug.c \ + bankd_main.c bankd_pcsc.c +osmo_remsim_bankd_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) $(OSMOSIM_LIBS) \ + $(PCSC_LIBS) $(top_builddir)/src/libosmo-rspro.la -lcsv + +# as suggested in http://lists.gnu.org/archive/html/automake/2009-03/msg00011.html +FORCE: +$(top_builddir)/src/libosmo-rspro.la: FORCE + (cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) libosmo-rspro.la) diff --git a/src/bankd.h b/src/bankd/bankd.h similarity index 100% rename from src/bankd.h rename to src/bankd/bankd.h diff --git a/src/bankd_main.c b/src/bankd/bankd_main.c similarity index 100% rename from src/bankd_main.c rename to src/bankd/bankd_main.c diff --git a/src/bankd_pcsc.c b/src/bankd/bankd_pcsc.c similarity index 100% rename from src/bankd_pcsc.c rename to src/bankd/bankd_pcsc.c diff --git a/src/driver_core.c b/src/bankd/driver_core.c similarity index 100% rename from src/driver_core.c rename to src/bankd/driver_core.c diff --git a/src/driver_pcsc.c b/src/bankd/driver_pcsc.c similarity index 100% rename from src/driver_pcsc.c rename to src/bankd/driver_pcsc.c diff --git a/src/internal.h b/src/bankd/internal.h similarity index 100% rename from src/internal.h rename to src/bankd/internal.h diff --git a/src/main.c b/src/bankd/main.c similarity index 100% rename from src/main.c rename to src/bankd/main.c -- To view, visit https://gerrit.osmocom.org/13504 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I29a1a0131fdfea6742ec12d81228879066b1ff7e Gerrit-Change-Number: 13504 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 12:29:22 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 12:29:22 +0000 Subject: Change in osmo-remsim[master]: update .gitignore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13505 ) Change subject: update .gitignore ...................................................................... update .gitignore Change-Id: I3b58f79b65e552f835f10abedb287d87941d6f9e --- M .gitignore 1 file changed, 20 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/.gitignore b/.gitignore index 2ec5f9f..00378bc 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ compile depcomp install-sh +libosmo-rspro.pc libtool ltmain.sh missing @@ -29,8 +30,22 @@ m4 gen_rspro.stamp -src/pcsc_test -src/remsim-bankd -src/remsim-client -src/simtrace2-remsim-client -src/server/remsim-server +src/osmo-remsim-client +src/osmo-remsim-client-st2 +src/bankd/pcsc_test +src/bankd/osmo-remsim-bankd +src/server/osmo-remsim-server + +contrib/deps +deps + +debian/tmp +debian/osmo-remsim-* +debian/libosmo-rspro0 +debian/libosmo-rspro-dev +debian/*.substvars +debian/*.debhelper.log +debian/autoreconf.* +debian/.debhelper +debian/debhelper* +debian/files -- To view, visit https://gerrit.osmocom.org/13505 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3b58f79b65e552f835f10abedb287d87941d6f9e Gerrit-Change-Number: 13505 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 12:34:16 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 12:34:16 +0000 Subject: Change in libosmocore[master]: Add code coverage support In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13496 ) Change subject: Add code coverage support ...................................................................... Patch Set 1: Code-Review+2 (2 comments) https://gerrit.osmocom.org/#/c/13496/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13496/1//COMMIT_MSG at 7 PS1, Line 7: Add code coverage support > Would be great to have more verbose commit description, i.e. [?] I guess everyone knows what "coverage" means in terms of software development/testing. So I'm not sure if a more detailed description is useful. https://gerrit.osmocom.org/#/c/13496/1//COMMIT_MSG at 10 PS1, Line 10: the resulting HTML report would be great to specify where that report is placed (path/filename). -- To view, visit https://gerrit.osmocom.org/13496 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c Gerrit-Change-Number: 13496 Gerrit-PatchSet: 1 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 03 Apr 2019 12:34:16 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 13:15:19 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Wed, 3 Apr 2019 13:15:19 +0000 Subject: Change in libosmo-sccp[master]: Cosmetic: sccp_scoc: fix local reference comments Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13506 Change subject: Cosmetic: sccp_scoc: fix local reference comments ...................................................................... Cosmetic: sccp_scoc: fix local reference comments Remove all comments, that claim conn_id is the local reference. This is only a hack, and should not be something to rely on. A properly separated local reference will be introduced shortly. Related: OS#3871 Change-Id: I900124037da76caaaf5ecee323eb82e1c6d2e368 --- M src/sccp_internal.h M src/sccp_scoc.c 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/06/13506/1 diff --git a/src/sccp_internal.h b/src/sccp_internal.h index 000f0f7..ad8a6fd 100644 --- a/src/sccp_internal.h +++ b/src/sccp_internal.h @@ -47,7 +47,7 @@ struct llist_head users; /* routing context to be used in all outbound messages */ uint32_t route_ctx; - /* next local reference to allocate */ + /* next connection ID to allocate */ uint32_t next_id; struct osmo_ss7_instance *ss7; void *priv; diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index e58251f..726426c 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -458,7 +458,7 @@ #define INIT_TIMER(x, fn, priv) do { (x)->cb = fn; (x)->data = priv; } while (0) -/* allocate + init a SCCP Connection with given ID (local reference) */ +/* allocate + init a SCCP Connection with given ID */ static struct sccp_connection *conn_create_id(struct osmo_sccp_instance *inst, uint32_t conn_id) { @@ -480,7 +480,7 @@ /* this might change at runtime, as it is not a constant :/ */ sccp_scoc_fsm.log_subsys = DLSCCP; - /* we simply use the local reference as FSM instance name */ + /* we simply use the connection ID as FSM instance name */ snprintf(name, sizeof(name), "%u", conn->conn_id); conn->fi = osmo_fsm_inst_alloc(&sccp_scoc_fsm, conn, conn, LOGL_DEBUG, name); @@ -493,7 +493,7 @@ return conn; } -/* Search for next free connection ID (local reference) and allocate conn */ +/* Search for next free connection ID and allocate conn */ static struct sccp_connection *conn_create(struct osmo_sccp_instance *inst) { uint32_t conn_id; -- To view, visit https://gerrit.osmocom.org/13506 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I900124037da76caaaf5ecee323eb82e1c6d2e368 Gerrit-Change-Number: 13506 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 13:15:20 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Wed, 3 Apr 2019 13:15:20 +0000 Subject: Change in libosmo-sccp[master]: sccp_scoc: move sccp_find_user() up Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13507 Change subject: sccp_scoc: move sccp_find_user() up ...................................................................... sccp_scoc: move sccp_find_user() up Move it before sccp_scoc_rx_scrc_rout_fail(), so it can be used in the latter function to figure out the local_ref from the user (follow up commit). Related: OS#3871 Change-Id: Ieabeda3126dcc0349a06c0fc7c9e468b900d7855 --- M src/sccp_scoc.c 1 file changed, 25 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/07/13507/1 diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index 726426c..82590a0 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1329,6 +1329,31 @@ return xua; } +/* Find a SCCP user for given SUA message (based on SUA_IEI_DEST_ADDR */ +static struct osmo_sccp_user *sccp_find_user(struct osmo_sccp_instance *inst, + struct xua_msg *xua) +{ + int rc; + struct osmo_sccp_addr called_addr; + + rc = sua_addr_parse(&called_addr, xua, SUA_IEI_DEST_ADDR); + if (rc < 0) { + LOGP(DLSCCP, LOGL_ERROR, "Cannot find SCCP User for XUA " + "Message %s without valid DEST_ADDR\n", + xua_hdr_dump(xua, &xua_dialect_sua)); + return NULL; + } + + if (!(called_addr.presence & OSMO_SCCP_ADDR_T_SSN)) { + LOGP(DLSCCP, LOGL_ERROR, "Cannot resolve SCCP User for " + "XUA Message %s without SSN in CalledAddr\n", + xua_hdr_dump(xua, &xua_dialect_sua)); + return NULL; + } + + return sccp_user_find(inst, called_addr.ssn, called_addr.pc); +} + /*! \brief SCOC: Receive SCRC Routing Failure * \param[in] inst SCCP Instance on which we operate * \param[in] xua SUA message that was failed to route @@ -1355,31 +1380,6 @@ } } -/* Find a SCCP user for given SUA message (based on SUA_IEI_DEST_ADDR */ -static struct osmo_sccp_user *sccp_find_user(struct osmo_sccp_instance *inst, - struct xua_msg *xua) -{ - int rc; - struct osmo_sccp_addr called_addr; - - rc = sua_addr_parse(&called_addr, xua, SUA_IEI_DEST_ADDR); - if (rc < 0) { - LOGP(DLSCCP, LOGL_ERROR, "Cannot find SCCP User for XUA " - "Message %s without valid DEST_ADDR\n", - xua_hdr_dump(xua, &xua_dialect_sua)); - return NULL; - } - - if (!(called_addr.presence & OSMO_SCCP_ADDR_T_SSN)) { - LOGP(DLSCCP, LOGL_ERROR, "Cannot resolve SCCP User for " - "XUA Message %s without SSN in CalledAddr\n", - xua_hdr_dump(xua, &xua_dialect_sua)); - return NULL; - } - - return sccp_user_find(inst, called_addr.ssn, called_addr.pc); -} - /* Generate a COERR based in input arguments */ static struct xua_msg *gen_coerr(uint32_t route_ctx, uint32_t dest_ref, uint32_t err_cause) -- To view, visit https://gerrit.osmocom.org/13507 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ieabeda3126dcc0349a06c0fc7c9e468b900d7855 Gerrit-Change-Number: 13507 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 13:15:20 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Wed, 3 Apr 2019 13:15:20 +0000 Subject: Change in libosmo-sccp[master]: sccp_scoc: add user arg to conn_create{, _id}() Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13508 Change subject: sccp_scoc: add user arg to conn_create{,_id}() ...................................................................... sccp_scoc: add user arg to conn_create{,_id}() Add the argument instead of calling conn_create() and setting conn->user afterwards. Prepare for generating a local_ref inside conn_create_id() in the future. Related: OS#3871 Change-Id: I2fb47c8ba6c0ce7cd92c9ac31f15c67eb67fb66e --- M src/sccp_scoc.c 1 file changed, 6 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/08/13508/1 diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index 82590a0..a916e58 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -459,7 +459,7 @@ #define INIT_TIMER(x, fn, priv) do { (x)->cb = fn; (x)->data = priv; } while (0) /* allocate + init a SCCP Connection with given ID */ -static struct sccp_connection *conn_create_id(struct osmo_sccp_instance *inst, +static struct sccp_connection *conn_create_id(struct osmo_sccp_instance *inst, struct osmo_sccp_user *user, uint32_t conn_id) { struct sccp_connection *conn = talloc_zero(inst, struct sccp_connection); @@ -490,11 +490,12 @@ return NULL; } + conn->user = user; return conn; } /* Search for next free connection ID and allocate conn */ -static struct sccp_connection *conn_create(struct osmo_sccp_instance *inst) +static struct sccp_connection *conn_create(struct osmo_sccp_instance *inst, struct osmo_sccp_user *user) { uint32_t conn_id; @@ -502,7 +503,7 @@ conn_id = inst->next_id++; } while (conn_find_by_id(inst, conn_id)); - return conn_create_id(inst, conn_id); + return conn_create_id(inst, user, conn_id); } /* destroy a SCCP connection state, releasing all timers, terminating @@ -1623,8 +1624,7 @@ return; } /* Allocate new connection */ - conn = conn_create(inst); - conn->user = scu; + conn = conn_create(inst, scu); conn->incoming = true; } else { uint32_t conn_id; @@ -1718,14 +1718,13 @@ return sccp_sclc_user_sap_down(scu, oph); case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_REQUEST): /* Allocate new connection structure */ - conn = conn_create_id(inst, prim->u.connect.conn_id); + conn = conn_create_id(inst, scu, prim->u.connect.conn_id); if (!conn) { /* FIXME: inform SCCP user with proper reply */ LOGP(DLSCCP, LOGL_ERROR, "Cannot create conn-id for primitive %s\n", osmo_scu_prim_name(&prim->oph)); goto out; } - conn->user = scu; break; case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_RESPONSE): case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_REQUEST): -- To view, visit https://gerrit.osmocom.org/13508 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2fb47c8ba6c0ce7cd92c9ac31f15c67eb67fb66e Gerrit-Change-Number: 13508 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 13:21:46 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Wed, 3 Apr 2019 13:21:46 +0000 Subject: Change in libosmo-sccp[master]: sccp_scoc: add user arg to conn_create{, _id}() In-Reply-To: References: Message-ID: osmith has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13508 ) Change subject: sccp_scoc: add user arg to conn_create{,_id}() ...................................................................... sccp_scoc: add user arg to conn_create{,_id}() Add the argument instead of calling conn_create() and setting conn->user afterwards. Prepare for generating a local_ref inside conn_create_id() in the future. Related: OS#3871 Change-Id: I2fb47c8ba6c0ce7cd92c9ac31f15c67eb67fb66e --- M src/sccp_scoc.c 1 file changed, 6 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/08/13508/2 -- To view, visit https://gerrit.osmocom.org/13508 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2fb47c8ba6c0ce7cd92c9ac31f15c67eb67fb66e Gerrit-Change-Number: 13508 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-CC: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 14:15:18 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 3 Apr 2019 14:15:18 +0000 Subject: Change in osmo-ci[master]: jenkins-slave: Use "jessie-backports" only on jessie systems In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13502 ) Change subject: jenkins-slave: Use "jessie-backports" only on jessie systems ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13502 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id62c03b9759367bd5bbe20144e9ad7048d12e61b Gerrit-Change-Number: 13502 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 03 Apr 2019 14:15:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 14:18:10 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 3 Apr 2019 14:18:10 +0000 Subject: Change in libosmo-sccp[master]: Cosmetic: sccp_scoc: fix local reference comments In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13506 ) Change subject: Cosmetic: sccp_scoc: fix local reference comments ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13506 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I900124037da76caaaf5ecee323eb82e1c6d2e368 Gerrit-Change-Number: 13506 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 03 Apr 2019 14:18:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 14:48:11 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 14:48:11 +0000 Subject: Change in libosmo-sccp[master]: Cosmetic: sccp_scoc: fix local reference comments In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13506 ) Change subject: Cosmetic: sccp_scoc: fix local reference comments ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13506 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I900124037da76caaaf5ecee323eb82e1c6d2e368 Gerrit-Change-Number: 13506 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 03 Apr 2019 14:48:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 14:48:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 14:48:12 +0000 Subject: Change in libosmo-sccp[master]: Cosmetic: sccp_scoc: fix local reference comments In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13506 ) Change subject: Cosmetic: sccp_scoc: fix local reference comments ...................................................................... Cosmetic: sccp_scoc: fix local reference comments Remove all comments, that claim conn_id is the local reference. This is only a hack, and should not be something to rely on. A properly separated local reference will be introduced shortly. Related: OS#3871 Change-Id: I900124037da76caaaf5ecee323eb82e1c6d2e368 --- M src/sccp_internal.h M src/sccp_scoc.c 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/sccp_internal.h b/src/sccp_internal.h index 000f0f7..ad8a6fd 100644 --- a/src/sccp_internal.h +++ b/src/sccp_internal.h @@ -47,7 +47,7 @@ struct llist_head users; /* routing context to be used in all outbound messages */ uint32_t route_ctx; - /* next local reference to allocate */ + /* next connection ID to allocate */ uint32_t next_id; struct osmo_ss7_instance *ss7; void *priv; diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index e58251f..726426c 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -458,7 +458,7 @@ #define INIT_TIMER(x, fn, priv) do { (x)->cb = fn; (x)->data = priv; } while (0) -/* allocate + init a SCCP Connection with given ID (local reference) */ +/* allocate + init a SCCP Connection with given ID */ static struct sccp_connection *conn_create_id(struct osmo_sccp_instance *inst, uint32_t conn_id) { @@ -480,7 +480,7 @@ /* this might change at runtime, as it is not a constant :/ */ sccp_scoc_fsm.log_subsys = DLSCCP; - /* we simply use the local reference as FSM instance name */ + /* we simply use the connection ID as FSM instance name */ snprintf(name, sizeof(name), "%u", conn->conn_id); conn->fi = osmo_fsm_inst_alloc(&sccp_scoc_fsm, conn, conn, LOGL_DEBUG, name); @@ -493,7 +493,7 @@ return conn; } -/* Search for next free connection ID (local reference) and allocate conn */ +/* Search for next free connection ID and allocate conn */ static struct sccp_connection *conn_create(struct osmo_sccp_instance *inst) { uint32_t conn_id; -- To view, visit https://gerrit.osmocom.org/13506 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I900124037da76caaaf5ecee323eb82e1c6d2e368 Gerrit-Change-Number: 13506 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 14:48:25 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 14:48:25 +0000 Subject: Change in libosmo-sccp[master]: sccp_scoc: move sccp_find_user() up In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13507 ) Change subject: sccp_scoc: move sccp_find_user() up ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13507 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieabeda3126dcc0349a06c0fc7c9e468b900d7855 Gerrit-Change-Number: 13507 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 03 Apr 2019 14:48:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 14:49:09 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 14:49:09 +0000 Subject: Change in libosmo-sccp[master]: sccp_scoc: add user arg to conn_create{, _id}() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13508 ) Change subject: sccp_scoc: add user arg to conn_create{,_id}() ...................................................................... Patch Set 2: I think the 'user' has a back-pointer to the instance, so you can basically replace the 'instance' pointer with the 'user' pointer to make the API easier to use. -- To view, visit https://gerrit.osmocom.org/13508 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2fb47c8ba6c0ce7cd92c9ac31f15c67eb67fb66e Gerrit-Change-Number: 13508 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 03 Apr 2019 14:49:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 15:11:25 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 3 Apr 2019 15:11:25 +0000 Subject: Change in osmo-gsm-tester[master]: process: add signal to NetNSProcess kill path Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13509 Change subject: process: add signal to NetNSProcess kill path ...................................................................... process: add signal to NetNSProcess kill path This allows to easily differentiate different calls to kill in order to terminate the process when looking at the logs. Change-Id: Ida88f2674b0ed1802f20c519aa4e3cbe81e0def8 --- M src/osmo_gsm_tester/process.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/09/13509/1 diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index a104e10..7ecb67e 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -364,7 +364,7 @@ # This function is overwritten from Process. def send_signal(self, sig): kill_cmd = ('kill', '-%d' % int(sig), str(self.process_obj.pid)) - run_local_netns_sync(self.run_dir, self.name()+"-kill", self.netns, kill_cmd) + run_local_netns_sync(self.run_dir, self.name()+"-kill"+str(sig), self.netns, kill_cmd) def run_local_sync(run_dir, name, popen_args): -- To view, visit https://gerrit.osmocom.org/13509 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ida88f2674b0ed1802f20c519aa4e3cbe81e0def8 Gerrit-Change-Number: 13509 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 15:25:04 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 15:25:04 +0000 Subject: Change in osmo-remsim[master]: README.md: add 'osmo-' prefix to remsim-{server, bankd, client} Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13510 Change subject: README.md: add 'osmo-' prefix to remsim-{server,bankd,client} ...................................................................... README.md: add 'osmo-' prefix to remsim-{server,bankd,client} Change-Id: I42df660d8c7f696a12118d4e4c38f7ee9e48d2e8 --- M README.md 1 file changed, 21 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/10/13510/1 diff --git a/README.md b/README.md index 8808338..8f2657f 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,23 @@ This software suite is a work in progress. -remsim-client -------------- +osmo-remsim-client +------------------ The client interfaces with GSM phones / modems via dedicated "Card Emulation" devices such as the Osmocom SIMtrace2 or sysmocom sysmoQMOD board + firmware. This hardware implements the ISO7816-3 electrical interface and protocol handling and passes any TPDU headers received -from the phone/modem to remsim-client for further processing of the +from the phone/modem to osmo-remsim-client for further processing of the TPDUs associated to the given APDU transfer. -remsim-client connects via a RSPRO control connection to remsim-server -at startup and registers itself. It will receive configuration data -such as the remsim-bankd IP+Port and the ClientId from remsim-server. +osmo-remsim-client connects via a RSPRO control connection to +osmo-remsim-server at startup and registers itself. It will receive +configuration data such as the osmo-remsim-bankd IP+Port and the +ClientId from osmo-remsim-server. -After receiving the configuration, remsim-client will establish a RSPRO -data connection to the remsim-bankd IP:Port. +After receiving the configuration, osmo-remsim-client will establish a +RSPRO data connection to the osmo-remsim-bankd IP:Port. As the USB interface for remote SIM in simtrace2.git uses one interface per slot, we can implement the client in blocking mode, i.e. use @@ -27,22 +28,22 @@ to a more complex async implementation. -remsim-bankd ------------- +osmo-remsim-bankd +----------------- -The remsim-bankd (SIM Bank Daemon) manages one given SIM bank. The +The osmo-remsim-bankd (SIM Bank Daemon) manages one given SIM bank. The initial implementation supports a PC/SC driver to expose any PC/SC compatible card readers as SIM bank. -remsim-bankd initially connects via a RSPRO control connection to -remsim-server at startup, and will in turn receive a set of initial +osmo-remsim-bankd initially connects via a RSPRO control connection to +osmo-remsim-server at startup, and will in turn receive a set of initial [client,slot]:[bankd,slot] mappings. These mappings determine which slot on the client (corresponding to a modem) is mapped to which slot on -the SIM bank. Mappings can be updated by remsim-server at any given +the SIM bank. Mappings can be updated by osmo-remsim-server at any given point in time. -remsim-bankd implements a RSPRO server, where it listens to connections -from remsim-clients. +osmo-remsim-bankd implements a RSPRO server, where it listens to +connections from osmo-remsim-clients. As PC/SC only offers a blocking API, there is one thread per PC/SC slot. This thread will perform blocking I/O on the socket towards the client, @@ -62,10 +63,10 @@ client has identified itself. The advantage is that the entire bankd can live without any non-blocking I/O. -The main thread handles the connection to remsim-server, where it can -also use non-blocking I/O. However, re-connection would be required, to -avoid stalling all banks/cards in the event of a connection loss to the -server. +The main thread handles the connection to osmo-remsim-server, where it +can also use non-blocking I/O. However, re-connection would be +required, to avoid stalling all banks/cards in the event of a connection +loss to the server. worker threads have the following states: * INIT (just started) -- To view, visit https://gerrit.osmocom.org/13510 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I42df660d8c7f696a12118d4e4c38f7ee9e48d2e8 Gerrit-Change-Number: 13510 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 15:25:31 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 15:25:31 +0000 Subject: Change in osmo-ci[master]: jenkins-slave: Use "jessie-backports" only on jessie systems In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13502 ) Change subject: jenkins-slave: Use "jessie-backports" only on jessie systems ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/13502 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id62c03b9759367bd5bbe20144e9ad7048d12e61b Gerrit-Change-Number: 13502 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 03 Apr 2019 15:25:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 15:25:32 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 15:25:32 +0000 Subject: Change in osmo-ci[master]: jenkins-slave: Use "jessie-backports" only on jessie systems In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13502 ) Change subject: jenkins-slave: Use "jessie-backports" only on jessie systems ...................................................................... jenkins-slave: Use "jessie-backports" only on jessie systems Change-Id: Id62c03b9759367bd5bbe20144e9ad7048d12e61b --- M ansible/roles/osmocom-jenkins-slave/tasks/debian.yml 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Harald Welte: Verified diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml index 30e4ece..641c6f3 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml @@ -22,6 +22,7 @@ repo: 'deb http://ftp.debian.org/debian jessie-backports main' filename: 'backports' update_cache: yes + when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie' - name: install java for jessie apt: -- To view, visit https://gerrit.osmocom.org/13502 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id62c03b9759367bd5bbe20144e9ad7048d12e61b Gerrit-Change-Number: 13502 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 15:25:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 15:25:57 +0000 Subject: Change in osmo-ci[master]: ansible: osmo-gsm-tester: Make modem net ifaces persistent In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13495 ) Change subject: ansible: osmo-gsm-tester: Make modem net ifaces persistent ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13495 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic3ef75285aa84f9aa606562cd2f6166de186c1a6 Gerrit-Change-Number: 13495 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Wed, 03 Apr 2019 15:25:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 15:26:17 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 15:26:17 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: add function to check if a subscriber is in VLR In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13491 ) Change subject: MSC_Tests: add function to check if a subscriber is in VLR ...................................................................... MSC_Tests: add function to check if a subscriber is in VLR The control interface of osmo-msc is able to return a list with all active subscribers from the VLR. Lets add a function, so that we can check from TTCN3 if a specified subscriber is known by the VLR or not. Change-Id: I7661ae55afe34795c3701d59795331b32d64c988 Related: OS#3614 --- M msc/MSC_Tests.ttcn 1 file changed, 17 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 6b2b259..a15fa57 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -63,6 +63,8 @@ import from USSD_Helpers all; import from DNS_Helpers all; +import from TCCConversion_Functions all; + const integer NUM_BSC := 2; type record of BSSAP_Configuration BSSAP_Configurations; @@ -3540,6 +3542,21 @@ * too long / short TLV values */ +/* Check if a subscriber exists in the VLR */ +private function f_ctrl_subscr_in_vlr(charstring imsi_or_msisdn) runs on BSC_ConnHdlr return boolean { + + var CtrlValue active_subsribers; + var integer rc; + active_subsribers := f_ctrl_get(IPA_CTRL, "subscriber-list-active-v1"); + + rc := f_strstr(active_subsribers, imsi_or_msisdn); + if (rc < 0) { + return false; + } + + return true; +} + /* Perform a location updatye at the A-Interface and run some checks to confirm * that everything is back to normal. */ private function f_sgsap_bssmap_screening() runs on BSC_ConnHdlr { -- To view, visit https://gerrit.osmocom.org/13491 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7661ae55afe34795c3701d59795331b32d64c988 Gerrit-Change-Number: 13491 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 15:26:17 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 15:26:17 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: add testcase TC_sgsap_impl_imsi_det_noneps In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13351 ) Change subject: MSC_Tests: add testcase TC_sgsap_impl_imsi_det_noneps ...................................................................... MSC_Tests: add testcase TC_sgsap_impl_imsi_det_noneps We have a testcase that sends an explicit (UE-Initiated) imsi detach from non EPS services. Lets also cover the case for an implicit (Network-initated) detach. Change-Id: I76049e6717680c54c18f97b7cd51944901a81ae7 Related: OS#3614 --- M msc/MSC_Tests.ttcn M msc/expected-results.xml 2 files changed, 29 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index a15fa57..ca633dc 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -3854,6 +3854,33 @@ vc_conn.done; } +private function f_tc_sgsap_impl_imsi_det_noneps(charstring id, BSC_ConnHdlrPars pars) +runs on BSC_ConnHdlr { + f_init_handler(pars); + f_sgs_perform_lu(); + f_sleep(3.0); + + var octetstring mme_name := f_enc_dns_hostname(mp_mme_name); + SGsAP.send(ts_SGsAP_IMSI_DETACH_IND(g_pars.imsi, mme_name, implicit_network_initiated)); + SGsAP.receive(tr_SGsAP_IMSI_DETACH_ACK(g_pars.imsi)); + + if (f_ctrl_subscr_in_vlr(hex2str(g_pars.imsi))) { + setverdict(fail, "subscriber not removed from VLR"); + } + + f_sgsap_bssmap_screening(); + + setverdict(pass); +} +testcase TC_sgsap_impl_imsi_det_noneps() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(1, true); + pars := f_init_pars(11815, true); + vc_conn := f_start_handler_with_pars(refers(f_tc_sgsap_impl_imsi_det_noneps), pars); + vc_conn.done; +} + /* Trigger a paging request via VTY and send a paging reject in response */ private function f_tc_sgsap_paging_rej(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -4649,6 +4676,7 @@ execute( TC_sgsap_lu_and_nothing() ); execute( TC_sgsap_expl_imsi_det_eps() ); execute( TC_sgsap_expl_imsi_det_noneps() ); + execute( TC_sgsap_impl_imsi_det_noneps() ); execute( TC_sgsap_paging_rej() ); execute( TC_sgsap_paging_subscr_rej() ); execute( TC_sgsap_paging_ue_unr() ); diff --git a/msc/expected-results.xml b/msc/expected-results.xml index 86e8a89..e829493 100644 --- a/msc/expected-results.xml +++ b/msc/expected-results.xml @@ -75,6 +75,7 @@ + -- To view, visit https://gerrit.osmocom.org/13351 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I76049e6717680c54c18f97b7cd51944901a81ae7 Gerrit-Change-Number: 13351 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 15:26:18 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 15:26:18 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: add testcase TC_sgsap_impl_imsi_det_eps In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13352 ) Change subject: MSC_Tests: add testcase TC_sgsap_impl_imsi_det_eps ...................................................................... MSC_Tests: add testcase TC_sgsap_impl_imsi_det_eps We have a testcase that sends an explicit (UE-Initiated) imsi detach from EPS services. Lets also cover the case for an implicit (Network-initated) detach. Change-Id: I63ebc32ae457dd74214d4abee4f511cde28de4a7 Related: OS#3614 --- M msc/MSC_Tests.ttcn M msc/expected-results.xml 2 files changed, 26 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index ca633dc..3b9ea40 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -3829,6 +3829,30 @@ vc_conn.done; } +private function f_tc_sgsap_impl_imsi_det_eps(charstring id, BSC_ConnHdlrPars pars) +runs on BSC_ConnHdlr { + f_init_handler(pars); + f_sgs_perform_lu(); + f_sleep(3.0); + + var octetstring mme_name := f_enc_dns_hostname(mp_mme_name); + SGsAP.send(ts_SGsAP_EPS_DETACH_IND(g_pars.imsi, mme_name, network_initiated)); + SGsAP.receive(tr_SGsAP_EPS_DETACH_ACK(g_pars.imsi)); + f_ctrl_get_exp(IPA_CTRL, "fsm.SGs-UE.id.imsi:" & hex2str(g_pars.imsi) & ".state", "SGs-NULL"); + + f_sgsap_bssmap_screening(); + + setverdict(pass); +} +testcase TC_sgsap_impl_imsi_det_eps() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(1, true); + pars := f_init_pars(11814, true); + vc_conn := f_start_handler_with_pars(refers(f_tc_sgsap_impl_imsi_det_eps), pars); + vc_conn.done; +} + private function f_tc_sgsap_expl_imsi_det_noneps(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); @@ -4675,6 +4699,7 @@ execute( TC_sgsap_lu_imsi_reject() ); execute( TC_sgsap_lu_and_nothing() ); execute( TC_sgsap_expl_imsi_det_eps() ); + execute( TC_sgsap_impl_imsi_det_eps() ); execute( TC_sgsap_expl_imsi_det_noneps() ); execute( TC_sgsap_impl_imsi_det_noneps() ); execute( TC_sgsap_paging_rej() ); diff --git a/msc/expected-results.xml b/msc/expected-results.xml index e829493..2c0083c 100644 --- a/msc/expected-results.xml +++ b/msc/expected-results.xml @@ -74,6 +74,7 @@ + -- To view, visit https://gerrit.osmocom.org/13352 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I63ebc32ae457dd74214d4abee4f511cde28de4a7 Gerrit-Change-Number: 13352 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 15:26:18 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 15:26:18 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: fix TC_sgsap_expl_imsi_det_noneps In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13492 ) Change subject: MSC_Tests: fix TC_sgsap_expl_imsi_det_noneps ...................................................................... MSC_Tests: fix TC_sgsap_expl_imsi_det_noneps When a subscriber is detached from non eps services, it gets fully detached from 2G, which means that the VLR is supposed to remove the subscriber. Lets check if the subscriber is in deed no longer known by the VLR. Change-Id: I2ec3f548dfcf5a9b99f10214a8bfd0c6978e253b Related: OS#3614 --- M msc/MSC_Tests.ttcn 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 3b9ea40..c7c61eb 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -3862,8 +3862,10 @@ var octetstring mme_name := f_enc_dns_hostname(mp_mme_name); SGsAP.send(ts_SGsAP_IMSI_DETACH_IND(g_pars.imsi, mme_name, combined_UE_initiated)); SGsAP.receive(tr_SGsAP_IMSI_DETACH_ACK(g_pars.imsi)); - f_ctrl_get_exp(IPA_CTRL, "fsm.SGs-UE.id.imsi:" & hex2str(g_pars.imsi) & ".state", "SGs-NULL"); - /* FIXME: How to verify that VLR has removed MM context? */ + + if (f_ctrl_subscr_in_vlr(hex2str(g_pars.imsi))) { + setverdict(fail, "subscriber not removed from VLR"); + } f_sgsap_bssmap_screening(); -- To view, visit https://gerrit.osmocom.org/13492 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2ec3f548dfcf5a9b99f10214a8bfd0c6978e253b Gerrit-Change-Number: 13492 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 15:40:20 2019 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Wed, 3 Apr 2019 15:40:20 +0000 Subject: Change in libosmocore[master]: Add code coverage support In-Reply-To: References: Message-ID: Vasil Velichkov has posted comments on this change. ( https://gerrit.osmocom.org/13496 ) Change subject: Add code coverage support ...................................................................... Patch Set 1: I just found a problem with the latest autoconf-archive 2019.01.06 -- To view, visit https://gerrit.osmocom.org/13496 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c Gerrit-Change-Number: 13496 Gerrit-PatchSet: 1 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vasil Velichkov Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 03 Apr 2019 15:40:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 15:46:11 2019 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Wed, 3 Apr 2019 15:46:11 +0000 Subject: Change in libosmocore[master]: Add code coverage support In-Reply-To: References: Message-ID: Vasil Velichkov has posted comments on this change. ( https://gerrit.osmocom.org/13496 ) Change subject: Add code coverage support ...................................................................... Patch Set 1: I just found a problem with the latest autoconf-archive 2019.01.06, they have changed how AX_ADD_AM_MACRO_STATIC is used in a backward incompatible way. https://github.com/autoconf-archive/autoconf-archive/blob/master/NEWS#noteworthy-changes-in-release-20190106-2019-01-06-stable https://github.com/autoconf-archive/autoconf-archive/commit/b5a2d69f7a7e0133733673586231b88464a98d58 To resolve this in a more portable way I could copy the latest version of this macro in libosmocore's m4 directory. Would this be OK? -- To view, visit https://gerrit.osmocom.org/13496 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c Gerrit-Change-Number: 13496 Gerrit-PatchSet: 1 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vasil Velichkov Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 03 Apr 2019 15:46:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 15:59:22 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 3 Apr 2019 15:59:22 +0000 Subject: Change in osmo-gsm-tester[master]: process: Prevent NetNSProcess alive forever after SIGKILL Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13511 Change subject: process: Prevent NetNSProcess alive forever after SIGKILL ...................................................................... process: Prevent NetNSProcess alive forever after SIGKILL NetNSProcess are run in the following process tree: osmo-gsm-tester -> sudo -> bash (osmo-gsm-tester_netns_exec.sh) -> tcpdump. Lots of osmo-gsm-tester_netns_exec.sh scripts with tcpdump child process were spotted in prod setup of osmo-gsm-tester. Apparently that happens because sometimes tcpdump doesn't get killed in time with SIGTERM and SIGINT, and as a result SIGKILL is sent by osmo-gsm-tester as usual termination procedure. When SIGKILL is sent, the parent sudo process is instantly killed without possibility to forward the signal to its children, leaving the bash script and tcpdump alive. In order to fix it, catch SIGKILL for this process class and send instead SIGUSR1. Then, modify the script under sudo to handle SIGUSR1 as if it was a SIGKILL towards its children to make sure child process in the netns terminates. Change-Id: I2bf389c47bbbd75f46af413e7ba897be5be386e1 --- M src/osmo_gsm_tester/process.py M utils/osmo-gsm-tester_netns_exec.sh 2 files changed, 42 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/11/13511/1 diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index 7ecb67e..441d4ea 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -363,6 +363,11 @@ # HACK: Since we run under sudo, only way to kill root-owned process is to kill as root... # This function is overwritten from Process. def send_signal(self, sig): + if sig == signal.SIGKILL: + # if we kill sudo, its children (bash running NETNS_EXEC_BIN + + # tcpdump under it) are kept alive. Let's instead tell the script to + # kill tcpdump: + sig = signal.SIGUSR1 kill_cmd = ('kill', '-%d' % int(sig), str(self.process_obj.pid)) run_local_netns_sync(self.run_dir, self.name()+"-kill"+str(sig), self.netns, kill_cmd) diff --git a/utils/osmo-gsm-tester_netns_exec.sh b/utils/osmo-gsm-tester_netns_exec.sh index 336b746..182ebff 100755 --- a/utils/osmo-gsm-tester_netns_exec.sh +++ b/utils/osmo-gsm-tester_netns_exec.sh @@ -1,5 +1,41 @@ #!/bin/bash netns="$1" shift + +child_ps=0 +forward_kill() { + sig="$1" + echo "Caught signal SIG$sig!" + if [ "$child_ps" != "0" ]; then + echo "Killing $child_ps with SIG$sig!" + kill -SIG${sig} $child_ps + else + exit 0 + fi +} +forward_kill_int() { + forward_kill "INT" +} +forward_kill_term() { + forward_kill "TERM" +} +forward_kill_usr1() { + # Special signal received from osmo-gsm-tester to tell child to SIGKILL + echo "Converting SIGUSR1->SIGKILL" + forward_kill "KILL" +} +# Don't use 'set -e', otherwise traps are not triggered! +trap forward_kill_int INT +trap forward_kill_term TERM +trap forward_kill_usr1 USR1 + #TODO: Later on I may want to call myself with specific ENV and calling sudo in order to run inside the netns but with dropped privileges -ip netns exec $netns "$@" +ip netns exec $netns "$@" & +child_ps=$! + +echo "$$: waiting for $child_ps" +wait "$child_ps" +child_exit_code="$?" +echo "child exited with $child_exit_code" + +exit $child_exit_code -- To view, visit https://gerrit.osmocom.org/13511 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2bf389c47bbbd75f46af413e7ba897be5be386e1 Gerrit-Change-Number: 13511 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 16:06:19 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 3 Apr 2019 16:06:19 +0000 Subject: Change in osmo-ci[master]: ansible: osmo-gsm-tester: Make modem net ifaces persistent In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13495 ) Change subject: ansible: osmo-gsm-tester: Make modem net ifaces persistent ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13495 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic3ef75285aa84f9aa606562cd2f6166de186c1a6 Gerrit-Change-Number: 13495 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 03 Apr 2019 16:06:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 16:06:21 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 3 Apr 2019 16:06:21 +0000 Subject: Change in osmo-ci[master]: ansible: osmo-gsm-tester: Make modem net ifaces persistent In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13495 ) Change subject: ansible: osmo-gsm-tester: Make modem net ifaces persistent ...................................................................... ansible: osmo-gsm-tester: Make modem net ifaces persistent Currently ofono doesn't catch network interface renaming (takes the name at ofono startup time). If a modem crashes, its net iface is unregistered and registered again, and it can happen that the new name is not the same as before (for instance, wwan8->wwan0 if wwan0 is located on another netns). These udev rules allow creating persistent unique names to prevent modem crashes resulting on interface name changing. dhcpcd is known to race against udev when managing dev interfaces, bringing them up before udev sometimes, and then udev is unable to rename it. By denying dhcpcd from managing modem ifaces (ww* and r* according to kernel/our rules), we get rid of this issue. Related: OS#3881 Change-Id: Ic3ef75285aa84f9aa606562cd2f6166de186c1a6 --- A ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules M ansible/roles/gsm-tester/tasks/main.yml 2 files changed, 22 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Verified diff --git a/ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules b/ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules new file mode 100644 index 0000000..a9826e2 --- /dev/null +++ b/ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules @@ -0,0 +1,10 @@ +SUBSYSTEM!="net", GOTO="net_setup_link_end" +ACTION!="add", GOTO="net_setup_link_end" + +IMPORT{builtin}="net_id" + +# If dev paths are too long (too many usb hubs in the path) (>IFNAMSIZ), ID_NET_NAME_PATH is not populated. +ENV{DEVTYPE}=="wwan", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}" +ENV{DEVTYPE}=="wwan", ENV{ID_NET_NAME_PATH}=="", PROGRAM="/bin/sh -ec 'echo ${DEVPATH} | sha1sum | head -c14'", NAME="r$result" + +LABEL="net_setup_link_end" diff --git a/ansible/roles/gsm-tester/tasks/main.yml b/ansible/roles/gsm-tester/tasks/main.yml index 8a854bd..c9b7429 100644 --- a/ansible/roles/gsm-tester/tasks/main.yml +++ b/ansible/roles/gsm-tester/tasks/main.yml @@ -274,3 +274,15 @@ src: 64-limesuite.rules dest: /etc/udev/rules.d/ notify: restart udev + +- name: use persistent naming for modem network interfaces + copy: + src: 70-net-setup-link-modems.rules + dest: /etc/udev/rules.d/ + notify: restart udev + +- name: avoid dhcpcd managing modem interfaces and racing with udev rename + lineinfile: + path: /etc/dhcpcd.conf + regexp: '^denyinterfaces' + line: 'denyinterfaces ww* r*' -- To view, visit https://gerrit.osmocom.org/13495 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic3ef75285aa84f9aa606562cd2f6166de186c1a6 Gerrit-Change-Number: 13495 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 16:37:06 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 3 Apr 2019 16:37:06 +0000 Subject: Change in libosmocore[master]: make use of OTC_GLOBAL when allocating library-internal contexts In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13338 ) Change subject: make use of OTC_GLOBAL when allocating library-internal contexts ...................................................................... Patch Set 5: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/13338/5/src/gsm/lapd_core.c File src/gsm/lapd_core.c: https://gerrit.osmocom.org/#/c/13338/5/src/gsm/lapd_core.c at 255 PS5, Line 255: __thread Looks like it should have been done in https://gerrit.osmocom.org/#/c/libosmocore/+/13436/. https://gerrit.osmocom.org/#/c/13338/5/src/logging.c File src/logging.c: https://gerrit.osmocom.org/#/c/13338/5/src/logging.c at 962 PS5, Line 962: ctx Should we mark it as '__unused' then? -- To view, visit https://gerrit.osmocom.org/13338 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I48f475efd3ee0d5120b8fc30861e852d1a6920b1 Gerrit-Change-Number: 13338 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 03 Apr 2019 16:37:06 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 17:01:19 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 3 Apr 2019 17:01:19 +0000 Subject: Change in libosmocore[master]: Add _buf() functions to bypass static string buffers In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13310 ) Change subject: Add _buf() functions to bypass static string buffers ...................................................................... Patch Set 9: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13310 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibf85f79e93244f53b2684ff6f1095c5b41203e05 Gerrit-Change-Number: 13310 Gerrit-PatchSet: 9 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 03 Apr 2019 17:01:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 17:52:04 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 3 Apr 2019 17:52:04 +0000 Subject: Change in libosmocore[master]: make all library-internal static buffers thread-local In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13436 ) Change subject: make all library-internal static buffers thread-local ...................................................................... Patch Set 4: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13436/4/src/utils.c File src/utils.c: https://gerrit.osmocom.org/#/c/13436/4/src/utils.c at 493 PS4, Line 493: static uint8_t buf[sizeof(uint64_t)]; What about this one? ;) This is the only one I could find using: git grep "static uint". -- To view, visit https://gerrit.osmocom.org/13436 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I50eb2436a7c1261d79a9d2955584dce92780ca07 Gerrit-Change-Number: 13436 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 03 Apr 2019 17:52:04 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 19:05:29 2019 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Wed, 3 Apr 2019 19:05:29 +0000 Subject: Change in libosmocore[master]: Add code coverage support 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/13496 to look at the new patch set (#2). Change subject: Add code coverage support ...................................................................... Add code coverage support The coverage report shows what code is covered by tests and what is not and the ratio could be tracked over time. These reports will allow us to identify code that is not being tested and improve the test suites. To enable the reports configure with --enable-code-coverage and execute "make check-code-coverage". The HTML report will be generated in a subdirectory with name libosmocore-$(PACKAGE_VERSION)-coverage/index.html The report is generated using gcov and lcov tools and the AX_CODE_COVERAGE macro from the autoconf-archive project. The ax_code_coverage.m4 was taken from autoconf-archive v2018.03.13 Closes: OS#1987 Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c --- M .gitignore M Makefile.am M configure.ac A m4/ax_code_coverage.m4 M src/Makefile.am M src/codec/Makefile.am M src/coding/Makefile.am M src/ctrl/Makefile.am M src/gb/Makefile.am M src/gsm/Makefile.am M src/pseudotalloc/Makefile.am M src/sim/Makefile.am M src/vty/Makefile.am 13 files changed, 310 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/96/13496/2 -- To view, visit https://gerrit.osmocom.org/13496 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c Gerrit-Change-Number: 13496 Gerrit-PatchSet: 2 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vasil Velichkov Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 19:09:34 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 19:09:34 +0000 Subject: Change in libosmocore[master]: Add code coverage support In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13496 ) Change subject: Add code coverage support ...................................................................... Patch Set 2: > To resolve this in a more portable way I could copy the latest > version of this macro in libosmocore's m4 directory. Would this be > OK? In theory yes, but the problem is that we'd have to add this to each and every osmocom project. I was hoping for something that avoids lots of copy+pasting. Maybe we can install the m4 file from libosmocore and use it from all other projects, similar to our "make release" helper? -- To view, visit https://gerrit.osmocom.org/13496 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c Gerrit-Change-Number: 13496 Gerrit-PatchSet: 2 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vasil Velichkov Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 03 Apr 2019 19:09:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 19:14:08 2019 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Wed, 3 Apr 2019 19:14:08 +0000 Subject: Change in libosmocore[master]: Add code coverage support In-Reply-To: References: Message-ID: Vasil Velichkov has posted comments on this change. ( https://gerrit.osmocom.org/13496 ) Change subject: Add code coverage support ...................................................................... Patch Set 2: (2 comments) I took the previous version of ax_code_coverage.m4 from autoconf-archive v2018.03.13 as the latest version from v2019.01.06 depends on other macros and I've to add them all to not introduce dependency to autoconf-archive. I've tried this but was not able to compile it in debian jessie and ubuntu trusty without installing autoconf-archive. The version from v2018.03.13 does not depend on other macros and I've been able to compile it without the full autoconf-archive. https://gerrit.osmocom.org/#/c/13496/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13496/1//COMMIT_MSG at 7 PS1, Line 7: Add code coverage support > I guess everyone knows what "coverage" means in terms of software development/testing. [?] Done https://gerrit.osmocom.org/#/c/13496/1//COMMIT_MSG at 10 PS1, Line 10: could be tracked over tim > would be great to specify where that report is placed (path/filename). Done -- To view, visit https://gerrit.osmocom.org/13496 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c Gerrit-Change-Number: 13496 Gerrit-PatchSet: 2 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Vasil Velichkov Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 03 Apr 2019 19:14:08 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 19:23:27 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 3 Apr 2019 19:23:27 +0000 Subject: Change in libosmocore[master]: Add code coverage support In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13496 ) Change subject: Add code coverage support ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13496 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c Gerrit-Change-Number: 13496 Gerrit-PatchSet: 2 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: Vasil Velichkov Gerrit-Comment-Date: Wed, 03 Apr 2019 19:23:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 19:35:43 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Apr 2019 19:35:43 +0000 Subject: Change in libosmocore[master]: make all library-internal static buffers thread-local In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13436 to look at the new patch set (#5). Change subject: make all library-internal static buffers thread-local ...................................................................... make all library-internal static buffers thread-local We have a number of library-internal static global buffers which are mainly used for various stringification functions. This worked as all of the related Osmocom programs were strictly single-threaded. Let's make those buffers at least thread-local. This way every thread gets their own set of buffers, and it's safe for multiple threads to execute the same functiosn once. They're of course still not re-entrant. If you need re-entrancy, you will need to use the _c() or _buf() suffix versionf of those functions and work with your own (stack or heap) buffers. Change-Id: I50eb2436a7c1261d79a9d2955584dce92780ca07 --- M src/fsm.c M src/gb/gprs_ns.c M src/gsm/abis_nm.c M src/gsm/apn.c M src/gsm/gsm0808_utils.c M src/gsm/gsm23003.c M src/gsm/gsm48.c M src/gsm/gsm_utils.c M src/gsm/rsl.c M src/msgb.c M src/sim/core.c M src/socket.c M src/utils.c 13 files changed, 32 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/13436/5 -- To view, visit https://gerrit.osmocom.org/13436 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I50eb2436a7c1261d79a9d2955584dce92780ca07 Gerrit-Change-Number: 13436 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 3 22:24:20 2019 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Wed, 3 Apr 2019 22:24:20 +0000 Subject: Change in libosmocore[master]: Add code coverage support In-Reply-To: References: Message-ID: Vasil Velichkov has posted comments on this change. ( https://gerrit.osmocom.org/13496 ) Change subject: Add code coverage support ...................................................................... Patch Set 2: > Patch Set 2: > > > To resolve this in a more portable way I could copy the latest > > version of this macro in libosmocore's m4 directory. Would this be > > OK? > > In theory yes, but the problem is that we'd have to add this to each and every osmocom project. I was hoping for something that avoids lots of copy+pasting. Maybe we can install the m4 file from libosmocore and use it from all other projects, similar to our "make release" helper? I'm going to research this and post a new patch, don't merge this for now. -- To view, visit https://gerrit.osmocom.org/13496 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c Gerrit-Change-Number: 13496 Gerrit-PatchSet: 2 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: Vasil Velichkov Gerrit-Comment-Date: Wed, 03 Apr 2019 22:24:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 06:19:58 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 4 Apr 2019 06:19:58 +0000 Subject: Change in docker-playground[master]: make/Makefile: fix recursive 'PULL' error Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13512 Change subject: make/Makefile: fix recursive 'PULL' error ...................................................................... make/Makefile: fix recursive 'PULL' error Don't abort with the following error, when running 'make' without setting the PULL environment variable: ../make/Makefile:20: *** Recursive variable 'PULL' references itself (eventually). Stop. This fixes a regression from Change-Id I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6. Related: OS#3869 Change-Id: I4b4772e9ed6e07ab00943154265c9cbdea22a2f5 --- M make/Makefile 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/12/13512/1 diff --git a/make/Makefile b/make/Makefile index d4e3c22..7dfa795 100644 --- a/make/Makefile +++ b/make/Makefile @@ -17,7 +17,7 @@ USERNAME?=$(USER) NAME?=$(shell basename $(CURDIR)) OSMO_TTCN3_BRANCH?=master -PULL?=$(PULL) +PULL?= RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support IMAGE?=$(REGISTRY_HOST)/$(USER)/$(NAME) -- To view, visit https://gerrit.osmocom.org/13512 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4b4772e9ed6e07ab00943154265c9cbdea22a2f5 Gerrit-Change-Number: 13512 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 08:08:02 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 4 Apr 2019 08:08:02 +0000 Subject: Change in libosmo-sccp[master]: sccp_scoc: conn_create{, _id}() user arg, not inst In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13508 to look at the new patch set (#3). Change subject: sccp_scoc: conn_create{,_id}() user arg, not inst ...................................................................... sccp_scoc: conn_create{,_id}() user arg, not inst Accept the osmo_sccp_user instead of calling conn_create() and setting conn->user afterwards. Prepare for generating a local_ref inside conn_create_id() in the future. Related: OS#3871 Change-Id: I2fb47c8ba6c0ce7cd92c9ac31f15c67eb67fb66e --- M src/sccp_scoc.c 1 file changed, 11 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/08/13508/3 -- To view, visit https://gerrit.osmocom.org/13508 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2fb47c8ba6c0ce7cd92c9ac31f15c67eb67fb66e Gerrit-Change-Number: 13508 Gerrit-PatchSet: 3 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 08:24:18 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Apr 2019 08:24:18 +0000 Subject: Change in docker-playground[master]: make/Makefile: fix recursive 'PULL' error In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13512 ) Change subject: make/Makefile: fix recursive 'PULL' error ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13512 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4b4772e9ed6e07ab00943154265c9cbdea22a2f5 Gerrit-Change-Number: 13512 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 04 Apr 2019 08:24:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 08:25:11 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Apr 2019 08:25:11 +0000 Subject: Change in libosmo-sccp[master]: sccp_scoc: conn_create{, _id}() user arg, not inst In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13508 ) Change subject: sccp_scoc: conn_create{,_id}() user arg, not inst ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13508 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2fb47c8ba6c0ce7cd92c9ac31f15c67eb67fb66e Gerrit-Change-Number: 13508 Gerrit-PatchSet: 3 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 04 Apr 2019 08:25:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 08:26:13 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 4 Apr 2019 08:26:13 +0000 Subject: Change in docker-playground[master]: make/Makefile: fix recursive 'PULL' error In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13512 ) Change subject: make/Makefile: fix recursive 'PULL' error ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13512 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4b4772e9ed6e07ab00943154265c9cbdea22a2f5 Gerrit-Change-Number: 13512 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Thu, 04 Apr 2019 08:26:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 08:26:15 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 4 Apr 2019 08:26:15 +0000 Subject: Change in docker-playground[master]: make/Makefile: fix recursive 'PULL' error In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13512 ) Change subject: make/Makefile: fix recursive 'PULL' error ...................................................................... make/Makefile: fix recursive 'PULL' error Don't abort with the following error, when running 'make' without setting the PULL environment variable: ../make/Makefile:20: *** Recursive variable 'PULL' references itself (eventually). Stop. This fixes a regression from Change-Id I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6. Related: OS#3869 Change-Id: I4b4772e9ed6e07ab00943154265c9cbdea22a2f5 --- M make/Makefile 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved osmith: Verified diff --git a/make/Makefile b/make/Makefile index d4e3c22..7dfa795 100644 --- a/make/Makefile +++ b/make/Makefile @@ -17,7 +17,7 @@ USERNAME?=$(USER) NAME?=$(shell basename $(CURDIR)) OSMO_TTCN3_BRANCH?=master -PULL?=$(PULL) +PULL?= RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support IMAGE?=$(REGISTRY_HOST)/$(USER)/$(NAME) -- To view, visit https://gerrit.osmocom.org/13512 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4b4772e9ed6e07ab00943154265c9cbdea22a2f5 Gerrit-Change-Number: 13512 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 08:34:26 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 4 Apr 2019 08:34:26 +0000 Subject: Change in osmo-hlr[master]: gsup_router.c: gsup_route_find(): support blob In-Reply-To: References: Message-ID: osmith has abandoned this change. ( https://gerrit.osmocom.org/13048 ) Change subject: gsup_router.c: gsup_route_find(): support blob ...................................................................... Abandoned Not needed anymore, see discussion. -- To view, visit https://gerrit.osmocom.org/13048 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I01a45900e14d41bcd338f50ad85d9fabf2c61405 Gerrit-Change-Number: 13048 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 08:40:02 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 4 Apr 2019 08:40:02 +0000 Subject: Change in osmo-msc[master]: sgs_iface: fix nullpointer dereference Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13513 Change subject: sgs_iface: fix nullpointer dereference ...................................................................... sgs_iface: fix nullpointer dereference The function sgs_tx() is using the sgs connection pointer as context, even though it has done a check for a nullpointer in the line before. This is very prone to lead into a segfault when the SGs connection dies. Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6 Related: OS#3859 --- M src/libmsc/sgs_iface.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/13/13513/1 diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c index 450d552..c12c4cb 100644 --- a/src/libmsc/sgs_iface.c +++ b/src/libmsc/sgs_iface.c @@ -301,8 +301,9 @@ msgb_sctp_ppid(msg) = 0; if (!sgc) { - LOGSGC(sgc, LOGL_NOTICE, "Cannot transmit %s: connection dead. Discarding\n", - sgsap_msg_type_name(msg->data[0])); + LOGP(LOGL_NOTICE, DSGS, "Cannot transmit %s: connection dead. Discarding\n", + sgsap_msg_type_name(msg->data[0])); + msgb_free(msg); return; } -- To view, visit https://gerrit.osmocom.org/13513 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6 Gerrit-Change-Number: 13513 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 09:32:51 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Thu, 4 Apr 2019 09:32:51 +0000 Subject: Change in osmo-gsm-manuals[master]: bts: Change VTY sample output from OpenBSC to OsmoBSC Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13514 Change subject: bts: Change VTY sample output from OpenBSC to OsmoBSC ...................................................................... bts: Change VTY sample output from OpenBSC to OsmoBSC Change-Id: Id473b625f47b3cf7ee10ced866d49eb678161719 --- M common/chapters/bts.adoc 1 file changed, 17 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/14/13514/1 diff --git a/common/chapters/bts.adoc b/common/chapters/bts.adoc index 30a33cc..6228310 100644 --- a/common/chapters/bts.adoc +++ b/common/chapters/bts.adoc @@ -18,7 +18,7 @@ information about all provisioned BTS numbers. ---- -OpenBSC> show bts 0 +OsmoBSC> show bts 0 BTS 0 is of nanobts type in band DCS1800, has CI 0 LAC 1, BSIC 63, TSC 7 and 1 TRX Description: (null) MS Max power: 15 dBm @@ -41,7 +41,7 @@ this BSC by using `show trx`: ---- -OpenBSC> show trx 0 0 +OsmoBSC> show trx 0 0 TRX 0 of BTS 0 is on ARFCN 871 Description: (null) RF Nominal Power: 23 dBm, reduced by 0 dB, resulting BS power: 23 dBm @@ -62,10 +62,10 @@ timeslot 0 0 4`). ---- -OpenBSC> show timeslot 0 0 0 +OsmoBSC> show timeslot 0 0 0 BTS 0, TRX 0, Timeslot 0, phys cfg CCCH, TSC 7 NM State: Oper 'Enabled', Admin 2, Avail 'OK' -OpenBSC> show timeslot 0 0 1 +OsmoBSC> show timeslot 0 0 1 BTS 0, TRX 0, Timeslot 1, phys cfg SDCCH8, TSC 7 NM State: Oper 'Enabled', Admin 2, Avail 'OK' ---- @@ -78,11 +78,11 @@ of commands: ---- -OpenBSC> enable -OpenBSC# configure terminal -OpenBSC(config)# network -OpenBSC(config-net)# bts 0 -OpenBSC(config-net-bts)# +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# network +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# ---- At this point, you have a plethora of commands, in fact an entire @@ -201,14 +201,14 @@ .Example configuration of GPRS PCU parameters at VTY BTS node ---- -OpenBSC(config-net-bts)# gprs mode gprs -OpenBSC(config-net-bts)# gprs routing area 1 -OpenBSC(config-net-bts)# gprs cell bvci 1234 -OpenBSC(config-net-bts)# gprs nsei 1234 -OpenBSC(config-net-bts)# gprs nsvc 0 nsvci 1234 -OpenBSC(config-net-bts)# gprs nsvc 0 local udp port 23000 -OpenBSC(config-net-bts)# gprs nsvc 0 remote udp port 23000 -OpenBSC(config-net-bts)# gprs nsvc 0 remote ip 192.168.100.239 +OsmoBSC(config-net-bts)# gprs mode gprs +OsmoBSC(config-net-bts)# gprs routing area 1 +OsmoBSC(config-net-bts)# gprs cell bvci 1234 +OsmoBSC(config-net-bts)# gprs nsei 1234 +OsmoBSC(config-net-bts)# gprs nsvc 0 nsvci 1234 +OsmoBSC(config-net-bts)# gprs nsvc 0 local udp port 23000 +OsmoBSC(config-net-bts)# gprs nsvc 0 remote udp port 23000 +OsmoBSC(config-net-bts)# gprs nsvc 0 remote ip 192.168.100.239 ---- -- To view, visit https://gerrit.osmocom.org/13514 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id473b625f47b3cf7ee10ced866d49eb678161719 Gerrit-Change-Number: 13514 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 10:39:30 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 10:39:30 +0000 Subject: Change in docker-playground[master]: gitignore: add .release In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13481 ) Change subject: gitignore: add .release ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13481 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9ea8e4326f6da2ff95cf45999637c89f884a9e19 Gerrit-Change-Number: 13481 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: roh Gerrit-Comment-Date: Thu, 04 Apr 2019 10:39:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 10:40:13 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 10:40:13 +0000 Subject: Change in osmo-gsm-manuals[master]: bts: Change VTY sample output from OpenBSC to OsmoBSC In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13514 ) Change subject: bts: Change VTY sample output from OpenBSC to OsmoBSC ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13514 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id473b625f47b3cf7ee10ced866d49eb678161719 Gerrit-Change-Number: 13514 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 04 Apr 2019 10:40:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 10:45:59 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 10:45:59 +0000 Subject: Change in osmo-gsm-tester[master]: process: add signal to NetNSProcess kill path In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13509 ) Change subject: process: add signal to NetNSProcess kill path ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13509 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida88f2674b0ed1802f20c519aa4e3cbe81e0def8 Gerrit-Change-Number: 13509 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 04 Apr 2019 10:45:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 10:46:01 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 10:46:01 +0000 Subject: Change in osmo-gsm-tester[master]: process: Prevent NetNSProcess alive forever after SIGKILL In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13511 ) Change subject: process: Prevent NetNSProcess alive forever after SIGKILL ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13511 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2bf389c47bbbd75f46af413e7ba897be5be386e1 Gerrit-Change-Number: 13511 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 04 Apr 2019 10:46:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 10:46:04 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 10:46:04 +0000 Subject: Change in osmo-gsm-tester[master]: process: add signal to NetNSProcess kill path In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13509 ) Change subject: process: add signal to NetNSProcess kill path ...................................................................... process: add signal to NetNSProcess kill path This allows to easily differentiate different calls to kill in order to terminate the process when looking at the logs. Change-Id: Ida88f2674b0ed1802f20c519aa4e3cbe81e0def8 --- M src/osmo_gsm_tester/process.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index a104e10..7ecb67e 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -364,7 +364,7 @@ # This function is overwritten from Process. def send_signal(self, sig): kill_cmd = ('kill', '-%d' % int(sig), str(self.process_obj.pid)) - run_local_netns_sync(self.run_dir, self.name()+"-kill", self.netns, kill_cmd) + run_local_netns_sync(self.run_dir, self.name()+"-kill"+str(sig), self.netns, kill_cmd) def run_local_sync(run_dir, name, popen_args): -- To view, visit https://gerrit.osmocom.org/13509 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ida88f2674b0ed1802f20c519aa4e3cbe81e0def8 Gerrit-Change-Number: 13509 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 10:46:04 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 10:46:04 +0000 Subject: Change in osmo-gsm-tester[master]: process: Prevent NetNSProcess alive forever after SIGKILL In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13511 ) Change subject: process: Prevent NetNSProcess alive forever after SIGKILL ...................................................................... process: Prevent NetNSProcess alive forever after SIGKILL NetNSProcess are run in the following process tree: osmo-gsm-tester -> sudo -> bash (osmo-gsm-tester_netns_exec.sh) -> tcpdump. Lots of osmo-gsm-tester_netns_exec.sh scripts with tcpdump child process were spotted in prod setup of osmo-gsm-tester. Apparently that happens because sometimes tcpdump doesn't get killed in time with SIGTERM and SIGINT, and as a result SIGKILL is sent by osmo-gsm-tester as usual termination procedure. When SIGKILL is sent, the parent sudo process is instantly killed without possibility to forward the signal to its children, leaving the bash script and tcpdump alive. In order to fix it, catch SIGKILL for this process class and send instead SIGUSR1. Then, modify the script under sudo to handle SIGUSR1 as if it was a SIGKILL towards its children to make sure child process in the netns terminates. Change-Id: I2bf389c47bbbd75f46af413e7ba897be5be386e1 --- M src/osmo_gsm_tester/process.py M utils/osmo-gsm-tester_netns_exec.sh 2 files changed, 42 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index 7ecb67e..441d4ea 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -363,6 +363,11 @@ # HACK: Since we run under sudo, only way to kill root-owned process is to kill as root... # This function is overwritten from Process. def send_signal(self, sig): + if sig == signal.SIGKILL: + # if we kill sudo, its children (bash running NETNS_EXEC_BIN + + # tcpdump under it) are kept alive. Let's instead tell the script to + # kill tcpdump: + sig = signal.SIGUSR1 kill_cmd = ('kill', '-%d' % int(sig), str(self.process_obj.pid)) run_local_netns_sync(self.run_dir, self.name()+"-kill"+str(sig), self.netns, kill_cmd) diff --git a/utils/osmo-gsm-tester_netns_exec.sh b/utils/osmo-gsm-tester_netns_exec.sh index 336b746..182ebff 100755 --- a/utils/osmo-gsm-tester_netns_exec.sh +++ b/utils/osmo-gsm-tester_netns_exec.sh @@ -1,5 +1,41 @@ #!/bin/bash netns="$1" shift + +child_ps=0 +forward_kill() { + sig="$1" + echo "Caught signal SIG$sig!" + if [ "$child_ps" != "0" ]; then + echo "Killing $child_ps with SIG$sig!" + kill -SIG${sig} $child_ps + else + exit 0 + fi +} +forward_kill_int() { + forward_kill "INT" +} +forward_kill_term() { + forward_kill "TERM" +} +forward_kill_usr1() { + # Special signal received from osmo-gsm-tester to tell child to SIGKILL + echo "Converting SIGUSR1->SIGKILL" + forward_kill "KILL" +} +# Don't use 'set -e', otherwise traps are not triggered! +trap forward_kill_int INT +trap forward_kill_term TERM +trap forward_kill_usr1 USR1 + #TODO: Later on I may want to call myself with specific ENV and calling sudo in order to run inside the netns but with dropped privileges -ip netns exec $netns "$@" +ip netns exec $netns "$@" & +child_ps=$! + +echo "$$: waiting for $child_ps" +wait "$child_ps" +child_exit_code="$?" +echo "child exited with $child_exit_code" + +exit $child_exit_code -- To view, visit https://gerrit.osmocom.org/13511 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2bf389c47bbbd75f46af413e7ba897be5be386e1 Gerrit-Change-Number: 13511 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 10:46:13 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 4 Apr 2019 10:46:13 +0000 Subject: Change in docker-playground[master]: gitignore: add .release In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13481 ) Change subject: gitignore: add .release ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/13481 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9ea8e4326f6da2ff95cf45999637c89f884a9e19 Gerrit-Change-Number: 13481 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Reviewer: roh Gerrit-Comment-Date: Thu, 04 Apr 2019 10:46:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 10:46:15 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 4 Apr 2019 10:46:15 +0000 Subject: Change in docker-playground[master]: gitignore: add .release In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13481 ) Change subject: gitignore: add .release ...................................................................... gitignore: add .release Ignore .release files generated by make/Makefile. Change-Id: I9ea8e4326f6da2ff95cf45999637c89f884a9e19 --- A .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved osmith: Verified diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a16a1a0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.release -- To view, visit https://gerrit.osmocom.org/13481 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9ea8e4326f6da2ff95cf45999637c89f884a9e19 Gerrit-Change-Number: 13481 Gerrit-PatchSet: 3 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Reviewer: roh -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 10:46:17 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 10:46:17 +0000 Subject: Change in osmo-trx[master]: osmo-trx: Check return code of osmo_fd_register In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13482 ) Change subject: osmo-trx: Check return code of osmo_fd_register ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13482 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I93fbcb062439a547379aaecba283d107fdc9cb59 Gerrit-Change-Number: 13482 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 04 Apr 2019 10:46:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 10:46:19 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 10:46:19 +0000 Subject: Change in osmo-trx[master]: osmo-trx: Check return code of osmo_fd_register In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13482 ) Change subject: osmo-trx: Check return code of osmo_fd_register ...................................................................... osmo-trx: Check return code of osmo_fd_register Fixes Coverity CID 197513. Change-Id: I93fbcb062439a547379aaecba283d107fdc9cb59 --- M Transceiver52M/osmo-trx.cpp 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 88b9de0..b252d0c 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -237,7 +237,10 @@ } osmo_fd_setup(&signal_ofd, sfd, OSMO_FD_READ, signalfd_callback, NULL, 0); - osmo_fd_register(&signal_ofd); + if (osmo_fd_register(&signal_ofd) < 0) { + fprintf(stderr, "osmo_fd_register() failed.\n"); + exit(EXIT_FAILURE); + } } static void print_help() -- To view, visit https://gerrit.osmocom.org/13482 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I93fbcb062439a547379aaecba283d107fdc9cb59 Gerrit-Change-Number: 13482 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 10:49:52 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 4 Apr 2019 10:49:52 +0000 Subject: Change in osmo-msc[master]: vlr_sgs: fix SGs IMSI detech from non EPS services In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13493 ) Change subject: vlr_sgs: fix SGs IMSI detech from non EPS services ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13493 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I575cf6036ad39468f590b2d57a06cd3512a4c31c Gerrit-Change-Number: 13493 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 04 Apr 2019 10:49:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 10:50:46 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 4 Apr 2019 10:50:46 +0000 Subject: Change in osmo-msc[master]: vlr_sgs: start lu expiration timer on sgs eps detach In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13494 ) Change subject: vlr_sgs: start lu expiration timer on sgs eps detach ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13494 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If95c63706dc1c5a537f7cd1b6481252427cbf234 Gerrit-Change-Number: 13494 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 04 Apr 2019 10:50:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 10:51:46 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 4 Apr 2019 10:51:46 +0000 Subject: Change in osmo-msc[master]: sgs_iface: fix nullpointer dereference In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13513 ) Change subject: sgs_iface: fix nullpointer dereference ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13513/1/src/libmsc/sgs_iface.c File src/libmsc/sgs_iface.c: https://gerrit.osmocom.org/#/c/13513/1/src/libmsc/sgs_iface.c at 306 PS1, Line 306: ws -- To view, visit https://gerrit.osmocom.org/13513 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6 Gerrit-Change-Number: 13513 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 04 Apr 2019 10:51:46 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 10:53:15 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 4 Apr 2019 10:53:15 +0000 Subject: Change in osmo-gsm-manuals[master]: bts: Change VTY sample output from OpenBSC to OsmoBSC In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13514 ) Change subject: bts: Change VTY sample output from OpenBSC to OsmoBSC ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13514 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id473b625f47b3cf7ee10ced866d49eb678161719 Gerrit-Change-Number: 13514 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 04 Apr 2019 10:53:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 11:39:57 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 4 Apr 2019 11:39:57 +0000 Subject: Change in osmo-msc[master]: sgs_iface: fix nullpointer dereference In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13513 to look at the new patch set (#2). Change subject: sgs_iface: fix nullpointer dereference ...................................................................... sgs_iface: fix nullpointer dereference The function sgs_tx() is using the sgs connection pointer as context, even though it has done a check for a nullpointer in the line before. This is very prone to lead into a segfault when the SGs connection dies. Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6 Related: OS#3859 --- M src/libmsc/sgs_iface.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/13/13513/2 -- To view, visit https://gerrit.osmocom.org/13513 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6 Gerrit-Change-Number: 13513 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 11:46:09 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 4 Apr 2019 11:46:09 +0000 Subject: Change in osmo-msc[master]: sgs_iface: fix nullpointer dereference In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/13513 ) Change subject: sgs_iface: fix nullpointer dereference ...................................................................... Patch Set 2: (1 comment) > Build Started https://jenkins.osmocom.org/jenkins/job/gerrit-osmo-msc/1432/ https://gerrit.osmocom.org/#/c/13513/1/src/libmsc/sgs_iface.c File src/libmsc/sgs_iface.c: https://gerrit.osmocom.org/#/c/13513/1/src/libmsc/sgs_iface.c at 306 PS1, Line 306: msgb_free(msg); > ws Done -- To view, visit https://gerrit.osmocom.org/13513 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6 Gerrit-Change-Number: 13513 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 04 Apr 2019 11:46:09 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 11:51:56 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 4 Apr 2019 11:51:56 +0000 Subject: Change in osmo-hlr[master]: USSD: send 'unknown imsi' back to source Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13515 Change subject: USSD: send 'unknown imsi' back to source ...................................................................... USSD: send 'unknown imsi' back to source Depends: Ic00b0601eacff6d72927cea51767801142ee75db (libosmocore.git) Change-Id: If5a65f471672949192061c5fe396603611123bc1 --- M src/hlr_ussd.c 1 file changed, 32 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/13515/1 diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index 7de750f..3a9151c 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -171,6 +171,11 @@ * Still, this should be refreshed in due time, e.g. once per received message. */ struct hlr_subscriber *subscr; + /* The IPA name of the entity (MSC/VLR) that sent this message, so we can send "unknown IMSI" errors back.*/ + uint8_t *source_name; + size_t source_name_len; + bool source_fallback; + /* we don't keep a pointer to the osmo_gsup_{route,conn} towards the MSC/VLR here, * as this might change during inter-VLR hand-over, and we simply look-up the serving MSC/VLR * every time we receive an USSD component from the EUSE */ @@ -202,7 +207,8 @@ ss_session_free(ss); } -struct ss_session *ss_session_alloc(struct hlr *hlr, const char *imsi, uint32_t session_id) +struct ss_session *ss_session_alloc(struct hlr *hlr, const char *imsi, uint32_t session_id, const uint8_t *source_name, + size_t source_name_len) { struct ss_session *ss; @@ -214,6 +220,10 @@ OSMO_STRLCPY_ARRAY(ss->imsi, imsi); ss->session_id = session_id; + ss->source_name = talloc_memdup(ss, source_name, source_name_len); + OSMO_ASSERT(ss->source_name); + ss->source_name_len = source_name_len; + /* Schedule self-destruction timer */ osmo_timer_setup(&ss->timeout, ss_session_timeout, ss); if (g_hlr->ncss_guard_timeout > 0) @@ -232,6 +242,8 @@ { struct hlr_subscriber _subscr = {}; struct hlr_subscriber *subscr = ss->subscr; + uint8_t *vlr_number; + size_t vlr_number_len; int rc; /* Use subscr as looked up by the caller, or look up now. */ @@ -245,14 +257,24 @@ subscr = &_subscr; } - if (!subscr->vlr_number[0]) { - LOGP(DLGSUP, LOGL_ERROR, "Cannot send GSUP message, no VLR number stored for subscriber %s\n", - subscr->imsi); - return -EINVAL; + vlr_number = (uint8_t *)&subscr->vlr_number; + vlr_number_len = strlen(subscr->vlr_number); + if (!vlr_number_len) { + if (ss->source_fallback) { + LOGP(DLGSUP, LOGL_DEBUG, "No VLR number stored for subscriber %s, sending to source instead\n", + subscr->imsi); + vlr_number = ss->source_name; + vlr_number_len = ss->source_name_len; + } else { + LOGP(DLGSUP, LOGL_ERROR, "Cannot send GSUP message, no VLR number stored for subscriber %s\n", + subscr->imsi); + return -EINVAL; + } } - LOGPSS(ss, LOGL_DEBUG, "Tx USSD for IMSI %s to VLR '%s'\n", subscr->imsi, subscr->vlr_number); - return osmo_gsup_addr_send(gs, (uint8_t *)subscr->vlr_number, strlen(subscr->vlr_number), msg); + LOGPSS(ss, LOGL_DEBUG, "Tx USSD for IMSI %s to VLR %s\n", subscr->imsi, + osmo_quote_str((const char *)vlr_number, vlr_number_len)); + return osmo_gsup_addr_send(gs, vlr_number, vlr_number_len, msg); } static int ss_tx_to_ms(struct ss_session *ss, enum osmo_gsup_message_type gsup_msg_type, @@ -527,7 +549,7 @@ gsup->imsi, gsup->session_id); goto out_err; } - ss = ss_session_alloc(hlr, gsup->imsi, gsup->session_id); + ss = ss_session_alloc(hlr, gsup->imsi, gsup->session_id, gsup->source_name, gsup->source_name_len); if (!ss) { LOGP(DSS, LOGL_ERROR, "%s/0x%08x: Unable to allocate SS session\n", gsup->imsi, gsup->session_id); @@ -555,6 +577,8 @@ ss->u.euse = hlr->euse_default; } } + /* send "unknown IMSI" errors back to source */ + ss->source_fallback = true; } /* dispatch unstructured SS to routing */ handle_ussd(conn, ss, gsup, &req); -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 11:52:49 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Thu, 4 Apr 2019 11:52:49 +0000 Subject: Change in osmo-gsm-manuals[master]: bts: Change VTY sample output from OpenBSC to OsmoBSC In-Reply-To: References: Message-ID: Daniel Willmann has submitted this change and it was merged. ( https://gerrit.osmocom.org/13514 ) Change subject: bts: Change VTY sample output from OpenBSC to OsmoBSC ...................................................................... bts: Change VTY sample output from OpenBSC to OsmoBSC Change-Id: Id473b625f47b3cf7ee10ced866d49eb678161719 --- M common/chapters/bts.adoc 1 file changed, 17 insertions(+), 17 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved Vadim Yanitskiy: Looks good to me, approved diff --git a/common/chapters/bts.adoc b/common/chapters/bts.adoc index 30a33cc..6228310 100644 --- a/common/chapters/bts.adoc +++ b/common/chapters/bts.adoc @@ -18,7 +18,7 @@ information about all provisioned BTS numbers. ---- -OpenBSC> show bts 0 +OsmoBSC> show bts 0 BTS 0 is of nanobts type in band DCS1800, has CI 0 LAC 1, BSIC 63, TSC 7 and 1 TRX Description: (null) MS Max power: 15 dBm @@ -41,7 +41,7 @@ this BSC by using `show trx`: ---- -OpenBSC> show trx 0 0 +OsmoBSC> show trx 0 0 TRX 0 of BTS 0 is on ARFCN 871 Description: (null) RF Nominal Power: 23 dBm, reduced by 0 dB, resulting BS power: 23 dBm @@ -62,10 +62,10 @@ timeslot 0 0 4`). ---- -OpenBSC> show timeslot 0 0 0 +OsmoBSC> show timeslot 0 0 0 BTS 0, TRX 0, Timeslot 0, phys cfg CCCH, TSC 7 NM State: Oper 'Enabled', Admin 2, Avail 'OK' -OpenBSC> show timeslot 0 0 1 +OsmoBSC> show timeslot 0 0 1 BTS 0, TRX 0, Timeslot 1, phys cfg SDCCH8, TSC 7 NM State: Oper 'Enabled', Admin 2, Avail 'OK' ---- @@ -78,11 +78,11 @@ of commands: ---- -OpenBSC> enable -OpenBSC# configure terminal -OpenBSC(config)# network -OpenBSC(config-net)# bts 0 -OpenBSC(config-net-bts)# +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# network +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# ---- At this point, you have a plethora of commands, in fact an entire @@ -201,14 +201,14 @@ .Example configuration of GPRS PCU parameters at VTY BTS node ---- -OpenBSC(config-net-bts)# gprs mode gprs -OpenBSC(config-net-bts)# gprs routing area 1 -OpenBSC(config-net-bts)# gprs cell bvci 1234 -OpenBSC(config-net-bts)# gprs nsei 1234 -OpenBSC(config-net-bts)# gprs nsvc 0 nsvci 1234 -OpenBSC(config-net-bts)# gprs nsvc 0 local udp port 23000 -OpenBSC(config-net-bts)# gprs nsvc 0 remote udp port 23000 -OpenBSC(config-net-bts)# gprs nsvc 0 remote ip 192.168.100.239 +OsmoBSC(config-net-bts)# gprs mode gprs +OsmoBSC(config-net-bts)# gprs routing area 1 +OsmoBSC(config-net-bts)# gprs cell bvci 1234 +OsmoBSC(config-net-bts)# gprs nsei 1234 +OsmoBSC(config-net-bts)# gprs nsvc 0 nsvci 1234 +OsmoBSC(config-net-bts)# gprs nsvc 0 local udp port 23000 +OsmoBSC(config-net-bts)# gprs nsvc 0 remote udp port 23000 +OsmoBSC(config-net-bts)# gprs nsvc 0 remote ip 192.168.100.239 ---- -- To view, visit https://gerrit.osmocom.org/13514 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id473b625f47b3cf7ee10ced866d49eb678161719 Gerrit-Change-Number: 13514 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 11:55:17 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Thu, 4 Apr 2019 11:55:17 +0000 Subject: Change in osmo-gsm-manuals[master]: Add a chapter to explain our different counters Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13516 Change subject: Add a chapter to explain our different counters ...................................................................... Add a chapter to explain our different counters Change-Id: I01b8529136450cb50e48b0fb5c17cb2daa5e24c3 --- A common/chapters/counters-overview.adoc 1 file changed, 50 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/16/13516/1 diff --git a/common/chapters/counters-overview.adoc b/common/chapters/counters-overview.adoc new file mode 100644 index 0000000..fbdef30 --- /dev/null +++ b/common/chapters/counters-overview.adoc @@ -0,0 +1,50 @@ +[[common-counters]] +== Osmocom Counters + +The following gives an overview of all the types of counters available: + +=== Osmo Counters + +Osmo counters are the oldest type of counters added to Osmocom projects. +They are not grouped. + +* Printed as part of VTY show stats +* Increment, Decrement +* Accessible through the control interface: counter. + +=== Rate Counters + +Rate counters count rates of events. + +* Printed as part of VTY show stats +* Intervals: per second, minute, hour, day or absolute value +* Increment only +* Accessible through the control interface +* Rate counters are grouped and different instances per group can exist + +The control interface command to get a counter (group) is: + +rate_ctr.per_{sec,min,hour,day,abs}...[counter_name] + +It is possible to get all counters from a group by omitting the counter name + +=== Stat Item + +Stat items are a grouped replacement for osmo counters, but not many stat +items are available yet. + +* Printed as part of VTY show stats +* Replacement for osmo counters +* Not yet available through the control interface +* Grouped and indexed like rate counters +* Items have a unit +* Keeps a list of the last values measured, so could return an average, min, + max, std. deviation + +=== Stats Reporter + +Statsd stats reporter can send osmo counter, rate counter and stats item values to statsd + +See the stats reporter command of the VTY reference for details on how to +setup the connection to statsd. + -- To view, visit https://gerrit.osmocom.org/13516 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I01b8529136450cb50e48b0fb5c17cb2daa5e24c3 Gerrit-Change-Number: 13516 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 12:15:07 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 4 Apr 2019 12:15:07 +0000 Subject: Change in osmo-msc[master]: sgs_iface: fix nullpointer dereference In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13513 ) Change subject: sgs_iface: fix nullpointer dereference ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13513 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6 Gerrit-Change-Number: 13513 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 04 Apr 2019 12:15:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 13:11:30 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 4 Apr 2019 13:11:30 +0000 Subject: Change in osmo-hlr[master]: fix error logging for GSUP route Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13517 Change subject: fix error logging for GSUP route ...................................................................... fix error logging for GSUP route The addr may not be nul terminated. Change-Id: Ie4def16008af573ed2e1367d9da50c3d2b5a71ef --- M src/gsup_send.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/17/13517/1 diff --git a/src/gsup_send.c b/src/gsup_send.c index b2c4e02..b178f8b 100644 --- a/src/gsup_send.c +++ b/src/gsup_send.c @@ -35,7 +35,7 @@ conn = gsup_route_find(gs, addr, addrlen); if (!conn) { - DEBUGP(DLGSUP, "Cannot find route for addr %s\n", addr); + DEBUGP(DLGSUP, "Cannot find route for addr %s\n", osmo_quote_str((const char*)addr, addrlen)); msgb_free(msg); return -ENODEV; } -- To view, visit https://gerrit.osmocom.org/13517 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie4def16008af573ed2e1367d9da50c3d2b5a71ef Gerrit-Change-Number: 13517 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 13:43:10 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 13:43:10 +0000 Subject: Change in osmo-ci[master]: ansible: gsm-tester: Remove net iface name from hash input Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13518 Change subject: ansible: gsm-tester: Remove net iface name from hash input ...................................................................... ansible: gsm-tester: Remove net iface name from hash input Otherwise every time the interface is added (ie when it goes back to default netns), the generate name changes due to DEVPATH containing current name at the end of the path. Change-Id: I87c686caa23a3b39e48e0762d4323a59be7cd4b8 --- M ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/18/13518/1 diff --git a/ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules b/ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules index a9826e2..376b214 100644 --- a/ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules +++ b/ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules @@ -5,6 +5,6 @@ # If dev paths are too long (too many usb hubs in the path) (>IFNAMSIZ), ID_NET_NAME_PATH is not populated. ENV{DEVTYPE}=="wwan", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}" -ENV{DEVTYPE}=="wwan", ENV{ID_NET_NAME_PATH}=="", PROGRAM="/bin/sh -ec 'echo ${DEVPATH} | sha1sum | head -c14'", NAME="r$result" +ENV{DEVTYPE}=="wwan", ENV{ID_NET_NAME_PATH}=="", PROGRAM="/bin/sh -ec 'echo ${DEVPATH} | xargs dirname | sha1sum | head -c14'", NAME="r$result" LABEL="net_setup_link_end" -- To view, visit https://gerrit.osmocom.org/13518 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I87c686caa23a3b39e48e0762d4323a59be7cd4b8 Gerrit-Change-Number: 13518 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 13:57:09 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 4 Apr 2019 13:57:09 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use proper format specifiers for BTS / TRX number Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13519 Change subject: abis_nm.c: use proper format specifiers for BTS / TRX number ...................................................................... abis_nm.c: use proper format specifiers for BTS / TRX number Change-Id: I429d00d1393c221070e4c9e0997cbd14ae96103e --- M src/osmo-bsc/abis_nm.c 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/19/13519/1 diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index 826c1e2..6478d81 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -1713,7 +1713,7 @@ return -EINVAL; } - DEBUGP(DNM, "Get Attr (bts=%d)\n", bts->nr); + DEBUGP(DNM, "Get Attr (bts=%u)\n", bts->nr); msg = nm_msgb_alloc(); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); @@ -1731,7 +1731,7 @@ struct msgb *msg = nm_msgb_alloc(); uint8_t *cur; - DEBUGP(DNM, "Set BTS Attr (bts=%d)\n", bts->nr); + DEBUGP(DNM, "Set BTS Attr (bts=%u)\n", bts->nr); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, attr_len, NM_MT_SET_BTS_ATTR, NM_OC_BTS, bts->bts_nr, 0xff, 0xff); @@ -1748,7 +1748,7 @@ struct msgb *msg = nm_msgb_alloc(); uint8_t *cur; - DEBUGP(DNM, "Set TRX Attr (bts=%d,trx=%d)\n", trx->bts->nr, trx->nr); + DEBUGP(DNM, "Set TRX Attr (bts=%u,trx=%u)\n", trx->bts->nr, trx->nr); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, attr_len, NM_MT_SET_RADIO_ATTR, NM_OC_RADIO_CARRIER, @@ -2853,7 +2853,7 @@ struct gsm_bts_trx *trx = data; struct ipacc_ack_signal_data signal; - LOGP(DRSL, LOGL_NOTICE, "(bts=%d,trx=%d) RSL connection request timed out\n", trx->bts->nr, trx->nr); + LOGP(DRSL, LOGL_NOTICE, "(bts=%u,trx=%u) RSL connection request timed out\n", trx->bts->nr, trx->nr); /* Fake an RSL CONECT NACK message from the BTS. */ signal.trx = trx; @@ -2884,7 +2884,7 @@ if (ip == 0) attr_len -= 5; - LOGP(DNM, LOGL_INFO, "(bts=%d,trx=%d) IPA RSL CONNECT IP=%s PORT=%u STREAM=0x%02x\n", + LOGP(DNM, LOGL_INFO, "(bts=%u,trx=%u) IPA RSL CONNECT IP=%s PORT=%u STREAM=0x%02x\n", trx->bts->nr, trx->nr, inet_ntoa(ia), port, stream); error = abis_nm_ipaccess_msg(trx->bts, NM_MT_IPACC_RSL_CONNECT, @@ -2939,7 +2939,7 @@ return; } - LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Requesting administrative state change %s -> %s [%s]\n", + LOGP(DNM, LOGL_NOTICE, "(bts=%u,trx=%u) Requesting administrative state change %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); -- To view, visit https://gerrit.osmocom.org/13519 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I429d00d1393c221070e4c9e0997cbd14ae96103e Gerrit-Change-Number: 13519 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 13:57:10 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 4 Apr 2019 13:57:10 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: also print TRX number in abis_nm_get_attr() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13520 Change subject: abis_nm.c: also print TRX number in abis_nm_get_attr() ...................................................................... abis_nm.c: also print TRX number in abis_nm_get_attr() Change-Id: Ice776b1cee37acf737afb952c79eff2803e84862 --- M src/osmo-bsc/abis_nm.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/20/13520/1 diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index 6478d81..33535a4 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -1713,7 +1713,7 @@ return -EINVAL; } - DEBUGP(DNM, "Get Attr (bts=%u)\n", bts->nr); + DEBUGP(DNM, "Get Attr (bts=%u,trx=%u)\n", bts->nr, trx_nr); msg = nm_msgb_alloc(); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); -- To view, visit https://gerrit.osmocom.org/13520 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ice776b1cee37acf737afb952c79eff2803e84862 Gerrit-Change-Number: 13520 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 13:57:10 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 4 Apr 2019 13:57:10 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use abis_nm_ipa_magic from libosmocore Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13521 Change subject: abis_nm.c: use abis_nm_ipa_magic from libosmocore ...................................................................... abis_nm.c: use abis_nm_ipa_magic from libosmocore Change-Id: I051ae0550b5375a141e1bd4b3383a54302da83e1 --- M src/osmo-bsc/abis_nm.c 1 file changed, 4 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/21/13521/1 diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index 33535a4..a9b5aa5 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -2690,10 +2690,6 @@ return abis_nm_sendmsg(bts, msg); } -/* ip.access nanoBTS specific commands */ -static const char ipaccess_magic[] = "com.ipaccess"; - - static int abis_nm_rx_ipacc(struct msgb *msg) { struct in_addr addr; @@ -2706,7 +2702,7 @@ foh = (struct abis_om_fom_hdr *) (oh->data + 1 + idstrlen); - if (strncmp((char *)&oh->data[1], ipaccess_magic, idstrlen)) { + if (strncmp((char *)&oh->data[1], abis_nm_ipa_magic, idstrlen)) { LOGPFOH(DNM, LOGL_ERROR, foh, "id string is not com.ipaccess !?!\n"); return -EINVAL; } @@ -2819,9 +2815,9 @@ oh->mdisc = ABIS_OM_MDISC_MANUF; /* add the ip.access magic */ - data = msgb_put(msg, sizeof(ipaccess_magic)+1); - *data++ = sizeof(ipaccess_magic); - memcpy(data, ipaccess_magic, sizeof(ipaccess_magic)); + data = msgb_put(msg, sizeof(abis_nm_ipa_magic)+1); + *data++ = sizeof(abis_nm_ipa_magic); + memcpy(data, abis_nm_ipa_magic, sizeof(abis_nm_ipa_magic)); /* fill the 12.21 FOM header */ foh = (struct abis_om_fom_hdr *) msgb_put(msg, sizeof(*foh)); -- To view, visit https://gerrit.osmocom.org/13521 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I051ae0550b5375a141e1bd4b3383a54302da83e1 Gerrit-Change-Number: 13521 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 13:57:11 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 4 Apr 2019 13:57:11 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13522 Change subject: abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic ...................................................................... abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic Change-Id: I1ce97fc28a608894c8dfa3bbc55032e66bc44e5b --- M src/osmo-bsc/abis_nm.c 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/22/13522/1 diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index a9b5aa5..5be207f 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -2815,9 +2815,8 @@ oh->mdisc = ABIS_OM_MDISC_MANUF; /* add the ip.access magic */ - data = msgb_put(msg, sizeof(abis_nm_ipa_magic)+1); - *data++ = sizeof(abis_nm_ipa_magic); - memcpy(data, abis_nm_ipa_magic, sizeof(abis_nm_ipa_magic)); + msgb_lv_put(msg, sizeof(abis_nm_ipa_magic), + (const uint8_t *) abis_nm_ipa_magic); /* fill the 12.21 FOM header */ foh = (struct abis_om_fom_hdr *) msgb_put(msg, sizeof(*foh)); -- To view, visit https://gerrit.osmocom.org/13522 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1ce97fc28a608894c8dfa3bbc55032e66bc44e5b Gerrit-Change-Number: 13522 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 13:57:11 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 4 Apr 2019 13:57:11 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: fix incomplete DEBUGPFOH() message Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13523 Change subject: abis_nm.c: fix incomplete DEBUGPFOH() message ...................................................................... abis_nm.c: fix incomplete DEBUGPFOH() message Change-Id: I65ff2968523a90607bafd44e6f4f3d3e29ff73ef --- M src/osmo-bsc/abis_nm.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/23/13523/1 diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index 5be207f..6ba32af 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -2709,7 +2709,8 @@ abis_nm_tlv_parse(&tp, sign_link->trx->bts, foh->data, oh->length-sizeof(*foh)); - DEBUGPFOH(DNM, foh, "IPACCESS(0x%02x): ", foh->msg_type); + DEBUGPFOH(DNM, foh, "IPACCESS(0x%02x): %s\n", foh->msg_type, + osmo_hexdump(foh->data, oh->length - sizeof(*foh))); switch (foh->msg_type) { case NM_MT_IPACC_RSL_CONNECT_ACK: -- To view, visit https://gerrit.osmocom.org/13523 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I65ff2968523a90607bafd44e6f4f3d3e29ff73ef Gerrit-Change-Number: 13523 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 14:23:05 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 4 Apr 2019 14:23:05 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: fix broken logging in abis_nm_rx_ipacc() In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13523 ) Change subject: abis_nm.c: fix broken logging in abis_nm_rx_ipacc() ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13523 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I65ff2968523a90607bafd44e6f4f3d3e29ff73ef Gerrit-Change-Number: 13523 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 04 Apr 2019 14:23:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 14:23:51 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 14:23:51 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use proper format specifiers for BTS / TRX number In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13519 ) Change subject: abis_nm.c: use proper format specifiers for BTS / TRX number ...................................................................... Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/13519/1/src/osmo-bsc/abis_nm.c File src/osmo-bsc/abis_nm.c: https://gerrit.osmocom.org/#/c/13519/1/src/osmo-bsc/abis_nm.c at 1716 PS1, Line 1716: DEBUGP(DNM, "Get Attr (bts=%u)\n", bts->nr); It's an uint8_t, it should actually be: DEBUGP(DNM, "Get Attr (bts=%" PRIu8 "\n", bts->nr); Same for others below. -- To view, visit https://gerrit.osmocom.org/13519 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I429d00d1393c221070e4c9e0997cbd14ae96103e Gerrit-Change-Number: 13519 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 04 Apr 2019 14:23:51 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 14:24:29 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 14:24:29 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: also print TRX number in abis_nm_get_attr() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13520 ) Change subject: abis_nm.c: also print TRX number in abis_nm_get_attr() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13520/1/src/osmo-bsc/abis_nm.c File src/osmo-bsc/abis_nm.c: https://gerrit.osmocom.org/#/c/13520/1/src/osmo-bsc/abis_nm.c at 1716 PS1, Line 1716: DEBUGP(DNM, "Get Attr (bts=%u,trx=%u)\n", bts->nr, trx_nr); SAme, PRIu8 -- To view, visit https://gerrit.osmocom.org/13520 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice776b1cee37acf737afb952c79eff2803e84862 Gerrit-Change-Number: 13520 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 04 Apr 2019 14:24:29 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 14:26:13 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 14:26:13 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use abis_nm_ipa_magic from libosmocore In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13521 ) Change subject: abis_nm.c: use abis_nm_ipa_magic from libosmocore ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13521 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I051ae0550b5375a141e1bd4b3383a54302da83e1 Gerrit-Change-Number: 13521 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 04 Apr 2019 14:26:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 14:26:22 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 4 Apr 2019 14:26:22 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use proper format specifiers for BTS / TRX number In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13519 ) Change subject: abis_nm.c: use proper format specifiers for BTS / TRX number ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13519/1/src/osmo-bsc/abis_nm.c File src/osmo-bsc/abis_nm.c: https://gerrit.osmocom.org/#/c/13519/1/src/osmo-bsc/abis_nm.c at 1716 PS1, Line 1716: DEBUGP(DNM, "Get Attr (bts=%u)\n", bts->nr); > it should actually be [...] PRIu8 Ideally, yes. But '%u' also works. What are the advantages of PRIu8 in this particular case? And whet are the disadvantages of '%u' here? -- To view, visit https://gerrit.osmocom.org/13519 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I429d00d1393c221070e4c9e0997cbd14ae96103e Gerrit-Change-Number: 13519 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 04 Apr 2019 14:26:22 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 14:28:37 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 14:28:37 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13522 ) Change subject: abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13522/1/src/osmo-bsc/abis_nm.c File src/osmo-bsc/abis_nm.c: https://gerrit.osmocom.org/#/c/13522/1/src/osmo-bsc/abis_nm.c at 2818 PS1, Line 2818: msgb_lv_put(msg, sizeof(abis_nm_ipa_magic), Are you sure this doesn't fit in one line? -- To view, visit https://gerrit.osmocom.org/13522 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1ce97fc28a608894c8dfa3bbc55032e66bc44e5b Gerrit-Change-Number: 13522 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 04 Apr 2019 14:28:37 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 14:30:27 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 14:30:27 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: fix broken logging in abis_nm_rx_ipacc() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13523 ) Change subject: abis_nm.c: fix broken logging in abis_nm_rx_ipacc() ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13523/2/src/osmo-bsc/abis_nm.c File src/osmo-bsc/abis_nm.c: https://gerrit.osmocom.org/#/c/13523/2/src/osmo-bsc/abis_nm.c at 2717 PS2, Line 2717: DEBUGPFOH(DNM, foh, "RSL CONNECT ACK "); Aren't you adding here an extra EOL which wasn't there before? -- To view, visit https://gerrit.osmocom.org/13523 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I65ff2968523a90607bafd44e6f4f3d3e29ff73ef Gerrit-Change-Number: 13523 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 04 Apr 2019 14:30:27 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 14:32:17 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 14:32:17 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use proper format specifiers for BTS / TRX number In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13519 ) Change subject: abis_nm.c: use proper format specifiers for BTS / TRX number ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13519/1/src/osmo-bsc/abis_nm.c File src/osmo-bsc/abis_nm.c: https://gerrit.osmocom.org/#/c/13519/1/src/osmo-bsc/abis_nm.c at 1716 PS1, Line 1716: DEBUGP(DNM, "Get Attr (bts=%u)\n", bts->nr); > > it should actually be [...] PRIu8 [?] Making sure it compiles fine if you ever happen to use some broken compiler which doesn't like using %u for uint8_t. -- To view, visit https://gerrit.osmocom.org/13519 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I429d00d1393c221070e4c9e0997cbd14ae96103e Gerrit-Change-Number: 13519 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 04 Apr 2019 14:32:17 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 14:38:45 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 14:38:45 +0000 Subject: Change in osmo-ci[master]: ansible: gsm-tester: Install osmo-gsm-tester_netns_setup.sh Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13524 Change subject: ansible: gsm-tester: Install osmo-gsm-tester_netns_setup.sh ...................................................................... ansible: gsm-tester: Install osmo-gsm-tester_netns_setup.sh Change-Id: Iaa8802b86429abfaf84fc0f20bd207737dbc9812 --- A ansible/roles/gsm-tester/files/osmo-gsm-tester_netns_setup.sh M ansible/roles/gsm-tester/tasks/main.yml 2 files changed, 35 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/24/13524/1 diff --git a/ansible/roles/gsm-tester/files/osmo-gsm-tester_netns_setup.sh b/ansible/roles/gsm-tester/files/osmo-gsm-tester_netns_setup.sh new file mode 100755 index 0000000..1600c44 --- /dev/null +++ b/ansible/roles/gsm-tester/files/osmo-gsm-tester_netns_setup.sh @@ -0,0 +1,22 @@ +#!/bin/bash -e + +ifname="$1" +netns="$2" +shift +shift + + + +if [ -f "/var/run/netns/${netns}" ]; then + echo "netns $netns already exists" +else + echo "Creating netns $netns" + ip netns add "$netns" +fi + +if [ -d "/sys/class/net/${ifname}" ]; then + echo "Moving iface $ifname to netns $netns" + ip link set $ifname netns $netns +else + ip netns exec $netns ls "/sys/class/net/${ifname}" >/dev/null && echo "iface $ifname already in netns $netns" +fi diff --git a/ansible/roles/gsm-tester/tasks/main.yml b/ansible/roles/gsm-tester/tasks/main.yml index c9b7429..34846a5 100644 --- a/ansible/roles/gsm-tester/tasks/main.yml +++ b/ansible/roles/gsm-tester/tasks/main.yml @@ -254,6 +254,19 @@ dest: /etc/sudoers.d/osmo-gsm-tester_netns_exec mode: 0440 +- name: create a wrapper script to move modem net iface into its own netns + copy: + src: osmo-gsm-tester_netns_setup.sh + dest: /usr/local/bin/osmo-gsm-tester_netns_setup.sh + mode: 755 + +- name: allow osmo-gsm-tester sudo osmo-gsm-tester_netns_setup.sh + copy: + content: | + %osmo-gsm-tester ALL=(root) NOPASSWD: /usr/local/bin/osmo-gsm-tester_netns_setup.sh + dest: /etc/sudoers.d/osmo-gsm-tester_netns_setup + mode: 0440 + - name: logrotate limit filesizes to 10M copy: content: "maxsize 10M" -- To view, visit https://gerrit.osmocom.org/13524 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iaa8802b86429abfaf84fc0f20bd207737dbc9812 Gerrit-Change-Number: 13524 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 14:39:14 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 14:39:14 +0000 Subject: Change in osmo-gsm-tester[master]: util: use launch_sync API instead of manual wait Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13525 Change subject: util: use launch_sync API instead of manual wait ...................................................................... util: use launch_sync API instead of manual wait The API is available so no need to manually craft all steps in there. Change-Id: I4afedb185f6e864929155981e8a2ec2df90110c3 --- M src/osmo_gsm_tester/util.py 1 file changed, 3 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/25/13525/1 diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index e9a1f30..21653be 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -52,10 +52,7 @@ ''' from .process import Process proc = Process('patchelf', run_dir, ['patchelf', '--set-rpath', paths, binary]) - proc.launch() - proc.wait() - if proc.result != 0: - raise RuntimeError('patchelf finished with err code %d' % proc.result) + proc.launch_sync() def ip_to_iface(ip): try: @@ -91,10 +88,7 @@ from .process import Process SETCAP_NET_RAW_BIN = 'osmo-gsm-tester_setcap_net_raw.sh' proc = Process(SETCAP_NET_RAW_BIN, run_dir, ['sudo', SETCAP_NET_RAW_BIN, binary]) - proc.launch() - proc.wait() - if proc.result != 0: - raise RuntimeError('%s finished with err code %d' % (SETCAP_NET_RAW_BIN, proc.result)) + proc.launch_sync() def setcap_net_admin(binary, run_dir): ''' @@ -104,10 +98,7 @@ from .process import Process SETCAP_NET_ADMIN_BIN = 'osmo-gsm-tester_setcap_net_admin.sh' proc = Process(SETCAP_NET_ADMIN_BIN, run_dir, ['sudo', SETCAP_NET_ADMIN_BIN, binary]) - proc.launch() - proc.wait() - if proc.result != 0: - raise RuntimeError('%s finished with err code %d' % (SETCAP_NET_ADMIN_BIN, proc.result)) + proc.launch_sync() def import_path_prepend(pathname): dir = os.path.realpath(pathname) -- To view, visit https://gerrit.osmocom.org/13525 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4afedb185f6e864929155981e8a2ec2df90110c3 Gerrit-Change-Number: 13525 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 14:39:14 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 14:39:14 +0000 Subject: Change in osmo-gsm-tester[master]: modem: Move modem iface to its netns before using it Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13526 Change subject: modem: Move modem iface to its netns before using it ...................................................................... modem: Move modem iface to its netns before using it We used to do that once after ofono startup for all iface (modem-netns-setup.py), but then if a modem crashes the interface is re-created on the default netns, and tests fail until manual re-run of modem-netns-setup.py. This way now we always make sure the iface is moved to the expected netns before it is used. Related: OS#3881 Change-Id: I506309c424aa46684c4516a1a0217343ecbf32c6 --- M src/osmo_gsm_tester/modem.py M src/osmo_gsm_tester/util.py A utils/osmo-gsm-tester_netns_setup.sh 3 files changed, 34 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/26/13526/1 diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py index 28f7f04..7e58e32 100644 --- a/src/osmo_gsm_tester/modem.py +++ b/src/osmo_gsm_tester/modem.py @@ -677,6 +677,7 @@ iface = ctx_settings.get('Interface', None) if not iface: raise log.Error('%s Settings contains no iface! %r' % (ctx_id, repr(ctx_settings))) + util.move_iface_to_netns(iface, self.netns(), self.run_dir.new_dir('move_netns')) self.run_netns_wait('ifup', ('ip', 'link', 'set', 'dev', iface, 'up')) self.run_netns_wait('dhcp', ('udhcpc', '-q', '-i', iface)) diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index 21653be..b0ce041 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -100,6 +100,17 @@ proc = Process(SETCAP_NET_ADMIN_BIN, run_dir, ['sudo', SETCAP_NET_ADMIN_BIN, binary]) proc.launch_sync() +def move_iface_to_netns(ifname, netns, run_dir): + ''' + Moves an iface to a netns. It creates the netns if it doesn't exist. + fail_iface_not_found=False is handy in order to assume the iface is already + in another netns and thus cannot be foud. + ''' + from .process import Process + NETNS_SETUP_BIN = 'osmo-gsm-tester_netns_setup.sh' + proc = Process('move_netns', run_dir, ['sudo', NETNS_SETUP_BIN, ifname, netns]) + proc.launch_sync() + def import_path_prepend(pathname): dir = os.path.realpath(pathname) if dir not in sys.path: diff --git a/utils/osmo-gsm-tester_netns_setup.sh b/utils/osmo-gsm-tester_netns_setup.sh new file mode 100755 index 0000000..1600c44 --- /dev/null +++ b/utils/osmo-gsm-tester_netns_setup.sh @@ -0,0 +1,22 @@ +#!/bin/bash -e + +ifname="$1" +netns="$2" +shift +shift + + + +if [ -f "/var/run/netns/${netns}" ]; then + echo "netns $netns already exists" +else + echo "Creating netns $netns" + ip netns add "$netns" +fi + +if [ -d "/sys/class/net/${ifname}" ]; then + echo "Moving iface $ifname to netns $netns" + ip link set $ifname netns $netns +else + ip netns exec $netns ls "/sys/class/net/${ifname}" >/dev/null && echo "iface $ifname already in netns $netns" +fi -- To view, visit https://gerrit.osmocom.org/13526 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I506309c424aa46684c4516a1a0217343ecbf32c6 Gerrit-Change-Number: 13526 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 14:46:34 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 14:46:34 +0000 Subject: Change in osmo-gsm-tester[master]: process: Early return during process termination if no proc running Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13527 Change subject: process: Early return during process termination if no proc running ...................................................................... process: Early return during process termination if no proc running This avoids extra unneeded logging about killing with signal when actually no signal is being sent. Change-Id: I5b5dd78fe3301d8eef2ab93da3b37029268ae198 --- M src/osmo_gsm_tester/process.py 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/27/13527/1 diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index 441d4ea..66ecae5 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -104,7 +104,10 @@ time.sleep(wait_step) def terminate_all(self): - self.dbg("Scheduled to terminate %d processes." % len(self._processes)) + num_processes = len(self._processes) + self.dbg("Scheduled to terminate %d processes." % num_processes) + if num_processes == 0: + return self._prune_dead_processes(True) self._build_process_map() @@ -116,6 +119,8 @@ if sig == signal.SIGKILL: continue self._poll_for_termination() + if len(self._processes) == 0: + return class Process(log.Origin): -- To view, visit https://gerrit.osmocom.org/13527 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5b5dd78fe3301d8eef2ab93da3b37029268ae198 Gerrit-Change-Number: 13527 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 14:47:06 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 4 Apr 2019 14:47:06 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13522 ) Change subject: abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13522/1/src/osmo-bsc/abis_nm.c File src/osmo-bsc/abis_nm.c: https://gerrit.osmocom.org/#/c/13522/1/src/osmo-bsc/abis_nm.c at 2818 PS1, Line 2818: msgb_lv_put(msg, sizeof(abis_nm_ipa_magic), > Are you sure this doesn't fit in one line? Of course it does fit in 120 chars long line, but at that moment I have been using vim in my regular 80 chars terminal. Personally, I still prefer the 80 chars limitation. If you insist, I can modify this patch. -- To view, visit https://gerrit.osmocom.org/13522 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1ce97fc28a608894c8dfa3bbc55032e66bc44e5b Gerrit-Change-Number: 13522 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 04 Apr 2019 14:47:06 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 14:48:13 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 14:48:13 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13522 ) Change subject: abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13522/1/src/osmo-bsc/abis_nm.c File src/osmo-bsc/abis_nm.c: https://gerrit.osmocom.org/#/c/13522/1/src/osmo-bsc/abis_nm.c at 2818 PS1, Line 2818: msgb_lv_put(msg, sizeof(abis_nm_ipa_magic), > Of course it does fit in 120 chars long line, but at that moment I have been using vim in my regular [?] It's fine, I thought the wrapping line in gerrit was 80-90 :) -- To view, visit https://gerrit.osmocom.org/13522 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1ce97fc28a608894c8dfa3bbc55032e66bc44e5b Gerrit-Change-Number: 13522 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 04 Apr 2019 14:48:13 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 15:38:35 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 15:38:35 +0000 Subject: Change in osmo-gsm-tester[master]: process: Early return during process termination if no proc running In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13527 ) Change subject: process: Early return during process termination if no proc running ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13527 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5b5dd78fe3301d8eef2ab93da3b37029268ae198 Gerrit-Change-Number: 13527 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 04 Apr 2019 15:38:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 15:49:24 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 15:49:24 +0000 Subject: Change in osmo-gsm-tester[master]: process: Early return during process termination if no proc running In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13527 to look at the new patch set (#3). Change subject: process: Early return during process termination if no proc running ...................................................................... process: Early return during process termination if no proc running This avoids extra unneeded logging about killing with signal when actually no signal is being sent. Change-Id: I5b5dd78fe3301d8eef2ab93da3b37029268ae198 --- M selftest/suite_test.ok M src/osmo_gsm_tester/process.py M src/osmo_gsm_tester/suite.py 3 files changed, 8 insertions(+), 57 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/27/13527/3 -- To view, visit https://gerrit.osmocom.org/13527 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5b5dd78fe3301d8eef2ab93da3b37029268ae198 Gerrit-Change-Number: 13527 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 15:49:25 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 15:49:25 +0000 Subject: Change in osmo-gsm-tester[master]: suite: Make _processes an empty list during init time Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13528 Change subject: suite: Make _processes an empty list during init time ...................................................................... suite: Make _processes an empty list during init time It simplifies the code because we don't need to check if it is a list or not. Change-Id: I634901a1f4ba3a6b7294666012ea679ae148ff08 --- M src/osmo_gsm_tester/suite.py 1 file changed, 10 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/28/13528/1 diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index aefdc24..85eca46 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -73,7 +73,7 @@ self._resource_requirements = None self._resource_modifiers = None self._config = None - self._processes = None + self._processes = [] self._run_dir = None self.trial = trial self.definition = suite_definition @@ -241,8 +241,6 @@ process managed by suite finishes before cleanup time, the current test will be marked as FAIL and end immediatelly. If respwan=True, then suite will respawn() the process instead.''' - if self._processes is None: - self._processes = [] self._processes.insert(0, (process, respawn)) def stop_processes(self): @@ -396,16 +394,15 @@ return bvci def poll(self): - if self._processes: - for proc, respawn in self._processes: - if proc.terminated(): - if respawn == True: - proc.respawn() - else: - proc.log_stdout_tail() - proc.log_stderr_tail() - log.ctx(proc) - raise log.Error('Process ended prematurely: %s' % proc.name()) + for proc, respawn in self._processes: + if proc.terminated(): + if respawn == True: + proc.respawn() + else: + proc.log_stdout_tail() + proc.log_stderr_tail() + log.ctx(proc) + raise log.Error('Process ended prematurely: %s' % proc.name()) def prompt(self, *msgs, **msg_details): 'ask for user interaction. Do not use in tests that should run automatically!' -- To view, visit https://gerrit.osmocom.org/13528 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I634901a1f4ba3a6b7294666012ea679ae148ff08 Gerrit-Change-Number: 13528 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 16:10:13 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 16:10:13 +0000 Subject: Change in osmo-gsm-tester[master]: util: use launch_sync API instead of manual wait In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13525 ) Change subject: util: use launch_sync API instead of manual wait ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13525 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4afedb185f6e864929155981e8a2ec2df90110c3 Gerrit-Change-Number: 13525 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 04 Apr 2019 16:10:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 16:10:16 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 16:10:16 +0000 Subject: Change in osmo-gsm-tester[master]: modem: Move modem iface to its netns before using it In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13526 ) Change subject: modem: Move modem iface to its netns before using it ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13526 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I506309c424aa46684c4516a1a0217343ecbf32c6 Gerrit-Change-Number: 13526 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 04 Apr 2019 16:10:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 16:10:19 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 16:10:19 +0000 Subject: Change in osmo-gsm-tester[master]: util: use launch_sync API instead of manual wait In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13525 ) Change subject: util: use launch_sync API instead of manual wait ...................................................................... util: use launch_sync API instead of manual wait The API is available so no need to manually craft all steps in there. Change-Id: I4afedb185f6e864929155981e8a2ec2df90110c3 --- M src/osmo_gsm_tester/util.py 1 file changed, 3 insertions(+), 12 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index e9a1f30..21653be 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -52,10 +52,7 @@ ''' from .process import Process proc = Process('patchelf', run_dir, ['patchelf', '--set-rpath', paths, binary]) - proc.launch() - proc.wait() - if proc.result != 0: - raise RuntimeError('patchelf finished with err code %d' % proc.result) + proc.launch_sync() def ip_to_iface(ip): try: @@ -91,10 +88,7 @@ from .process import Process SETCAP_NET_RAW_BIN = 'osmo-gsm-tester_setcap_net_raw.sh' proc = Process(SETCAP_NET_RAW_BIN, run_dir, ['sudo', SETCAP_NET_RAW_BIN, binary]) - proc.launch() - proc.wait() - if proc.result != 0: - raise RuntimeError('%s finished with err code %d' % (SETCAP_NET_RAW_BIN, proc.result)) + proc.launch_sync() def setcap_net_admin(binary, run_dir): ''' @@ -104,10 +98,7 @@ from .process import Process SETCAP_NET_ADMIN_BIN = 'osmo-gsm-tester_setcap_net_admin.sh' proc = Process(SETCAP_NET_ADMIN_BIN, run_dir, ['sudo', SETCAP_NET_ADMIN_BIN, binary]) - proc.launch() - proc.wait() - if proc.result != 0: - raise RuntimeError('%s finished with err code %d' % (SETCAP_NET_ADMIN_BIN, proc.result)) + proc.launch_sync() def import_path_prepend(pathname): dir = os.path.realpath(pathname) -- To view, visit https://gerrit.osmocom.org/13525 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4afedb185f6e864929155981e8a2ec2df90110c3 Gerrit-Change-Number: 13525 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 16:10:20 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 16:10:20 +0000 Subject: Change in osmo-gsm-tester[master]: modem: Move modem iface to its netns before using it In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13526 ) Change subject: modem: Move modem iface to its netns before using it ...................................................................... modem: Move modem iface to its netns before using it We used to do that once after ofono startup for all iface (modem-netns-setup.py), but then if a modem crashes the interface is re-created on the default netns, and tests fail until manual re-run of modem-netns-setup.py. This way now we always make sure the iface is moved to the expected netns before it is used. Related: OS#3881 Change-Id: I506309c424aa46684c4516a1a0217343ecbf32c6 --- M src/osmo_gsm_tester/modem.py M src/osmo_gsm_tester/util.py A utils/osmo-gsm-tester_netns_setup.sh 3 files changed, 34 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py index 28f7f04..7e58e32 100644 --- a/src/osmo_gsm_tester/modem.py +++ b/src/osmo_gsm_tester/modem.py @@ -677,6 +677,7 @@ iface = ctx_settings.get('Interface', None) if not iface: raise log.Error('%s Settings contains no iface! %r' % (ctx_id, repr(ctx_settings))) + util.move_iface_to_netns(iface, self.netns(), self.run_dir.new_dir('move_netns')) self.run_netns_wait('ifup', ('ip', 'link', 'set', 'dev', iface, 'up')) self.run_netns_wait('dhcp', ('udhcpc', '-q', '-i', iface)) diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index 21653be..b0ce041 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -100,6 +100,17 @@ proc = Process(SETCAP_NET_ADMIN_BIN, run_dir, ['sudo', SETCAP_NET_ADMIN_BIN, binary]) proc.launch_sync() +def move_iface_to_netns(ifname, netns, run_dir): + ''' + Moves an iface to a netns. It creates the netns if it doesn't exist. + fail_iface_not_found=False is handy in order to assume the iface is already + in another netns and thus cannot be foud. + ''' + from .process import Process + NETNS_SETUP_BIN = 'osmo-gsm-tester_netns_setup.sh' + proc = Process('move_netns', run_dir, ['sudo', NETNS_SETUP_BIN, ifname, netns]) + proc.launch_sync() + def import_path_prepend(pathname): dir = os.path.realpath(pathname) if dir not in sys.path: diff --git a/utils/osmo-gsm-tester_netns_setup.sh b/utils/osmo-gsm-tester_netns_setup.sh new file mode 100755 index 0000000..1600c44 --- /dev/null +++ b/utils/osmo-gsm-tester_netns_setup.sh @@ -0,0 +1,22 @@ +#!/bin/bash -e + +ifname="$1" +netns="$2" +shift +shift + + + +if [ -f "/var/run/netns/${netns}" ]; then + echo "netns $netns already exists" +else + echo "Creating netns $netns" + ip netns add "$netns" +fi + +if [ -d "/sys/class/net/${ifname}" ]; then + echo "Moving iface $ifname to netns $netns" + ip link set $ifname netns $netns +else + ip netns exec $netns ls "/sys/class/net/${ifname}" >/dev/null && echo "iface $ifname already in netns $netns" +fi -- To view, visit https://gerrit.osmocom.org/13526 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I506309c424aa46684c4516a1a0217343ecbf32c6 Gerrit-Change-Number: 13526 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 16:10:30 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 16:10:30 +0000 Subject: Change in osmo-gsm-tester[master]: suite: Make _processes an empty list during init time In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13528 ) Change subject: suite: Make _processes an empty list during init time ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13528 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I634901a1f4ba3a6b7294666012ea679ae148ff08 Gerrit-Change-Number: 13528 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 04 Apr 2019 16:10:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 16:10:32 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 16:10:32 +0000 Subject: Change in osmo-gsm-tester[master]: process: Early return during process termination if no proc running In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13527 ) Change subject: process: Early return during process termination if no proc running ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13527 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5b5dd78fe3301d8eef2ab93da3b37029268ae198 Gerrit-Change-Number: 13527 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 04 Apr 2019 16:10:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 16:10:33 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 16:10:33 +0000 Subject: Change in osmo-gsm-tester[master]: suite: Make _processes an empty list during init time In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13528 ) Change subject: suite: Make _processes an empty list during init time ...................................................................... suite: Make _processes an empty list during init time It simplifies the code because we don't need to check if it is a list or not. Change-Id: I634901a1f4ba3a6b7294666012ea679ae148ff08 --- M src/osmo_gsm_tester/suite.py 1 file changed, 10 insertions(+), 13 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index aefdc24..85eca46 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -73,7 +73,7 @@ self._resource_requirements = None self._resource_modifiers = None self._config = None - self._processes = None + self._processes = [] self._run_dir = None self.trial = trial self.definition = suite_definition @@ -241,8 +241,6 @@ process managed by suite finishes before cleanup time, the current test will be marked as FAIL and end immediatelly. If respwan=True, then suite will respawn() the process instead.''' - if self._processes is None: - self._processes = [] self._processes.insert(0, (process, respawn)) def stop_processes(self): @@ -396,16 +394,15 @@ return bvci def poll(self): - if self._processes: - for proc, respawn in self._processes: - if proc.terminated(): - if respawn == True: - proc.respawn() - else: - proc.log_stdout_tail() - proc.log_stderr_tail() - log.ctx(proc) - raise log.Error('Process ended prematurely: %s' % proc.name()) + for proc, respawn in self._processes: + if proc.terminated(): + if respawn == True: + proc.respawn() + else: + proc.log_stdout_tail() + proc.log_stderr_tail() + log.ctx(proc) + raise log.Error('Process ended prematurely: %s' % proc.name()) def prompt(self, *msgs, **msg_details): 'ask for user interaction. Do not use in tests that should run automatically!' -- To view, visit https://gerrit.osmocom.org/13528 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I634901a1f4ba3a6b7294666012ea679ae148ff08 Gerrit-Change-Number: 13528 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 16:10:34 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 4 Apr 2019 16:10:34 +0000 Subject: Change in osmo-gsm-tester[master]: process: Early return during process termination if no proc running In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13527 ) Change subject: process: Early return during process termination if no proc running ...................................................................... process: Early return during process termination if no proc running This avoids extra unneeded logging about killing with signal when actually no signal is being sent. Change-Id: I5b5dd78fe3301d8eef2ab93da3b37029268ae198 --- M selftest/suite_test.ok M src/osmo_gsm_tester/process.py M src/osmo_gsm_tester/suite.py 3 files changed, 8 insertions(+), 57 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 85e94b2..908f24f 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -96,14 +96,6 @@ tst hello_world.py:[LINENR]: two [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR]: three [test_suite?hello_world.py:[LINENR]] tst hello_world.py:[LINENR] Test passed (N.N sec) [test_suite?hello_world.py] ---- ParallelTerminationStrategy: DBG: Scheduled to terminate 0 processes. ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGTERM ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGINT ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGKILL ---- ParallelTerminationStrategy: DBG: Scheduled to terminate 0 processes. ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGTERM ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGINT ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGKILL --------------------------------------------------------------------- trial test_suite PASS --------------------------------------------------------------------- @@ -127,14 +119,6 @@ tst test_error.py:[LINENR]: I am 'test_suite' / 'test_error.py:[LINENR]' [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]] tst test_error.py:[LINENR]: ERR: AssertionError: test_error.py:[LINENR]: assert False [test_suite?test_error.py:[LINENR]] [test_error.py:[LINENR]: assert False] tst test_error.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_error.py:[LINENR]] [test.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Scheduled to terminate 0 processes. [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGTERM [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGINT [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGKILL [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Scheduled to terminate 0 processes. [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGTERM [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGINT [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGKILL [process.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL --------------------------------------------------------------------- @@ -158,14 +142,6 @@ tst test_fail.py:[LINENR]: I am 'test_suite' / 'test_fail.py:[LINENR]' [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] tst test_fail.py:[LINENR]: ERR: EpicFail: This failure is expected [test_suite?test_fail.py:[LINENR]] [test_fail.py:[LINENR]] tst test_fail.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail.py:[LINENR]] [test.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Scheduled to terminate 0 processes. [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGTERM [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGINT [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGKILL [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Scheduled to terminate 0 processes. [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGTERM [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGINT [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGKILL [process.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL --------------------------------------------------------------------- @@ -188,14 +164,6 @@ ---------------------------------------------- tst test_fail_raise.py:[LINENR]: ERR: ExpectedFail: This failure is expected [test_suite?test_fail_raise.py:[LINENR]] [test_fail_raise.py:[LINENR]: raise ExpectedFail('This failure is expected')] tst test_fail_raise.py:[LINENR]: Test FAILED (N.N sec) [test_suite?test_fail_raise.py:[LINENR]] [test.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Scheduled to terminate 0 processes. [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGTERM [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGINT [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGKILL [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Scheduled to terminate 0 processes. [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGTERM [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGINT [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGKILL [process.py:[LINENR]] --------------------------------------------------------------------- trial test_suite FAIL --------------------------------------------------------------------- @@ -283,14 +251,6 @@ 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] [test.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Scheduled to terminate 0 processes. [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGTERM [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGINT [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGKILL [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Scheduled to terminate 0 processes. [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGTERM [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGINT [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGKILL [process.py:[LINENR]] --------------------------------------------------------------------- trial test_suite PASS --------------------------------------------------------------------- @@ -378,14 +338,6 @@ 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] [test.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Scheduled to terminate 0 processes. [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGTERM [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGINT [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGKILL [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Scheduled to terminate 0 processes. [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGTERM [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGINT [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGKILL [process.py:[LINENR]] --------------------------------------------------------------------- trial test_suite PASS --------------------------------------------------------------------- @@ -519,14 +471,6 @@ 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] [test.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Scheduled to terminate 0 processes. [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGTERM [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGINT [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGKILL [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Scheduled to terminate 0 processes. [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGTERM [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGINT [process.py:[LINENR]] ---- ParallelTerminationStrategy: DBG: Starting to kill with SIGKILL [process.py:[LINENR]] --------------------------------------------------------------------- trial test_suite PASS --------------------------------------------------------------------- diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index 441d4ea..66ecae5 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -104,7 +104,10 @@ time.sleep(wait_step) def terminate_all(self): - self.dbg("Scheduled to terminate %d processes." % len(self._processes)) + num_processes = len(self._processes) + self.dbg("Scheduled to terminate %d processes." % num_processes) + if num_processes == 0: + return self._prune_dead_processes(True) self._build_process_map() @@ -116,6 +119,8 @@ if sig == signal.SIGKILL: continue self._poll_for_termination() + if len(self._processes) == 0: + return class Process(log.Origin): diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 85eca46..0738e96 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -244,6 +244,8 @@ self._processes.insert(0, (process, respawn)) def stop_processes(self): + if len(self._processes) == 0: + return strategy = process.ParallelTerminationStrategy() while self._processes: proc, _ = self._processes.pop() -- To view, visit https://gerrit.osmocom.org/13527 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5b5dd78fe3301d8eef2ab93da3b37029268ae198 Gerrit-Change-Number: 13527 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 4 18:45:38 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 4 Apr 2019 18:45:38 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: fix broken logging in abis_nm_rx_ipacc() In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13523 ) Change subject: abis_nm.c: fix broken logging in abis_nm_rx_ipacc() ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13523/2/src/osmo-bsc/abis_nm.c File src/osmo-bsc/abis_nm.c: https://gerrit.osmocom.org/#/c/13523/2/src/osmo-bsc/abis_nm.c at 2712 PS2, Line 2712: \n I am intentionally adding this EOL, because the most branches of switch (excluding NM_MT_IPACC_RSL_CONNECT_ACK and the 'default') are using LOGPFOH() and LOGPFOH() to print the message type. As a result, we get the following: DNM DEBUG <0004> abis_nm.c:2716 OC=GPRS-CELL(f1) INST=(00,00,ff): IPACCESS(0xf6): DNM DEBUG <0004> abis_nm.c:2769 OC=GPRS-CELL(f1) INST=(00,00,ff): SET ATTR ACK After this patch, we would get the following: DNM DEBUG <0004> abis_nm.c:2713 OC=GPRS-NSE(f0) INST=(00,ff,ff): Rx IPACCESS(0xf6): 9d 00 02 00 65 a0 00 07 03 03 03 03 1e 03 0a a1 00 0b 03 03 03 03 03 0a 03 0a 03 0a 03 DNM DEBUG <0004> abis_nm.c:2766 OC=GPRS-NSE(f0) INST=(00,ff,ff): SET ATTR ACK -- To view, visit https://gerrit.osmocom.org/13523 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I65ff2968523a90607bafd44e6f4f3d3e29ff73ef Gerrit-Change-Number: 13523 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 04 Apr 2019 18:45:38 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 06:36:12 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 5 Apr 2019 06:36:12 +0000 Subject: Change in docker-playground[master]: nplab-m3ua-test: add sigtran-tests dependency Message-ID: Hello Pau Espin Pedrol, Daniel Willmann, I'd like you to do a code review. Please visit https://gerrit.osmocom.org/13529 to review the following change. Change subject: nplab-m3ua-test: add sigtran-tests dependency ...................................................................... nplab-m3ua-test: add sigtran-tests dependency Make sure to build sigtran-tests before building nplab-m3ua-tests. This has been working by coincidence without the dependency so far, because nplab-sua-test had the dependency listed and that test ran on the same host. Change-Id: I9df1d2b188e86b3c99c6ec793b6eb644ab3c27c9 --- M nplab-m3ua-test/jenkins.sh 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/29/13529/1 diff --git a/nplab-m3ua-test/jenkins.sh b/nplab-m3ua-test/jenkins.sh index 103ea13..0f189ea 100755 --- a/nplab-m3ua-test/jenkins.sh +++ b/nplab-m3ua-test/jenkins.sh @@ -4,6 +4,7 @@ IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}" docker_images_require \ "debian-stretch-build" \ + "sigtran-tests" \ "osmo-stp-$IMAGE_SUFFIX" \ "debian-stretch-titan" \ "nplab-m3ua-test" -- To view, visit https://gerrit.osmocom.org/13529 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9df1d2b188e86b3c99c6ec793b6eb644ab3c27c9 Gerrit-Change-Number: 13529 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 06:36:13 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 5 Apr 2019 06:36:13 +0000 Subject: Change in docker-playground[master]: nplab-m3ua-test: support running without jenkins Message-ID: Hello Pau Espin Pedrol, Daniel Willmann, I'd like you to do a code review. Please visit https://gerrit.osmocom.org/13530 to review the following change. Change subject: nplab-m3ua-test: support running without jenkins ...................................................................... nplab-m3ua-test: support running without jenkins Don't use $WORKSPACE anymore, use $VOL_BASE_DIR like in every other jenkins.sh in this repository. Make it possible to run jenkins.sh outside of jenkins (where $WORKSPACE is not set), because jenkins_common.sh will set up $VOL_BASE_DIR to point to /tmp/logs. Change-Id: I200b4ee1760a879cbc0a80a30a062a3f2a8e703d --- M nplab-m3ua-test/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/30/13530/1 diff --git a/nplab-m3ua-test/jenkins.sh b/nplab-m3ua-test/jenkins.sh index 0f189ea..5021ff2 100755 --- a/nplab-m3ua-test/jenkins.sh +++ b/nplab-m3ua-test/jenkins.sh @@ -30,7 +30,7 @@ --network $NET_NAME --ip 172.18.7.2 \ -v $VOL_BASE_DIR/m3ua-tester:/data \ --name ${BUILD_TAG}-m3ua-test \ - $REPO_USER/nplab-m3ua-test > $WORKSPACE/logs/junit-xml-m3ua.log + $REPO_USER/nplab-m3ua-test > $VOL_BASE_DIR/junit-xml-m3ua.log docker container stop -t 1 ${BUILD_TAG}-stp -- To view, visit https://gerrit.osmocom.org/13530 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I200b4ee1760a879cbc0a80a30a062a3f2a8e703d Gerrit-Change-Number: 13530 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 06:37:55 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 5 Apr 2019 06:37:55 +0000 Subject: Change in docker-playground[master]: nplab-m3ua-test: add sigtran-tests dependency In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13529 ) Change subject: nplab-m3ua-test: add sigtran-tests dependency ...................................................................... Patch Set 1: Fixes the failure discussed yesterday: https://jenkins.osmocom.org/jenkins/view/TTCN3/job/nplab-m3ua-test-latest/173/console -- To view, visit https://gerrit.osmocom.org/13529 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9df1d2b188e86b3c99c6ec793b6eb644ab3c27c9 Gerrit-Change-Number: 13529 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Fri, 05 Apr 2019 06:37:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 08:51:29 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 5 Apr 2019 08:51:29 +0000 Subject: Change in osmo-hlr[master]: fix USSD routing to multiple MSC In-Reply-To: References: Message-ID: osmith has uploaded a new patch set (#5) to the change originally created by Neels Hofmeyr. ( https://gerrit.osmocom.org/13479 ) Change subject: fix USSD routing to multiple MSC ...................................................................... fix USSD routing to multiple MSC hlr_ussd.c so far hardcoded osmo-msc's default IPA-name and hence was only able to negotiate USSD sessions to - a single osmo-msc - that has no custom IPA-name set. Fix: correctly route USSD to any number of MSC with any custom IPA names. Resolve the right MSC's IPA name from the USSD session's IMSI, using hlr_subscriber->vlr_number to determine the right GSUP peer. Add ss_session->subscr, so that if a code path already knows the subscriber data, setting a pointer to it avoids another database lookup. Related: OS#3710 Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 --- M src/hlr_ussd.c 1 file changed, 46 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/79/13479/5 -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 08:51:57 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 5 Apr 2019 08:51:57 +0000 Subject: Change in osmo-hlr[master]: fix USSD routing to multiple MSC In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13479 ) Change subject: fix USSD routing to multiple MSC ...................................................................... Patch Set 4: (3 comments) Neels asked me to finish this up. https://gerrit.osmocom.org/#/c/13479/4/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13479/4/src/hlr_ussd.c at 255 PS4, Line 255: strlen(subscr->vlr_number) This must be strlen(subscr->vlr_number) + 1 or else it does not work. At least when setting ipa-name in osmo-msc.cfg. I've added debug prints in gsup_route_find() [1] and this is how the compare fails without the +1: gsup route find: "MSC-13-37-00-00-00-00", len: 21 gsup route find: comparing with: "MSC-13-37-00-00-00-00\0", len: 22 [1]: https://git.osmocom.org/osmo-hlr/tree/src/gsup_router.c?id=3cf87fe22cf53178ddd4f7e5c4be67ca8c4bc8bd#n37 Fixed in patchset #5. https://gerrit.osmocom.org/#/c/13479/4/src/hlr_ussd.c at 335 PS4, Line 335: ss->subscr = NULL; > I think doing this manually is not a good idea... [?] I have added a timer and set it to 10 seconds. https://gerrit.osmocom.org/#/c/13479/4/src/hlr_ussd.c at 338 PS4, Line 338: ss_tx_error(ss, true, GSM0480_ERR_CODE_UNKNOWN_SUBSCRIBER); > > should probably also somehow remember which MSC initiated the session? [?] See my follow up patch here: https://gerrit.osmocom.org/#/c/osmo-hlr/+/13515/ Is this the right approach? Vadim, since Neels is super busy with finishing up MSC handover stuff, maybe you can take a look at it? -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Fri, 05 Apr 2019 08:51:57 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 10:17:24 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 5 Apr 2019 10:17:24 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: fix broken logging in abis_nm_rx_ipacc() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13523 ) Change subject: abis_nm.c: fix broken logging in abis_nm_rx_ipacc() ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13523 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I65ff2968523a90607bafd44e6f4f3d3e29ff73ef Gerrit-Change-Number: 13523 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 05 Apr 2019 10:17:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 10:45:35 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 5 Apr 2019 10:45:35 +0000 Subject: Change in osmo-gsm-tester[master]: suites: gprs: Keep terminating all iperf3 processes if one fails to t... Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13531 Change subject: suites: gprs: Keep terminating all iperf3 processes if one fails to terminate ...................................................................... suites: gprs: Keep terminating all iperf3 processes if one fails to terminate Change-Id: I0cc183529988463800e0d40c8cf3a4cea041031c --- M suites/gprs/lib/testlib.py 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/31/13531/1 diff --git a/suites/gprs/lib/testlib.py b/suites/gprs/lib/testlib.py index ac3a847..284ca63 100644 --- a/suites/gprs/lib/testlib.py +++ b/suites/gprs/lib/testlib.py @@ -26,7 +26,10 @@ proc.wait() except Exception as e: for proc in procs: - proc.terminate() + try: + proc.terminate() + except Exception: + print("Exception while terminating process %r" % repr(process)) raise e -- To view, visit https://gerrit.osmocom.org/13531 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0cc183529988463800e0d40c8cf3a4cea041031c Gerrit-Change-Number: 13531 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 11:01:08 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 5 Apr 2019 11:01:08 +0000 Subject: Change in osmo-hlr[master]: fix error logging for GSUP route In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13517 ) Change subject: fix error logging for GSUP route ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13517 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie4def16008af573ed2e1367d9da50c3d2b5a71ef Gerrit-Change-Number: 13517 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-Comment-Date: Fri, 05 Apr 2019 11:01:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 11:27:16 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 5 Apr 2019 11:27:16 +0000 Subject: Change in osmo-ci[master]: ansible: gsm-tester: Remove net iface name from hash input In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13518 ) Change subject: ansible: gsm-tester: Remove net iface name from hash input ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13518 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I87c686caa23a3b39e48e0762d4323a59be7cd4b8 Gerrit-Change-Number: 13518 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 05 Apr 2019 11:27:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 11:27:19 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 5 Apr 2019 11:27:19 +0000 Subject: Change in osmo-ci[master]: ansible: gsm-tester: Install osmo-gsm-tester_netns_setup.sh In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13524 ) Change subject: ansible: gsm-tester: Install osmo-gsm-tester_netns_setup.sh ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13524 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaa8802b86429abfaf84fc0f20bd207737dbc9812 Gerrit-Change-Number: 13524 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 05 Apr 2019 11:27:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 16:02:26 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 5 Apr 2019 16:02:26 +0000 Subject: Change in osmo-gsm-tester[master]: suites: gprs: Keep terminating all iperf3 processes if one fails to t... In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13531 ) Change subject: suites: gprs: Keep terminating all iperf3 processes if one fails to terminate ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13531 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0cc183529988463800e0d40c8cf3a4cea041031c Gerrit-Change-Number: 13531 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 05 Apr 2019 16:02:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 16:02:27 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 5 Apr 2019 16:02:27 +0000 Subject: Change in osmo-gsm-tester[master]: suites: gprs: Keep terminating all iperf3 processes if one fails to t... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13531 ) Change subject: suites: gprs: Keep terminating all iperf3 processes if one fails to terminate ...................................................................... suites: gprs: Keep terminating all iperf3 processes if one fails to terminate Change-Id: I0cc183529988463800e0d40c8cf3a4cea041031c --- M suites/gprs/lib/testlib.py 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/suites/gprs/lib/testlib.py b/suites/gprs/lib/testlib.py index ac3a847..284ca63 100644 --- a/suites/gprs/lib/testlib.py +++ b/suites/gprs/lib/testlib.py @@ -26,7 +26,10 @@ proc.wait() except Exception as e: for proc in procs: - proc.terminate() + try: + proc.terminate() + except Exception: + print("Exception while terminating process %r" % repr(process)) raise e -- To view, visit https://gerrit.osmocom.org/13531 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0cc183529988463800e0d40c8cf3a4cea041031c Gerrit-Change-Number: 13531 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 18:11:45 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 5 Apr 2019 18:11:45 +0000 Subject: Change in osmo-gsm-tester[master]: processes: Fix kill of processes run under sudo Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13532 Change subject: processes: Fix kill of processes run under sudo ...................................................................... processes: Fix kill of processes run under sudo sudo drops forwarding of signals sent by processes of the same process group, which means by default will drop signals from parent and children processes. By moving it to another group, we will later be able to kill it. Note: sudo documentation is wrong, since it states it only drops signals from children. See following link for more information: https://stackoverflow.com/questions/34337840/cant-terminate-a-sudo-process-created-with-python-in-ubuntu-15-10 Change-Id: I25990234aaa496c501ff45ad7f7fd549d6f188da --- M src/osmo_gsm_tester/process.py 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/32/13532/1 diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index 66ecae5..12da831 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -157,16 +157,27 @@ return f def launch(self): + preexec_fn = None log.dbg('cd %r; %s %s' % ( os.path.abspath(str(self.run_dir)), ' '.join(['%s=%r'%(k,v) for k,v in self.popen_kwargs.get('env', {}).items()]), ' '.join(self.popen_args))) + if self.popen_args[0] == "sudo": + # sudo drops forwarding of signals sent by processes of the same + # process group, which means by default will drop signals from + # parent and children processes. By moving it to another group, we + # will later be able to kill it. + # Note: sudo documentation is wrong, since it states it only drops + # signals from children. + preexec_fn = os.setpgrp + self.process_obj = subprocess.Popen( self.popen_args, stdout=self.make_output_log('stdout'), stderr=self.make_output_log('stderr'), stdin=subprocess.PIPE, + preexec_fn = preexec_fn, shell=False, cwd=self.run_dir.path, **self.popen_kwargs) -- To view, visit https://gerrit.osmocom.org/13532 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I25990234aaa496c501ff45ad7f7fd549d6f188da Gerrit-Change-Number: 13532 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 18:12:20 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 5 Apr 2019 18:12:20 +0000 Subject: Change in osmo-gsm-tester[master]: processes: Fix kill of processes run under sudo In-Reply-To: References: Message-ID: Pau Espin Pedrol has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13532 ) Change subject: processes: Fix kill of processes run under sudo ...................................................................... processes: Fix kill of processes run under sudo sudo drops forwarding of signals sent by processes of the same process group, which means by default will drop signals from parent and children processes. By moving it to another group, we will later be able to kill it. Note: sudo documentation is wrong, since it states it only drops signals from children. See following link for more information: https://stackoverflow.com/questions/34337840/cant-terminate-a-sudo-process-created-with-python-in-ubuntu-15-10 Change-Id: I25990234aaa496c501ff45ad7f7fd549d6f188da --- M src/osmo_gsm_tester/process.py 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/32/13532/2 -- To view, visit https://gerrit.osmocom.org/13532 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I25990234aaa496c501ff45ad7f7fd549d6f188da Gerrit-Change-Number: 13532 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 18:30:38 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 5 Apr 2019 18:30:38 +0000 Subject: Change in osmo-gsm-tester[master]: processes: Fix kill of processes run under sudo In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13532 ) Change subject: processes: Fix kill of processes run under sudo ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13532 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I25990234aaa496c501ff45ad7f7fd549d6f188da Gerrit-Change-Number: 13532 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 05 Apr 2019 18:30:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 18:30:42 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 5 Apr 2019 18:30:42 +0000 Subject: Change in osmo-gsm-tester[master]: processes: Fix kill of processes run under sudo In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13532 ) Change subject: processes: Fix kill of processes run under sudo ...................................................................... processes: Fix kill of processes run under sudo sudo drops forwarding of signals sent by processes of the same process group, which means by default will drop signals from parent and children processes. By moving it to another group, we will later be able to kill it. Note: sudo documentation is wrong, since it states it only drops signals from children. See following link for more information: https://stackoverflow.com/questions/34337840/cant-terminate-a-sudo-process-created-with-python-in-ubuntu-15-10 Change-Id: I25990234aaa496c501ff45ad7f7fd549d6f188da --- M src/osmo_gsm_tester/process.py 1 file changed, 11 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py index 66ecae5..4b22d0c 100644 --- a/src/osmo_gsm_tester/process.py +++ b/src/osmo_gsm_tester/process.py @@ -157,16 +157,27 @@ return f def launch(self): + preexec_fn = None log.dbg('cd %r; %s %s' % ( os.path.abspath(str(self.run_dir)), ' '.join(['%s=%r'%(k,v) for k,v in self.popen_kwargs.get('env', {}).items()]), ' '.join(self.popen_args))) + if self.popen_args[0] == "sudo": + # sudo drops forwarding of signals sent by processes of the same + # process group, which means by default will drop signals from + # parent and children processes. By moving it to another group, we + # will later be able to kill it. + # Note: sudo documentation is wrong, since it states it only drops + # signals from children. + preexec_fn = os.setpgrp + self.process_obj = subprocess.Popen( self.popen_args, stdout=self.make_output_log('stdout'), stderr=self.make_output_log('stderr'), stdin=subprocess.PIPE, + preexec_fn=preexec_fn, shell=False, cwd=self.run_dir.path, **self.popen_kwargs) -- To view, visit https://gerrit.osmocom.org/13532 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I25990234aaa496c501ff45ad7f7fd549d6f188da Gerrit-Change-Number: 13532 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 5 19:34:50 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 5 Apr 2019 19:34:50 +0000 Subject: Change in osmo-hlr[master]: fix USSD routing to multiple MSC In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13479 ) Change subject: fix USSD routing to multiple MSC ...................................................................... Patch Set 5: Code-Review-1 (5 comments) https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 238 PS5, Line 238: ss->subscr This will always remain NULL, because AFAICS you never set this pointer... https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 251 PS5, Line 251: return -EINVAL; memleak: msg was allocated dynamically, so here you need to free it. https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 260 PS5, Line 260: return -EINVAL; same here. https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 263 PS5, Line 263: USSD 'SS/USSD' would be more correct, as we would also deal with "structured" Supplementary Services some day. https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 286 PS5, Line 286: resp_msg = gsm0480_msgb_alloc_name(__func__); So here we allocate a message buffer on heap... BTW (off-topic): why do we use gsm0480_msgb_alloc_name()? We have nothing to do with GSM 04.80 at the HLR - it's only used to encapsulate the SS payload between MS and MSC. This is not that critical, but may be misleading. Also, gsm0480_msgb_alloc_name() allocates a smaller buffer: return msgb_alloc_headroom(1024, 128, name); than osmo_gsup_client_msgb_alloc() does: return msgb_alloc_headroom(4000, 64, __func__); -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Fri, 05 Apr 2019 19:34:50 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Sat Apr 6 02:40:09 2019 From: admin at opensuse.org (OBS Notification) Date: Sat, 06 Apr 2019 02:40:09 +0000 Subject: Build failure of network:osmocom:nightly/osmo-sip-connector in xUbuntu_17.10/i586 In-Reply-To: References: Message-ID: <5ca81194e46a2_29b052e5f4322456@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-sip-connector/xUbuntu_17.10/i586 Package network:osmocom:nightly/osmo-sip-connector failed to build in xUbuntu_17.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-sip-connector Last lines of build log: [ 119s] /* confdefs.h */ [ 119s] #define PACKAGE_NAME "osmo-sip-connector" [ 119s] #define PACKAGE_TARNAME "osmo-sip-connector" [ 119s] #define PACKAGE_VERSION "1.2.0.3-c908" [ 119s] #define PACKAGE_STRING "osmo-sip-connector 1.2.0.3-c908" [ 119s] #define PACKAGE_BUGREPORT "openbsc at lists.osmocom.org" [ 119s] #define PACKAGE_URL "" [ 119s] #define PACKAGE "osmo-sip-connector" [ 119s] #define VERSION "1.2.0.3-c908" [ 119s] [ 119s] configure: exit 1 [ 119s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libexecdir=\${prefix}/lib/osmo-sip-connector --disable-maintainer-mode --disable-dependency-tracking --with-systemdsystemunitdir=/lib/systemd/system returned exit code 1 [ 119s] debian/rules:18: recipe for target 'override_dh_auto_configure' failed [ 119s] make[1]: *** [override_dh_auto_configure] Error 25 [ 119s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 119s] debian/rules:12: recipe for target 'build' failed [ 119s] make: *** [build] Error 2 [ 119s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 119s] /.build/build: line 383: 15830 Segmentation fault (core dumped) rm -f $BUILD_ROOT/exit [ 119s] [ 119s] lamb55 failed "build osmo-sip-connector_1.2.0.3.c908.dsc" at Sat Apr 6 02:39:56 UTC 2019. [ 119s] [ 119s] ### VM INTERACTION START ### [ 122s] [ 109.322789] sysrq: SysRq : Power Off [ 122s] [ 109.343056] reboot: Power down [ 122s] ### VM INTERACTION END ### [ 122s] [ 122s] lamb55 failed "build osmo-sip-connector_1.2.0.3.c908.dsc" at Sat Apr 6 02:40:00 UTC 2019. [ 122s] -- 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 Apr 6 10:18:32 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:18:32 +0000 Subject: Change in osmo-ci[master]: ansible: gsm-tester: Install osmo-gsm-tester_netns_setup.sh In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13524 ) Change subject: ansible: gsm-tester: Install osmo-gsm-tester_netns_setup.sh ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13524 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaa8802b86429abfaf84fc0f20bd207737dbc9812 Gerrit-Change-Number: 13524 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 06 Apr 2019 10:18:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 10:18:42 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:18:42 +0000 Subject: Change in osmo-ci[master]: ansible: gsm-tester: Remove net iface name from hash input In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13518 ) Change subject: ansible: gsm-tester: Remove net iface name from hash input ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13518 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I87c686caa23a3b39e48e0762d4323a59be7cd4b8 Gerrit-Change-Number: 13518 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 06 Apr 2019 10:18:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 10:19:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:19:08 +0000 Subject: Change in docker-playground[master]: nplab-m3ua-test: support running without jenkins In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13530 ) Change subject: nplab-m3ua-test: support running without jenkins ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13530 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I200b4ee1760a879cbc0a80a30a062a3f2a8e703d Gerrit-Change-Number: 13530 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 06 Apr 2019 10:19:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 10:20:35 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:20:35 +0000 Subject: Change in docker-playground[master]: nplab-m3ua-test: add sigtran-tests dependency In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13529 ) Change subject: nplab-m3ua-test: add sigtran-tests dependency ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13529 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9df1d2b188e86b3c99c6ec793b6eb644ab3c27c9 Gerrit-Change-Number: 13529 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Sat, 06 Apr 2019 10:20:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 10:22:50 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:22:50 +0000 Subject: Change in osmo-hlr[master]: fix error logging for GSUP route In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13517 ) Change subject: fix error logging for GSUP route ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13517 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie4def16008af573ed2e1367d9da50c3d2b5a71ef Gerrit-Change-Number: 13517 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-Comment-Date: Sat, 06 Apr 2019 10:22:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 10:32:47 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:32:47 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use proper format specifiers for BTS / TRX number In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13519 ) Change subject: abis_nm.c: use proper format specifiers for BTS / TRX number ...................................................................... Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/13519/1/src/osmo-bsc/abis_nm.c File src/osmo-bsc/abis_nm.c: https://gerrit.osmocom.org/#/c/13519/1/src/osmo-bsc/abis_nm.c at 1716 PS1, Line 1716: DEBUGP(DNM, "Get Attr (bts=%u)\n", bts->nr); > Making sure it compiles fine if you ever happen to use some broken compiler which doesn't like using [?] I wouldn't go that far, honestly. If at all, we could consider using "unsigned int" as type. uint8_t makes sense for fields that are encoded as 8bit value in some protocol header, but for internal values/data structures we're of course free to use whatever types you want. I used uint8_t because the numbers in Abis OML are restricted to that size. Irrespective of the above: I'm *perfectly* fine with using %u for uint8_t. -- To view, visit https://gerrit.osmocom.org/13519 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I429d00d1393c221070e4c9e0997cbd14ae96103e Gerrit-Change-Number: 13519 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 06 Apr 2019 10:32:47 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 10:33:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:33:12 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: also print TRX number in abis_nm_get_attr() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13520 ) Change subject: abis_nm.c: also print TRX number in abis_nm_get_attr() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13520 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice776b1cee37acf737afb952c79eff2803e84862 Gerrit-Change-Number: 13520 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 06 Apr 2019 10:33:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 10:35:07 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:35:07 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use abis_nm_ipa_magic from libosmocore In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13521 ) Change subject: abis_nm.c: use abis_nm_ipa_magic from libosmocore ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13521 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I051ae0550b5375a141e1bd4b3383a54302da83e1 Gerrit-Change-Number: 13521 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 06 Apr 2019 10:35:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 10:35:52 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:35:52 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13522 ) Change subject: abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13522 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1ce97fc28a608894c8dfa3bbc55032e66bc44e5b Gerrit-Change-Number: 13522 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 06 Apr 2019 10:35:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 10:36:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:36:57 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: fix broken logging in abis_nm_rx_ipacc() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13523 ) Change subject: abis_nm.c: fix broken logging in abis_nm_rx_ipacc() ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13523 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I65ff2968523a90607bafd44e6f4f3d3e29ff73ef Gerrit-Change-Number: 13523 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 06 Apr 2019 10:36:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 10:37:00 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:37:00 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use proper format specifiers for BTS / TRX number In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13519 ) Change subject: abis_nm.c: use proper format specifiers for BTS / TRX number ...................................................................... abis_nm.c: use proper format specifiers for BTS / TRX number Change-Id: I429d00d1393c221070e4c9e0997cbd14ae96103e --- M src/osmo-bsc/abis_nm.c 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Objections: Pau Espin Pedrol: I would prefer this is not merged as is diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index 826c1e2..6478d81 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -1713,7 +1713,7 @@ return -EINVAL; } - DEBUGP(DNM, "Get Attr (bts=%d)\n", bts->nr); + DEBUGP(DNM, "Get Attr (bts=%u)\n", bts->nr); msg = nm_msgb_alloc(); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); @@ -1731,7 +1731,7 @@ struct msgb *msg = nm_msgb_alloc(); uint8_t *cur; - DEBUGP(DNM, "Set BTS Attr (bts=%d)\n", bts->nr); + DEBUGP(DNM, "Set BTS Attr (bts=%u)\n", bts->nr); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, attr_len, NM_MT_SET_BTS_ATTR, NM_OC_BTS, bts->bts_nr, 0xff, 0xff); @@ -1748,7 +1748,7 @@ struct msgb *msg = nm_msgb_alloc(); uint8_t *cur; - DEBUGP(DNM, "Set TRX Attr (bts=%d,trx=%d)\n", trx->bts->nr, trx->nr); + DEBUGP(DNM, "Set TRX Attr (bts=%u,trx=%u)\n", trx->bts->nr, trx->nr); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, attr_len, NM_MT_SET_RADIO_ATTR, NM_OC_RADIO_CARRIER, @@ -2853,7 +2853,7 @@ struct gsm_bts_trx *trx = data; struct ipacc_ack_signal_data signal; - LOGP(DRSL, LOGL_NOTICE, "(bts=%d,trx=%d) RSL connection request timed out\n", trx->bts->nr, trx->nr); + LOGP(DRSL, LOGL_NOTICE, "(bts=%u,trx=%u) RSL connection request timed out\n", trx->bts->nr, trx->nr); /* Fake an RSL CONECT NACK message from the BTS. */ signal.trx = trx; @@ -2884,7 +2884,7 @@ if (ip == 0) attr_len -= 5; - LOGP(DNM, LOGL_INFO, "(bts=%d,trx=%d) IPA RSL CONNECT IP=%s PORT=%u STREAM=0x%02x\n", + LOGP(DNM, LOGL_INFO, "(bts=%u,trx=%u) IPA RSL CONNECT IP=%s PORT=%u STREAM=0x%02x\n", trx->bts->nr, trx->nr, inet_ntoa(ia), port, stream); error = abis_nm_ipaccess_msg(trx->bts, NM_MT_IPACC_RSL_CONNECT, @@ -2939,7 +2939,7 @@ return; } - LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Requesting administrative state change %s -> %s [%s]\n", + LOGP(DNM, LOGL_NOTICE, "(bts=%u,trx=%u) Requesting administrative state change %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); -- To view, visit https://gerrit.osmocom.org/13519 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I429d00d1393c221070e4c9e0997cbd14ae96103e Gerrit-Change-Number: 13519 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 10:37:00 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:37:00 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: also print TRX number in abis_nm_get_attr() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13520 ) Change subject: abis_nm.c: also print TRX number in abis_nm_get_attr() ...................................................................... abis_nm.c: also print TRX number in abis_nm_get_attr() Change-Id: Ice776b1cee37acf737afb952c79eff2803e84862 --- M src/osmo-bsc/abis_nm.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index 6478d81..33535a4 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -1713,7 +1713,7 @@ return -EINVAL; } - DEBUGP(DNM, "Get Attr (bts=%u)\n", bts->nr); + DEBUGP(DNM, "Get Attr (bts=%u,trx=%u)\n", bts->nr, trx_nr); msg = nm_msgb_alloc(); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); -- To view, visit https://gerrit.osmocom.org/13520 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ice776b1cee37acf737afb952c79eff2803e84862 Gerrit-Change-Number: 13520 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 10:37:01 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:37:01 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use abis_nm_ipa_magic from libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13521 ) Change subject: abis_nm.c: use abis_nm_ipa_magic from libosmocore ...................................................................... abis_nm.c: use abis_nm_ipa_magic from libosmocore Change-Id: I051ae0550b5375a141e1bd4b3383a54302da83e1 --- M src/osmo-bsc/abis_nm.c 1 file changed, 4 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index 33535a4..a9b5aa5 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -2690,10 +2690,6 @@ return abis_nm_sendmsg(bts, msg); } -/* ip.access nanoBTS specific commands */ -static const char ipaccess_magic[] = "com.ipaccess"; - - static int abis_nm_rx_ipacc(struct msgb *msg) { struct in_addr addr; @@ -2706,7 +2702,7 @@ foh = (struct abis_om_fom_hdr *) (oh->data + 1 + idstrlen); - if (strncmp((char *)&oh->data[1], ipaccess_magic, idstrlen)) { + if (strncmp((char *)&oh->data[1], abis_nm_ipa_magic, idstrlen)) { LOGPFOH(DNM, LOGL_ERROR, foh, "id string is not com.ipaccess !?!\n"); return -EINVAL; } @@ -2819,9 +2815,9 @@ oh->mdisc = ABIS_OM_MDISC_MANUF; /* add the ip.access magic */ - data = msgb_put(msg, sizeof(ipaccess_magic)+1); - *data++ = sizeof(ipaccess_magic); - memcpy(data, ipaccess_magic, sizeof(ipaccess_magic)); + data = msgb_put(msg, sizeof(abis_nm_ipa_magic)+1); + *data++ = sizeof(abis_nm_ipa_magic); + memcpy(data, abis_nm_ipa_magic, sizeof(abis_nm_ipa_magic)); /* fill the 12.21 FOM header */ foh = (struct abis_om_fom_hdr *) msgb_put(msg, sizeof(*foh)); -- To view, visit https://gerrit.osmocom.org/13521 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I051ae0550b5375a141e1bd4b3383a54302da83e1 Gerrit-Change-Number: 13521 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 10:37:01 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:37:01 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13522 ) Change subject: abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic ...................................................................... abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic Change-Id: I1ce97fc28a608894c8dfa3bbc55032e66bc44e5b --- M src/osmo-bsc/abis_nm.c 1 file changed, 2 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index a9b5aa5..5be207f 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -2815,9 +2815,8 @@ oh->mdisc = ABIS_OM_MDISC_MANUF; /* add the ip.access magic */ - data = msgb_put(msg, sizeof(abis_nm_ipa_magic)+1); - *data++ = sizeof(abis_nm_ipa_magic); - memcpy(data, abis_nm_ipa_magic, sizeof(abis_nm_ipa_magic)); + msgb_lv_put(msg, sizeof(abis_nm_ipa_magic), + (const uint8_t *) abis_nm_ipa_magic); /* fill the 12.21 FOM header */ foh = (struct abis_om_fom_hdr *) msgb_put(msg, sizeof(*foh)); -- To view, visit https://gerrit.osmocom.org/13522 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1ce97fc28a608894c8dfa3bbc55032e66bc44e5b Gerrit-Change-Number: 13522 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 10:37:01 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 10:37:01 +0000 Subject: Change in osmo-bsc[master]: abis_nm.c: fix broken logging in abis_nm_rx_ipacc() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13523 ) Change subject: abis_nm.c: fix broken logging in abis_nm_rx_ipacc() ...................................................................... abis_nm.c: fix broken logging in abis_nm_rx_ipacc() Change-Id: I65ff2968523a90607bafd44e6f4f3d3e29ff73ef --- M src/osmo-bsc/abis_nm.c 1 file changed, 4 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index 5be207f..240517b 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -2709,11 +2709,12 @@ abis_nm_tlv_parse(&tp, sign_link->trx->bts, foh->data, oh->length-sizeof(*foh)); - DEBUGPFOH(DNM, foh, "IPACCESS(0x%02x): ", foh->msg_type); + DEBUGPFOH(DNM, foh, "Rx IPACCESS(0x%02x): %s\n", foh->msg_type, + osmo_hexdump(foh->data, oh->length - sizeof(*foh))); switch (foh->msg_type) { case NM_MT_IPACC_RSL_CONNECT_ACK: - DEBUGPC(DNM, "RSL CONNECT ACK "); + DEBUGPFOH(DNM, foh, "RSL CONNECT ACK "); if (TLVP_PRESENT(&tp, NM_ATT_IPACC_DST_IP)) { memcpy(&addr, TLVP_VAL(&tp, NM_ATT_IPACC_DST_IP), sizeof(addr)); @@ -2773,7 +2774,7 @@ LOGPC(DNM, LOGL_ERROR, "\n"); break; default: - DEBUGPC(DNM, "unknown\n"); + LOGPFOH(DNM, LOGL_ERROR, foh, "Unknown message\n"); break; } -- To view, visit https://gerrit.osmocom.org/13523 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I65ff2968523a90607bafd44e6f4f3d3e29ff73ef Gerrit-Change-Number: 13523 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 11:59:22 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 6 Apr 2019 11:59:22 +0000 Subject: Change in osmo-bsc[master]: osmo_bsc_lcls.c: cosmetic: make Coverity happy Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13533 Change subject: osmo_bsc_lcls.c: cosmetic: make Coverity happy ...................................................................... osmo_bsc_lcls.c: cosmetic: make Coverity happy The 'return' that makes Coverity angry can be safely replaced by 'break'. Change-Id: Ib3d7519421319fb0e6d65441bba123b7b01f4556 Fixes: CID#188873 Identical code for different branches --- M src/osmo-bsc/osmo_bsc_lcls.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/33/13533/1 diff --git a/src/osmo-bsc/osmo_bsc_lcls.c b/src/osmo-bsc/osmo_bsc_lcls.c index c1f62dc..9cd13a7 100644 --- a/src/osmo-bsc/osmo_bsc_lcls.c +++ b/src/osmo-bsc/osmo_bsc_lcls.c @@ -471,7 +471,7 @@ case LCLS_EV_UPDATE_CFG_CSC: if (lcls_handle_cfg_update(conn, data) != 0) return; - return; + break; case LCLS_EV_APPLY_CFG_CSC: if (lcls_perform_correlation(conn) != 0) { /* no correlation result: Remain in NOT_POSSIBLE_LS */ -- To view, visit https://gerrit.osmocom.org/13533 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3d7519421319fb0e6d65441bba123b7b01f4556 Gerrit-Change-Number: 13533 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 12:18:33 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 6 Apr 2019 12:18:33 +0000 Subject: Change in libosmocore[master]: vty/talloc_ctx_vty.c: allocate walk_cb_params on stack, not heap Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13534 Change subject: vty/talloc_ctx_vty.c: allocate walk_cb_params on stack, not heap ...................................................................... vty/talloc_ctx_vty.c: allocate walk_cb_params on stack, not heap There is no need to allocate struct 'walk_cb_params' dynamically. Change-Id: I96f25f1ddb36b19b12055deaeeb6f58e59180e72 --- M src/vty/talloc_ctx_vty.c 1 file changed, 15 insertions(+), 43 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/13534/1 diff --git a/src/vty/talloc_ctx_vty.c b/src/vty/talloc_ctx_vty.c index e7fe675..c4d5a88 100644 --- a/src/vty/talloc_ctx_vty.c +++ b/src/vty/talloc_ctx_vty.c @@ -180,22 +180,13 @@ 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; + struct walk_cb_params params = { 0 }; /* Set up callback parameters */ - params->filter = WALK_FILTER_NONE; - params->vty = vty; + params.filter = WALK_FILTER_NONE; + params.vty = vty; - talloc_ctx_walk(argv[0], argv[1], params); - - /* Free memory */ - talloc_free(params); - + talloc_ctx_walk(argv[0], argv[1], ¶ms); return CMD_SUCCESS; } @@ -204,31 +195,22 @@ "Filter chunks using regular expression\n" "Regular expression\n") { - struct walk_cb_params *params; + struct walk_cb_params params = { 0 }; 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); + 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; + params.filter = WALK_FILTER_REGEXP; + params.vty = vty; - talloc_ctx_walk(argv[0], argv[1], params); - - /* Free memory */ - regfree(¶ms->regexp); - talloc_free(params); + talloc_ctx_walk(argv[0], argv[1], ¶ms); + regfree(¶ms.regexp); return CMD_SUCCESS; } @@ -238,31 +220,21 @@ "Display only a specific memory chunk\n" "Chunk address (e.g. 0xdeadbeef)\n") { - struct walk_cb_params *params; + struct walk_cb_params params = { 0 }; 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); + 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; + params.filter = WALK_FILTER_TREE; + params.vty = vty; - talloc_ctx_walk(argv[0], argv[1], params); - - /* Free memory */ - talloc_free(params); - + talloc_ctx_walk(argv[0], argv[1], ¶ms); return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/13534 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I96f25f1ddb36b19b12055deaeeb6f58e59180e72 Gerrit-Change-Number: 13534 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 13:12:00 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 6 Apr 2019 13:12:00 +0000 Subject: Change in osmo-bsc[master]: ipaccess-config: use POSIX regex for Unit ID format check Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13535 Change subject: ipaccess-config: use POSIX regex for Unit ID format check ...................................................................... ipaccess-config: use POSIX regex for Unit ID format check Instead of counting digits and slashes of the IPA Unit ID manually, use POSIX regex functions, so the code is easier to maintain and read. As a bonus, this fixes CID#188854: variable 'remain_slash' was of type 'uint8_t', so it could never be lower than zero. Change-Id: Id613bf650833dd38eaad08fdfffdf8dbe2f002b1 Related: CID#188854 Unsigned integer overflow --- M src/ipaccess/ipaccess-config.c 1 file changed, 9 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/35/13535/1 diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c index da19ce2..54e4efd 100644 --- a/src/ipaccess/ipaccess-config.c +++ b/src/ipaccess/ipaccess-config.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -842,33 +843,20 @@ static bool check_unitid_fmt(const char* unit_id) { - const char *p = unit_id; - bool must_digit = true; - uint8_t remain_slash = 2; + regex_t regexp; + int rc; if (strlen(unit_id) < 5) goto wrong_fmt; - while (*p != '\0') { - if (*p != '/' && !isdigit(*p)) - goto wrong_fmt; - if (*p == '/' && must_digit) - goto wrong_fmt; - if (*p == '/') { - must_digit = true; - remain_slash--; - if (remain_slash < 0) - goto wrong_fmt; - } else { - must_digit = false; - } - p++; - } + rc = regcomp(®exp, "^[0-9]+/[0-9]+/[0-9]+$", REG_EXTENDED | REG_NOSUB); + OSMO_ASSERT(!rc); - if (*(p-1) == '/') - goto wrong_fmt; + rc = regexec(®exp, unit_id, 0, NULL, 0); + regfree(®exp); - return true; + if (rc == 0) + return true; wrong_fmt: fprintf(stderr, "ERROR: unit-id wrong format. Must be '\\d+/\\d+/\\d+'\n"); -- To view, visit https://gerrit.osmocom.org/13535 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id613bf650833dd38eaad08fdfffdf8dbe2f002b1 Gerrit-Change-Number: 13535 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 13:25:47 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 6 Apr 2019 13:25:47 +0000 Subject: Change in libosmocore[master]: vty/talloc_ctx_vty.c: use REG_NOSUB flag of regcomp() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13536 Change subject: vty/talloc_ctx_vty.c: use REG_NOSUB flag of regcomp() ...................................................................... vty/talloc_ctx_vty.c: use REG_NOSUB flag of regcomp() We don't need to know position of matches: just yes or no. This change would save some computation power. Change-Id: Id55ffe64cc1a35dd83f61dbb0f9828aa676696f9 --- M src/vty/talloc_ctx_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/13536/1 diff --git a/src/vty/talloc_ctx_vty.c b/src/vty/talloc_ctx_vty.c index c4d5a88..16cb763 100644 --- a/src/vty/talloc_ctx_vty.c +++ b/src/vty/talloc_ctx_vty.c @@ -199,7 +199,7 @@ int rc; /* Attempt to compile a regular expression */ - rc = regcomp(¶ms.regexp, argv[2], 0); + rc = regcomp(¶ms.regexp, argv[2], REG_NOSUB); if (rc) { vty_out(vty, "Invalid expression%s", VTY_NEWLINE); return CMD_WARNING; -- To view, visit https://gerrit.osmocom.org/13536 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id55ffe64cc1a35dd83f61dbb0f9828aa676696f9 Gerrit-Change-Number: 13536 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 13:30:01 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 6 Apr 2019 13:30:01 +0000 Subject: Change in osmo-bsc[master]: osmo_bsc_lcls.c: cosmetic: make Coverity happy In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13533 to look at the new patch set (#2). Change subject: osmo_bsc_lcls.c: cosmetic: make Coverity happy ...................................................................... osmo_bsc_lcls.c: cosmetic: make Coverity happy The 'return' that makes Coverity angry can be safely replaced by 'break'. Change-Id: Ib3d7519421319fb0e6d65441bba123b7b01f4556 Fixes: CID#188873 Identical code for different branches Fixes: CID#188850 Identical code for different branches Fixes: CID#188845 Identical code for different branches --- M src/osmo-bsc/osmo_bsc_lcls.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/33/13533/2 -- To view, visit https://gerrit.osmocom.org/13533 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib3d7519421319fb0e6d65441bba123b7b01f4556 Gerrit-Change-Number: 13533 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 15:14:56 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 6 Apr 2019 15:14:56 +0000 Subject: Change in osmo-hlr[master]: fix USSD routing to multiple MSC In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13479 ) Change subject: fix USSD routing to multiple MSC ...................................................................... Patch Set 5: Code-Review-1 (6 comments) current patch set has more holes than a swiss cheese, but I have a better idea... https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 175 PS5, Line 175: struct osmo_timer_list subscr_timeout; let's take this ss->subscr from the top. I had a very simple idea in mind, but it wasn't thought through properly, confused you guys and has now mutated to a timeouted cache of stale data... Let's drop this again. Here is a probably much better approach: - store only the MSC name in ss->. - For all MO USSD sessions, store the originating MSC's vlr_name in ss-> on the first message coming in from the MSC/VLR. Whatever happens, always route back to that MSC name: all errors and replies. This should then prevent all additional database lookups. - For MT USSD sessions, there will be no MSC's vlr_name stored in ss-> at first. Do a db lookup for routing to the right vlr_name, store it in ss->vlr_name. Hence we will hit the db for routing at most once per ss_session, will not keep any other stale subscr state, don't need timers. https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 251 PS5, Line 251: return -EINVAL; > memleak: msg was allocated dynamically, so here you need to free it. thx https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 254 PS5, Line 254: osmo_timer_schedule(&ss->subscr_timeout, OSMO_SESSION_SUBSCRIBER_CACHE_TIMEOUT, 0); (this was not even assigning anything to ss->subscr) https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 263 PS5, Line 263: USSD > 'SS/USSD' would be more correct, as we would also deal with "structured" Supplementary Services some [?] (ack, I have no good idea about naming here) https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 286 PS5, Line 286: resp_msg = gsm0480_msgb_alloc_name(__func__); > So here we allocate a message buffer on heap... [?] agree, but separate patch. https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 343 PS5, Line 343: osmo_timer_schedule(&ss->subscr_timeout, OSMO_SESSION_SUBSCRIBER_CACHE_TIMEOUT, 0); (setting ss->subscr to point at local struct subscr becomes invalid memory as soon as the function exits) -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Sat, 06 Apr 2019 15:14:56 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 16:11:33 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 16:11:33 +0000 Subject: Change in osmo-gsm-manuals[master]: Add a chapter to explain our different counters In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13516 ) Change subject: Add a chapter to explain our different counters ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13516 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I01b8529136450cb50e48b0fb5c17cb2daa5e24c3 Gerrit-Change-Number: 13516 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sat, 06 Apr 2019 16:11:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 16:13:19 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 16:13:19 +0000 Subject: Change in libosmocore[master]: vty/talloc_ctx_vty.c: allocate walk_cb_params on stack, not heap In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13534 ) Change subject: vty/talloc_ctx_vty.c: allocate walk_cb_params on stack, not heap ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13534 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I96f25f1ddb36b19b12055deaeeb6f58e59180e72 Gerrit-Change-Number: 13534 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sat, 06 Apr 2019 16:13:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 16:17:06 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 16:17:06 +0000 Subject: Change in libosmocore[master]: vty/talloc_ctx_vty.c: use REG_NOSUB flag of regcomp() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13536 ) Change subject: vty/talloc_ctx_vty.c: use REG_NOSUB flag of regcomp() ...................................................................... Patch Set 1: Code-Review+2 looks great. Makes sense to also check our other regcomp invocations, as (I think) we don't need the position of matches in all cases: openbsc/contrib/nat/test_regexp.c: if (regcomp(®, argv[1], REG_EXTENDED) != 0) { openbsc/src/libcommon/gsm_data.c: ret = regcomp(reg, argv[0], 0); openbsc/src/osmo-bsc_nat/bsc_nat_rewrite.c: if (regcomp(&entry->msisdn_reg, regexp, 0) != 0) { openbsc/src/osmo-bsc_nat/bsc_nat_rewrite.c: if (regcomp(&entry->num_reg, cfg_entry->option, REG_EXTENDED) != 0) { osmo-bsc/src/osmo-bsc/gsm_data.c: ret = regcomp(reg, argv[0], 0); osmo-sgsn/src/gprs/gb_proxy_patch.c: rc = regcomp(&match->re_comp, filter, -- To view, visit https://gerrit.osmocom.org/13536 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id55ffe64cc1a35dd83f61dbb0f9828aa676696f9 Gerrit-Change-Number: 13536 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sat, 06 Apr 2019 16:17:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 16:18:38 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 16:18:38 +0000 Subject: Change in libosmocore[master]: select: Make file descriptor lists per-thread Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13537 Change subject: select: Make file descriptor lists per-thread ...................................................................... select: Make file descriptor lists per-thread In a multi-threaded environemnt, it's likely that each thread will have its own, distinct set of file descriptors that it wants to watch. Hence, let's make the osmo_fd_* functions configure not one global list of file descriptors, but a thread-local list of file descriptors. Change-Id: I5082ed3e500ad1a7516e1785bc57e008da2fac9a --- M include/osmocom/core/select.h M src/select.c 2 files changed, 18 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/13537/1 diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h index a200b6f..92904e2 100644 --- a/include/osmocom/core/select.h +++ b/include/osmocom/core/select.h @@ -52,6 +52,7 @@ void osmo_fd_close(struct osmo_fd *fd); int osmo_select_main(int polling); int osmo_select_main_ctx(int polling); +void osmo_select_init(void); struct osmo_fd *osmo_fd_get_by_fd(int fd); diff --git a/src/select.c b/src/select.c index d7679e9..f96a548 100644 --- a/src/select.c +++ b/src/select.c @@ -50,9 +50,11 @@ * * \file select.c */ -static int maxfd = 0; -static LLIST_HEAD(osmo_fds); -static int unregistered_count; +/* keep a set of file descriptors per-thread, so that each thread can have its own + * distinct set of file descriptors to interact with */ +static __thread int maxfd = 0; +static __thread struct llist_head osmo_fds; /* TLS cannot use LLIST_HEAD() */ +static __thread int unregistered_count; /*! Set up an osmo-fd. Will not register it. * \param[inout] ofd Osmo FD to be set-up @@ -308,6 +310,18 @@ return NULL; } +/*! initialize the osmocom select abstraction for the current thread */ +void osmo_select_init(void) +{ + INIT_LLIST_HEAD(&osmo_fds); +} + +/* ensure main thread always has pre-initialized osmo_fds */ +static __attribute__((constructor)) void on_dso_load_select(void) +{ + osmo_select_init(); +} + #ifdef HAVE_SYS_TIMERFD_H #include -- To view, visit https://gerrit.osmocom.org/13537 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5082ed3e500ad1a7516e1785bc57e008da2fac9a Gerrit-Change-Number: 13537 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 16:18:38 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 16:18:38 +0000 Subject: Change in libosmocore[master]: WIP: osmo_it_msgq: Osmocom Inter-thread Message Queue Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13538 Change subject: WIP: osmo_it_msgq: Osmocom Inter-thread Message Queue ...................................................................... WIP: osmo_it_msgq: Osmocom Inter-thread Message Queue This implements an inter-thread message queue based on top of osmocom msgb, linked lists, eventfd and pthread mutex. Change-Id: I30a7233cb0b51a883ad85c8c4165270b32c4be61 --- M include/Makefile.am A include/osmocom/core/it_msgq.h M src/Makefile.am A src/it_msgq.c M tests/Makefile.am A tests/it_msgq/it_msgq_test.c A tests/it_msgq/it_msgq_test.ok M tests/testsuite.at 8 files changed, 399 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/13538/1 diff --git a/include/Makefile.am b/include/Makefile.am index 17f7d1c..8b18530 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -27,6 +27,7 @@ osmocom/core/gsmtap.h \ osmocom/core/gsmtap_util.h \ osmocom/core/isdnhdlc.h \ + osmocom/core/it_msgq.h \ osmocom/core/linuxlist.h \ osmocom/core/linuxrbtree.h \ osmocom/core/logging.h \ diff --git a/include/osmocom/core/it_msgq.h b/include/osmocom/core/it_msgq.h new file mode 100644 index 0000000..8e81a9a --- /dev/null +++ b/include/osmocom/core/it_msgq.h @@ -0,0 +1,43 @@ +#pragma once + +#include +#include +#include +#include + +/*! \defgroup it_msgq Inter-ThreadMessage Queue + * @{ + * \file it_msgq.h */ + +struct osmo_it_msgq { + /* entry in global list of message queues */ + struct llist_head entry; + + /* the actual list of msgb's. HEAD: first in queue; TAIL: last in queue */ + struct llist_head list; + /* A pthread mutex to safeguard accesses to the queue. No rwlock as we always write. */ + pthread_mutex_t mutex; + /* Current count of messages in the queue */ + unsigned int current_length; + /* osmo-fd wrapped eventfd */ + struct osmo_fd event_ofd; + + /* a user-defined name for this queue */ + const char *name; + /* maximum permitted length of queue */ + unsigned int max_length; + /* read call-back, called for each de-queued message */ + void (*read_cb)(struct osmo_it_msgq *q, struct msgb *msg); + /* opaque data pointer passed through to call-back function */ + void *data; +}; + +struct osmo_it_msgq *osmo_it_msgq_by_name(const char *name); +int osmo_it_msgq_enqueue(struct osmo_it_msgq *queue, struct msgb *msg); +struct msgb *osmo_it_msgq_dequeue(struct osmo_it_msgq *queue); +struct osmo_it_msgq *osmo_it_msgq_alloc(void *ctx, const char *name, unsigned int max_length, + void (*read_cb)(struct osmo_it_msgq *q, struct msgb *msg)); +void osmo_it_msgq_destroy(struct osmo_it_msgq *q); +void osmo_it_msgq_flush(struct osmo_it_msgq *q); + +/*! @} */ diff --git a/src/Makefile.am b/src/Makefile.am index 54e9280..fb2e125 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,7 +12,7 @@ lib_LTLIBRARIES = libosmocore.la -libosmocore_la_LIBADD = $(BACKTRACE_LIB) $(TALLOC_LIBS) $(LIBRARY_RT) +libosmocore_la_LIBADD = $(BACKTRACE_LIB) $(TALLOC_LIBS) $(LIBRARY_RT) -lpthread libosmocore_la_SOURCES = context.c timer.c timer_gettimeofday.c timer_clockgettime.c \ select.c signal.c msgb.c bits.c \ bitvec.c bitcomp.c counter.c fsm.c \ @@ -23,7 +23,7 @@ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ conv_acc.c conv_acc_generic.c sercomm.c prbs.c \ - isdnhdlc.c \ + isdnhdlc.c it_msgq.c \ tdef.c if HAVE_SSSE3 diff --git a/src/it_msgq.c b/src/it_msgq.c new file mode 100644 index 0000000..3086d01 --- /dev/null +++ b/src/it_msgq.c @@ -0,0 +1,220 @@ +/*! \file it_msgq.c + * Osmocom Inter-Thread message queue implementation */ +/* (C) 2019 by Harald Welte + * All Rights Reserved. + * + * SPDX-License-Identifier: GPL-2.0+ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +/*! \addtogroup it_msgq + * @{ + * Inter-Thread Message Queue. + * + * This implements a general-purpose message queue between threads. It + * uses 'struct msgb' as elements in the queue and an eventfd-based notification + * mechanism. Hence, it can be used for pretty much anything that can be stored + * inside msgbs, including msgb-wrapped osmo_prim. + * + * The idea is that the sending thread simply calls osmo_it_msgq_enqueue(). + * The receiving thread is woken up from its osmo_select_main() loop by eventfd, + * and a general osmo_fd callback function for the eventfd will dequeue each msgb + * and call a queue-specific callback function. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include + +static int eventfd_increment(int fd, uint64_t inc) +{ + int rc; + + rc = write(fd, &inc, sizeof(inc)); + if (rc != sizeof(inc)) + return -1; + + return 0; +} + +/* global (for all threads) list of message queues in a program + associated lock */ +static LLIST_HEAD(msg_queues); +static pthread_rwlock_t msg_queues_rwlock; + +static struct osmo_it_msgq *_osmo_it_msgq_by_name(const char *name) +{ + struct osmo_it_msgq *q; + llist_for_each_entry(q, &msg_queues, entry) { + if (!strcmp(q->name, name)) + return q; + } + return NULL; +} + +struct osmo_it_msgq *osmo_it_msgq_by_name(const char *name) +{ + struct osmo_it_msgq *q; + pthread_rwlock_rdlock(&msg_queues_rwlock); + q = _osmo_it_msgq_by_name(name); + pthread_rwlock_unlock(&msg_queues_rwlock); + return q; +} + +/* osmo_fd call-back when eventfd is readable */ +static int osmo_it_msgq_fd_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct osmo_it_msgq *q = (struct osmo_it_msgq *) ofd->data; + uint64_t val; + int i, rc; + + if (!(what & OSMO_FD_READ)) + return 0; + + rc = read(ofd->fd, &val, sizeof(val)); + if (rc < sizeof(val)) + return rc; + + for (i = 0; i < val; i++) { + struct msgb *msg = osmo_it_msgq_dequeue(q); + /* in case the user might have called osmo_it_msgq_flush() we may + * end up in the eventfd-dispatch but witout any messages left in the queue, + * otherwise I'd have loved to OSMO_ASSERT(msg) here. */ + if (!msg) + break; + q->read_cb(q, msg); + } + + return 0; +} + +/*! Allocate a new inter-thread message queue. + * \param[in] ctx talloc context from which to allocate the queue + * \param[in] name human-readable string name of the queue; function creates a copy. + * \param[in] read_cb call-back function to be called for each de-queued message + * \returns a newly-allocated inter-thread message queue; NULL in case of error */ +struct osmo_it_msgq *osmo_it_msgq_alloc(void *ctx, const char *name, unsigned int max_length, + void (*read_cb)(struct osmo_it_msgq *q, struct msgb *msg)) +{ + struct osmo_it_msgq *q; + int fd; + + q = talloc_zero(ctx, struct osmo_it_msgq); + if (!q) + return NULL; + q->name = talloc_strdup(q, name); + q->current_length = 0; + q->max_length = max_length; + q->read_cb = read_cb; + INIT_LLIST_HEAD(&q->list); + + /* create eventfd */ + fd = eventfd(0, 0); + if (fd < 0) { + talloc_free(q); + return NULL; + } + + /* initialize BUT NOT REGISTER the osmo_fd. The receiving thread must + * take are to select/poll/read/... on ot */ + osmo_fd_setup(&q->event_ofd, fd, OSMO_FD_READ, osmo_it_msgq_fd_cb, q, 0); + + /* add to global list of queues, checking for duplicate names */ + pthread_rwlock_wrlock(&msg_queues_rwlock); + if (_osmo_it_msgq_by_name(q->name)) { + pthread_rwlock_unlock(&msg_queues_rwlock); + osmo_fd_close(&q->event_ofd); + talloc_free(q); + return NULL; + } + llist_add_tail(&q->entry, &msg_queues); + pthread_rwlock_unlock(&msg_queues_rwlock); + + return q; +} + +/*! Flush all messages currently present in queue */ +static void _osmo_it_msgq_flush(struct osmo_it_msgq *q) +{ + struct msgb *msg; + while ((msg = msgb_dequeue_count(&q->list, &q->current_length))) { + msgb_free(msg); + } +} + +/*! Flush all messages currently present in queue */ +void osmo_it_msgq_flush(struct osmo_it_msgq *q) +{ + pthread_mutex_lock(&q->mutex); + _osmo_it_msgq_flush(q); + pthread_mutex_unlock(&q->mutex); +} + +/*! Destroy a message queue */ +void osmo_it_msgq_destroy(struct osmo_it_msgq *q) +{ + /* first remove from global list of queues */ + pthread_rwlock_wrlock(&msg_queues_rwlock); + llist_del(&q->entry); + pthread_rwlock_unlock(&msg_queues_rwlock); + /* next, close the eventfd */ + osmo_fd_close(&q->event_ofd); + /* flush all messages still present */ + osmo_it_msgq_flush(q); + /* and finally release memory */ + talloc_free(q); +} + +/*! Thread-safe en-queue to an inter-thread message queue. + * \param[in] queue Inter-thread queue on which to enqueue + * \param[in] msgb Message buffer to enqueue + * \returns 0 on success; negative on error */ +int osmo_it_msgq_enqueue(struct osmo_it_msgq *queue, struct msgb *msg) +{ + pthread_mutex_lock(&queue->mutex); + if (queue->current_length+1 > queue->max_length) { + pthread_mutex_unlock(&queue->mutex); + return -ENOSPC; + } + msgb_enqueue_count(&queue->list, msg, &queue->current_length); + pthread_mutex_unlock(&queue->mutex); + /* increment eventfd counter by one */ + eventfd_increment(queue->event_ofd.fd, 1); + return 0; +} + +/*! Thread-safe de-queue from an inter-thread message queue. + * \param[in] queue Inter-thread queue from which to dequeue + * \returns dequeued message buffer; NULL if none available + */ +struct msgb *osmo_it_msgq_dequeue(struct osmo_it_msgq *queue) +{ + struct msgb *msg; + + pthread_mutex_lock(&queue->mutex); + msg = msgb_dequeue_count(&queue->list, &queue->current_length); + pthread_mutex_unlock(&queue->mutex); + + return msg; +} + +/*! @} */ diff --git a/tests/Makefile.am b/tests/Makefile.am index 6aa1279..c51c039 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,7 +30,7 @@ tdef/tdef_test tdef/tdef_vty_test_config_root \ tdef/tdef_vty_test_config_subnode \ tdef/tdef_vty_test_dynamic \ - context/context_test \ + context/context_test it_msgq/it_msgq_test \ $(NULL) if ENABLE_MSGFILE @@ -240,6 +240,10 @@ context_context_test_SOURCES = context/context_test.c context_context_test_LDADD = $(LDADD) + +it_msgq_it_msgq_test_SOURCES = it_msgq/it_msgq_test.c +it_msgq_it_msgq_test_LDADD = $(LDADD) + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -309,6 +313,7 @@ tdef/tdef_vty_test_config_subnode.vty \ tdef/tdef_vty_test_dynamic.vty \ context/context_test.ok \ + it_msgq/it_msgq_test.ok \ $(NULL) DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c diff --git a/tests/it_msgq/it_msgq_test.c b/tests/it_msgq/it_msgq_test.c new file mode 100644 index 0000000..c01b613 --- /dev/null +++ b/tests/it_msgq/it_msgq_test.c @@ -0,0 +1,106 @@ +#include +#include + +#include +#include + +#define ENTER_TC printf("\n== Entering test case %s\n", __func__) + +static void tc_alloc(void) +{ + struct osmo_it_msgq *q1, *q2; + + ENTER_TC; + + printf("allocating q1\n"); + q1 = osmo_it_msgq_alloc(OTC_GLOBAL, "q1", 3, NULL); + OSMO_ASSERT(q1); + + /* ensure that no duplicate allocation for the */ + printf("attempting duplicate allocation of qa\n"); + q2 = osmo_it_msgq_alloc(OTC_GLOBAL, "q1", 3, NULL); + OSMO_ASSERT(!q2); + + /* ensure that same name can be re-created after destroying old one */ + osmo_it_msgq_destroy(q1); + printf("re-allocating q1\n"); + q1 = osmo_it_msgq_alloc(OTC_GLOBAL, "q1", 3, NULL); + OSMO_ASSERT(q1); + + osmo_it_msgq_destroy(q1); +} + +static void tc_queue_length(void) +{ + struct osmo_it_msgq *q1; + unsigned int qlen = 3; + struct msgb *msg; + int i, rc; + + ENTER_TC; + + printf("allocating q1\n"); + q1 = osmo_it_msgq_alloc(OTC_GLOBAL, "q1", qlen, NULL); + OSMO_ASSERT(q1); + + printf("adding queue entries up to the limit\n"); + for (i = 0; i < qlen; i++) { + msg = msgb_alloc(23, __func__); + rc = osmo_it_msgq_enqueue(q1, msg); + OSMO_ASSERT(rc == 0); + } + printf("attempting to add more than the limit\n"); + msg = msgb_alloc(23, __func__); + rc = osmo_it_msgq_enqueue(q1, msg); + OSMO_ASSERT(rc == -ENOSPC); + + osmo_it_msgq_destroy(q1); +} + +static int g_read_cb_count; + +static void q_read_cb(struct osmo_it_msgq *q, struct msgb *msg) +{ + g_read_cb_count++; + talloc_free(msg); +} + +static void tc_eventfd(void) +{ + struct osmo_it_msgq *q1; + unsigned int qlen = 30; + struct msgb *msg; + int i, rc; + + ENTER_TC; + + printf("allocating q1\n"); + q1 = osmo_it_msgq_alloc(OTC_GLOBAL, "q1", qlen, q_read_cb); + OSMO_ASSERT(q1); + osmo_fd_register(&q1->event_ofd); + + /* ensure read-cb isn't called unless we enqueue something */ + osmo_select_main(1); + OSMO_ASSERT(g_read_cb_count == 0); + + /* ensure read-cb is called for each enqueued msg once */ + printf("adding %u queue entries up to the limit\n", qlen); + for (i = 0; i < qlen; i++) { + msg = msgb_alloc(23, __func__); + rc = osmo_it_msgq_enqueue(q1, msg); + OSMO_ASSERT(rc == 0); + } + + osmo_select_main(1); + printf("%u entries were dequeued\n", qlen); + OSMO_ASSERT(g_read_cb_count == qlen); + + osmo_it_msgq_destroy(q1); +} + +int main(int argc, char **argv) +{ + tc_alloc(); + tc_queue_length(); + tc_eventfd(); +} diff --git a/tests/it_msgq/it_msgq_test.ok b/tests/it_msgq/it_msgq_test.ok new file mode 100644 index 0000000..7f102c6 --- /dev/null +++ b/tests/it_msgq/it_msgq_test.ok @@ -0,0 +1,15 @@ + +== Entering test case tc_alloc +allocating q1 +attempting duplicate allocation of qa +re-allocating q1 + +== Entering test case tc_queue_length +allocating q1 +adding queue entries up to the limit +attempting to add more than the limit + +== Entering test case tc_eventfd +allocating q1 +adding 30 queue entries up to the limit +30 entries were dequeued diff --git a/tests/testsuite.at b/tests/testsuite.at index f1534e4..2c48485 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -337,3 +337,9 @@ cat $abs_srcdir/context/context_test.ok > expout AT_CHECK([$abs_top_builddir/tests/context/context_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([it_msgq]) +AT_KEYWORDS([it_msgq]) +cat $abs_srcdir/it_msgq/it_msgq_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/it_msgq/it_msgq_test], [0], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/13538 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I30a7233cb0b51a883ad85c8c4165270b32c4be61 Gerrit-Change-Number: 13538 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 17:30:22 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 6 Apr 2019 17:30:22 +0000 Subject: Change in libosmocore[master]: select: Make file descriptor lists per-thread In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13537 ) Change subject: select: Make file descriptor lists per-thread ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13537 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5082ed3e500ad1a7516e1785bc57e008da2fac9a Gerrit-Change-Number: 13537 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 06 Apr 2019 17:30:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 17:35:00 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 6 Apr 2019 17:35:00 +0000 Subject: Change in osmo-bsc[master]: gsm_data.c: use REG_NOSUB flag of regcomp() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13539 Change subject: gsm_data.c: use REG_NOSUB flag of regcomp() ...................................................................... gsm_data.c: use REG_NOSUB flag of regcomp() We don't need to know position of matches: just yes or no. This change would save some computation power. Change-Id: Ia8414bf83d030adfae806c0aeaa757bc4c8cda2b --- M src/osmo-bsc/gsm_data.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/39/13539/1 diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index 509f805..45c433c 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -260,7 +260,7 @@ if (argc > 0) { *str = talloc_strdup(ctx, argv[0]); - ret = regcomp(reg, argv[0], 0); + ret = regcomp(reg, argv[0], REG_NOSUB); /* handle compilation failures */ if (ret != 0) { -- To view, visit https://gerrit.osmocom.org/13539 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8414bf83d030adfae806c0aeaa757bc4c8cda2b Gerrit-Change-Number: 13539 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 18:23:42 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 18:23:42 +0000 Subject: Change in libosmo-abis[master]: ipa_keepalive_fsm: Fix OSMO_IPA_KA_E_STOP allstate event Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13540 Change subject: ipa_keepalive_fsm: Fix OSMO_IPA_KA_E_STOP allstate event ...................................................................... ipa_keepalive_fsm: Fix OSMO_IPA_KA_E_STOP allstate event We had the allstate_action function registered, and that function implemented handling of OSMO_IPA_KA_E_STOP. However, the allstate_event_mask was not set, rendering this functionality inaccessible. Change-Id: I83fd991bdacb7bab794878e47c7797fecf8b9286 --- M src/input/ipa_keepalive.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/40/13540/1 diff --git a/src/input/ipa_keepalive.c b/src/input/ipa_keepalive.c index 1aae096..6467720 100644 --- a/src/input/ipa_keepalive.c +++ b/src/input/ipa_keepalive.c @@ -189,6 +189,7 @@ .states = ipa_keepalive_states, .num_states = ARRAY_SIZE(ipa_keepalive_states), .log_subsys = DLINP, + .allstate_event_mask = S(OSMO_IPA_KA_E_STOP), .allstate_action = ipa_ka_allstate_action, .event_names = ipa_keepalive_event_names, .timer_cb = ipa_ka_fsm_timer_cb, -- To view, visit https://gerrit.osmocom.org/13540 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I83fd991bdacb7bab794878e47c7797fecf8b9286 Gerrit-Change-Number: 13540 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 18:29:01 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 6 Apr 2019 18:29:01 +0000 Subject: Change in libosmo-abis[master]: ipa_keepalive_fsm: Suppress error messages for INIT -> INIT transition Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13541 Change subject: ipa_keepalive_fsm: Suppress error messages for INIT -> INIT transition ...................................................................... ipa_keepalive_fsm: Suppress error messages for INIT -> INIT transition If we receive an OSMO_IPA_KA_E_STOP in INIT state, we are trying to re-enter INIT, which is not permitted as per the FSM definition. Adding this permission avoids the below error message from hitting the logs every time this happens: <0003> input/ipa_keepalive.c:158 IPA-KEEPALIVE(server)[0x612000000520]{INIT}: transition to state INIT not permitted! Change-Id: I8db2f2e708fc4fbb81f5019973098a80e8f540d2 --- M src/input/ipa_keepalive.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/41/13541/1 diff --git a/src/input/ipa_keepalive.c b/src/input/ipa_keepalive.c index 6467720..81b5a26 100644 --- a/src/input/ipa_keepalive.c +++ b/src/input/ipa_keepalive.c @@ -167,7 +167,7 @@ [OSMO_IPA_KA_S_INIT] = { .name = "INIT", .in_event_mask = S(OSMO_IPA_KA_E_START), - .out_state_mask = S(OSMO_IPA_KA_S_WAIT_RESP), + .out_state_mask = S(OSMO_IPA_KA_S_WAIT_RESP) | S(OSMO_IPA_KA_S_INIT), .action = ipa_ka_init, }, [OSMO_IPA_KA_S_IDLE] = { -- To view, visit https://gerrit.osmocom.org/13541 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8db2f2e708fc4fbb81f5019973098a80e8f540d2 Gerrit-Change-Number: 13541 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 19:21:02 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 6 Apr 2019 19:21:02 +0000 Subject: Change in libosmo-abis[master]: ipa_keepalive_fsm: Fix OSMO_IPA_KA_E_STOP allstate event In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13540 ) Change subject: ipa_keepalive_fsm: Fix OSMO_IPA_KA_E_STOP allstate event ...................................................................... Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/13540/1/src/input/ipa_keepalive.c File src/input/ipa_keepalive.c: https://gerrit.osmocom.org/#/c/13540/1/src/input/ipa_keepalive.c at 192 PS1, Line 192: allstate_event_mask Hmm, maybe we should warn the API user from fsm.c when the allstate_action is set, but allstate_event_mask is 0x00? -- To view, visit https://gerrit.osmocom.org/13540 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I83fd991bdacb7bab794878e47c7797fecf8b9286 Gerrit-Change-Number: 13540 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 06 Apr 2019 19:21:02 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 19:22:02 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 6 Apr 2019 19:22:02 +0000 Subject: Change in libosmo-abis[master]: ipa_keepalive_fsm: Suppress error messages for INIT -> INIT transition In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13541 ) Change subject: ipa_keepalive_fsm: Suppress error messages for INIT -> INIT transition ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13541 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8db2f2e708fc4fbb81f5019973098a80e8f540d2 Gerrit-Change-Number: 13541 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 06 Apr 2019 19:22:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 19:47:54 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 6 Apr 2019 19:47:54 +0000 Subject: Change in pysim[master]: cosmetic: fix sourecode formatting In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13476 ) Change subject: cosmetic: fix sourecode formatting ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13476 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4836826811ffb0aeb103d32eb874f5fa52af4186 Gerrit-Change-Number: 13476 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 06 Apr 2019 19:47:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 19:49:28 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 6 Apr 2019 19:49:28 +0000 Subject: Change in pysim[master]: wavemobile-sim: write mnc-length field ine EF.AD In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13478 ) Change subject: wavemobile-sim: write mnc-length field ine EF.AD ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13478 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieda0ce864bf3e8c7b92f062eaa3a5482c98507e2 Gerrit-Change-Number: 13478 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 06 Apr 2019 19:49:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 20:18:29 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 6 Apr 2019 20:18:29 +0000 Subject: Change in osmo-ci[master]: ansible: gsm-tester: Remove net iface name from hash input In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13518 ) Change subject: ansible: gsm-tester: Remove net iface name from hash input ...................................................................... ansible: gsm-tester: Remove net iface name from hash input Otherwise every time the interface is added (ie when it goes back to default netns), the generate name changes due to DEVPATH containing current name at the end of the path. Change-Id: I87c686caa23a3b39e48e0762d4323a59be7cd4b8 --- M ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules b/ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules index a9826e2..376b214 100644 --- a/ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules +++ b/ansible/roles/gsm-tester/files/70-net-setup-link-modems.rules @@ -5,6 +5,6 @@ # If dev paths are too long (too many usb hubs in the path) (>IFNAMSIZ), ID_NET_NAME_PATH is not populated. ENV{DEVTYPE}=="wwan", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}" -ENV{DEVTYPE}=="wwan", ENV{ID_NET_NAME_PATH}=="", PROGRAM="/bin/sh -ec 'echo ${DEVPATH} | sha1sum | head -c14'", NAME="r$result" +ENV{DEVTYPE}=="wwan", ENV{ID_NET_NAME_PATH}=="", PROGRAM="/bin/sh -ec 'echo ${DEVPATH} | xargs dirname | sha1sum | head -c14'", NAME="r$result" LABEL="net_setup_link_end" -- To view, visit https://gerrit.osmocom.org/13518 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I87c686caa23a3b39e48e0762d4323a59be7cd4b8 Gerrit-Change-Number: 13518 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 20:18:30 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 6 Apr 2019 20:18:30 +0000 Subject: Change in osmo-ci[master]: ansible: gsm-tester: Install osmo-gsm-tester_netns_setup.sh In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13524 ) Change subject: ansible: gsm-tester: Install osmo-gsm-tester_netns_setup.sh ...................................................................... ansible: gsm-tester: Install osmo-gsm-tester_netns_setup.sh Change-Id: Iaa8802b86429abfaf84fc0f20bd207737dbc9812 --- A ansible/roles/gsm-tester/files/osmo-gsm-tester_netns_setup.sh M ansible/roles/gsm-tester/tasks/main.yml 2 files changed, 35 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/ansible/roles/gsm-tester/files/osmo-gsm-tester_netns_setup.sh b/ansible/roles/gsm-tester/files/osmo-gsm-tester_netns_setup.sh new file mode 100755 index 0000000..1600c44 --- /dev/null +++ b/ansible/roles/gsm-tester/files/osmo-gsm-tester_netns_setup.sh @@ -0,0 +1,22 @@ +#!/bin/bash -e + +ifname="$1" +netns="$2" +shift +shift + + + +if [ -f "/var/run/netns/${netns}" ]; then + echo "netns $netns already exists" +else + echo "Creating netns $netns" + ip netns add "$netns" +fi + +if [ -d "/sys/class/net/${ifname}" ]; then + echo "Moving iface $ifname to netns $netns" + ip link set $ifname netns $netns +else + ip netns exec $netns ls "/sys/class/net/${ifname}" >/dev/null && echo "iface $ifname already in netns $netns" +fi diff --git a/ansible/roles/gsm-tester/tasks/main.yml b/ansible/roles/gsm-tester/tasks/main.yml index c9b7429..34846a5 100644 --- a/ansible/roles/gsm-tester/tasks/main.yml +++ b/ansible/roles/gsm-tester/tasks/main.yml @@ -254,6 +254,19 @@ dest: /etc/sudoers.d/osmo-gsm-tester_netns_exec mode: 0440 +- name: create a wrapper script to move modem net iface into its own netns + copy: + src: osmo-gsm-tester_netns_setup.sh + dest: /usr/local/bin/osmo-gsm-tester_netns_setup.sh + mode: 755 + +- name: allow osmo-gsm-tester sudo osmo-gsm-tester_netns_setup.sh + copy: + content: | + %osmo-gsm-tester ALL=(root) NOPASSWD: /usr/local/bin/osmo-gsm-tester_netns_setup.sh + dest: /etc/sudoers.d/osmo-gsm-tester_netns_setup + mode: 0440 + - name: logrotate limit filesizes to 10M copy: content: "maxsize 10M" -- To view, visit https://gerrit.osmocom.org/13524 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iaa8802b86429abfaf84fc0f20bd207737dbc9812 Gerrit-Change-Number: 13524 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 20:22:06 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 6 Apr 2019 20:22:06 +0000 Subject: Change in osmo-bsc[master]: ipaccess-config: use POSIX regex for Unit ID format check In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13535 ) Change subject: ipaccess-config: use POSIX regex for Unit ID format check ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13535 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id613bf650833dd38eaad08fdfffdf8dbe2f002b1 Gerrit-Change-Number: 13535 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 06 Apr 2019 20:22:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 20:23:55 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 6 Apr 2019 20:23:55 +0000 Subject: Change in osmo-bsc[master]: osmo_bsc_lcls.c: cosmetic: make Coverity happy In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13533 ) Change subject: osmo_bsc_lcls.c: cosmetic: make Coverity happy ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13533/2/src/osmo-bsc/osmo_bsc_lcls.c File src/osmo-bsc/osmo_bsc_lcls.c: https://gerrit.osmocom.org/#/c/13533/2/src/osmo-bsc/osmo_bsc_lcls.c at 427 PS2, Line 427: if (lcls_handle_cfg_update(conn, data) != 0) So it cries because in first time this return here makes no sense. Better remove the if clause and the return statement. -- To view, visit https://gerrit.osmocom.org/13533 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib3d7519421319fb0e6d65441bba123b7b01f4556 Gerrit-Change-Number: 13533 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 06 Apr 2019 20:23:55 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 20:28:58 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 6 Apr 2019 20:28:58 +0000 Subject: Change in libosmocore[master]: select: Make file descriptor lists per-thread In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13537 ) Change subject: select: Make file descriptor lists per-thread ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13537/1/src/select.c File src/select.c: https://gerrit.osmocom.org/#/c/13537/1/src/select.c at 57 PS1, Line 57: static __thread int unregistered_count; If these variables are used together then we'll probably want to put them together in a struct in order to speed up lookup for each thread. -- To view, visit https://gerrit.osmocom.org/13537 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5082ed3e500ad1a7516e1785bc57e008da2fac9a Gerrit-Change-Number: 13537 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 06 Apr 2019 20:28:58 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 20:30:16 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 6 Apr 2019 20:30:16 +0000 Subject: Change in libosmo-abis[master]: ipa_keepalive_fsm: Fix OSMO_IPA_KA_E_STOP allstate event In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13540 ) Change subject: ipa_keepalive_fsm: Fix OSMO_IPA_KA_E_STOP allstate event ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13540 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I83fd991bdacb7bab794878e47c7797fecf8b9286 Gerrit-Change-Number: 13540 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 06 Apr 2019 20:30:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 20:31:04 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 6 Apr 2019 20:31:04 +0000 Subject: Change in libosmo-abis[master]: ipa_keepalive_fsm: Suppress error messages for INIT -> INIT transition In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13541 ) Change subject: ipa_keepalive_fsm: Suppress error messages for INIT -> INIT transition ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13541 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8db2f2e708fc4fbb81f5019973098a80e8f540d2 Gerrit-Change-Number: 13541 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 06 Apr 2019 20:31:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 20:58:45 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 6 Apr 2019 20:58:45 +0000 Subject: Change in osmo-bsc[master]: osmo_bsc_lcls.c: cosmetic: make Coverity happy In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13533 ) Change subject: osmo_bsc_lcls.c: cosmetic: make Coverity happy ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13533/2/src/osmo-bsc/osmo_bsc_lcls.c File src/osmo-bsc/osmo_bsc_lcls.c: https://gerrit.osmocom.org/#/c/13533/2/src/osmo-bsc/osmo_bsc_lcls.c at 427 PS2, Line 427: if (lcls_handle_cfg_update(conn, data) != 0) > So it cries because in first time this return here makes no sense. [?] No, it actually cries because we do 'return' in both cases: if the condition is true, or the condition is false. The benefit of using 'break' is that one can still add some code after the 'switch' statement, and it won't be unreachable in such cases. -- To view, visit https://gerrit.osmocom.org/13533 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib3d7519421319fb0e6d65441bba123b7b01f4556 Gerrit-Change-Number: 13533 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 06 Apr 2019 20:58:45 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 21:27:16 2019 From: gerrit-no-reply at lists.osmocom.org (Rafael Diniz) Date: Sat, 6 Apr 2019 21:27:16 +0000 Subject: Change in osmo-pcu[master]: Help output of osmo-pcu looks better now. Message-ID: Rafael Diniz has uploaded this change for review. ( https://gerrit.osmocom.org/13542 Change subject: Help output of osmo-pcu looks better now. ...................................................................... Help output of osmo-pcu looks better now. Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f --- M src/pcu_main.cpp 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/42/13542/1 diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index c39c337..9233e6f 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -65,18 +65,18 @@ static void print_help() { - printf( "Some useful options:\n" - " -h --help this text\n" + printf( "Options:\n" + " -h --help This text\n" " -c --config-file Specify the filename of the config " "file\n" - " -m --mcc MCC use given MCC instead of value " + " -m --mcc MCC Use given MCC instead of value " "provided by BTS\n" - " -n --mnc MNC use given MNC instead of value " + " -n --mnc MNC Use given MNC instead of value " "provided by BTS\n" - " -V --version print version\n" - " -r --realtime PRIO Use SCHED_RR with the specified " + " -V --version Print version\n" + " -r --realtime PRIO Use SCHED_RR with the specified " "priority\n" - " -D --daemonize Fork the process into a background" + " -D --daemonize Fork the process into a background " "daemon\n" " -i --gsmtap-ip The destination IP used for GSMTAP.\n" ); -- To view, visit https://gerrit.osmocom.org/13542 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f Gerrit-Change-Number: 13542 Gerrit-PatchSet: 1 Gerrit-Owner: Rafael Diniz -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 6 22:24:06 2019 From: gerrit-no-reply at lists.osmocom.org (Rafael Diniz) Date: Sat, 6 Apr 2019 22:24:06 +0000 Subject: Change in osmo-pcu[master]: Help output of osmo-pcu looks better now. In-Reply-To: References: Message-ID: Rafael Diniz has posted comments on this change. ( https://gerrit.osmocom.org/13542 ) Change subject: Help output of osmo-pcu looks better now. ...................................................................... Patch Set 1: Code-Review+1 Just cosmetic stuff. -- To view, visit https://gerrit.osmocom.org/13542 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f Gerrit-Change-Number: 13542 Gerrit-PatchSet: 1 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Rafael Diniz Gerrit-Comment-Date: Sat, 06 Apr 2019 22:24:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 7 07:29:00 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 7 Apr 2019 07:29:00 +0000 Subject: Change in osmo-pcu[master]: Help output of osmo-pcu looks better now. In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13542 ) Change subject: Help output of osmo-pcu looks better now. ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/13542/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13542/1//COMMIT_MSG at 7 PS1, Line 7: Help output of osmo-pcu looks better now. In general, all our commits make something better ;) Consider rephrasing: Unify help message text. https://gerrit.osmocom.org/#/c/13542/1/src/pcu_main.cpp File src/pcu_main.cpp: https://gerrit.osmocom.org/#/c/13542/1/src/pcu_main.cpp at 81 PS1, Line 81: . This dot could be also removed. -- To view, visit https://gerrit.osmocom.org/13542 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f Gerrit-Change-Number: 13542 Gerrit-PatchSet: 1 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Rafael Diniz Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Sun, 07 Apr 2019 07:29:00 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 7 14:11:16 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Sun, 7 Apr 2019 14:11:16 +0000 Subject: Change in osmo-sgsn[master]: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. Message-ID: Mykola Shchetinin has uploaded this change for review. ( https://gerrit.osmocom.org/13543 Change subject: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. ...................................................................... gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. Related OS#3908 Change-Id: Ibd918375be1593e461279792cfe41572a56c6aad --- M src/gprs/gprs_gmm.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/43/13543/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index cc6ea4a..26d271c 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -2035,6 +2035,11 @@ goto null_mmctx; /* only in case SGSN offered new P-TMSI */ LOGMMCTXP(LOGL_INFO, mmctx, "-> ATTACH COMPLETE\n"); + + if (mmctx->iu.ue_ctx) { + ranap_iu_tx_release(mmctx->iu.ue_ctx, NULL); + } + mmctx_timer_stop(mmctx, 3350); mmctx->t3350_mode = GMM_T3350_MODE_NONE; mmctx->p_tmsi_old = 0; -- To view, visit https://gerrit.osmocom.org/13543 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibd918375be1593e461279792cfe41572a56c6aad Gerrit-Change-Number: 13543 Gerrit-PatchSet: 1 Gerrit-Owner: Mykola Shchetinin -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 7 14:13:05 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Sun, 7 Apr 2019 14:13:05 +0000 Subject: Change in osmo-sgsn[master]: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. In-Reply-To: References: Message-ID: Mykola Shchetinin has abandoned this change. ( https://gerrit.osmocom.org/13543 ) Change subject: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. ...................................................................... Abandoned wrong commit message -- To view, visit https://gerrit.osmocom.org/13543 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Ibd918375be1593e461279792cfe41572a56c6aad Gerrit-Change-Number: 13543 Gerrit-PatchSet: 1 Gerrit-Owner: Mykola Shchetinin Gerrit-CC: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 7 14:14:35 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Sun, 7 Apr 2019 14:14:35 +0000 Subject: Change in osmo-sgsn[master]: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. Message-ID: Mykola Shchetinin has uploaded this change for review. ( https://gerrit.osmocom.org/13544 Change subject: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. ...................................................................... gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Related: OS#3908 --- M src/gprs/gprs_gmm.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/44/13544/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index cc6ea4a..26d271c 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -2035,6 +2035,11 @@ goto null_mmctx; /* only in case SGSN offered new P-TMSI */ LOGMMCTXP(LOGL_INFO, mmctx, "-> ATTACH COMPLETE\n"); + + if (mmctx->iu.ue_ctx) { + ranap_iu_tx_release(mmctx->iu.ue_ctx, NULL); + } + mmctx_timer_stop(mmctx, 3350); mmctx->t3350_mode = GMM_T3350_MODE_NONE; mmctx->p_tmsi_old = 0; -- To view, visit https://gerrit.osmocom.org/13544 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Gerrit-Change-Number: 13544 Gerrit-PatchSet: 1 Gerrit-Owner: Mykola Shchetinin -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 7 14:25:57 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Sun, 7 Apr 2019 14:25:57 +0000 Subject: Change in osmo-sgsn[master]: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13544 to look at the new patch set (#2). Change subject: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. ...................................................................... gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Related: OS#3908 --- M src/gprs/gprs_gmm.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/44/13544/2 -- To view, visit https://gerrit.osmocom.org/13544 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Gerrit-Change-Number: 13544 Gerrit-PatchSet: 2 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 7 16:22:41 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 7 Apr 2019 16:22:41 +0000 Subject: Change in osmo-bsc[master]: osmo_bsc_lcls.c: cosmetic: make Coverity happy In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13533 ) Change subject: osmo_bsc_lcls.c: cosmetic: make Coverity happy ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13533 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib3d7519421319fb0e6d65441bba123b7b01f4556 Gerrit-Change-Number: 13533 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sun, 07 Apr 2019 16:22:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 7 18:52:55 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 7 Apr 2019 18:52:55 +0000 Subject: Change in osmo-bsc[master]: osmo_bsc_lcls.c: cosmetic: make Coverity happy In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13533 ) Change subject: osmo_bsc_lcls.c: cosmetic: make Coverity happy ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13533 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib3d7519421319fb0e6d65441bba123b7b01f4556 Gerrit-Change-Number: 13533 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sun, 07 Apr 2019 18:52:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 7 18:53:31 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 7 Apr 2019 18:53:31 +0000 Subject: Change in osmo-bsc[master]: ipaccess-config: use POSIX regex for Unit ID format check In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13535 ) Change subject: ipaccess-config: use POSIX regex for Unit ID format check ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13535 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id613bf650833dd38eaad08fdfffdf8dbe2f002b1 Gerrit-Change-Number: 13535 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sun, 07 Apr 2019 18:53:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 7 18:55:05 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 7 Apr 2019 18:55:05 +0000 Subject: Change in osmo-sgsn[master]: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13544 ) Change subject: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. ...................................................................... Patch Set 2: Code-Review+1 I'm not entirely sure if this is the correct solution or if this is merely a "quick hack" to make it work. In either case, we can merege it for now. However, the commitlog should be extended. -- To view, visit https://gerrit.osmocom.org/13544 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Gerrit-Change-Number: 13544 Gerrit-PatchSet: 2 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sun, 07 Apr 2019 18:55:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 7 18:55:39 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 7 Apr 2019 18:55:39 +0000 Subject: Change in osmo-bsc[master]: gsm_data.c: use REG_NOSUB flag of regcomp() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13539 ) Change subject: gsm_data.c: use REG_NOSUB flag of regcomp() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13539 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia8414bf83d030adfae806c0aeaa757bc4c8cda2b Gerrit-Change-Number: 13539 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sun, 07 Apr 2019 18:55:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 7 18:57:31 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 7 Apr 2019 18:57:31 +0000 Subject: Change in osmo-msc[master]: vlr_sgs: fix SGs IMSI detech from non EPS services In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13493 ) Change subject: vlr_sgs: fix SGs IMSI detech from non EPS services ...................................................................... vlr_sgs: fix SGs IMSI detech from non EPS services When the subscriber is detached from non EPS services while the SGs-association is not SGs-NULL, it needs to be removed from the VLR database. Change-Id: I575cf6036ad39468f590b2d57a06cd3512a4c31c Related: OS#3614 --- M src/libvlr/vlr_sgs.c 1 file changed, 12 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/libvlr/vlr_sgs.c b/src/libvlr/vlr_sgs.c index 8614892..538c9f2 100644 --- a/src/libvlr/vlr_sgs.c +++ b/src/libvlr/vlr_sgs.c @@ -131,10 +131,17 @@ { struct vlr_subscr *vsub; enum sgs_ue_fsm_event evt; + vsub = vlr_subscr_find_by_imsi(vlr, imsi); if (!vsub) return; + /* See also: 3GPP TS 29.118, 5.6.3 Procedures in the VLR: In case of + * an implicit detach, we are supposed to check if the state of the + * SGs-association, and only when it is not SGs-NULL, we may proceed. */ + if (vsub->sgs_fsm->state == SGS_UE_ST_NULL && type == SGSAP_ID_NONEPS_T_IMPLICIT_UE_EPS_NONEPS) + return; + switch (type) { case SGSAP_ID_NONEPS_T_EXPLICIT_UE_NONEPS: evt = SGS_UE_E_RX_DETACH_IND_FROM_UE; @@ -153,6 +160,11 @@ osmo_fsm_inst_dispatch(vsub->sgs_fsm, evt, NULL); vlr_subscr_put(vsub); + + /* Detaching from non EPS services essentially means that the + * subscriber is detached from 2G. In any case the VLR will + * get rid of the subscriber. */ + vlr_subscr_expire(vsub); } /*! Perform an SGs EPS detach. -- To view, visit https://gerrit.osmocom.org/13493 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I575cf6036ad39468f590b2d57a06cd3512a4c31c Gerrit-Change-Number: 13493 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 7 18:57:40 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 7 Apr 2019 18:57:40 +0000 Subject: Change in osmo-msc[master]: vlr_sgs: start lu expiration timer on sgs eps detach In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13494 ) Change subject: vlr_sgs: start lu expiration timer on sgs eps detach ...................................................................... vlr_sgs: start lu expiration timer on sgs eps detach When the subscriber is detached from SGs services (but not from 2g services). Then the subscriber essentially becomes a regular 2g subscriber, which means thet the lu expiration timer needs to be started. Change-Id: If95c63706dc1c5a537f7cd1b6481252427cbf234 Related: OS#3614 --- M src/libvlr/vlr_sgs.c 1 file changed, 14 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/libvlr/vlr_sgs.c b/src/libvlr/vlr_sgs.c index 538c9f2..06737db 100644 --- a/src/libvlr/vlr_sgs.c +++ b/src/libvlr/vlr_sgs.c @@ -101,6 +101,11 @@ vsub->cgi.lai = *new_lai; vsub->cs.lac = vsub->sgs.lai.lac; + /* Subscribers that are created by the SGs location update will not + * expire automatically, however a 2G LU or an implicit IMSI detach + * from EPS services may change this. */ + vsub->expire_lu = VLR_SUBSCRIBER_NO_EXPIRATION; + return 0; } @@ -197,6 +202,15 @@ } osmo_fsm_inst_dispatch(vsub->sgs_fsm, evt, NULL); + + /* See also 3GPP TS 29.118, 5.4.3 Procedures in the VLR. Detaching from + * EPS services essentially means that the subscriber leaves the 4G RAN + * but continues to live on 2G, this basically turns the subscriber into + * a normal 2G subscriber and we need to make sure that the lu- + * expiration timer is running. */ + if (vsub->expire_lu == VLR_SUBSCRIBER_NO_EXPIRATION) + vlr_subscr_enable_expire_lu(vsub); + vlr_subscr_put(vsub); } -- To view, visit https://gerrit.osmocom.org/13494 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If95c63706dc1c5a537f7cd1b6481252427cbf234 Gerrit-Change-Number: 13494 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 7 22:21:17 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 7 Apr 2019 22:21:17 +0000 Subject: Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13392 ) Change subject: fsm: support graceful osmo_fsm_inst_term() cascades ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/13392/4/src/fsm.c File src/fsm.c: https://gerrit.osmocom.org/#/c/13392/4/src/fsm.c at 409 PS4, Line 409: talloc_steal(osmo_fsm_inst_terminating_root, fi); I am reparenting "any" FSM instance as a child of "any other" in the order of release events, to save us having to create a separate talloc_ctx to steal into. However, talloc manpage says: It is possible to produce loops in the parent/child relationship if you are not careful with talloc_steal(). No guarantees are provided as to your sanity or the safety of your data if you do this. So after all it seems like a bad idea to do this optimization. We don't want to risk our sanity, right. -- To view, visit https://gerrit.osmocom.org/13392 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 Gerrit-Change-Number: 13392 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Sun, 07 Apr 2019 22:21:17 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 7 22:30:49 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 7 Apr 2019 22:30:49 +0000 Subject: Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13392 ) Change subject: fsm: support graceful osmo_fsm_inst_term() cascades ...................................................................... Patch Set 4: > Patch Set 4: > new libraries should always run old programs fine. ack, got it now. So we should make this feature a runtime switch. It would suffice to have one global boolean variable for all FSMs. As soon as a client program sets that to true ("recommended use") fsm.c uses the new method. The osmo-msc source tree can then decide itself from which revision on it switches to the new FSM termination behavior. It could also be an argument passed to osmo_fsm_inst_term2(), or a flag set in each FSM definition. But that would become a lot more complex and patch prone than one global switch. -- To view, visit https://gerrit.osmocom.org/13392 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 Gerrit-Change-Number: 13392 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Sun, 07 Apr 2019 22:30:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 00:40:14 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 00:40:14 +0000 Subject: Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13392 to look at the new patch set (#5). Change subject: fsm: support graceful osmo_fsm_inst_term() cascades ...................................................................... fsm: support graceful osmo_fsm_inst_term() cascades Add global flag osmo_fsm_term_safely() -- if set to true, enable the following behavior: Detect osmo_fsm_inst_term() occuring within osmo_fsm_inst_term(): - collect deallocations until the outermost osmo_fsm_inst_term() is done. - call osmo_fsm_inst_free() *after* dispatching the parent event. If a struct osmo_fsm_inst enters osmo_fsm_inst_term() while another is already within osmo_fsm_inst_term(), do not directly deallocate it, but talloc-reparent it to a separate talloc context, to be deallocated with the outermost FSM inst. The effect is that all osmo_fsm_inst freed within an osmo_fsm_inst_term() cascade will stay allocated until all osmo_fsm_inst_term() are complete and all of them will be deallocated at the same time. Mark the deferred deallocation state as __thread in an attempt to make cascaded deallocation handling threadsafe. Keep the enable/disable flag separate, so that it is global and not per-thread. The feature is showcased by fsm_dealloc_test.c: with this feature, all of those wild deallocation scenarios succeed. Make fsm_dealloc_test a normal regression test in testsuite.at. Rationale: It is difficult to gracefully handle deallocations of groups of FSM instances that reference each other. As soon as one child dispatching a cleanup event causes its parent to deallocate before fsm.c was ready for it, deallocation will hit a use-after-free. Before this patch, by using parent_term events and distinct "terminating" FSM states, parent/child FSMs can be taught to wait for all children to deallocate before deallocating the parent. But as soon as a non-child / non-parent FSM instance is involved, or actually any other cleanup() action that triggers parent FSMs or parent talloc contexts to become unused, it is near impossible to think of all possible deallocation events ricocheting, and to avoid running into freeing FSM instances that were still in the middle of osmo_fsm_inst_term(), or FSM instances to enter osmo_fsm_inst_term() more than once. This patch makes deallocation of "all possible" setups of complex cross referencing FSM instances easy to handle correctly, without running into use-after-free or double free situations, and, notably, without changing calling code. Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 --- M include/osmocom/core/fsm.h M src/fsm.c M tests/Makefile.am M tests/fsm/fsm_dealloc_test.c M tests/fsm/fsm_dealloc_test.err M tests/testsuite.at 6 files changed, 3,502 insertions(+), 301 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/13392/5 -- To view, visit https://gerrit.osmocom.org/13392 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 Gerrit-Change-Number: 13392 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 00:40:14 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 00:40:14 +0000 Subject: Change in libosmocore[master]: fsm_dealloc_test: no need for ST_DESTROYING 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/13393 to look at the new patch set (#5). Change subject: fsm_dealloc_test: no need for ST_DESTROYING ...................................................................... fsm_dealloc_test: no need for ST_DESTROYING A separate ST_DESTROYING state originally helped with certain deallocation scenarios. But now that fsm.c avoids re-entering osmo_fsm_inst_term() twice and gracefully handles FSM instance deallocations for termination cascades, it is actually just as safe without a separate ST_DESTROYING state. ST_DESTROYING was used to flag deallocation and prevent entering osmo_fsm_inst_term() twice, which works only in a very limited range of scenarios. Remove ST_DESTROYING from fsm_dealloc_test.c to show that all tested scenarios still clean up gracefully. Change-Id: I05354e6cad9b82ba474fa50ffd41d481b3c697b4 --- M tests/fsm/fsm_dealloc_test.c M tests/fsm/fsm_dealloc_test.err 2 files changed, 1,522 insertions(+), 1,801 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/93/13393/5 -- To view, visit https://gerrit.osmocom.org/13393 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I05354e6cad9b82ba474fa50ffd41d481b3c697b4 Gerrit-Change-Number: 13393 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 00:40:17 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 00:40:17 +0000 Subject: Change in libosmocore[master]: fsm: add flag to ensure osmo_fsm_inst_term() happens only once Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13545 Change subject: fsm: add flag to ensure osmo_fsm_inst_term() happens only once ...................................................................... fsm: add flag to ensure osmo_fsm_inst_term() happens only once To prevent re-entering osmo_fsm_inst_term() twice for the same osmo_fsm_inst, add flag osmo_fsm_inst.proc.terminating. osmo_fsm_inst_term() sets this to true, or exits if it already is true. Update fsm_dealloc_test.err for illustration. It is not relevant for unit testing yet, just showing the difference. Change-Id: I0c02d76a86f90c49e0eae2f85db64704c96a7674 --- M TODO-RELEASE M include/osmocom/core/fsm.h M src/fsm.c M tests/fsm/fsm_dealloc_test.err 4 files changed, 349 insertions(+), 38 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/45/13545/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index ba603c6..5ddc57a 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -10,3 +10,4 @@ libosmogb gprs_ns_inst Adding bss_sns_fi member for IP-SNS support libosmogb gprs_nsvc Adding sig_weight and data_weight members for IP-SNS support libosmogb various new symbols Adding functions related to IP-SNS support +libosmocore osmo_fsm_inst Add flag proc.terminating (ABI change) diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index c40d7f3..07bcd12 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -114,6 +114,8 @@ struct llist_head children; /*! \ref llist_head linked to parent->proc.children */ struct llist_head child; + /*! Indicator whether osmo_fsm_inst_term() was already invoked on this instance. */ + bool terminating; } proc; }; diff --git a/src/fsm.c b/src/fsm.c index d86ff4b..d18406a 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -710,6 +710,12 @@ struct osmo_fsm_inst *parent; uint32_t parent_term_event = fi->proc.parent_term_event; + if (fi->proc.terminating) { + LOGPFSMSRC(fi, file, line, "Ignoring trigger to terminate: already terminating\n"); + return; + } + fi->proc.terminating = true; + LOGPFSMSRC(fi, file, line, "Terminating (cause = %s)\n", osmo_fsm_term_cause_name(cause)); diff --git a/tests/fsm/fsm_dealloc_test.err b/tests/fsm/fsm_dealloc_test.err index 1719677..7f41340 100644 --- a/tests/fsm/fsm_dealloc_test.err +++ b/tests/fsm/fsm_dealloc_test.err @@ -41,6 +41,310 @@ DLGLOBAL DEBUG test(_branch0){alive}: state_chg to destroying DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.destroying_onenter()) DLGLOBAL DEBUG test(_branch0){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(_branch0){destroying}: Ignoring trigger to terminate: already terminating +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG 4 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() done +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: Freeing instance +DLGLOBAL DEBUG test(other){destroying}: Deallocated +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: Received Event EV_CHILD_GONE +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying(EV_CHILD_GONE) +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),_branch0.destroying(),_branch0.child_gone()) +DLGLOBAL DEBUG test(_branch0){destroying}: EV_CHILD_GONE: Dropped reference _branch0.child[0] = __twig0a +DLGLOBAL DEBUG test(_branch0){destroying}: No more children +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() done +DLGLOBAL DEBUG 0 (-) +DLGLOBAL DEBUG test(__twig0a){alive}: Freeing instance +DLGLOBAL DEBUG test(__twig0a){alive}: Deallocated +DLGLOBAL DEBUG 1 (_branch0.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() +DLGLOBAL DEBUG test(_branch0){destroying}: scene forgets _branch0 +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() done +DLGLOBAL DEBUG 0 (-) +DLGLOBAL DEBUG test(_branch0){destroying}: Freeing instance +DLGLOBAL DEBUG test(_branch0){destroying}: Deallocated +DLGLOBAL DEBUG scene_alloc() +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: is child of test(_branch0) +DLGLOBAL DEBUG test(other){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: _branch0.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[0] = _branch0 +DLGLOBAL DEBUG test(__twig0a){alive}: __twig0a.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[1] = __twig0a +DLGLOBAL DEBUG --- Test disabled: object 0 was not created. Cleaning up. +DLGLOBAL DEBUG test(_branch0){alive}: Terminating (cause = OSMO_FSM_TERM_ERROR) +DLGLOBAL DEBUG test(_branch0){alive}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DLGLOBAL DEBUG test(__twig0a){alive}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Removing from parent test(_branch0) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() +DLGLOBAL DEBUG test(__twig0a){alive}: scene forgets __twig0a +DLGLOBAL DEBUG test(__twig0a){alive}: removing reference __twig0a.other[0] -> other +DLGLOBAL DEBUG test(other){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.other_gone()) +DLGLOBAL DEBUG test(other){alive}: EV_OTHER_GONE: Dropped reference other.other[1] = __twig0a +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: state_chg to destroying +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(other){destroying}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(other){destroying}: pre_term() +DLGLOBAL DEBUG 4 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() +DLGLOBAL DEBUG test(other){destroying}: scene forgets other +DLGLOBAL DEBUG test(other){destroying}: removing reference other.other[0] -> _branch0 +DLGLOBAL DEBUG test(_branch0){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.other_gone()) +DLGLOBAL DEBUG test(_branch0){alive}: EV_OTHER_GONE: Dropped reference _branch0.other[0] = other +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: state_chg to destroying +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.destroying_onenter()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(_branch0){destroying}: Ignoring trigger to terminate: already terminating +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG 4 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() done +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: Freeing instance +DLGLOBAL DEBUG test(other){destroying}: Deallocated +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: Received Event EV_CHILD_GONE +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying(EV_CHILD_GONE) +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),_branch0.destroying(),_branch0.child_gone()) +DLGLOBAL DEBUG test(_branch0){destroying}: EV_CHILD_GONE: Dropped reference _branch0.child[0] = __twig0a +DLGLOBAL DEBUG test(_branch0){destroying}: No more children +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() done +DLGLOBAL DEBUG 0 (-) +DLGLOBAL DEBUG test(__twig0a){alive}: Freeing instance +DLGLOBAL DEBUG test(__twig0a){alive}: Deallocated +DLGLOBAL DEBUG 1 (_branch0.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() +DLGLOBAL DEBUG test(_branch0){destroying}: scene forgets _branch0 +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() done +DLGLOBAL DEBUG 0 (-) +DLGLOBAL DEBUG test(_branch0){destroying}: Freeing instance +DLGLOBAL DEBUG test(_branch0){destroying}: Deallocated +DLGLOBAL DEBUG scene_alloc() +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: is child of test(_branch0) +DLGLOBAL DEBUG test(other){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: _branch0.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[0] = _branch0 +DLGLOBAL DEBUG test(__twig0a){alive}: __twig0a.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[1] = __twig0a +DLGLOBAL DEBUG ------ before term cascade, got: +DLGLOBAL DEBUG _branch0 +DLGLOBAL DEBUG __twig0a +DLGLOBAL DEBUG other +DLGLOBAL DEBUG --- +DLGLOBAL DEBUG --- term at _branch0 +DLGLOBAL DEBUG test(_branch0){alive}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(_branch0){alive}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DLGLOBAL DEBUG test(__twig0a){alive}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Removing from parent test(_branch0) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() +DLGLOBAL DEBUG test(__twig0a){alive}: scene forgets __twig0a +DLGLOBAL DEBUG test(__twig0a){alive}: removing reference __twig0a.other[0] -> other +DLGLOBAL DEBUG test(other){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.other_gone()) +DLGLOBAL DEBUG test(other){alive}: EV_OTHER_GONE: Dropped reference other.other[1] = __twig0a +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: state_chg to destroying +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(other){destroying}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(other){destroying}: pre_term() +DLGLOBAL DEBUG 4 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() +DLGLOBAL DEBUG test(other){destroying}: scene forgets other +DLGLOBAL DEBUG test(other){destroying}: removing reference other.other[0] -> _branch0 +DLGLOBAL DEBUG test(_branch0){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.other_gone()) +DLGLOBAL DEBUG test(_branch0){alive}: EV_OTHER_GONE: Dropped reference _branch0.other[0] = other +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: state_chg to destroying +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.destroying_onenter()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(_branch0){destroying}: Ignoring trigger to terminate: already terminating +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG 4 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() done +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: Freeing instance +DLGLOBAL DEBUG test(other){destroying}: Deallocated +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: Received Event EV_CHILD_GONE +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying(EV_CHILD_GONE) +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),_branch0.destroying(),_branch0.child_gone()) +DLGLOBAL DEBUG test(_branch0){destroying}: EV_CHILD_GONE: Dropped reference _branch0.child[0] = __twig0a +DLGLOBAL DEBUG test(_branch0){destroying}: No more children +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() done +DLGLOBAL DEBUG 0 (-) +DLGLOBAL DEBUG test(__twig0a){alive}: Freeing instance +DLGLOBAL DEBUG test(__twig0a){alive}: Deallocated +DLGLOBAL DEBUG 1 (_branch0.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() +DLGLOBAL DEBUG test(_branch0){destroying}: scene forgets _branch0 +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() done +DLGLOBAL DEBUG 0 (-) +DLGLOBAL DEBUG test(_branch0){destroying}: Freeing instance +DLGLOBAL DEBUG test(_branch0){destroying}: Deallocated +DLGLOBAL DEBUG --- after term cascade: +DLGLOBAL DEBUG --- all deallocated. +DLGLOBAL DEBUG scene_alloc() +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: is child of test(_branch0) +DLGLOBAL DEBUG test(other){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: _branch0.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[0] = _branch0 +DLGLOBAL DEBUG test(__twig0a){alive}: __twig0a.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[1] = __twig0a +DLGLOBAL DEBUG ------ before destroy-event cascade, got: +DLGLOBAL DEBUG _branch0 +DLGLOBAL DEBUG __twig0a +DLGLOBAL DEBUG other +DLGLOBAL DEBUG --- +DLGLOBAL DEBUG --- destroy-event at _branch0 +DLGLOBAL DEBUG test(_branch0){alive}: Received Event EV_DESTROY +DLGLOBAL DEBUG 1 (_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: alive(EV_DESTROY) +DLGLOBAL DEBUG test(_branch0){alive}: state_chg to destroying +DLGLOBAL DEBUG 2 (_branch0.alive(),_branch0.destroying_onenter()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(_branch0){destroying}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(_branch0){destroying}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DLGLOBAL DEBUG test(__twig0a){alive}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Removing from parent test(_branch0) +DLGLOBAL DEBUG 3 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() +DLGLOBAL DEBUG test(__twig0a){alive}: scene forgets __twig0a +DLGLOBAL DEBUG test(__twig0a){alive}: removing reference __twig0a.other[0] -> other +DLGLOBAL DEBUG test(other){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 4 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 5 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.other_gone()) +DLGLOBAL DEBUG test(other){alive}: EV_OTHER_GONE: Dropped reference other.other[1] = __twig0a +DLGLOBAL DEBUG 4 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: state_chg to destroying +DLGLOBAL DEBUG 5 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(other){destroying}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(other){destroying}: pre_term() +DLGLOBAL DEBUG 6 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() +DLGLOBAL DEBUG test(other){destroying}: scene forgets other +DLGLOBAL DEBUG test(other){destroying}: removing reference other.other[0] -> _branch0 +DLGLOBAL DEBUG test(_branch0){destroying}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 7 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_ +DLGLOBAL DEBUG test(_branch0){destroying}: destroying(EV_OTHER_GONE) +DLGLOBAL DEBUG 8 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_ +DLGLOBAL DEBUG test(_branch0){destroying}: EV_OTHER_GONE: Dropped reference _branch0.other[0] = other +DLGLOBAL DEBUG 7 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_ +DLGLOBAL DEBUG 6 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() done +DLGLOBAL DEBUG 5 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: Freeing instance +DLGLOBAL DEBUG test(other){destroying}: Deallocated +DLGLOBAL DEBUG 4 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG 3 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: Received Event EV_CHILD_GONE +DLGLOBAL DEBUG 4 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying(EV_CHILD_GONE) +DLGLOBAL DEBUG 5 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),_branch0.destroying(),_branch0.child_gone()) +DLGLOBAL DEBUG test(_branch0){destroying}: EV_CHILD_GONE: Dropped reference _branch0.child[0] = __twig0a +DLGLOBAL DEBUG test(_branch0){destroying}: No more children +DLGLOBAL DEBUG 4 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG 3 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() done +DLGLOBAL DEBUG 2 (_branch0.alive(),_branch0.destroying_onenter()) +DLGLOBAL DEBUG test(__twig0a){alive}: Freeing instance +DLGLOBAL DEBUG test(__twig0a){alive}: Deallocated +DLGLOBAL DEBUG 3 (_branch0.alive(),_branch0.destroying_onenter(),_branch0.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() +DLGLOBAL DEBUG test(_branch0){destroying}: scene forgets _branch0 +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() done +DLGLOBAL DEBUG 2 (_branch0.alive(),_branch0.destroying_onenter()) +DLGLOBAL DEBUG test(_branch0){destroying}: Freeing instance +DLGLOBAL DEBUG test(_branch0){destroying}: Deallocated +DLGLOBAL DEBUG 1 (_branch0.alive()) +DLGLOBAL DEBUG 0 (-) +DLGLOBAL DEBUG --- after destroy-event cascade: +DLGLOBAL DEBUG --- all deallocated. +DLGLOBAL DEBUG scene_alloc() +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: is child of test(_branch0) +DLGLOBAL DEBUG test(other){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: _branch0.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[0] = _branch0 +DLGLOBAL DEBUG test(__twig0a){alive}: __twig0a.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[1] = __twig0a +DLGLOBAL DEBUG ------ before term cascade, got: +DLGLOBAL DEBUG _branch0 +DLGLOBAL DEBUG __twig0a +DLGLOBAL DEBUG other +DLGLOBAL DEBUG --- +DLGLOBAL DEBUG --- term at __twig0a +DLGLOBAL DEBUG test(__twig0a){alive}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(__twig0a){alive}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Removing from parent test(_branch0) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() +DLGLOBAL DEBUG test(__twig0a){alive}: scene forgets __twig0a +DLGLOBAL DEBUG test(__twig0a){alive}: removing reference __twig0a.other[0] -> other +DLGLOBAL DEBUG test(other){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.other_gone()) +DLGLOBAL DEBUG test(other){alive}: EV_OTHER_GONE: Dropped reference other.other[1] = __twig0a +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: state_chg to destroying +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(other){destroying}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(other){destroying}: pre_term() +DLGLOBAL DEBUG 4 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() +DLGLOBAL DEBUG test(other){destroying}: scene forgets other +DLGLOBAL DEBUG test(other){destroying}: removing reference other.other[0] -> _branch0 +DLGLOBAL DEBUG test(_branch0){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.other_gone()) +DLGLOBAL DEBUG test(_branch0){alive}: EV_OTHER_GONE: Dropped reference _branch0.other[0] = other +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: state_chg to destroying +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.destroying_onenter()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying_onenter() from alive DLGLOBAL DEBUG test(_branch0){destroying}: Terminating (cause = OSMO_FSM_TERM_REGULAR) DLGLOBAL DEBUG test(_branch0){destroying}: pre_term() DLGLOBAL DEBUG 7 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.destroying_onenter(),_ @@ -57,49 +361,47 @@ DLGLOBAL DEBUG test(other){destroying}: Freeing instance DLGLOBAL DEBUG test(other){destroying}: Deallocated ================================================================= -==12545==ERROR: AddressSanitizer: heap-use-after-free on address 0x6120000003a8 at pc 0x7fa96fdc9149 bp 0x7fff6045b000 sp 0x7fff6045aff8 -WRITE of size 8 at 0x6120000003a8 thread T0 - #0 0x7fa96fdc9148 in __llist_del ../../../src/libosmocore/include/osmocom/core/linuxlist.h:114 - #1 0x7fa96fdc9280 in llist_del ../../../src/libosmocore/include/osmocom/core/linuxlist.h:126 - #2 0x7fa96fdcddaa in osmo_fsm_inst_free ../../../src/libosmocore/src/fsm.c:404 - #3 0x7fa96fdd599c in _osmo_fsm_inst_term ../../../src/libosmocore/src/fsm.c:738 - #4 0x55dde97cb9e3 in destroying_onenter ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:177 - #5 0x7fa96fdd26be in state_chg ../../../src/libosmocore/src/fsm.c:521 - #6 0x7fa96fdd2770 in _osmo_fsm_inst_state_chg ../../../src/libosmocore/src/fsm.c:577 - #7 0x55dde97cb2e6 in alive ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:151 - #8 0x7fa96fdd3d2f in _osmo_fsm_inst_dispatch ../../../src/libosmocore/src/fsm.c:685 - #9 0x55dde97cd0ee in cleanup ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:255 - #10 0x7fa96fdd5192 in _osmo_fsm_inst_term ../../../src/libosmocore/src/fsm.c:733 - #11 0x7fa96fdd60b1 in _osmo_fsm_inst_term_children ../../../src/libosmocore/src/fsm.c:784 - #12 0x7fa96fdd475e in _osmo_fsm_inst_term ../../../src/libosmocore/src/fsm.c:720 - #13 0x55dde97cf5d5 in scene_clean ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:392 - #14 0x55dde97cf92f in test_dealloc ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:417 - #15 0x55dde97cfffe in main ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:465 - #16 0x7fa96eff409a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a) - #17 0x55dde97c7329 in _start (/n/s/dev/make/libosmocore/tests/fsm/fsm_dealloc_test+0x11329) +==12033==ERROR: AddressSanitizer: heap-use-after-free on address 0x6120000015a8 at pc 0x7f873241e1f9 bp 0x7ffe32f6c8c0 sp 0x7ffe32f6c8b8 +WRITE of size 8 at 0x6120000015a8 thread T0 + #0 0x7f873241e1f8 in __llist_del ../../../src/libosmocore/include/osmocom/core/linuxlist.h:117 + #1 0x7f873241e330 in llist_del ../../../src/libosmocore/include/osmocom/core/linuxlist.h:129 + #2 0x7f8732422e5a in osmo_fsm_inst_free ../../../src/libosmocore/src/fsm.c:404 + #3 0x7f873242b2e4 in _osmo_fsm_inst_term ../../../src/libosmocore/src/fsm.c:744 + #4 0x55c9a9fb49e3 in destroying_onenter ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:177 + #5 0x7f873242776e in state_chg ../../../src/libosmocore/src/fsm.c:521 + #6 0x7f8732427820 in _osmo_fsm_inst_state_chg ../../../src/libosmocore/src/fsm.c:577 + #7 0x55c9a9fb42e6 in alive ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:151 + #8 0x7f8732428ddf in _osmo_fsm_inst_dispatch ../../../src/libosmocore/src/fsm.c:685 + #9 0x55c9a9fb60ee in cleanup ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:255 + #10 0x7f873242aada in _osmo_fsm_inst_term ../../../src/libosmocore/src/fsm.c:739 + #11 0x55c9a9fb87d6 in obj_term ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:405 + #12 0x55c9a9fb8d00 in test_dealloc ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:428 + #13 0x55c9a9fb8ffe in main ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:465 + #14 0x7f873164509a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a) + #15 0x55c9a9fb0329 in _start (/n/s/dev/make/libosmocore/tests/fsm/fsm_dealloc_test+0x11329) -0x6120000003a8 is located 104 bytes inside of 288-byte region [0x612000000340,0x612000000460) +0x6120000015a8 is located 104 bytes inside of 296-byte region [0x612000001540,0x612000001668) freed by thread T0 here: - #0 0x7fa970061b50 in free (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe8b50) - #1 0x7fa96fcbd5d2 (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0xb5d2) + #0 0x7f87326bcfd0 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe8fd0) + #1 0x7f873230f5d2 (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0xb5d2) previously allocated by thread T0 here: - #0 0x7fa970061ed0 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe8ed0) - #1 0x7fa96fcbb140 in _talloc_zero (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0x9140) + #0 0x7f87326bd350 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9350) + #1 0x7f873230d140 in _talloc_zero (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0x9140) -SUMMARY: AddressSanitizer: heap-use-after-free ../../../src/libosmocore/include/osmocom/core/linuxlist.h:114 in __llist_del +SUMMARY: AddressSanitizer: heap-use-after-free ../../../src/libosmocore/include/osmocom/core/linuxlist.h:117 in __llist_del Shadow bytes around the buggy address: - 0x0c247fff8020: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa - 0x0c247fff8030: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd - 0x0c247fff8040: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd - 0x0c247fff8050: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa - 0x0c247fff8060: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd -=>0x0c247fff8070: fd fd fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd - 0x0c247fff8080: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa - 0x0c247fff8090: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 - 0x0c247fff80a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x0c247fff80b0: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa - 0x0c247fff80c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x0c247fff8260: fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa + 0x0c247fff8270: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd + 0x0c247fff8280: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd + 0x0c247fff8290: fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa + 0x0c247fff82a0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd +=>0x0c247fff82b0: fd fd fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd + 0x0c247fff82c0: fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa + 0x0c247fff82d0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 + 0x0c247fff82e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x0c247fff82f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa + 0x0c247fff8300: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 @@ -119,4 +421,4 @@ ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb -==12545==ABORTING +==12033==ABORTING -- To view, visit https://gerrit.osmocom.org/13545 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0c02d76a86f90c49e0eae2f85db64704c96a7674 Gerrit-Change-Number: 13545 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 00:59:23 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 00:59:23 +0000 Subject: Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13392 to look at the new patch set (#6). Change subject: fsm: support graceful osmo_fsm_inst_term() cascades ...................................................................... fsm: support graceful osmo_fsm_inst_term() cascades Add global flag osmo_fsm_term_safely() -- if set to true, enable the following behavior: Detect osmo_fsm_inst_term() occuring within osmo_fsm_inst_term(): - collect deallocations until the outermost osmo_fsm_inst_term() is done. - call osmo_fsm_inst_free() *after* dispatching the parent event. If a struct osmo_fsm_inst enters osmo_fsm_inst_term() while another is already within osmo_fsm_inst_term(), do not directly deallocate it, but talloc-reparent it to a separate talloc context, to be deallocated with the outermost FSM inst. The effect is that all osmo_fsm_inst freed within an osmo_fsm_inst_term() cascade will stay allocated until all osmo_fsm_inst_term() are complete and all of them will be deallocated at the same time. Mark the deferred deallocation state as __thread in an attempt to make cascaded deallocation handling threadsafe. Keep the enable/disable flag separate, so that it is global and not per-thread. The feature is showcased by fsm_dealloc_test.c: with this feature, all of those wild deallocation scenarios succeed. Make fsm_dealloc_test a normal regression test in testsuite.at. Rationale: It is difficult to gracefully handle deallocations of groups of FSM instances that reference each other. As soon as one child dispatching a cleanup event causes its parent to deallocate before fsm.c was ready for it, deallocation will hit a use-after-free. Before this patch, by using parent_term events and distinct "terminating" FSM states, parent/child FSMs can be taught to wait for all children to deallocate before deallocating the parent. But as soon as a non-child / non-parent FSM instance is involved, or actually any other cleanup() action that triggers parent FSMs or parent talloc contexts to become unused, it is near impossible to think of all possible deallocation events ricocheting, and to avoid running into freeing FSM instances that were still in the middle of osmo_fsm_inst_term(), or FSM instances to enter osmo_fsm_inst_term() more than once. This patch makes deallocation of "all possible" setups of complex cross referencing FSM instances easy to handle correctly, without running into use-after-free or double free situations, and, notably, without changing calling code. Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 --- M include/osmocom/core/fsm.h M src/fsm.c M tests/Makefile.am M tests/fsm/fsm_dealloc_test.c M tests/fsm/fsm_dealloc_test.err M tests/testsuite.at 6 files changed, 3,503 insertions(+), 301 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/13392/6 -- To view, visit https://gerrit.osmocom.org/13392 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 Gerrit-Change-Number: 13392 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 00:59:23 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 00:59:23 +0000 Subject: Change in libosmocore[master]: fsm_dealloc_test: no need for ST_DESTROYING 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/13393 to look at the new patch set (#6). Change subject: fsm_dealloc_test: no need for ST_DESTROYING ...................................................................... fsm_dealloc_test: no need for ST_DESTROYING A separate ST_DESTROYING state originally helped with certain deallocation scenarios. But now that fsm.c avoids re-entering osmo_fsm_inst_term() twice and gracefully handles FSM instance deallocations for termination cascades, it is actually just as safe without a separate ST_DESTROYING state. ST_DESTROYING was used to flag deallocation and prevent entering osmo_fsm_inst_term() twice, which works only in a very limited range of scenarios. Remove ST_DESTROYING from fsm_dealloc_test.c to show that all tested scenarios still clean up gracefully. Change-Id: I05354e6cad9b82ba474fa50ffd41d481b3c697b4 --- M tests/fsm/fsm_dealloc_test.c M tests/fsm/fsm_dealloc_test.err 2 files changed, 1,522 insertions(+), 1,801 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/93/13393/6 -- To view, visit https://gerrit.osmocom.org/13393 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I05354e6cad9b82ba474fa50ffd41d481b3c697b4 Gerrit-Change-Number: 13393 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 02:58:28 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Mon, 8 Apr 2019 02:58:28 +0000 Subject: Change in osmo-sgsn[master]: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. 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/13544 to look at the new patch set (#3). Change subject: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. ...................................................................... gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. UE expects to receive Iu-ReleaseCommand after Attach Complete. If it doesn't receive it, then it sends Iu-ReleaseRequest after a timeout which makes the "PS Activation" process long. Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Related: OS#3908 --- M src/gprs/gprs_gmm.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/44/13544/3 -- To view, visit https://gerrit.osmocom.org/13544 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Gerrit-Change-Number: 13544 Gerrit-PatchSet: 3 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 03:02:01 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Mon, 8 Apr 2019 03:02:01 +0000 Subject: Change in osmo-sgsn[master]: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. In-Reply-To: References: Message-ID: Mykola Shchetinin has posted comments on this change. ( https://gerrit.osmocom.org/13544 ) Change subject: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. ...................................................................... Patch Set 3: > I'm not entirely sure if this is the correct solution or if this is merely a "quick hack" to make it work. I am not sure either. I know only that it solves the problem described in OS#3908. What would be the correct place to ask someone experienced in osmo-sgsn about the right way to add some messages to the "flow"? I guess I should have asked in the mailing list first... answered my own question... -- To view, visit https://gerrit.osmocom.org/13544 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Gerrit-Change-Number: 13544 Gerrit-PatchSet: 3 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Comment-Date: Mon, 08 Apr 2019 03:02:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 06:40:14 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 06:40:14 +0000 Subject: Change in osmo-sgsn[master]: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13544 ) Change subject: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. ...................................................................... Patch Set 3: Code-Review+1 > > I'm not entirely sure if this is the correct solution or if this > is merely a "quick hack" to make it work. > I am not sure either. I know only that it solves the problem > described in OS#3908. What would be the correct place to ask > someone experienced in osmo-sgsn about the right way to add some > messages to the "flow"? I guess I should have asked in the mailing > list first... answered my own question... You did everything right, I saw your mailing list posting. We now "just" have to see when somebody finds the time to investigate deeper and re-read the relevant parts of the specs. I don't think anyone would be able to respodn to it without that, myself included :) -- To view, visit https://gerrit.osmocom.org/13544 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Gerrit-Change-Number: 13544 Gerrit-PatchSet: 3 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Mon, 08 Apr 2019 06:40:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:03:52 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 07:03:52 +0000 Subject: Change in pysim[master]: sysmo-usim-sjs1: update EF.AD with correct MNC length In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/13366 ) Change subject: sysmo-usim-sjs1: update EF.AD with correct MNC length ...................................................................... sysmo-usim-sjs1: update EF.AD with correct MNC length At the moment EF.AD, which contains the length of the MNC is not updated. For two digit MNC (the usual case) this is fine since the length is set to 2 by default. However, when one wants to set an MNC with 3 digit length the file must be updated, otherwise the third digit of the MNC is recognized as part of the MSIN. Change-Id: I827092b2c7f7952f54b2d9f8dbda419a0dbfaf65 Related: OS#3850 --- M pySim-read.py M pySim/cards.py 2 files changed, 26 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/pySim-read.py b/pySim-read.py index 4356453..bcdbca6 100755 --- a/pySim-read.py +++ b/pySim-read.py @@ -176,5 +176,12 @@ except Exception as e: print "MSISDN: Can't read file -- " + str(e) + # EF.AD + (res, sw) = scc.read_binary(['3f00', '7f20', '6fad']) + if sw == '9000': + print("AD: %s" % (res,)) + else: + print("AD: Can't read, response code = %s" % (sw,)) + # Done for this card and maybe for everything ? print "Done !\n" diff --git a/pySim/cards.py b/pySim/cards.py index 1012cfd..fb84a8d 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -118,6 +118,20 @@ data, sw = self._scc.update_record(EF['SMSP'], 1, rpad(smsp, 84)) return sw + def update_ad(self, mnc): + #See also: 3GPP TS 31.102, chapter 4.2.18 + mnclen = len(str(mnc)) + if mnclen == 1: + mnclen = 2 + if mnclen > 3: + raise RuntimeError('unable to calculate proper mnclen') + + data = self._scc.read_binary(EF['AD'], length=None, offset=0) + size = len(data[0])/2 + content = data[0][0:6] + "%02X" % mnclen + data, sw = self._scc.update_binary(EF['AD'], content) + return sw + def read_spn(self): (spn, sw) = self._scc.read_binary(EF['SPN']) if sw == '9000': @@ -593,6 +607,11 @@ if sw != '9000': print("Programming OPLMNwAcT failed with code %s"%sw) + # EF.AD + if p.get('mcc') and p.get('mnc'): + sw = self.update_ad(p['mnc']) + if sw != '9000': + print("Programming AD failed with code %s"%sw) # EF.SMSP r = self._scc.select_file(['3f00', '7f10']) -- To view, visit https://gerrit.osmocom.org/13366 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I827092b2c7f7952f54b2d9f8dbda419a0dbfaf65 Gerrit-Change-Number: 13366 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:08:36 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 07:08:36 +0000 Subject: Change in pysim[master]: cosmetic: fix sourecode formatting In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/13476 ) Change subject: cosmetic: fix sourecode formatting ...................................................................... cosmetic: fix sourecode formatting Change-Id: I4836826811ffb0aeb103d32eb874f5fa52af4186 --- M pySim/cards.py 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve diff --git a/pySim/cards.py b/pySim/cards.py index fb84a8d..d912a7a 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -338,12 +338,12 @@ # Set first entry entry = ( - '81' + # 1b Status: Valid & Active + '81' + # 1b Status: Valid & Active rpad(b2h(p['name'][0:14]), 28) + # 14b Entry Name - enc_iccid(p['iccid']) + # 10b ICCID - enc_imsi(p['imsi']) + # 9b IMSI_len + id_type(9) + IMSI - p['ki'] + # 16b Ki - lpad(p['smsp'], 80) # 40b SMSP (padded with ff if needed) + enc_iccid(p['iccid']) + # 10b ICCID + enc_imsi(p['imsi']) + # 9b IMSI_len + id_type(9) + IMSI + p['ki'] + # 16b Ki + lpad(p['smsp'], 80) # 40b SMSP (padded with ff if needed) ) self._scc.update_record('000c', 1, entry) -- To view, visit https://gerrit.osmocom.org/13476 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4836826811ffb0aeb103d32eb874f5fa52af4186 Gerrit-Change-Number: 13476 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:08:49 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 07:08:49 +0000 Subject: Change in pysim[master]: wavemobile-sim: write mnc-length field ine EF.AD In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/13478 ) Change subject: wavemobile-sim: write mnc-length field ine EF.AD ...................................................................... wavemobile-sim: write mnc-length field ine EF.AD The length field in wavemobile sim cards is not set, so that the field stays at its initial value, which is 0xFF. Lets write the correct mnc length here. Change-Id: Ieda0ce864bf3e8c7b92f062eaa3a5482c98507e2 Related: OS#3850 --- M pySim/cards.py 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve diff --git a/pySim/cards.py b/pySim/cards.py index d912a7a..a341b71 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -896,6 +896,12 @@ if sw != '9000': print("Programming OPLMNwAcT failed with code %s"%sw) + # EF.AD + if p.get('mcc') and p.get('mnc'): + sw = self.update_ad(p['mnc']) + if sw != '9000': + print("Programming AD failed with code %s"%sw) + return None def erase(self): -- To view, visit https://gerrit.osmocom.org/13478 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ieda0ce864bf3e8c7b92f062eaa3a5482c98507e2 Gerrit-Change-Number: 13478 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:09:47 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:09:47 +0000 Subject: Change in libosmocore[master]: fsm: add flag to ensure osmo_fsm_inst_term() happens only once In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13545 ) Change subject: fsm: add flag to ensure osmo_fsm_inst_term() happens only once ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13545/1/include/osmocom/core/fsm.h File include/osmocom/core/fsm.h: https://gerrit.osmocom.org/#/c/13545/1/include/osmocom/core/fsm.h at 118 PS1, Line 118: bool terminating; one could use some "uint32_t flags" member and have a single-bit enum type flag in case we'd expect to introduce more flags in the future. I don't have any such plans, and I don't think you *must* change it. It's just a thought that occurred to me. -- To view, visit https://gerrit.osmocom.org/13545 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0c02d76a86f90c49e0eae2f85db64704c96a7674 Gerrit-Change-Number: 13545 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 08 Apr 2019 07:09:47 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:30:22 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:30:22 +0000 Subject: Change in libosmocore[master]: fsm_dealloc_test: no need for ST_DESTROYING In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13393 ) Change subject: fsm_dealloc_test: no need for ST_DESTROYING ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13393 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I05354e6cad9b82ba474fa50ffd41d481b3c697b4 Gerrit-Change-Number: 13393 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 08 Apr 2019 07:30:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:30:35 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:30:35 +0000 Subject: Change in osmo-bsc[master]: gsm_data.c: use REG_NOSUB flag of regcomp() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13539 ) Change subject: gsm_data.c: use REG_NOSUB flag of regcomp() ...................................................................... gsm_data.c: use REG_NOSUB flag of regcomp() We don't need to know position of matches: just yes or no. This change would save some computation power. Change-Id: Ia8414bf83d030adfae806c0aeaa757bc4c8cda2b --- M src/osmo-bsc/gsm_data.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index 509f805..45c433c 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -260,7 +260,7 @@ if (argc > 0) { *str = talloc_strdup(ctx, argv[0]); - ret = regcomp(reg, argv[0], 0); + ret = regcomp(reg, argv[0], REG_NOSUB); /* handle compilation failures */ if (ret != 0) { -- To view, visit https://gerrit.osmocom.org/13539 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia8414bf83d030adfae806c0aeaa757bc4c8cda2b Gerrit-Change-Number: 13539 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:30:42 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:30:42 +0000 Subject: Change in osmo-bsc[master]: osmo_bsc_lcls.c: cosmetic: make Coverity happy In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13533 ) Change subject: osmo_bsc_lcls.c: cosmetic: make Coverity happy ...................................................................... osmo_bsc_lcls.c: cosmetic: make Coverity happy The 'return' that makes Coverity angry can be safely replaced by 'break'. Change-Id: Ib3d7519421319fb0e6d65441bba123b7b01f4556 Fixes: CID#188873 Identical code for different branches Fixes: CID#188850 Identical code for different branches Fixes: CID#188845 Identical code for different branches --- M src/osmo-bsc/osmo_bsc_lcls.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_lcls.c b/src/osmo-bsc/osmo_bsc_lcls.c index c1f62dc..98c74c7 100644 --- a/src/osmo-bsc/osmo_bsc_lcls.c +++ b/src/osmo-bsc/osmo_bsc_lcls.c @@ -388,7 +388,7 @@ case LCLS_EV_UPDATE_CFG_CSC: if (lcls_handle_cfg_update(conn, data) != 0) return; - return; + break; case LCLS_EV_APPLY_CFG_CSC: if (conn->lcls.config == GSM0808_LCLS_CFG_NA) return; @@ -426,7 +426,7 @@ case LCLS_EV_UPDATE_CFG_CSC: if (lcls_handle_cfg_update(conn, data) != 0) return; - return; + break; case LCLS_EV_APPLY_CFG_CSC: if (lcls_enable_possible(conn)) { osmo_fsm_inst_state_chg(fi, ST_LOCALLY_SWITCHED, 0, 0); @@ -471,7 +471,7 @@ case LCLS_EV_UPDATE_CFG_CSC: if (lcls_handle_cfg_update(conn, data) != 0) return; - return; + break; case LCLS_EV_APPLY_CFG_CSC: if (lcls_perform_correlation(conn) != 0) { /* no correlation result: Remain in NOT_POSSIBLE_LS */ -- To view, visit https://gerrit.osmocom.org/13533 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib3d7519421319fb0e6d65441bba123b7b01f4556 Gerrit-Change-Number: 13533 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:30:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:30:45 +0000 Subject: Change in osmo-bsc[master]: ipaccess-config: use POSIX regex for Unit ID format check In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13535 ) Change subject: ipaccess-config: use POSIX regex for Unit ID format check ...................................................................... ipaccess-config: use POSIX regex for Unit ID format check Instead of counting digits and slashes of the IPA Unit ID manually, use POSIX regex functions, so the code is easier to maintain and read. As a bonus, this fixes CID#188854: variable 'remain_slash' was of type 'uint8_t', so it could never be lower than zero. Change-Id: Id613bf650833dd38eaad08fdfffdf8dbe2f002b1 Related: CID#188854 Unsigned integer overflow --- M src/ipaccess/ipaccess-config.c 1 file changed, 9 insertions(+), 21 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c index da19ce2..54e4efd 100644 --- a/src/ipaccess/ipaccess-config.c +++ b/src/ipaccess/ipaccess-config.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -842,33 +843,20 @@ static bool check_unitid_fmt(const char* unit_id) { - const char *p = unit_id; - bool must_digit = true; - uint8_t remain_slash = 2; + regex_t regexp; + int rc; if (strlen(unit_id) < 5) goto wrong_fmt; - while (*p != '\0') { - if (*p != '/' && !isdigit(*p)) - goto wrong_fmt; - if (*p == '/' && must_digit) - goto wrong_fmt; - if (*p == '/') { - must_digit = true; - remain_slash--; - if (remain_slash < 0) - goto wrong_fmt; - } else { - must_digit = false; - } - p++; - } + rc = regcomp(®exp, "^[0-9]+/[0-9]+/[0-9]+$", REG_EXTENDED | REG_NOSUB); + OSMO_ASSERT(!rc); - if (*(p-1) == '/') - goto wrong_fmt; + rc = regexec(®exp, unit_id, 0, NULL, 0); + regfree(®exp); - return true; + if (rc == 0) + return true; wrong_fmt: fprintf(stderr, "ERROR: unit-id wrong format. Must be '\\d+/\\d+/\\d+'\n"); -- To view, visit https://gerrit.osmocom.org/13535 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id613bf650833dd38eaad08fdfffdf8dbe2f002b1 Gerrit-Change-Number: 13535 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:31:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:31:21 +0000 Subject: Change in osmo-pcu[master]: Help output of osmo-pcu looks better now. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13542 ) Change subject: Help output of osmo-pcu looks better now. ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13542 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f Gerrit-Change-Number: 13542 Gerrit-PatchSet: 1 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Rafael Diniz Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 08 Apr 2019 07:31:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:31:38 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:31:38 +0000 Subject: Change in libosmocore[master]: Add _buf() functions to bypass static string buffers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13310 ) Change subject: Add _buf() functions to bypass static string buffers ...................................................................... Add _buf() functions to bypass static string buffers We have a number of static buffers in use in libosmo*. This means the related functions are not usable in a thread-safe way. While we so far don't have many multi-threaded programs in the osmocom universe, the static buffers also prevent us from calling the same e.g. string-ify function twice within a single printf() call. Let's make sure there's an alternative function in all those cases, where the user can pass in a caller-allocated buffer + size, and make the 'classic' function with the static buffer a wrapper around that _buf() variant. Change-Id: Ibf85f79e93244f53b2684ff6f1095c5b41203e05 --- M include/osmocom/core/msgb.h M include/osmocom/core/utils.h M include/osmocom/gprs/gprs_ns.h M include/osmocom/gsm/abis_nm.h M include/osmocom/gsm/apn.h M include/osmocom/gsm/gsm0808_utils.h M include/osmocom/gsm/gsm23003.h M include/osmocom/gsm/gsm48.h M include/osmocom/gsm/gsm_utils.h M include/osmocom/gsm/protocol/gsm_04_08.h M include/osmocom/gsm/rsl.h M include/osmocom/sim/sim.h M src/gb/gprs_ns.c M src/gb/libosmogb.map M src/gsm/abis_nm.c M src/gsm/apn.c M src/gsm/gsm0808_utils.c M src/gsm/gsm23003.c M src/gsm/gsm48.c M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map M src/gsm/rsl.c M src/msgb.c M src/sim/core.c M src/utils.c 25 files changed, 362 insertions(+), 118 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 5029225..0c51ce2 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -67,6 +67,7 @@ extern void msgb_reset(struct msgb *m); uint16_t msgb_length(const struct msgb *msg); extern const char *msgb_hexdump(const struct msgb *msg); +char *msgb_hexdump_buf(char *buf, size_t buf_len, const struct msgb *msg); extern int msgb_resize_area(struct msgb *msg, uint8_t *area, int old_size, int new_size); extern struct msgb *msgb_copy(const struct msgb *msg, const char *name); diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index e3728cd..6a2b7d5 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -53,6 +53,7 @@ int osmo_hexparse(const char *str, uint8_t *b, int max_len); +char *osmo_ubit_dump_buf(char *buf, size_t buf_len, const uint8_t *bits, unsigned int len); char *osmo_ubit_dump(const uint8_t *bits, unsigned int len); char *osmo_hexdump(const unsigned char *buf, int len); char *osmo_hexdump_nospc(const unsigned char *buf, int len); @@ -139,7 +140,7 @@ const char *osmo_escape_str(const char *str, int len); char *osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize); const char *osmo_quote_str(const char *str, int in_len); -const char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize); +char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize); uint32_t osmo_isqrt32(uint32_t x); diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index c62ef98..ed155ff 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -211,6 +211,8 @@ /* Resturn peer info as string (NOTE: the buffer is allocated statically) */ const char *gprs_ns_ll_str(const struct gprs_nsvc *nsvc); +/* Return peer info in user-supplied buffer */ +char *gprs_ns_ll_str_buf(char *buf, size_t buf_len, const struct gprs_nsvc *nsvc); /* Copy the link layer info from other into nsvc */ void gprs_ns_ll_copy(struct gprs_nsvc *nsvc, struct gprs_nsvc *other); diff --git a/include/osmocom/gsm/abis_nm.h b/include/osmocom/gsm/abis_nm.h index 823b5a4..788727c 100644 --- a/include/osmocom/gsm/abis_nm.h +++ b/include/osmocom/gsm/abis_nm.h @@ -42,6 +42,7 @@ extern const struct tlv_definition abis_nm_att_tlvdef_ipa; const char *abis_nm_dump_foh(const struct abis_om_fom_hdr *foh); +char *abis_nm_dump_foh_buf(char *buf, size_t buf_len, const struct abis_om_fom_hdr *foh); /*! write a human-readable OML header to the debug log * \param[in] ss Logging sub-system diff --git a/include/osmocom/gsm/apn.h b/include/osmocom/gsm/apn.h index 288b229..7899bb2 100644 --- a/include/osmocom/gsm/apn.h +++ b/include/osmocom/gsm/apn.h @@ -11,11 +11,14 @@ #define APN_MAXLEN 100 char *osmo_apn_qualify(unsigned int mcc, unsigned int mnc, const char *ni); +char *osmo_apn_qualify_buf(char *buf, size_t buf_len, unsigned int mcc, unsigned int mnc, const char *ni); /* Compose a string of the form '.mnc001.mcc002.gprs\0', returned in a * static buffer. */ char *osmo_apn_qualify_from_imsi(const char *imsi, const char *ni, int have_3dig_mnc); +char *osmo_apn_qualify_from_imsi_buf(char *buf, size_t buf_len, const char *imsi, + const char *ni, int have_3dig_mnc); int osmo_apn_from_str(uint8_t *apn_enc, size_t max_apn_enc_len, const char *str); char *osmo_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t apn_enc_len); diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index dedb029..e246967 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -69,7 +69,9 @@ }; char *osmo_lcls_dump(const struct osmo_lcls *lcls); +char *osmo_lcls_dump_buf(char *buf, size_t buf_len, const struct osmo_lcls *lcls); char *osmo_gcr_dump(const struct osmo_lcls *lcls); +char *osmo_gcr_dump_buf(char *buf, size_t buf_len, const struct osmo_lcls *lcls); extern const struct value_string gsm0808_cell_id_discr_names[]; static inline const char *gsm0808_cell_id_discr_name(enum CELL_IDENT id_discr) @@ -251,5 +253,6 @@ } const char *gsm0808_channel_type_name(const struct gsm0808_channel_type *ct); +char *gsm0808_channel_type_name_buf(char *buf, size_t buf_len, const struct gsm0808_channel_type *ct); /*! @} */ diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h index cf622ce..88c4f3c 100644 --- a/include/osmocom/gsm/gsm23003.h +++ b/include/osmocom/gsm/gsm23003.h @@ -105,13 +105,19 @@ bool osmo_imei_str_valid(const char *imei, bool with_15th_digit); const char *osmo_mcc_name(uint16_t mcc); +char *osmo_mcc_name_buf(char *buf, size_t buf_len, uint16_t mcc); const char *osmo_mnc_name(uint16_t mnc, bool mnc_3_digits); +char *osmo_mnc_name_buf(char *buf, size_t buf_len, uint16_t mnc, bool mnc_3_digits); const char *osmo_plmn_name(const struct osmo_plmn_id *plmn); const char *osmo_plmn_name2(const struct osmo_plmn_id *plmn); +char *osmo_plmn_name_buf(char *buf, size_t buf_len, const struct osmo_plmn_id *plmn); const char *osmo_lai_name(const struct osmo_location_area_id *lai); +char *osmo_lai_name_buf(char *buf, size_t buf_len, const struct osmo_location_area_id *lai); const char *osmo_cgi_name(const struct osmo_cell_global_id *cgi); const char *osmo_cgi_name2(const struct osmo_cell_global_id *cgi); +char *osmo_cgi_name_buf(char *buf, size_t buf_len, const struct osmo_cell_global_id *cgi); const char *osmo_gummei_name(const struct osmo_gummei *gummei); +char *osmo_gummei_name_buf(char *buf, size_t buf_len, const struct osmo_gummei *gummei); void osmo_plmn_to_bcd(uint8_t *bcd_dst, const struct osmo_plmn_id *plmn); void osmo_plmn_from_bcd(const uint8_t *bcd_src, struct osmo_plmn_id *plmn); diff --git a/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index 7e0e5c4..81b2bf0 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -35,6 +35,7 @@ const char *gsm48_rr_msg_name(uint8_t msgtype); const char *rr_cause_name(uint8_t cause); const char *osmo_rai_name(const struct gprs_ra_id *rai); +char *osmo_rai_name_buf(char *buf, size_t buf_len, const struct gprs_ra_id *rai); int gsm48_decode_lai(struct gsm48_loc_area_id *lai, uint16_t *mcc, uint16_t *mnc, uint16_t *lac) @@ -55,6 +56,7 @@ const uint8_t *mi, const int mi_len); const char *gsm48_mi_type_name(uint8_t mi); const char *osmo_mi_name(const uint8_t *mi, uint8_t mi_len); +char *osmo_mi_name_buf(char *buf, size_t buf_len, const uint8_t *mi, uint8_t mi_len); /* Parse Routeing Area Identifier */ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf); diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index f8f72a7..f48cc68 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -180,6 +180,7 @@ /* Returns static buffer with string representation of a GSM Time */ char *osmo_dump_gsmtime(const struct gsm_time *tm); +char *osmo_dump_gsmtime_buf(char *buf, size_t buf_len, const struct gsm_time *tm); /* GSM TS 03.03 Chapter 2.6 */ enum gprs_tlli_type { diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index c052e4c..c97df16 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -70,6 +70,7 @@ bool osmo_gsm48_classmark2_is_r99(const struct gsm48_classmark2 *cm2, uint8_t cm2_len); int osmo_gsm48_classmark_supports_a5(const struct osmo_gsm48_classmark *cm, uint8_t a5); const char *osmo_gsm48_classmark_a5_name(const struct osmo_gsm48_classmark *cm); +char *osmo_gsm48_classmark_a5_name_buf(char *buf, size_t buf_len, const struct osmo_gsm48_classmark *cm); void osmo_gsm48_classmark_update(struct osmo_gsm48_classmark *dst, const struct osmo_gsm48_classmark *src); /* Chapter 10.5.2.1b.3 */ @@ -1643,6 +1644,7 @@ extern const struct value_string gsm48_mm_msgtype_names[]; extern const struct value_string gsm48_cc_msgtype_names[]; const char *gsm48_pdisc_msgtype_name(uint8_t pdisc, uint8_t msg_type); +char *gsm48_pdisc_msgtype_name_buf(char *buf, size_t buf_len, uint8_t pdisc, uint8_t msg_type); /* FIXME: Table 10.4 / 10.4a (GPRS) */ diff --git a/include/osmocom/gsm/rsl.h b/include/osmocom/gsm/rsl.h index be0fa79..4a1da3a 100644 --- a/include/osmocom/gsm/rsl.h +++ b/include/osmocom/gsm/rsl.h @@ -30,6 +30,7 @@ /* decode channel number as per Section 9.3.1 */ int rsl_dec_chan_nr(uint8_t chan_nr, uint8_t *type, uint8_t *subch, uint8_t *timeslot); /* Turns channel number into a string */ +char *rsl_chan_nr_str_buf(char *buf, size_t buf_len, uint8_t chan_nr); const char *rsl_chan_nr_str(uint8_t chan_nr); diff --git a/include/osmocom/sim/sim.h b/include/osmocom/sim/sim.h index 680cad1..0490dcd 100644 --- a/include/osmocom/sim/sim.h +++ b/include/osmocom/sim/sim.h @@ -296,6 +296,7 @@ uint16_t sw_in); struct osim_card_hdl; +char *osim_print_sw_buf(char *buf, size_t buf_len, const struct osim_card_hdl *ch, uint16_t sw_in); char *osim_print_sw(const struct osim_card_hdl *ch, uint16_t sw_in); extern const struct tlv_definition ts102221_fcp_tlv_def; diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index c7ff78e..fc120ce 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1525,17 +1525,15 @@ return rc; } -const char *gprs_ns_ll_str(const struct gprs_nsvc *nsvc) +char *gprs_ns_ll_str_buf(char *buf, size_t buf_len, const struct gprs_nsvc *nsvc) { - static char buf[80]; - switch(nsvc->ll) { case GPRS_NS_LL_UDP: - snprintf(buf, sizeof(buf), "%s:%u", + snprintf(buf, buf_len, "%s:%u", inet_ntoa(nsvc->ip.bts_addr.sin_addr), osmo_ntohs(nsvc->ip.bts_addr.sin_port)); break; case GPRS_NS_LL_FR_GRE: - snprintf(buf, sizeof(buf), "%s:%u", + snprintf(buf, buf_len, "%s:%u", inet_ntoa(nsvc->frgre.bts_addr.sin_addr), osmo_ntohs(nsvc->frgre.bts_addr.sin_port)); break; default: @@ -1543,11 +1541,17 @@ break; } - buf[sizeof(buf) - 1] = '\0'; + buf[buf_len - 1] = '\0'; return buf; } +const char *gprs_ns_ll_str(const struct gprs_nsvc *nsvc) +{ + static char buf[80]; + return gprs_ns_ll_str_buf(buf, sizeof(buf), nsvc); +} + void gprs_ns_ll_copy(struct gprs_nsvc *nsvc, struct gprs_nsvc *other) { nsvc->ll = other->ll; diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map index 2ad3ff7..21929da 100644 --- a/src/gb/libosmogb.map +++ b/src/gb/libosmogb.map @@ -64,6 +64,7 @@ gprs_ns_tx_unblock; gprs_ns_vty_init; gprs_ns_ll_str; +gprs_ns_ll_str_buf; gprs_ns_ll_copy; gprs_ns_ll_clear; gprs_ns_msgb_alloc; diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c index 49d05ba..e25fdd0 100644 --- a/src/gsm/abis_nm.c +++ b/src/gsm/abis_nm.c @@ -928,14 +928,19 @@ return GSM_PCHAN_NONE; } -const char *abis_nm_dump_foh(const struct abis_om_fom_hdr *foh) +char *abis_nm_dump_foh_buf(char *buf, size_t buf_len, const struct abis_om_fom_hdr *foh) { - static char foh_buf[128]; - snprintf(foh_buf, sizeof(foh_buf), "OC=%s(%02x) INST=(%02x,%02x,%02x)", + snprintf(buf, buf_len, "OC=%s(%02x) INST=(%02x,%02x,%02x)", get_value_string(abis_nm_obj_class_names, foh->obj_class), foh->obj_class, foh->obj_inst.bts_nr, foh->obj_inst.trx_nr, foh->obj_inst.ts_nr); - return foh_buf; + return buf; +} + +const char *abis_nm_dump_foh(const struct abis_om_fom_hdr *foh) +{ + static char foh_buf[128]; + return abis_nm_dump_foh_buf(foh_buf, sizeof(foh_buf), foh); } /* this is just for compatibility reasons, it is now a macro */ diff --git a/src/gsm/apn.c b/src/gsm/apn.c index 2674663..4ab370c 100644 --- a/src/gsm/apn.c +++ b/src/gsm/apn.c @@ -32,17 +32,22 @@ static char apn_strbuf[APN_MAXLEN+1]; -char *osmo_apn_qualify(unsigned int mcc, unsigned int mnc, const char *ni) +char *osmo_apn_qualify_buf(char *buf, size_t buf_len, unsigned int mcc, unsigned int mnc, const char *ni) { - snprintf(apn_strbuf, sizeof(apn_strbuf)-1, APN_GPRS_FMT, - ni, mnc, mcc); - apn_strbuf[sizeof(apn_strbuf)-1] = '\0'; + snprintf(buf, buf_len-1, APN_GPRS_FMT, ni, mnc, mcc); + buf[buf_len-1] = '\0'; - return apn_strbuf; + return buf; } -char *osmo_apn_qualify_from_imsi(const char *imsi, - const char *ni, int have_3dig_mnc) +char *osmo_apn_qualify(unsigned int mcc, unsigned int mnc, const char *ni) +{ + return osmo_apn_qualify_buf(apn_strbuf, sizeof(apn_strbuf), mcc, mnc, ni); +} + + +char *osmo_apn_qualify_from_imsi_buf(char *buf, size_t buf_len, const char *imsi, + const char *ni, int have_3dig_mnc) { char cbuf[3+1], nbuf[3+1]; @@ -56,7 +61,13 @@ strncpy(nbuf, imsi+3, 2); nbuf[2] = '\0'; } - return osmo_apn_qualify(atoi(cbuf), atoi(nbuf), ni); + return osmo_apn_qualify_buf(buf, buf_len, atoi(cbuf), atoi(nbuf), ni); +} + +char *osmo_apn_qualify_from_imsi(const char *imsi, + const char *ni, int have_3dig_mnc) +{ + return osmo_apn_qualify_from_imsi_buf(apn_strbuf, sizeof(apn_strbuf), imsi, ni, have_3dig_mnc); } /** diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index e0cdaaf..52e4674 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -595,11 +595,13 @@ static char dbuf[256]; /*! Dump LCLS parameters (GCR excluded) into string for printing. + * \param[out] buf caller-allocated output string buffer + * \param[in] buf_len size of buf in bytes * \param[in] lcls pointer to the struct to print. * \returns string representation of LCLS or NULL on error. */ -char *osmo_lcls_dump(const struct osmo_lcls *lcls) +char *osmo_lcls_dump_buf(char *buf, size_t buf_len, const struct osmo_lcls *lcls) { - struct osmo_strbuf s = { .buf = dbuf, .len = 256 }; + struct osmo_strbuf s = { .buf = buf, .len = buf_len }; if (!lcls) return NULL; @@ -612,12 +614,22 @@ return dbuf; } +/*! Dump LCLS parameters (GCR excluded) into static string buffer for printing. + * \param[in] lcls pointer to the struct to print. + * \returns string representation of LCLS in static buffer or NULL on error. */ +char *osmo_lcls_dump(const struct osmo_lcls *lcls) +{ + return osmo_lcls_dump_buf(dbuf, sizeof(dbuf), lcls); +} + /*! Dump GCR struct into string for printing. + * \param[out] buf caller-allocated output string buffer + * \param[in] buf_len size of buf in bytes * \param[in] lcls pointer to the struct to print. * \returns string representation of GCR or NULL on error. */ -char *osmo_gcr_dump(const struct osmo_lcls *lcls) +char *osmo_gcr_dump_buf(char *buf, size_t buf_len, const struct osmo_lcls *lcls) { - struct osmo_strbuf s = { .buf = dbuf, .len = 256 }; + struct osmo_strbuf s = { .buf = buf, .len = buf_len }; if (!lcls) return NULL; @@ -631,6 +643,15 @@ return dbuf; } +/*! Dump GCR struct into static string buffer for printing. + * \param[in] lcls pointer to the struct to print. + * \returns string representation of GCR in static buffer or NULL on error. */ +char *osmo_gcr_dump(const struct osmo_lcls *lcls) +{ + return osmo_gcr_dump_buf(dbuf, sizeof(dbuf), lcls); +} + + /*! Encode TS 08.08 Encryption Information IE * \param[out] msg Message Buffer to which IE is to be appended * \param[in] ei Encryption Information to be encoded @@ -1838,13 +1859,18 @@ #undef APPEND_STR #undef APPEND_CELL_ID_U -const char *gsm0808_channel_type_name(const struct gsm0808_channel_type *ct) +char *gsm0808_channel_type_name_buf(char *buf, size_t buf_len, const struct gsm0808_channel_type *ct) { - static char buf[128]; - snprintf(buf, sizeof(buf), "ch_indctr=0x%x ch_rate_type=0x%x perm_spch=%s", + snprintf(buf, buf_len, "ch_indctr=0x%x ch_rate_type=0x%x perm_spch=%s", ct->ch_indctr, ct->ch_rate_type, osmo_hexdump(ct->perm_spch, ct->perm_spch_len)); return buf; } +const char *gsm0808_channel_type_name(const struct gsm0808_channel_type *ct) +{ + static char buf[128]; + return gsm0808_channel_type_name_buf(buf, sizeof(buf), ct); +} + /*! @} */ diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c index 720c09b..bbfe236 100644 --- a/src/gsm/gsm23003.c +++ b/src/gsm/gsm23003.c @@ -90,13 +90,37 @@ } /*! Return MCC string as standardized 3-digit with leading zeros. + * \param[out] buf caller-allocated output buffer + * \param[in] buf_len size of buf in bytes + * \param[in] mcc MCC value. + * \returns string in user-supplied output buffer + */ +char *osmo_mcc_name_buf(char *buf, size_t buf_len, uint16_t mcc) +{ + snprintf(buf, buf_len, "%03u", mcc); + return buf; +} + +/*! Return MCC string as standardized 3-digit with leading zeros. * \param[in] mcc MCC value. * \returns string in static buffer. */ const char *osmo_mcc_name(uint16_t mcc) { static char buf[8]; - snprintf(buf, sizeof(buf), "%03u", mcc); + return osmo_mcc_name_buf(buf, sizeof(buf), mcc); +} + +/*! Return MNC string as standardized 2- or 3-digit with leading zeros. + * \param[out] buf caller-allocated output buffer + * \param[in] buf_len size of buf in bytes + * \param[in] mnc MNC value. + * \param[in] mnc_3_digits True if an MNC should fill three digits, only has an effect if MNC < 100. + * \returns string in static buffer. + */ +char *osmo_mnc_name_buf(char *buf, size_t buf_len, uint16_t mnc, bool mnc_3_digits) +{ + snprintf(buf, buf_len, "%0*u", mnc_3_digits ? 3 : 2, mnc); return buf; } @@ -108,14 +132,21 @@ const char *osmo_mnc_name(uint16_t mnc, bool mnc_3_digits) { static char buf[8]; - snprintf(buf, sizeof(buf), "%0*u", mnc_3_digits ? 3 : 2, mnc); - return buf; + return osmo_mnc_name_buf(buf, sizeof(buf), mnc, mnc_3_digits); } -static inline void plmn_name(char *buf, size_t buflen, const struct osmo_plmn_id *plmn) +/*! Return MCC-MNC string as standardized 3-digit-dash-2/3-digit with leading zeros. + * \param[out] buf caller-allocated output buffer + * \param[in] buf_len size of buf in bytes + * \param[in] plmn MCC-MNC value. + * \returns string in static buffer. + */ +char *osmo_plmn_name_buf(char *buf, size_t buf_len, const struct osmo_plmn_id *plmn) { - snprintf(buf, buflen, "%s-%s", osmo_mcc_name(plmn->mcc), - osmo_mnc_name(plmn->mnc, plmn->mnc_3_digits)); + char mcc[8], mnc[8]; + snprintf(buf, buf_len, "%s-%s", osmo_mcc_name_buf(mcc, sizeof(mcc), plmn->mcc), + osmo_mnc_name_buf(mnc, sizeof(mnc), plmn->mnc, plmn->mnc_3_digits)); + return buf; } /*! Return MCC-MNC string as standardized 3-digit-dash-2/3-digit with leading zeros. @@ -125,10 +156,10 @@ const char *osmo_plmn_name(const struct osmo_plmn_id *plmn) { static char buf[16]; - plmn_name(buf, sizeof(buf), plmn); - return buf; + return osmo_plmn_name_buf(buf, sizeof(buf), plmn); } + /*! Same as osmo_plmn_name(), but returning in a different static buffer. * \param[in] plmn MCC-MNC value. * \returns string in static buffer. @@ -136,7 +167,19 @@ const char *osmo_plmn_name2(const struct osmo_plmn_id *plmn) { static char buf[16]; - plmn_name(buf, sizeof(buf), plmn); + return osmo_plmn_name_buf(buf, sizeof(buf), plmn); +} + +/*! Return MCC-MNC-LAC as string, in caller-provided output buffer. + * \param[out] buf caller-allocated output buffer + * \param[in] buf_len size of buf in bytes + * \param[in] lai LAI to encode, the rac member is ignored. + * \returns buf + */ +char *osmo_lai_name_buf(char *buf, size_t buf_len, const struct osmo_location_area_id *lai) +{ + char plmn[16]; + snprintf(buf, buf_len, "%s-%u", osmo_plmn_name_buf(plmn, sizeof(plmn), &lai->plmn), lai->lac); return buf; } @@ -147,13 +190,18 @@ const char *osmo_lai_name(const struct osmo_location_area_id *lai) { static char buf[32]; - snprintf(buf, sizeof(buf), "%s-%u", osmo_plmn_name(&lai->plmn), lai->lac); - return buf; + return osmo_lai_name_buf(buf, sizeof(buf), lai); } -static const char *_cgi_name(const struct osmo_cell_global_id *cgi, char *buf, size_t buflen) +/*! Return MCC-MNC-LAC-CI as string, in caller-provided output buffer. + * \param[out] buf caller-allocated output buffer + * \param[in] buf_len size of buf in bytes + * \param[in] cgi CGI to encode. + * \returns buf + */ +char *osmo_cgi_name_buf(char *buf, size_t buf_len, const struct osmo_cell_global_id *cgi) { - snprintf(buf, buflen, "%s-%u", osmo_lai_name(&cgi->lai), cgi->cell_identity); + snprintf(buf, buf_len, "%s-%u", osmo_lai_name(&cgi->lai), cgi->cell_identity); return buf; } @@ -164,7 +212,7 @@ const char *osmo_cgi_name(const struct osmo_cell_global_id *cgi) { static char buf[32]; - return _cgi_name(cgi, buf, sizeof(buf)); + return osmo_cgi_name_buf(buf, sizeof(buf), cgi); } /*! Same as osmo_cgi_name(), but uses a different static buffer. @@ -175,7 +223,7 @@ const char *osmo_cgi_name2(const struct osmo_cell_global_id *cgi) { static char buf[32]; - return _cgi_name(cgi, buf, sizeof(buf)); + return osmo_cgi_name_buf(buf, sizeof(buf), cgi); } static void to_bcd(uint8_t *bcd, uint16_t val) @@ -187,14 +235,31 @@ bcd[0] = val % 10; } -const char *osmo_gummei_name(const struct osmo_gummei *gummei) +/*! Return string representation of GUMMEI in caller-provided output buffer. + * \param[out] buf pointer to caller-provided output buffer + * \param[in] buf_len size of buf in bytes + * \param[in] gummei GUMMEI to be stringified + * \returns buf + */ +char *osmo_gummei_name_buf(char *buf, size_t buf_len, const struct osmo_gummei *gummei) { - static char buf[32]; - snprintf(buf, sizeof(buf), "%s-%04x-%02x", osmo_plmn_name(&gummei->plmn), + char plmn[16]; + snprintf(buf, buf_len, "%s-%04x-%02x", osmo_plmn_name_buf(plmn, sizeof(plmn), &gummei->plmn), gummei->mme.group_id, gummei->mme.code); return buf; } +/*! Return string representation of GUMMEI in static output buffer. + * \param[in] gummei GUMMEI to be stringified + * \returns pointer to static output buffer + */ +const char *osmo_gummei_name(const struct osmo_gummei *gummei) +{ + static char buf[32]; + return osmo_gummei_name_buf(buf, sizeof(buf), gummei); +} + + /* Convert MCC + MNC to BCD representation * \param[out] bcd_dst caller-allocated memory for output * \param[in] mcc Mobile Country Code diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index 5dc30ad..a45d67b 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -182,6 +182,20 @@ return get_value_string(rr_cause_names, cause); } +/*! Return MCC-MNC-LAC-RAC as string, in a caller-provided output buffer. + * \param[out] buf caller-provided output buffer + * \param[in] buf_len size of buf in bytes + * \param[in] rai RAI to encode. + * \returns buf + */ +char *osmo_rai_name_buf(char *buf, size_t buf_len, const struct gprs_ra_id *rai) +{ + snprintf(buf, buf_len, "%s-%s-%u-%u", + osmo_mcc_name(rai->mcc), osmo_mnc_name(rai->mnc, rai->mnc_3_digits), rai->lac, + rai->rac); + return buf; +} + /*! Return MCC-MNC-LAC-RAC as string, in a static buffer. * \param[in] rai RAI to encode. * \returns Static string buffer. @@ -189,10 +203,7 @@ const char *osmo_rai_name(const struct gprs_ra_id *rai) { static char buf[32]; - snprintf(buf, sizeof(buf), "%s-%s-%u-%u", - osmo_mcc_name(rai->mcc), osmo_mnc_name(rai->mnc, rai->mnc_3_digits), rai->lac, - rai->rac); - return buf; + return osmo_rai_name_buf(buf, sizeof(buf), rai); } /* FIXME: convert to value_string */ @@ -433,14 +444,15 @@ return get_value_string(mi_type_names, mi); } -/*! Return a human readable representation of a Mobile Identity in static buffer. +/*! Return a human readable representation of a Mobile Identity in caller-provided buffer. + * \param[out] buf caller-provided output buffer + * \param[in] buf_len size of buf in bytes * \param[in] mi Mobile Identity buffer containing 3GPP TS 04.08 style MI type and data. * \param[in] mi_len Length of mi. - * \return A string like "IMSI-1234567", "TMSI-0x1234ABCD" or "unknown", "TMSI-invalid"... + * \return buf */ -const char *osmo_mi_name(const uint8_t *mi, uint8_t mi_len) +char *osmo_mi_name_buf(char *buf, size_t buf_len, const uint8_t *mi, uint8_t mi_len) { - static char mi_name[10 + GSM48_MI_SIZE + 1]; uint8_t mi_type; uint32_t tmsi; char mi_string[GSM48_MI_SIZE]; @@ -452,8 +464,8 @@ /* Table 10.5.4.3, reverse generate_mid_from_tmsi */ if (mi_len == GSM48_TMSI_LEN && mi[0] == (0xf0 | GSM_MI_TYPE_TMSI)) { tmsi = osmo_load32be(&mi[1]); - snprintf(mi_name, sizeof(mi_name), "TMSI-0x%08" PRIX32, tmsi); - return mi_name; + snprintf(buf, buf_len, "TMSI-0x%08" PRIX32, tmsi); + return buf; } return "TMSI-invalid"; @@ -461,14 +473,25 @@ case GSM_MI_TYPE_IMEI: case GSM_MI_TYPE_IMEISV: osmo_bcd2str(mi_string, sizeof(mi_string), mi, 1, (mi_len * 2) - (mi[0] & GSM_MI_ODD ? 0 : 1), true); - snprintf(mi_name, sizeof(mi_name), "%s-%s", gsm48_mi_type_name(mi_type), mi_string); - return mi_name; + snprintf(buf, buf_len, "%s-%s", gsm48_mi_type_name(mi_type), mi_string); + return buf; default: return "unknown"; } } +/*! Return a human readable representation of a Mobile Identity in static buffer. + * \param[in] mi Mobile Identity buffer containing 3GPP TS 04.08 style MI type and data. + * \param[in] mi_len Length of mi. + * \return A string like "IMSI-1234567", "TMSI-0x1234ABCD" or "unknown", "TMSI-invalid"... + */ +const char *osmo_mi_name(const uint8_t *mi, uint8_t mi_len) +{ + static char mi_name[10 + GSM48_MI_SIZE + 1]; + return osmo_mi_name_buf(mi_name, sizeof(mi_name), mi, mi_len); +} + /*! Checks is particular message is cipherable in A/Gb mode according to * 3GPP TS 24.008 ? 4.7.1.2 * \param[in] hdr Message header @@ -1050,16 +1073,17 @@ { 0, NULL } }; -/*! Compose a string naming the message type for given protocol. +/*! Compose a string naming the message type for given protocol, in a caller-provided buffer. * If the message type string is known, return the message type name, otherwise * return ":". + * \param[out] buf caller-allcated output string buffer + * \param[in] buf_len size of buf in bytes * \param[in] pdisc protocol discriminator like GSM48_PDISC_MM * \param[in] msg_type message type like GSM48_MT_MM_LOC_UPD_REQUEST - * \returns statically allocated string or string constant. + * \returns buf */ -const char *gsm48_pdisc_msgtype_name(uint8_t pdisc, uint8_t msg_type) +char *gsm48_pdisc_msgtype_name_buf(char *buf, size_t buf_len, uint8_t pdisc, uint8_t msg_type) { - static char namebuf[64]; const struct value_string *msgt_names; switch (pdisc) { @@ -1081,11 +1105,23 @@ } if (msgt_names) - return get_value_string(msgt_names, msg_type); + snprintf(buf, buf_len, "%s", get_value_string(msgt_names, msg_type)); + else + snprintf(buf, buf_len, "%s:0x%02x", gsm48_pdisc_name(pdisc), msg_type); + return buf; +} - snprintf(namebuf, sizeof(namebuf), "%s:0x%02x", - gsm48_pdisc_name(pdisc), msg_type); - return namebuf; +/*! Compose a string naming the message type for given protocol, in a static buffer. + * If the message type string is known, return the message type name, otherwise + * return ":". + * \param[in] pdisc protocol discriminator like GSM48_PDISC_MM + * \param[in] msg_type message type like GSM48_MT_MM_LOC_UPD_REQUEST + * \returns statically allocated string or string constant. + */ +const char *gsm48_pdisc_msgtype_name(uint8_t pdisc, uint8_t msg_type) +{ + static char namebuf[64]; + return gsm48_pdisc_msgtype_name_buf(namebuf, sizeof(namebuf), pdisc, msg_type); } const struct value_string gsm48_reject_value_names[] = { @@ -1187,9 +1223,8 @@ * \param[in] cm Classmarks. * \returns A statically allocated string like "cm1{a5/1=supported} cm2{0x23= A5/2 A5/3} no-cm3" */ -const char *osmo_gsm48_classmark_a5_name(const struct osmo_gsm48_classmark *cm) +char *osmo_gsm48_classmark_a5_name_buf(char *buf, size_t buf_len, const struct osmo_gsm48_classmark *cm) { - static char buf[128]; char cm1[42] = "no-cm1"; char cm2[42] = " no-cm2"; char cm3[42] = " no-cm3"; @@ -1212,10 +1247,21 @@ cm->classmark3[0] & (1 << 2) ? " A5/6" : "", cm->classmark3[0] & (1 << 3) ? " A5/7" : ""); - snprintf(buf, sizeof(buf), "%s%s%s", cm1, cm2, cm3); + snprintf(buf, buf_len, "%s%s%s", cm1, cm2, cm3); return buf; } +/*! Return a string representation of A5 cipher algorithms indicated by Classmark 1, 2 and 3. + * \param[in] cm Classmarks. + * \returns A statically allocated string like "cm1{a5/1=supported} cm2{0x23= A5/2 A5/3} no-cm3" + */ +const char *osmo_gsm48_classmark_a5_name(const struct osmo_gsm48_classmark *cm) +{ + static char buf[128]; + return osmo_gsm48_classmark_a5_name_buf(buf, sizeof(buf), cm); +} + + /*! Overwrite dst with the Classmark information present in src. * Add an new Classmark and overwrite in dst what src has to offer, but where src has no Classmark information, leave * dst unchanged. (For Classmark 2 and 3, dst will exactly match any non-zero Classmark length from src, hence may end diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index c9c15d5..f34d9ea 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -886,16 +886,21 @@ return (51 * ((time->t3 - time->t2 + 26) % 26) + time->t3 + (26 * 51 * time->t1)); } -char *osmo_dump_gsmtime(const struct gsm_time *tm) +char *osmo_dump_gsmtime_buf(char *buf, size_t buf_len, const struct gsm_time *tm) { - static char buf[64]; - - snprintf(buf, sizeof(buf), "%06"PRIu32"/%02"PRIu16"/%02"PRIu8"/%02"PRIu8"/%02"PRIu8, + snprintf(buf, buf_len, "%06"PRIu32"/%02"PRIu16"/%02"PRIu8"/%02"PRIu8"/%02"PRIu8, tm->fn, tm->t1, tm->t2, tm->t3, (uint8_t)tm->fn%52); buf[sizeof(buf)-1] = '\0'; return buf; } +char *osmo_dump_gsmtime(const struct gsm_time *tm) +{ + static char buf[64]; + return osmo_dump_gsmtime_buf(buf, sizeof(buf), tm); +} + + /*! append range1024 encoded data to bit vector * \param[out] bv Caller-provided output bit-vector * \param[in] r Input Range1024 sructure */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 3fadc5a..a69fb60 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -9,6 +9,7 @@ abis_nm_chcomb4pchan; abis_nm_debugp_foh; abis_nm_dump_foh; +abis_nm_dump_foh_buf; abis_nm_event_type_name; abis_nm_nack_cause_name; abis_nm_nack_name; @@ -225,6 +226,7 @@ gsm0808_permitted_speech_names; gsm0808_chosen_enc_alg_names; gsm0808_channel_type_name; +gsm0808_channel_type_name_buf; gsm0808_lcls_config_names; gsm0808_lcls_control_names; gsm0808_lcls_status_names; @@ -250,7 +252,9 @@ osmo_dec_gcr; osmo_gcr_eq; osmo_gcr_dump; +osmo_gcr_dump_buf; osmo_lcls_dump; +osmo_lcls_dump_buf; gsm0858_rsl_ul_meas_enc; @@ -345,6 +349,7 @@ gsm48_dtx_mode; gsm48_mi_type_name; osmo_mi_name; +osmo_mi_name_buf; gsm48_mcc_mnc_to_bcd; gsm48_mcc_mnc_from_bcd; gsm48_generate_lai2; @@ -354,14 +359,21 @@ osmo_plmn_to_bcd; osmo_plmn_from_bcd; osmo_mcc_name; +osmo_mcc_name_buf; osmo_mnc_name; +osmo_mnc_name_buf; osmo_plmn_name; +osmo_plmn_name_buf; osmo_plmn_name2; osmo_lai_name; +osmo_lai_name_buf; osmo_rai_name; +osmo_rai_name_buf; osmo_cgi_name; +osmo_cgi_name_buf; osmo_cgi_name2; osmo_gummei_name; +osmo_gummei_name_buf; osmo_mnc_from_str; osmo_mnc_cmp; osmo_plmn_cmp; @@ -378,6 +390,7 @@ gsm48_cc_msgtype_names; gsm48_cc_cause_names; gsm48_pdisc_msgtype_name; +gsm48_pdisc_msgtype_name_buf; gsm48_reject_value_names; gsm_7bit_decode; @@ -403,6 +416,7 @@ gsm_get_octet_len; gsm_gsmtime2fn; osmo_dump_gsmtime; +osmo_dump_gsmtime_buf; gsm_milenage; gsm_septet_encode; @@ -472,6 +486,7 @@ rsl_ccch_conf_to_bs_cc_chans; rsl_ccch_conf_to_bs_ccch_sdcch_comb; rsl_chan_nr_str; +rsl_chan_nr_str_buf; rsl_dec_chan_nr; rsl_enc_chan_nr; rsl_err_name; @@ -533,7 +548,9 @@ ipa_send; osmo_apn_qualify; +osmo_apn_qualify_buf; osmo_apn_qualify_from_imsi; +osmo_apn_qualify_from_imsi_buf; osmo_apn_to_str; osmo_apn_from_str; @@ -592,6 +609,7 @@ osmo_gsm48_classmark2_is_r99; osmo_gsm48_classmark_supports_a5; osmo_gsm48_classmark_a5_name; +osmo_gsm48_classmark_a5_name_buf; osmo_gsm48_classmark_update; local: *; diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index e610ebf..7bc6002 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -215,33 +215,47 @@ return 0; } -/*! Get human-readable string for RSL channel number */ -const char *rsl_chan_nr_str(uint8_t chan_nr) +/*! Get human-readable string for RSL channel number, in caller-provided buffer. + * \param[out] buf caller-provided output buffer + * \param[in] buf_len size of buf in bytes + * \param[in] chan_nr channel number to be stringified + * \returns buf with string + */ +char *rsl_chan_nr_str_buf(char *buf, size_t buf_len, uint8_t chan_nr) { - static char str[20]; int ts = chan_nr & 7; uint8_t cbits = chan_nr >> 3; if (cbits == 0x01) - sprintf(str, "TCH/F on TS%d", ts); + snprintf(buf, buf_len, "TCH/F on TS%d", ts); else if ((cbits & 0x1e) == 0x02) - sprintf(str, "TCH/H(%u) on TS%d", cbits & 0x01, ts); + snprintf(buf, buf_len, "TCH/H(%u) on TS%d", cbits & 0x01, ts); else if ((cbits & 0x1c) == 0x04) - sprintf(str, "SDCCH/4(%u) on TS%d", cbits & 0x03, ts); + snprintf(buf, buf_len, "SDCCH/4(%u) on TS%d", cbits & 0x03, ts); else if ((cbits & 0x18) == 0x08) - sprintf(str, "SDCCH/8(%u) on TS%d", cbits & 0x07, ts); + snprintf(buf, buf_len, "SDCCH/8(%u) on TS%d", cbits & 0x07, ts); else if (cbits == 0x10) - sprintf(str, "BCCH on TS%d", ts); + snprintf(buf, buf_len, "BCCH on TS%d", ts); else if (cbits == 0x11) - sprintf(str, "RACH on TS%d", ts); + snprintf(buf, buf_len, "RACH on TS%d", ts); else if (cbits == 0x12) - sprintf(str, "PCH/AGCH on TS%d", ts); + snprintf(buf, buf_len, "PCH/AGCH on TS%d", ts); else if (cbits == 0x18) - sprintf(str, "PDCH on TS%d", ts); + snprintf(buf, buf_len, "PDCH on TS%d", ts); else - sprintf(str, "UNKNOWN on TS%d", ts); + snprintf(buf, buf_len, "UNKNOWN on TS%d", ts); - return str; + return buf; +} + +/*! Get human-readable string for RSL channel number, in static buffer. + * \param[in] chan_nr channel number to be stringified + * \returns buf with string + */ +const char *rsl_chan_nr_str(uint8_t chan_nr) +{ + static char str[20]; + return rsl_chan_nr_str_buf(str, sizeof(str), chan_nr); } static const struct value_string rsl_err_vals[] = { diff --git a/src/msgb.c b/src/msgb.c index ce7654a..47b413b 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -392,13 +392,14 @@ } -/*! Return a (static) buffer containing a hexdump of the msg - * \param[in] msg message buffer - * \returns a pointer to a static char array +/*! fill user-provided buffer with hexdump of the msg. + * \param[out] buf caller-allocated buffer for output string + * \param[in] buf_len length of buf + * \param[in] msg message buffer to be dumped + * \returns buf */ -const char *msgb_hexdump(const struct msgb *msg) +char *msgb_hexdump_buf(char *buf, size_t buf_len, const struct msgb *msg) { - static char buf[4100]; int buf_offs = 0; int nchars; const unsigned char *start = msg->data; @@ -421,32 +422,32 @@ if (lxhs[i] > msg->tail) continue; if (lxhs[i] < msg->data || lxhs[i] > msg->tail) { - nchars = snprintf(buf + buf_offs, sizeof(buf) - buf_offs, + nchars = snprintf(buf + buf_offs, buf_len - buf_offs, "(L%d=data%+" PRIdPTR ") ", i+1, lxhs[i] - msg->data); buf_offs += nchars; continue; } if (lxhs[i] < start) { - nchars = snprintf(buf + buf_offs, sizeof(buf) - buf_offs, + nchars = snprintf(buf + buf_offs, buf_len - buf_offs, "(L%d%+" PRIdPTR ") ", i+1, start - lxhs[i]); buf_offs += nchars; continue; } - nchars = snprintf(buf + buf_offs, sizeof(buf) - buf_offs, + nchars = snprintf(buf + buf_offs, buf_len - buf_offs, "%s[L%d]> ", osmo_hexdump(start, lxhs[i] - start), i+1); - if (nchars < 0 || nchars + buf_offs >= sizeof(buf)) + if (nchars < 0 || nchars + buf_offs >= buf_len) return "ERROR"; buf_offs += nchars; start = lxhs[i]; } - nchars = snprintf(buf + buf_offs, sizeof(buf) - buf_offs, + nchars = snprintf(buf + buf_offs, buf_len - buf_offs, "%s", osmo_hexdump(start, msg->tail - start)); - if (nchars < 0 || nchars + buf_offs >= sizeof(buf)) + if (nchars < 0 || nchars + buf_offs >= buf_len) return "ERROR"; buf_offs += nchars; @@ -456,17 +457,17 @@ continue; if (lxhs[i] < msg->head || lxhs[i] > msg->head + msg->data_len) { - nchars = snprintf(buf + buf_offs, sizeof(buf) - buf_offs, + nchars = snprintf(buf + buf_offs, buf_len - buf_offs, "(L%d out of range) ", i+1); } else if (lxhs[i] <= msg->data + msg->data_len && lxhs[i] > msg->tail) { - nchars = snprintf(buf + buf_offs, sizeof(buf) - buf_offs, + nchars = snprintf(buf + buf_offs, buf_len - buf_offs, "(L%d=tail%+" PRIdPTR ") ", i+1, lxhs[i] - msg->tail); } else continue; - if (nchars < 0 || nchars + buf_offs >= sizeof(buf)) + if (nchars < 0 || nchars + buf_offs >= buf_len) return "ERROR"; buf_offs += nchars; } @@ -474,6 +475,15 @@ return buf; } +/*! Return a (static) buffer containing a hexdump of the msg. + * \param[in] msg message buffer + * \returns a pointer to a static char array + */ +const char *msgb_hexdump(const struct msgb *msg) +{ + static char buf[4100]; + return msgb_hexdump_buf(buf, sizeof(buf), msg); +} /*! Print a string to the end of message buffer. * \param[in] msgb message buffer. diff --git a/src/sim/core.c b/src/sim/core.c index a78cecc..998e836 100644 --- a/src/sim/core.c +++ b/src/sim/core.c @@ -267,10 +267,8 @@ return msg; } -/* FIXME: do we want to mark this as __thread? */ -static char sw_print_buf[256]; -char *osim_print_sw(const struct osim_card_hdl *ch, uint16_t sw_in) +char *osim_print_sw_buf(char *buf, size_t buf_len, const struct osim_card_hdl *ch, uint16_t sw_in) { const struct osim_card_sw *csw; @@ -283,25 +281,29 @@ switch (csw->type) { case SW_TYPE_STR: - snprintf(sw_print_buf, sizeof(sw_print_buf), - "%04x (%s)", sw_in, csw->u.str); + snprintf(buf, buf_len, "%04x (%s)", sw_in, csw->u.str); break; default: goto ret_def; } - sw_print_buf[sizeof(sw_print_buf)-1] = '\0'; + buf[buf_len-1] = '\0'; - return sw_print_buf; + return buf; ret_def: - snprintf(sw_print_buf, sizeof(sw_print_buf), - "%04x (Unknown)", sw_in); - sw_print_buf[sizeof(sw_print_buf)-1] = '\0'; + snprintf(buf, buf_len, "%04x (Unknown)", sw_in); + buf[buf_len-1] = '\0'; - return sw_print_buf; + return buf; } +char *osim_print_sw(const struct osim_card_hdl *ch, uint16_t sw_in) +{ + /* FIXME: do we want to mark this as __thread? */ + static char sw_print_buf[256]; + return osim_print_sw_buf(sw_print_buf, sizeof(sw_print_buf), ch, sw_in); +} const struct osim_card_sw *osim_find_sw(const struct osim_card_profile *cp, uint16_t sw_in) diff --git a/src/utils.c b/src/utils.c index 019e733..4796365 100644 --- a/src/utils.c +++ b/src/utils.c @@ -273,17 +273,20 @@ return out_buf; } -/*! Convert a sequence of unpacked bits to ASCII string +/*! Convert a sequence of unpacked bits to ASCII string, in user-supplied buffer. + * \param[out] buf caller-provided output string buffer + * \param[out] buf_len size of buf in bytes * \param[in] bits A sequence of unpacked bits * \param[in] len Length of bits + * \returns string representation in static buffer. */ -char *osmo_ubit_dump(const uint8_t *bits, unsigned int len) +char *osmo_ubit_dump_buf(char *buf, size_t buf_len, const uint8_t *bits, unsigned int len) { int i; - if (len > sizeof(hexd_buff)-1) - len = sizeof(hexd_buff)-1; - memset(hexd_buff, 0, sizeof(hexd_buff)); + if (len > buf_len-1) + len = buf_len-1; + memset(buf, 0, buf_len); for (i = 0; i < len; i++) { char outch; @@ -301,10 +304,20 @@ outch = 'E'; break; } - hexd_buff[i] = outch; + buf[i] = outch; } - hexd_buff[sizeof(hexd_buff)-1] = 0; - return hexd_buff; + buf[buf_len-1] = 0; + return buf; +} + +/*! Convert a sequence of unpacked bits to ASCII string, in static buffer. + * \param[in] bits A sequence of unpacked bits + * \param[in] len Length of bits + * \returns string representation in static buffer. + */ +char *osmo_ubit_dump(const uint8_t *bits, unsigned int len) +{ + return osmo_ubit_dump_buf(hexd_buff, sizeof(hexd_buff), bits, len); } /*! Convert binary sequence to hexadecimal ASCII string @@ -632,7 +645,7 @@ * \param[in] in_len Pass -1 to print until nul char, or >= 0 to force a length. * \returns buf containing a quoted and escaped representation, possibly truncated. */ -const char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize) +char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize) { int l; if (!str) -- To view, visit https://gerrit.osmocom.org/13310 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ibf85f79e93244f53b2684ff6f1095c5b41203e05 Gerrit-Change-Number: 13310 Gerrit-PatchSet: 9 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:32:40 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:32:40 +0000 Subject: Change in libosmocore[master]: Add _c versions of functions that otherwise return static buffers In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13311 ) Change subject: Add _c versions of functions that otherwise return static buffers ...................................................................... Patch Set 9: no review here? This has been around for almost three weeks. somebody must have an opinion about this... -- To view, visit https://gerrit.osmocom.org/13311 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8481c19b68ff67cfa22abb93c405ebcfcb0ab19b Gerrit-Change-Number: 13311 Gerrit-PatchSet: 9 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Mon, 08 Apr 2019 07:32:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:33:53 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:33:53 +0000 Subject: Change in docker-playground[master]: nplab-m3ua-test: support running without jenkins In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13530 ) Change subject: nplab-m3ua-test: support running without jenkins ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13530 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I200b4ee1760a879cbc0a80a30a062a3f2a8e703d Gerrit-Change-Number: 13530 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 08 Apr 2019 07:33:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:33:59 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:33:59 +0000 Subject: Change in docker-playground[master]: nplab-m3ua-test: add sigtran-tests dependency In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13529 ) Change subject: nplab-m3ua-test: add sigtran-tests dependency ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13529 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9df1d2b188e86b3c99c6ec793b6eb644ab3c27c9 Gerrit-Change-Number: 13529 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 07:33:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:34:01 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:34:01 +0000 Subject: Change in docker-playground[master]: nplab-m3ua-test: add sigtran-tests dependency In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13529 ) Change subject: nplab-m3ua-test: add sigtran-tests dependency ...................................................................... nplab-m3ua-test: add sigtran-tests dependency Make sure to build sigtran-tests before building nplab-m3ua-tests. This has been working by coincidence without the dependency so far, because nplab-sua-test had the dependency listed and that test ran on the same host. Change-Id: I9df1d2b188e86b3c99c6ec793b6eb644ab3c27c9 --- M nplab-m3ua-test/jenkins.sh 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/nplab-m3ua-test/jenkins.sh b/nplab-m3ua-test/jenkins.sh index 103ea13..0f189ea 100755 --- a/nplab-m3ua-test/jenkins.sh +++ b/nplab-m3ua-test/jenkins.sh @@ -4,6 +4,7 @@ IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}" docker_images_require \ "debian-stretch-build" \ + "sigtran-tests" \ "osmo-stp-$IMAGE_SUFFIX" \ "debian-stretch-titan" \ "nplab-m3ua-test" -- To view, visit https://gerrit.osmocom.org/13529 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9df1d2b188e86b3c99c6ec793b6eb644ab3c27c9 Gerrit-Change-Number: 13529 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:34:02 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:34:02 +0000 Subject: Change in docker-playground[master]: nplab-m3ua-test: support running without jenkins In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13530 ) Change subject: nplab-m3ua-test: support running without jenkins ...................................................................... nplab-m3ua-test: support running without jenkins Don't use $WORKSPACE anymore, use $VOL_BASE_DIR like in every other jenkins.sh in this repository. Make it possible to run jenkins.sh outside of jenkins (where $WORKSPACE is not set), because jenkins_common.sh will set up $VOL_BASE_DIR to point to /tmp/logs. Change-Id: I200b4ee1760a879cbc0a80a30a062a3f2a8e703d --- M nplab-m3ua-test/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/nplab-m3ua-test/jenkins.sh b/nplab-m3ua-test/jenkins.sh index 0f189ea..5021ff2 100755 --- a/nplab-m3ua-test/jenkins.sh +++ b/nplab-m3ua-test/jenkins.sh @@ -30,7 +30,7 @@ --network $NET_NAME --ip 172.18.7.2 \ -v $VOL_BASE_DIR/m3ua-tester:/data \ --name ${BUILD_TAG}-m3ua-test \ - $REPO_USER/nplab-m3ua-test > $WORKSPACE/logs/junit-xml-m3ua.log + $REPO_USER/nplab-m3ua-test > $VOL_BASE_DIR/junit-xml-m3ua.log docker container stop -t 1 ${BUILD_TAG}-stp -- To view, visit https://gerrit.osmocom.org/13530 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I200b4ee1760a879cbc0a80a30a062a3f2a8e703d Gerrit-Change-Number: 13530 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:34:20 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:34:20 +0000 Subject: Change in osmo-msc[master]: msc/gsm_data.h: drop unused SMS_HDR_SIZE macro In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13483 ) Change subject: msc/gsm_data.h: drop unused SMS_HDR_SIZE macro ...................................................................... msc/gsm_data.h: drop unused SMS_HDR_SIZE macro Change-Id: Iea32a26673ebb57b18dc7e86ad321d9ed48e0948 --- M include/osmocom/msc/gsm_data.h 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 7d3a1e7..1a0d144 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -239,7 +239,6 @@ SMS_SOURCE_SMPP, /* received via SMPP */ }; -#define SMS_HDR_SIZE 128 #define SMS_TEXT_SIZE 256 struct gsm_sms_addr { -- To view, visit https://gerrit.osmocom.org/13483 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iea32a26673ebb57b18dc7e86ad321d9ed48e0948 Gerrit-Change-Number: 13483 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:34:59 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:34:59 +0000 Subject: Change in osmo-pcu[master]: vty: add commands to show TBF of a certain kind In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/6239 ) Change subject: vty: add commands to show TBF of a certain kind ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6239 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I80f8df4fe663a0346f4289a4220b761e39726312 Gerrit-Change-Number: 6239 Gerrit-PatchSet: 6 Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 08 Apr 2019 07:34:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:35:00 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:35:00 +0000 Subject: Change in osmo-pcu[master]: vty: add commands to show TBF of a certain kind In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/6239 ) Change subject: vty: add commands to show TBF of a certain kind ...................................................................... vty: add commands to show TBF of a certain kind Add vty commands to show only TBFs allocated via PACCH or CCCH. Change-Id: I80f8df4fe663a0346f4289a4220b761e39726312 Related: OS#1759 --- M src/pcu_vty.c M src/pcu_vty_functions.cpp M src/pcu_vty_functions.h 3 files changed, 23 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 960c90d..3a733ef 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -1083,11 +1083,20 @@ DEFUN(show_tbf, show_tbf_cmd, - "show tbf all", - SHOW_STR "information about TBFs\n" "All TBFs\n") + "show tbf (all|ccch|pacch)", + SHOW_STR "information about TBFs\n" + "All TBFs\n" + "TBFs allocated via CCCH\n" + "TBFs allocated via PACCH\n") { struct gprs_rlcmac_bts *bts = bts_main_data(); - return pcu_vty_show_tbf_all(vty, bts); + if (!strcmp(argv[0], "all")) + return pcu_vty_show_tbf_all(vty, bts, true, true); + + if (!strcmp(argv[0], "ccch")) + return pcu_vty_show_tbf_all(vty, bts_main_data(), true, false); + + return pcu_vty_show_tbf_all(vty, bts_main_data(), false, true); } DEFUN(show_ms_all, diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index c93935d..98e8185 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -44,11 +44,17 @@ #include "coding_scheme.h" } -static void tbf_print_vty_info(struct vty *vty, gprs_rlcmac_tbf *tbf) +static void tbf_print_vty_info(struct vty *vty, gprs_rlcmac_tbf *tbf, bool show_ccch, bool show_pacch) { gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf); gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf); + if (show_ccch && !(tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) + return; + + if (show_pacch && !(tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH))) + return; + vty_out(vty, "TBF: TFI=%d TLLI=0x%08x (%s) TA=%u DIR=%s IMSI=%s%s", tbf->tfi(), tbf->tlli(), tbf->is_tlli_valid() ? "valid" : "invalid", tbf->ta(), @@ -101,18 +107,18 @@ vty_out(vty, "%s%s", VTY_NEWLINE, VTY_NEWLINE); } -int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data) +int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data, bool show_ccch, bool show_pacch) { BTS *bts = bts_data->bts; LListHead *ms_iter; vty_out(vty, "UL TBFs%s", VTY_NEWLINE); llist_for_each(ms_iter, &bts->ul_tbfs()) - tbf_print_vty_info(vty, ms_iter->entry()); + tbf_print_vty_info(vty, ms_iter->entry(), show_ccch, show_pacch); vty_out(vty, "%sDL TBFs%s", VTY_NEWLINE, VTY_NEWLINE); llist_for_each(ms_iter, &bts->dl_tbfs()) - tbf_print_vty_info(vty, ms_iter->entry()); + tbf_print_vty_info(vty, ms_iter->entry(), show_ccch, show_pacch); return CMD_SUCCESS; } diff --git a/src/pcu_vty_functions.h b/src/pcu_vty_functions.h index 470df0e..3fef208 100644 --- a/src/pcu_vty_functions.h +++ b/src/pcu_vty_functions.h @@ -27,7 +27,7 @@ struct vty; struct gprs_rlcmac_bts; -int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data); +int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data, bool show_ccch, bool show_pacch); int pcu_vty_show_ms_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data); int pcu_vty_show_ms_by_tlli(struct vty *vty, struct gprs_rlcmac_bts *bts_data, uint32_t tlli); -- To view, visit https://gerrit.osmocom.org/6239 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I80f8df4fe663a0346f4289a4220b761e39726312 Gerrit-Change-Number: 6239 Gerrit-PatchSet: 7 Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:35:20 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:35:20 +0000 Subject: Change in osmo-pcu[master]: Update MCS selection for retransmission In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13402 ) Change subject: Update MCS selection for retransmission ...................................................................... Update MCS selection for retransmission In 3GPP TS 44.060 the selection of MCS for retransmissions is defined as separate tables (8.1.1.1 and 8.1.1.2) depending on the value of resegmentation bit (which is opposite to the way EGPRS_ARQ are defined in the source code). Let's follow the same idea and explicitly check for resegmentation bit value and use separate tables. This also makes it easier to add proper support for special cases (MCS-6-9 and MCS-5-7) and padding in future independently for different ARQ types. The code is also moved to c to avoid unnecessary conversions to and from cpp class. Change-Id: Ia73baeefee7a58834f0fc50e3b8bf8d5e3eb7815 --- M src/coding_scheme.c M src/coding_scheme.h M src/gprs_coding_scheme.cpp M src/gprs_coding_scheme.h M src/tbf_dl.cpp 5 files changed, 40 insertions(+), 50 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/coding_scheme.c b/src/coding_scheme.c index a4ae882..eaa4953 100644 --- a/src/coding_scheme.c +++ b/src/coding_scheme.c @@ -127,3 +127,39 @@ const char *mode_name(enum mcs_kind val) { return get_value_string(mode_names, val); } + +/* FIXME: take into account padding and special cases of commanded MCS (MCS-6-9 and MCS-5-7) */ +enum CodingScheme get_retx_mcs(enum CodingScheme initial_mcs, enum CodingScheme commanded_mcs, bool resegment_bit) +{ + OSMO_ASSERT(mcs_is_edge(initial_mcs)); + OSMO_ASSERT(mcs_is_edge(commanded_mcs)); + OSMO_ASSERT(NUM_SCHEMES - MCS1 == 9); + + if (resegment_bit) { /* 3GPP TS 44.060 Table 8.1.1.1, reflected over antidiagonal */ + enum CodingScheme egprs_reseg[NUM_SCHEMES - MCS1][NUM_SCHEMES - MCS1] = { + { MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1 }, + { MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2 }, + { MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3 }, + { MCS1, MCS1, MCS1, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4 }, + { MCS2, MCS2, MCS2, MCS2, MCS5, MCS5, MCS7, MCS7, MCS7 }, + { MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS6, MCS9 }, + { MCS2, MCS2, MCS2, MCS2, MCS5, MCS5, MCS7, MCS7, MCS7 }, + { MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS8, MCS8 }, + { MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS6, MCS9 }, + }; + return egprs_reseg[mcs_chan_code(initial_mcs)][mcs_chan_code(commanded_mcs)]; + } else { /* 3GPP TS 44.060 Table 8.1.1.2, reflected over antidiagonal */ + enum CodingScheme egprs_no_reseg[NUM_SCHEMES - MCS1][NUM_SCHEMES - MCS1] = { + { MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1 }, + { MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2 }, + { MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3 }, + { MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4 }, + { MCS5, MCS5, MCS5, MCS5, MCS5, MCS5, MCS7, MCS7, MCS7 }, + { MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS9 }, + { MCS5, MCS5, MCS5, MCS5, MCS5, MCS5, MCS7, MCS7, MCS7 }, + { MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS8, MCS8 }, + { MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS9 }, + }; + return egprs_no_reseg[mcs_chan_code(initial_mcs)][mcs_chan_code(commanded_mcs)]; + } +} diff --git a/src/coding_scheme.h b/src/coding_scheme.h index aac4bba..24db86d 100644 --- a/src/coding_scheme.h +++ b/src/coding_scheme.h @@ -32,6 +32,7 @@ extern const struct value_string mcs_names[]; const char *mcs_name(enum CodingScheme val); +enum CodingScheme get_retx_mcs(enum CodingScheme initial_mcs, enum CodingScheme commanded_mcs, bool resegment_bit); bool mcs_is_gprs(enum CodingScheme cs); bool mcs_is_edge(enum CodingScheme cs); diff --git a/src/gprs_coding_scheme.cpp b/src/gprs_coding_scheme.cpp index a149f81..0c22670 100644 --- a/src/gprs_coding_scheme.cpp +++ b/src/gprs_coding_scheme.cpp @@ -21,41 +21,6 @@ #include "gprs_coding_scheme.h" -#define MAX_NUM_ARQ 2 /* max. number of ARQ */ -#define MAX_NUM_MCS 9 /* max. number of MCS */ - -/* - * 44.060 Table 8.1.1.1 and Table 8.1.1.2 - * It has 3 level indexing. 0th level is ARQ type - * 1st level is Original MCS( index 0 corresponds to MCS1 and so on) - * 2nd level is MS MCS (index 0 corresponds to MCS1 and so on) - */ -static enum CodingScheme egprs_mcs_retx_tbl[MAX_NUM_ARQ] - [MAX_NUM_MCS][MAX_NUM_MCS] = { - { - {MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1}, - {MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2}, - {MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3}, - {MCS1, MCS1, MCS1, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4}, - {MCS2, MCS2, MCS2, MCS2, MCS5, MCS5, MCS7, MCS7, MCS7}, - {MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS6, MCS9}, - {MCS2, MCS2, MCS2, MCS2, MCS5, MCS5, MCS7, MCS7, MCS7}, - {MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS8, MCS8}, - {MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS6, MCS9} - }, - { - {MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1}, - {MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2}, - {MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3}, - {MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4}, - {MCS5, MCS5, MCS5, MCS5, MCS5, MCS5, MCS7, MCS7, MCS7}, - {MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS9}, - {MCS5, MCS5, MCS5, MCS5, MCS5, MCS5, MCS7, MCS7, MCS7}, - {MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS8, MCS8}, - {MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS9} - } - }; - enum Family { FAMILY_INVALID, FAMILY_A, @@ -63,13 +28,6 @@ FAMILY_C, }; -CodingScheme GprsCodingScheme::get_retx_mcs(const GprsCodingScheme mcs, - const GprsCodingScheme demanded_mcs, - const unsigned arq_type) -{ - return egprs_mcs_retx_tbl[arq_type][mcs_chan_code(mcs)][mcs_chan_code(demanded_mcs)]; -} - static struct { struct { uint8_t bytes; diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h index d5604fb..c31f58f 100644 --- a/src/gprs_coding_scheme.h +++ b/src/gprs_coding_scheme.h @@ -73,9 +73,6 @@ static GprsCodingScheme getGprsByNum(unsigned num); static GprsCodingScheme getEgprsByNum(unsigned num); - static CodingScheme get_retx_mcs(const GprsCodingScheme mcs, - const GprsCodingScheme retx_mcs, - const unsigned arq_type); private: GprsCodingScheme(int s); /* fail on use */ GprsCodingScheme& operator =(int s); /* fail on use */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 08df05a..c97436a 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -378,11 +378,9 @@ if (is_egprs_enabled()) { /* Table 8.1.1.2 and Table 8.1.1.1 of 44.060 */ - m_rlc.block(bsn)->cs_current_trans = - GprsCodingScheme::get_retx_mcs( - m_rlc.block(bsn)->cs_init, - ms()->current_cs_dl(), - bts->bts_data()->dl_arq_type); + m_rlc.block(bsn)->cs_current_trans = get_retx_mcs(m_rlc.block(bsn)->cs_init, + ms()->current_cs_dl(), + !bts->bts_data()->dl_arq_type); LOGPTBFDL(this, LOGL_DEBUG, "initial_cs_dl(%s) last_mcs(%s) demanded_mcs(%s) cs_trans(%s) arq_type(%d) bsn(%d)\n", -- To view, visit https://gerrit.osmocom.org/13402 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia73baeefee7a58834f0fc50e3b8bf8d5e3eb7815 Gerrit-Change-Number: 13402 Gerrit-PatchSet: 5 Gerrit-Owner: Max Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:36:10 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:36:10 +0000 Subject: Change in osmo-pcu[master]: cosmetic: use const pointer for bts_data In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/12246 ) Change subject: cosmetic: use const pointer for bts_data ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/12246 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icfd9e5603a5d8701f487f17e9c0335d458e9e80b Gerrit-Change-Number: 12246 Gerrit-PatchSet: 3 Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 07:36:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:36:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:36:12 +0000 Subject: Change in osmo-pcu[master]: cosmetic: use const pointer for bts_data In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/12246 ) Change subject: cosmetic: use const pointer for bts_data ...................................................................... cosmetic: use const pointer for bts_data It's used several time for logging so let's call it once to make code easier to follow. Change-Id: Icfd9e5603a5d8701f487f17e9c0335d458e9e80b --- M src/tbf_dl.cpp M src/tbf_ul.cpp 2 files changed, 7 insertions(+), 4 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 c97436a..d5e4a45 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -1350,9 +1350,11 @@ void gprs_rlcmac_dl_tbf::set_window_size() { - uint16_t ws = egprs_window_size(bts->bts_data(), dl_slots()); + const struct gprs_rlcmac_bts *b = bts->bts_data(); + uint16_t ws = egprs_window_size(b, dl_slots()); + LOGPTBFDL(this, LOGL_INFO, "setting EGPRS DL window size to %u, base(%u) slots(%u) ws_pdch(%u)\n", - ws, bts->bts_data()->ws_base, pcu_bitcount(dl_slots()), bts->bts_data()->ws_pdch); + ws, b->ws_base, pcu_bitcount(dl_slots()), b->ws_pdch); m_window.set_ws(ws); } diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index fd7d73b..e1a0fbd 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -588,8 +588,9 @@ void gprs_rlcmac_ul_tbf::set_window_size() { - uint16_t ws = egprs_window_size(bts->bts_data(), ul_slots()); + const struct gprs_rlcmac_bts *b = bts->bts_data(); + uint16_t ws = egprs_window_size(b, ul_slots()); LOGPTBFUL(this, LOGL_INFO, "setting EGPRS UL window size to %u, base(%u) slots(%u) ws_pdch(%u)\n", - ws, bts->bts_data()->ws_base, pcu_bitcount(ul_slots()), bts->bts_data()->ws_pdch); + ws, b->ws_base, pcu_bitcount(ul_slots()), b->ws_pdch); m_window.set_ws(ws); } -- To view, visit https://gerrit.osmocom.org/12246 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Icfd9e5603a5d8701f487f17e9c0335d458e9e80b Gerrit-Change-Number: 12246 Gerrit-PatchSet: 4 Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 07:39:44 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Apr 2019 07:39:44 +0000 Subject: Change in osmo-bsc[master]: Use osmo_lcls instead of anonymous struct In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13419 ) Change subject: Use osmo_lcls instead of anonymous struct ...................................................................... Patch Set 1: Code-Review-1 (1 comment) I don't see a need for using dynamic allocations at all, the 'struct osmo_lcls' is present in all subscr_conn, so why not make it a static member? https://gerrit.osmocom.org/#/c/13419/1/include/osmocom/bsc/gsm_data.h File include/osmocom/bsc/gsm_data.h: https://gerrit.osmocom.org/#/c/13419/1/include/osmocom/bsc/gsm_data.h at 295 PS1, Line 295: struct osmo_lcls *par; /* LCLS parameters */ why is this not a static member here? Your patch doesn't only change from discrete members to 'struct osmo_lcls', but it also switches from static to dynamic allocation. I support the former, but I don't undestand why the latter change is required. -- To view, visit https://gerrit.osmocom.org/13419 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0f2c2a065755d9051fc7d7ce52c19ab0b7d9288a Gerrit-Change-Number: 13419 Gerrit-PatchSet: 1 Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Comment-Date: Mon, 08 Apr 2019 07:39:44 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 09:22:01 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Apr 2019 09:22:01 +0000 Subject: Change in libosmocore[master]: Add _c versions of functions that otherwise return static buffers In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13311 ) Change subject: Add _c versions of functions that otherwise return static buffers ...................................................................... Patch Set 9: Code-Review+1 I am not against this channge, I see the point of standariging options for APIs, but I'm not really sure about the benefit of introducing _c functions for APIs which already have a _buf one (meaning one can already use them in multithreaded env). I don't like adding similar APIs for the sake of convenience, because on the other hand it grows libosmocore size, maintainership and complexity to find APIs as a user. IMHO we should deprecate static buffers and keep only _buf ones, and drop _c or talloc functions as much as possible for simple return types like strings. Of course we want to have/keep _c for APIs returning complex stuff like msgb. -- To view, visit https://gerrit.osmocom.org/13311 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8481c19b68ff67cfa22abb93c405ebcfcb0ab19b Gerrit-Change-Number: 13311 Gerrit-PatchSet: 9 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Mon, 08 Apr 2019 09:22:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 09:24:10 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 09:24:10 +0000 Subject: Change in osmo-bts[master]: oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging() In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Daniel Willmann, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13275 to look at the new patch set (#4). Change subject: oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging() ...................................................................... oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging() The function osmo_init_logging() is deprecated, lets use osmo_init_logging2() as suggested. Change-Id: Iebc80cd1f77f10a879d4536d788377f522dd853f --- M src/osmo-bts-oc2g/misc/oc2gbts_mgr.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/75/13275/4 -- To view, visit https://gerrit.osmocom.org/13275 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iebc80cd1f77f10a879d4536d788377f522dd853f Gerrit-Change-Number: 13275 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 09:24:10 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 09:24:10 +0000 Subject: Change in osmo-bts[master]: pcu_sock: use %zu conversion specifier for printing sizeof() result In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Daniel Willmann, Max, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13267 to look at the new patch set (#4). Change subject: pcu_sock: use %zu conversion specifier for printing sizeof() result ...................................................................... pcu_sock: use %zu conversion specifier for printing sizeof() result When using %lu and sizeof() for printing the compiler may throw a warning. Lets prevent this by using %zu instead of %lu as conversion specifier. Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709 --- M src/common/pcu_sock.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/13267/4 -- To view, visit https://gerrit.osmocom.org/13267 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709 Gerrit-Change-Number: 13267 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 09:42:03 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Apr 2019 09:42:03 +0000 Subject: Change in osmo-bts[master]: l1_if: add include for missing header file In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13273 ) Change subject: l1_if: add include for missing header file ...................................................................... Patch Set 4: It seems meas_test output changed, osmo_dump_gsmtime() provides different output. -- To view, visit https://gerrit.osmocom.org/13273 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I95d7e89eed969dd5b3ccff0eebcc6c568196a97d Gerrit-Change-Number: 13273 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 08 Apr 2019 09:42:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 09:45:35 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 09:45:35 +0000 Subject: Change in osmo-bts[master]: testme Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13546 Change subject: testme ...................................................................... testme Change-Id: Icdf0bf56cb35ad2924958d8126d7a49ba1f36f9d --- A testme 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/13546/1 diff --git a/testme b/testme new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/testme -- To view, visit https://gerrit.osmocom.org/13546 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Icdf0bf56cb35ad2924958d8126d7a49ba1f36f9d Gerrit-Change-Number: 13546 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 10:00:11 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 10:00:11 +0000 Subject: Change in osmo-bts[master]: l1_if: add include for missing header file In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/13273 ) Change subject: l1_if: add include for missing header file ...................................................................... Patch Set 4: (1 comment) > It seems meas_test output changed, osmo_dump_gsmtime() provides > different output. I am currently looking into this. First I wasn't able to reproduce this locally, but after libosmocore update it started failing. https://gerrit.osmocom.org/#/c/13273/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13273/1//COMMIT_MSG at 10 PS1, Line 10: declared in cbch.h. Lets include this header file in order to be > typo: decleared Done -- To view, visit https://gerrit.osmocom.org/13273 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I95d7e89eed969dd5b3ccff0eebcc6c568196a97d Gerrit-Change-Number: 13273 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-Comment-Date: Mon, 08 Apr 2019 10:00:11 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 10:12:13 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 10:12:13 +0000 Subject: Change in libosmocore[master]: gsm_utils: fix use buf_len instead of sizeof() osmo_dump_gsmtime_buf Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13547 Change subject: gsm_utils: fix use buf_len instead of sizeof() osmo_dump_gsmtime_buf ...................................................................... gsm_utils: fix use buf_len instead of sizeof() osmo_dump_gsmtime_buf The function osmo_dump_gsmtime_buf gets a pointer *buf and a parameter buf_len. The pointer *buf is a string buffer and the function places an \0 at the end of the buffer before it exists. However it uses sizeof(buf) as part of the index calculation, which is incorrect. Lets correct this by using buf_len instead. Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114 --- M src/gsm/gsm_utils.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/47/13547/1 diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index f34d9ea..f2bf57b 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -890,7 +890,7 @@ { snprintf(buf, buf_len, "%06"PRIu32"/%02"PRIu16"/%02"PRIu8"/%02"PRIu8"/%02"PRIu8, tm->fn, tm->t1, tm->t2, tm->t3, (uint8_t)tm->fn%52); - buf[sizeof(buf)-1] = '\0'; + buf[buf_len-1] = '\0'; return buf; } -- To view, visit https://gerrit.osmocom.org/13547 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114 Gerrit-Change-Number: 13547 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 10:16:25 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 10:16:25 +0000 Subject: Change in libosmocore[master]: gsm_utils: fix use buf_len instead of sizeof in osmo_dump_gsmtime_buf 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/13547 to look at the new patch set (#2). Change subject: gsm_utils: fix use buf_len instead of sizeof in osmo_dump_gsmtime_buf ...................................................................... gsm_utils: fix use buf_len instead of sizeof in osmo_dump_gsmtime_buf The function osmo_dump_gsmtime_buf gets a pointer *buf and a parameter buf_len. The pointer *buf is a string buffer and the function places an \0 at the end of the buffer before it exists. However it uses sizeof(buf) as part of the index calculation, which is incorrect. Lets correct this by using buf_len instead. Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114 --- M src/gsm/gsm_utils.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/47/13547/2 -- To view, visit https://gerrit.osmocom.org/13547 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114 Gerrit-Change-Number: 13547 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 10:20:01 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 10:20:01 +0000 Subject: Change in osmo-bts[master]: testme In-Reply-To: References: Message-ID: dexter has abandoned this change. ( https://gerrit.osmocom.org/13546 ) Change subject: testme ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/13546 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Icdf0bf56cb35ad2924958d8126d7a49ba1f36f9d Gerrit-Change-Number: 13546 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 11:24:14 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 8 Apr 2019 11:24:14 +0000 Subject: Change in libosmocore[master]: gsm_utils: fix use buf_len instead of sizeof in osmo_dump_gsmtime_buf In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13547 ) Change subject: gsm_utils: fix use buf_len instead of sizeof in osmo_dump_gsmtime_buf ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13547 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114 Gerrit-Change-Number: 13547 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 08 Apr 2019 11:24:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 11:44:41 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 11:44:41 +0000 Subject: Change in libosmocore[master]: gsm_utils: fix use buf_len instead of sizeof in osmo_dump_gsmtime_buf In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/13547 ) Change subject: gsm_utils: fix use buf_len instead of sizeof in osmo_dump_gsmtime_buf ...................................................................... gsm_utils: fix use buf_len instead of sizeof in osmo_dump_gsmtime_buf The function osmo_dump_gsmtime_buf gets a pointer *buf and a parameter buf_len. The pointer *buf is a string buffer and the function places an \0 at the end of the buffer before it exists. However it uses sizeof(buf) as part of the index calculation, which is incorrect. Lets correct this by using buf_len instead. Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114 --- M src/gsm/gsm_utils.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Vadim Yanitskiy: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index f34d9ea..f2bf57b 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -890,7 +890,7 @@ { snprintf(buf, buf_len, "%06"PRIu32"/%02"PRIu16"/%02"PRIu8"/%02"PRIu8"/%02"PRIu8, tm->fn, tm->t1, tm->t2, tm->t3, (uint8_t)tm->fn%52); - buf[sizeof(buf)-1] = '\0'; + buf[buf_len-1] = '\0'; return buf; } -- To view, visit https://gerrit.osmocom.org/13547 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114 Gerrit-Change-Number: 13547 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 11:57:23 2019 From: gerrit-no-reply at lists.osmocom.org (Rafael Diniz) Date: Mon, 8 Apr 2019 11:57:23 +0000 Subject: Change in osmo-pcu[master]: Fix help message formatting of osmo-pcu. In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13542 to look at the new patch set (#2). Change subject: Fix help message formatting of osmo-pcu. ...................................................................... Fix help message formatting of osmo-pcu. Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f --- M src/pcu_main.cpp 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/42/13542/2 -- To view, visit https://gerrit.osmocom.org/13542 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f Gerrit-Change-Number: 13542 Gerrit-PatchSet: 2 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Rafael Diniz Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 11:57:45 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 11:57:45 +0000 Subject: Change in osmo-hlr[master]: USSD: fix routing to multiple MSC In-Reply-To: References: Message-ID: osmith has uploaded a new patch set (#6) to the change originally created by Neels Hofmeyr. ( https://gerrit.osmocom.org/13479 ) Change subject: USSD: fix routing to multiple MSC ...................................................................... USSD: fix routing to multiple MSC hlr_ussd.c so far hardcoded osmo-msc's default IPA-name and hence was only able to negotiate USSD sessions to - a single osmo-msc - that has no custom IPA-name set. Fix: correctly route USSD to any number of MSC with any custom IPA names. Resolve the right MSC's IPA name from the USSD session's IMSI, using hlr_subscriber->vlr_number to determine the right GSUP peer. Cache it in ss_session->vlr_number to have at most one db hit for routing per session. Related: OS#3710 Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 --- M src/hlr_ussd.c 1 file changed, 38 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/79/13479/6 -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 11:58:24 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 11:58:24 +0000 Subject: Change in osmo-hlr[master]: USSD: fix routing to multiple MSC In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13479 ) Change subject: USSD: fix routing to multiple MSC ...................................................................... Patch Set 6: (5 comments) Thanks for the reviews, here's the next version. https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 175 PS5, Line 175: > let's take this ss->subscr from the top. [?] Updated the patch to have ss->vlr_number, and look it up once if it is empty (like the MT USSD case you have described). The timer is dropped again. The MO USSD case depends on the libosmocore.git MSC HO GSUP messages patch (needs gsup->source_name), so I've kept it as follow up patch here: https://gerrit.osmocom.org/#/c/osmo-hlr/+/13515/ (I've used vlr_number instead of vlr_name, because it is also called vlr_number in hlr_subscriber->vlr_number, and so we don't introduce yet another name for the same thing.) https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 251 PS5, Line 251: OGP(DLGSUP, LOG > thx Done https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 260 PS5, Line 260: > same here. Done https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 263 PS5, Line 263: > (ack, I have no good idea about naming here) Changed to "SS/USSD". https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 343 PS5, Line 343: ss_tx_error(ss, true, GSM0480_ERR_CODE_SYSTEM_FAILURE); > (setting ss->subscr to point at local struct subscr becomes invalid memory as soon as the function e [?] Now I get it - it worked in your patch (#4), because you had set it to NULL afterwards. Thanks for explaining. -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 11:58:24 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 11:58:45 2019 From: gerrit-no-reply at lists.osmocom.org (Rafael Diniz) Date: Mon, 8 Apr 2019 11:58:45 +0000 Subject: Change in osmo-pcu[master]: Fix help message formatting of osmo-pcu. In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13542 to look at the new patch set (#3). Change subject: Fix help message formatting of osmo-pcu. ...................................................................... Fix help message formatting of osmo-pcu. Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f --- M src/pcu_main.cpp 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/42/13542/3 -- To view, visit https://gerrit.osmocom.org/13542 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f Gerrit-Change-Number: 13542 Gerrit-PatchSet: 3 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Rafael Diniz Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 12:07:01 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 12:07:01 +0000 Subject: Change in osmo-hlr[master]: USSD: fix routing to multiple MSC In-Reply-To: References: Message-ID: osmith has uploaded a new patch set (#7) to the change originally created by Neels Hofmeyr. ( https://gerrit.osmocom.org/13479 ) Change subject: USSD: fix routing to multiple MSC ...................................................................... USSD: fix routing to multiple MSC hlr_ussd.c so far hardcoded osmo-msc's default IPA-name and hence was only able to negotiate USSD sessions to - a single osmo-msc - that has no custom IPA-name set. Fix: correctly route USSD to any number of MSC with any custom IPA names. Resolve the right MSC's IPA name from the USSD session's IMSI, using hlr_subscriber->vlr_number to determine the right GSUP peer. Cache it in ss_session->vlr_number to have at most one db hit for routing per session. Related: OS#3710 Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 --- M src/hlr_ussd.c 1 file changed, 35 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/79/13479/7 -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 7 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 12:10:13 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 12:10:13 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 6 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 12:10:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 12:11:41 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 12:11:41 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13515 to look at the new patch set (#7). Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... USSD: save MO USSD's originating MSC's vlr_number Save the source MSC/VLR in ss_session, so we can send "invalid IMSI" messages to the originating MSC. Related: OS#3710 Depends: Ic00b0601eacff6d72927cea51767801142ee75db (libosmocore.git) Change-Id: If5a65f471672949192061c5fe396603611123bc1 --- M src/hlr_ussd.c 1 file changed, 15 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/13515/7 -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 7 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 12:15:34 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 8 Apr 2019 12:15:34 +0000 Subject: Change in osmo-pcu[master]: Fix help message formatting of osmo-pcu. In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13542 ) Change subject: Fix help message formatting of osmo-pcu. ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13542 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f Gerrit-Change-Number: 13542 Gerrit-PatchSet: 3 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Rafael Diniz Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 08 Apr 2019 12:15:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 12:42:33 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 12:42:33 +0000 Subject: Change in osmo-hlr[master]: USSD: don't use gsm0480_msgb_alloc_name() Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13548 Change subject: USSD: don't use gsm0480_msgb_alloc_name() ...................................................................... USSD: don't use gsm0480_msgb_alloc_name() We have nothing to do with GSM 04.80 at the HLR - it's only used to encapsulate the SS payload between MS and MSC. This is not that critical, but may be misleading. Also, gsm0480_msgb_alloc_name() allocates a smaller buffer: return msgb_alloc_headroom(1024, 128, name); than osmo_gsup_client_msgb_alloc() does: return msgb_alloc_headroom(4000, 64, __func__); Change-Id: Icdab40c6a933888eb9f51bee9c5264c8919dbf7b --- M src/hlr_ussd.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/48/13548/1 diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index cc6aa8a..4f9f023 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -241,7 +241,7 @@ resp.ss_info_len = msgb_length(ss_msg); } - resp_msg = gsm0480_msgb_alloc_name(__func__); + resp_msg = msgb_alloc_headroom(4000, 64, __func__); OSMO_ASSERT(resp_msg); osmo_gsup_encode(resp_msg, &resp); msgb_free(ss_msg); -- To view, visit https://gerrit.osmocom.org/13548 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Icdab40c6a933888eb9f51bee9c5264c8919dbf7b Gerrit-Change-Number: 13548 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 12:42:58 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 12:42:58 +0000 Subject: Change in osmo-hlr[master]: USSD: fix routing to multiple MSC In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13479 ) Change subject: USSD: fix routing to multiple MSC ...................................................................... Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c at 286 PS5, Line 286: resp_msg = gsm0480_msgb_alloc_name(__func__); > agree, but separate patch. https://gerrit.osmocom.org/#/c/osmo-hlr/+/13548 -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 12:42:58 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 12:49:18 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 12:49:18 +0000 Subject: Change in osmo-bts[master]: l1_if: add include for missing header file In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/13273 ) Change subject: l1_if: add include for missing header file ...................................................................... l1_if: add include for missing header file the function bts_cbch_get() is used in l1_if.c. The function is declared in cbch.h. Lets include this header file in order to be complete. Change-Id: I95d7e89eed969dd5b3ccff0eebcc6c568196a97d --- M src/osmo-bts-oc2g/l1_if.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved Harald Welte: Looks good to me, approved Max: Looks good to me, but someone else must approve diff --git a/src/osmo-bts-oc2g/l1_if.c b/src/osmo-bts-oc2g/l1_if.c index e834879..87c7cf7 100644 --- a/src/osmo-bts-oc2g/l1_if.c +++ b/src/osmo-bts-oc2g/l1_if.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include -- To view, visit https://gerrit.osmocom.org/13273 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I95d7e89eed969dd5b3ccff0eebcc6c568196a97d Gerrit-Change-Number: 13273 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 12:59:19 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 8 Apr 2019 12:59:19 +0000 Subject: Change in osmo-hlr[master]: USSD: fix routing to multiple MSC In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13479 ) Change subject: USSD: fix routing to multiple MSC ...................................................................... Patch Set 7: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c at 171 PS7, Line 171: vlr_number What about static memory allocation? char vlr_number[32]; -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 7 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 12:59:19 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 13:12:59 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 13:12:59 +0000 Subject: Change in osmo-hlr[master]: Cosmetic: gsup_route_find: comment addr, addrlen Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13549 Change subject: Cosmetic: gsup_route_find: comment addr, addrlen ...................................................................... Cosmetic: gsup_route_find: comment addr, addrlen Describe the addr, addrlen parameters in gsup_route_find() and (more commonly used) osmo_gsup_addr_send(). Without this description, it is easy to get the parameters wrong and have routes not being found, as shown with debug prints like these: gsup_route_find: addr, addrlen: "MSC-13-37-00-00-00-00", 21 gsup_route_find: comparing with: "MSC-13-37-00-00-00-00\0", 22 Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb --- M src/gsup_router.c M src/gsup_send.c 2 files changed, 15 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/49/13549/1 diff --git a/src/gsup_router.c b/src/gsup_router.c index 16ea202..4fedd38 100644 --- a/src/gsup_router.c +++ b/src/gsup_router.c @@ -33,7 +33,13 @@ struct osmo_gsup_conn *conn; }; -/* find a route for the given address */ +/*! Find a route for the given address. + * \param[in] gs gsup server + * \param[in] addr IPA name of the client (SGSN, MSC/VLR). Although this is passed like a blob, together with the + * length, it must be nul-terminated! This is for legacy reasons, see the discussion here: + * https://gerrit.osmocom.org/#/c/osmo-hlr/+/13048/ + * \param[in] addrlen length of addr, *including the nul-byte* (strlen(addr) + 1). + */ struct osmo_gsup_conn *gsup_route_find(struct osmo_gsup_server *gs, const uint8_t *addr, size_t addrlen) { diff --git a/src/gsup_send.c b/src/gsup_send.c index b2c4e02..889cf63 100644 --- a/src/gsup_send.c +++ b/src/gsup_send.c @@ -26,7 +26,14 @@ #include -/* Send a msgb to a given address using routing */ +/*! Send a msgb to a given address using routing. + * \param[in] gs gsup server + * \param[in] addr IPA name of the client (SGSN, MSC/VLR). Although this is passed like a blob, together with the + * length, it must be nul-terminated! This is for legacy reasons, see the discussion here: + * https://gerrit.osmocom.org/#/c/osmo-hlr/+/13048/ + * \param[in] addrlen length of addr, *including the nul-byte* (strlen(addr) + 1). + * \param[in] msg message buffer + */ int osmo_gsup_addr_send(struct osmo_gsup_server *gs, const uint8_t *addr, size_t addrlen, struct msgb *msg) -- To view, visit https://gerrit.osmocom.org/13549 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb Gerrit-Change-Number: 13549 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 13:14:01 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 13:14:01 +0000 Subject: Change in osmo-hlr[master]: gsup_router.c: gsup_route_find(): support blob In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13048 ) Change subject: gsup_router.c: gsup_route_find(): support blob ...................................................................... Patch Set 2: New patch that describes the addr, addrlen parameters instead: https://gerrit.osmocom.org/#/c/osmo-hlr/+/13549 -- To view, visit https://gerrit.osmocom.org/13048 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I01a45900e14d41bcd338f50ad85d9fabf2c61405 Gerrit-Change-Number: 13048 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 08 Apr 2019 13:14:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 13:16:23 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 13:16:23 +0000 Subject: Change in osmo-bts[master]: oc2gbts_mgr_calib: don't use fsync() on *FILE pointer In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/13271 ) Change subject: oc2gbts_mgr_calib: don't use fsync() on *FILE pointer ...................................................................... oc2gbts_mgr_calib: don't use fsync() on *FILE pointer fsync() takes an integer file descriptor but we have a *FILE pointer here. Lets use fileno() first to convert the integer file descriptor to a FILE pointer. Change-Id: I46ffd8c680ba0b445cbbd133d5ce92b79e3d8d87 --- M src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved Harald Welte: Looks good to me, approved diff --git a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c index eac8ed1..33c0782 100644 --- a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c +++ b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c @@ -134,7 +134,7 @@ fclose(fp); return -EIO; } - fsync(fp); + fsync(fileno(fp)); fclose(fp); return 0; -- To view, visit https://gerrit.osmocom.org/13271 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I46ffd8c680ba0b445cbbd133d5ce92b79e3d8d87 Gerrit-Change-Number: 13271 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 13:16:39 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 13:16:39 +0000 Subject: Change in osmo-bts[master]: oc2gbts_mgr_calib: do not return NULL on integer function In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/13272 ) Change subject: oc2gbts_mgr_calib: do not return NULL on integer function ...................................................................... oc2gbts_mgr_calib: do not return NULL on integer function The functions oc2gbts_par_get_uptime() and oc2gbts_par_set_uptime() try to return with NULL, but both functions are declared as int. Lets return -EINVAL instead. Change-Id: I63b61be2940c59b221089d3d1501371b0116d89a --- M src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved Harald Welte: Looks good to me, approved diff --git a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c index 33c0782..3ddf0e8 100644 --- a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c +++ b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c @@ -87,7 +87,7 @@ fpath = talloc_asprintf(ctx, "%s", UPTIME_TMP_PATH); if (!fpath) - return NULL; + return -EINVAL; fp = fopen(fpath, "r"); if (!fp) @@ -117,7 +117,7 @@ fpath = talloc_asprintf(ctx, "%s", UPTIME_TMP_PATH); if (!fpath) - return NULL; + return -EINVAL; fp = fopen(fpath, "w"); if (!fp) -- To view, visit https://gerrit.osmocom.org/13272 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I63b61be2940c59b221089d3d1501371b0116d89a Gerrit-Change-Number: 13272 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 13:25:29 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 13:25:29 +0000 Subject: Change in osmo-hlr[master]: USSD: fix routing to multiple MSC In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13479 ) Change subject: USSD: fix routing to multiple MSC ...................................................................... Patch Set 7: (2 comments) https://gerrit.osmocom.org/#/c/13479/4/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13479/4/src/hlr_ussd.c at 255 PS4, Line 255: en(ss->vlr_number) + 1, ms > This must be [?] Patch to avoid this mistake with proper documentation for addr, addrlen: https://gerrit.osmocom.org/#/c/osmo-hlr/+/13549 https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c at 171 PS7, Line 171: vlr_number > What about static memory allocation? [?] I'm not sure if this is a good idea. I know that db.h has it defined that way. But we don't seem to enforce that as max size in the VTY config of OsmoMSC [1]. Follow up patch [2] will save the gsup->source_name as vlr_number, where we also don't enforce that size limit. So we might end up shortening two IPA names that are longer than 32 bytes and cause a collision. [1]: https://git.osmocom.org/osmo-msc/tree/src/libmsc/msc_vty.c?id=0f52319765e9834095c4774ef6a3b22825fa618c#n1622 [2]: https://gerrit.osmocom.org/#/c/osmo-hlr/+/13515/ -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 7 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 13:25:29 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 13:32:12 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 13:32:12 +0000 Subject: Change in osmo-hlr[master]: USSD: fix routing to multiple MSC In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13479 ) Change subject: USSD: fix routing to multiple MSC ...................................................................... Patch Set 7: (3 comments) in general the approach looks good https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c at 171 PS7, Line 171: vlr_number > What about static memory allocation? [?] In the current state I would agree, but I know where this is coming from. In the long run, the aim is to have a blob as VLR identification, a uint8_t* plus an arbitrary len. But I'm not entirely sure yet that we're approaching the blob plan in the right way. So, yes, in this patch alone, the most sensible thing would be a vlr_number[32] array, at least while hlr_subscriber also maintains a char[32] for it. https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c at 171 PS7, Line 171: vlr_number > I'm not sure if this is a good idea. I know that db.h has it defined that way. [?] [2] is wrong, will comment over there https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c at 244 PS7, Line 244: ss->vlr_number = talloc_strdup(ss, subscr.vlr_number); (maybe OSMO_ASSERT(ss->vlr_number) ) -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 7 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 13:32:12 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 13:35:46 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 13:35:46 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 7: (2 comments) https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c at 248 PS7, Line 248: ss->vlr_number_len = strlen(subscr.vlr_number) + 1; (I still don't like the +1 on the strlen, I think we may need to discuss the blob plan separately some time) https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c at 562 PS7, Line 562: if (gsup->source_name) { SS/USSD GSUP does not include the source_name. You wrote the routing code, remember? ;) Instead you need to get it from the osmo_gsup_conn if at all. I think you can completely skip this patch chunk. -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 7 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 13:35:46 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 13:46:47 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 13:46:47 +0000 Subject: Change in libosmocore[master]: add osmo_sockaddr_str API In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13123 ) Change subject: add osmo_sockaddr_str API ...................................................................... Patch Set 10: This change is ready for review. -- To view, visit https://gerrit.osmocom.org/13123 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63 Gerrit-Change-Number: 13123 Gerrit-PatchSet: 10 Gerrit-Owner: Neels Hofmeyr Gerrit-Assignee: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 13:46:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 13:47:02 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 13:47:02 +0000 Subject: Change in libosmocore[master]: add osmo_sockaddr_str API In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13123 ) Change subject: add osmo_sockaddr_str API ...................................................................... Patch Set 10: Code-Review+2 testing done, re-applying previous +2 -- To view, visit https://gerrit.osmocom.org/13123 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63 Gerrit-Change-Number: 13123 Gerrit-PatchSet: 10 Gerrit-Owner: Neels Hofmeyr Gerrit-Assignee: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 13:47:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 13:47:18 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 13:47:18 +0000 Subject: Change in libosmocore[master]: add osmo_sockaddr_str API In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13123 ) Change subject: add osmo_sockaddr_str API ...................................................................... add osmo_sockaddr_str API For handling RTP IP addresses and ports, osmo-mgw, osmo-bsc and osmo-msc so far have their own separate shims and code duplication around inet_ntoa(), htons(), sockaddr conversions etc. Unify and standardize with this common API. In the MGW endpoint FSM that was introduced in osmo-bsc and which I would like to re-use for osmo-msc (upcoming patch moving that to osmo-mgw), it has turned out that using char* IP address and uint16_t port number types are a convenient common denominator for logging, MGCP message composition and GSM48. Ongoing osmo-msc work also uses this for MNCC. This is of course potentially useful for any other IP+port combinations besides RTP stream handling. Needless to say that most current implementations will probably stay with their current own conversion code for a long time; for current osmo-{bsc,msc,mgw} work (MGW endpoint FSM) though, I would like to move to this API here. Change-Id: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63 --- M configure.ac M include/Makefile.am A include/osmocom/core/sockaddr_str.h M src/Makefile.am A src/sockaddr_str.c M tests/Makefile.am A tests/sockaddr_str/sockaddr_str_test.c A tests/sockaddr_str/sockaddr_str_test.ok M tests/testsuite.at 9 files changed, 1,008 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 4a00e69..d717a0b 100644 --- a/configure.ac +++ b/configure.ac @@ -57,7 +57,7 @@ dnl checks for header files AC_HEADER_STDC -AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h sys/timerfd.h syslog.h ctype.h netinet/tcp.h) +AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h sys/timerfd.h syslog.h ctype.h netinet/tcp.h netinet/in.h) # for src/conv.c AC_FUNC_ALLOCA AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DLOPEN="$LIBS";LIBS=""]) diff --git a/include/Makefile.am b/include/Makefile.am index 17f7d1c..6ed7fe6 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -52,6 +52,7 @@ osmocom/core/timer_compat.h \ osmocom/core/utils.h \ osmocom/core/write_queue.h \ + osmocom/core/sockaddr_str.h \ osmocom/crypt/auth.h \ osmocom/crypt/gprs_cipher.h \ osmocom/ctrl/control_cmd.h \ diff --git a/include/osmocom/core/sockaddr_str.h b/include/osmocom/core/sockaddr_str.h new file mode 100644 index 0000000..253b755 --- /dev/null +++ b/include/osmocom/core/sockaddr_str.h @@ -0,0 +1,87 @@ +/*! \file sockaddr_str.h + * Common API to store an IP address and port. + */ +/* + * (C) 2019 by sysmocom - s.f.m.c. GmbH + * + * Author: neels at hofmeyr.de + * + * All Rights Reserved + * + * SPDX-License-Identifier: GPL-2.0+ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#pragma once + +#include +#include +#include + +struct in_addr; +struct in6_addr; +struct sockaddr_storage; +struct sockaddr_in; +struct sockaddr_in6; + +/*! \defgroup sockaddr_str IP address/port utilities. + * @{ + * \file sockaddr_str.h + */ + +int osmo_ip_str_type(const char *ip); + +struct osmo_sockaddr_str { + /*! AF_INET for IPv4 address, or AF_INET6 for IPv6 address. */ + int af; + /*! NUL terminated string of the IPv4 or IPv6 address. */ + char ip[INET6_ADDRSTRLEN]; + /*! Port number */ + uint16_t port; +}; + +/*! Format string to print an osmo_sockaddr_str. + * + * For example: + * + * struct osmo_sockaddr_str *my_sockaddr_str = ...; + * printf("got " OSMO_SOCKADDR_STR_FMT "\n", OSMO_SOCKADDR_STR_FMT_ARGS(my_sockaddr_str)); + */ +#define OSMO_SOCKADDR_STR_FMT "%s:%u" +#define OSMO_SOCKADDR_STR_FMT_ARGS(R) ((R)->ip ? : ""), (R)->port + +bool osmo_sockaddr_str_is_set(const struct osmo_sockaddr_str *sockaddr_str); + +int osmo_sockaddr_str_from_str(struct osmo_sockaddr_str *sockaddr_str, const char *ip, uint16_t port); + +int osmo_sockaddr_str_from_in_addr(struct osmo_sockaddr_str *sockaddr_str, const struct in_addr *addr, uint16_t port); +int osmo_sockaddr_str_from_in6_addr(struct osmo_sockaddr_str *sockaddr_str, const struct in6_addr *addr, uint16_t port); +int osmo_sockaddr_str_from_32(struct osmo_sockaddr_str *sockaddr_str, uint32_t ip, uint16_t port); +int osmo_sockaddr_str_from_32n(struct osmo_sockaddr_str *sockaddr_str, uint32_t ip, uint16_t port); +int osmo_sockaddr_str_from_sockaddr_in(struct osmo_sockaddr_str *sockaddr_str, const struct sockaddr_in *src); +int osmo_sockaddr_str_from_sockaddr_in6(struct osmo_sockaddr_str *sockaddr_str, const struct sockaddr_in6 *src); +int osmo_sockaddr_str_from_sockaddr(struct osmo_sockaddr_str *sockaddr_str, const struct sockaddr_storage *src); + +int osmo_sockaddr_str_to_in_addr(const struct osmo_sockaddr_str *sockaddr_str, struct in_addr *dst); +int osmo_sockaddr_str_to_in6_addr(const struct osmo_sockaddr_str *sockaddr_str, struct in6_addr *dst); +int osmo_sockaddr_str_to_32(const struct osmo_sockaddr_str *sockaddr_str, uint32_t *ip); +int osmo_sockaddr_str_to_32n(const struct osmo_sockaddr_str *sockaddr_str, uint32_t *ip); +int osmo_sockaddr_str_to_sockaddr_in(const struct osmo_sockaddr_str *sockaddr_str, struct sockaddr_in *dst); +int osmo_sockaddr_str_to_sockaddr_in6(const struct osmo_sockaddr_str *sockaddr_str, struct sockaddr_in6 *dst); +int osmo_sockaddr_str_to_sockaddr(const struct osmo_sockaddr_str *sockaddr_str, struct sockaddr_storage *dst); + +/*! @} */ diff --git a/src/Makefile.am b/src/Makefile.am index 27ab702..1fae8b0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,7 +24,9 @@ macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ conv_acc.c conv_acc_generic.c sercomm.c prbs.c \ isdnhdlc.c \ - tdef.c + tdef.c \ + sockaddr_str.c \ + $(NULL) if HAVE_SSSE3 libosmocore_la_SOURCES += conv_acc_sse.c diff --git a/src/sockaddr_str.c b/src/sockaddr_str.c new file mode 100644 index 0000000..c9d9a94 --- /dev/null +++ b/src/sockaddr_str.c @@ -0,0 +1,378 @@ +/*! \file sockaddr_str.c + * Common implementation to store an IP address and port. + */ +/* + * (C) 2019 by sysmocom - s.f.m.c. GmbH + * + * Author: neels at hofmeyr.de + * + * All Rights Reserved + * + * SPDX-License-Identifier: GPL-2.0+ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include "config.h" + +#ifdef HAVE_NETINET_IN_H +#include +#include +#include +#include + +#include +#include +#include + +/*! \addtogroup sockaddr_str + * + * Common operations to store IP address as a char string along with a uint16_t port number. + * + * Convert IP address string to/from in_addr and in6_addr, with bounds checking and basic housekeeping. + * + * The initial purpose is to store and translate IP address info between GSM CC and MGCP protocols -- GSM mostly using + * 32-bit IPv4 addresses, and MGCP forwarding addresses as ASCII character strings. + * + * (At the time of writing, there are no immediate IPv6 users that come to mind, but it seemed appropriate to + * accommodate both address families from the start.) + * + * @{ + * \file sockaddr_str.c + */ + +/*! Return true if all elements of the osmo_sockaddr_str instance are set. + * \param[in] sockaddr_str The instance to examine. + * \return True iff ip is nonempty, port is not 0 and af is set to either AF_INET or AF_INET6. + */ +bool osmo_sockaddr_str_is_set(const struct osmo_sockaddr_str *sockaddr_str) +{ + return *sockaddr_str->ip + && sockaddr_str->port + && (sockaddr_str->af == AF_INET || sockaddr_str->af == AF_INET6); +} + +/*! Distinguish between valid IPv4 and IPv6 strings. + * This does not verify whether the string is a valid IP address; it assumes that the input is a valid IP address, and + * on that premise returns whether it is an IPv4 or IPv6 string, by looking for '.' and ':' characters. It is safe to + * feed invalid address strings, but the return value is only guaranteed to be meaningful if the input was valid. + * \param[in] ip Valid IP address string. + * \return AF_INET or AF_INET6, or AF_UNSPEC if neither '.' nor ':' are found in the string. + */ +int osmo_ip_str_type(const char *ip) +{ + if (!ip) + return AF_UNSPEC; + /* Could also be IPv4-mapped IPv6 format with both colons and dots: x:x:x:x:x:x:d.d.d.d */ + if (strchr(ip, ':')) + return AF_INET6; + if (strchr(ip, '.')) + return AF_INET; + return AF_UNSPEC; +} + +/*! Safely copy the given ip string to sockaddr_str, classify to AF_INET or AF_INET6, and set the port. + * Data will be written to sockaddr_str even if an error is returned. + * \param[out] sockaddr_str The instance to copy to. + * \param[in] ip Valid IP address string. + * \param[in] port Port number. + * \return 0 on success, negative if copying the address string failed (e.g. too long), if the address family could + * not be detected (i.e. if osmo_ip_str_type() returned AF_UNSPEC), or if sockaddr_str is NULL. + */ +int osmo_sockaddr_str_from_str(struct osmo_sockaddr_str *sockaddr_str, const char *ip, uint16_t port) +{ + int rc; + if (!sockaddr_str) + return -ENOSPC; + if (!ip) + ip = ""; + *sockaddr_str = (struct osmo_sockaddr_str){ + .af = osmo_ip_str_type(ip), + .port = port, + }; + rc = osmo_strlcpy(sockaddr_str->ip, ip, sizeof(sockaddr_str->ip)); + if (rc <= 0) + return -EIO; + if (rc >= sizeof(sockaddr_str->ip)) + return -ENOSPC; + if (sockaddr_str->af == AF_UNSPEC) + return -EINVAL; + return 0; +} + +/*! Convert IPv4 address to osmo_sockaddr_str, and set port. + * \param[out] sockaddr_str The instance to copy to. + * \param[in] addr IPv4 address data. + * \param[in] port Port number. + * \return 0 on success, negative on error. + */ +int osmo_sockaddr_str_from_in_addr(struct osmo_sockaddr_str *sockaddr_str, const struct in_addr *addr, uint16_t port) +{ + if (!sockaddr_str) + return -ENOSPC; + *sockaddr_str = (struct osmo_sockaddr_str){ + .af = AF_INET, + .port = port, + }; + if (!inet_ntop(AF_INET, addr, sockaddr_str->ip, sizeof(sockaddr_str->ip))) + return -ENOSPC; + return 0; +} + +/*! Convert IPv6 address to osmo_sockaddr_str, and set port. + * \param[out] sockaddr_str The instance to copy to. + * \param[in] addr IPv6 address data. + * \param[in] port Port number. + * \return 0 on success, negative on error. + */ +int osmo_sockaddr_str_from_in6_addr(struct osmo_sockaddr_str *sockaddr_str, const struct in6_addr *addr, uint16_t port) +{ + if (!sockaddr_str) + return -ENOSPC; + *sockaddr_str = (struct osmo_sockaddr_str){ + .af = AF_INET6, + .port = port, + }; + if (!inet_ntop(AF_INET6, addr, sockaddr_str->ip, sizeof(sockaddr_str->ip))) + return -ENOSPC; + return 0; +} + +/*! Convert IPv4 address from 32bit host-byte-order to osmo_sockaddr_str, and set port. + * \param[out] sockaddr_str The instance to copy to. + * \param[in] addr 32bit IPv4 address data. + * \param[in] port Port number. + * \return 0 on success, negative on error. + */ +int osmo_sockaddr_str_from_32(struct osmo_sockaddr_str *sockaddr_str, uint32_t ip, uint16_t port) +{ + struct in_addr addr; + if (!sockaddr_str) + return -ENOSPC; + addr.s_addr = ip; + return osmo_sockaddr_str_from_in_addr(sockaddr_str, &addr, port); +} + +/*! Convert IPv4 address from 32bit network-byte-order to osmo_sockaddr_str, and set port. + * \param[out] sockaddr_str The instance to copy to. + * \param[in] addr 32bit IPv4 address data. + * \param[in] port Port number. + * \return 0 on success, negative on error. + */ +int osmo_sockaddr_str_from_32n(struct osmo_sockaddr_str *sockaddr_str, uint32_t ip, uint16_t port) +{ + if (!sockaddr_str) + return -ENOSPC; + return osmo_sockaddr_str_from_32(sockaddr_str, osmo_ntohl(ip), port); +} + +/*! Convert IPv4 address and port to osmo_sockaddr_str. + * \param[out] sockaddr_str The instance to copy to. + * \param[in] src IPv4 address and port data. + * \return 0 on success, negative on error. + */ +int osmo_sockaddr_str_from_sockaddr_in(struct osmo_sockaddr_str *sockaddr_str, const struct sockaddr_in *src) +{ + if (!sockaddr_str) + return -ENOSPC; + if (!src) + return -EINVAL; + if (src->sin_family != AF_INET) + return -EINVAL; + return osmo_sockaddr_str_from_in_addr(sockaddr_str, &src->sin_addr, osmo_ntohs(src->sin_port)); +} + +/*! Convert IPv6 address and port to osmo_sockaddr_str. + * \param[out] sockaddr_str The instance to copy to. + * \param[in] src IPv6 address and port data. + * \return 0 on success, negative on error. + */ +int osmo_sockaddr_str_from_sockaddr_in6(struct osmo_sockaddr_str *sockaddr_str, const struct sockaddr_in6 *src) +{ + if (!sockaddr_str) + return -ENOSPC; + if (!src) + return -EINVAL; + if (src->sin6_family != AF_INET6) + return -EINVAL; + return osmo_sockaddr_str_from_in6_addr(sockaddr_str, &src->sin6_addr, osmo_ntohs(src->sin6_port)); +} + +/*! Convert IPv4 or IPv6 address and port to osmo_sockaddr_str. + * \param[out] sockaddr_str The instance to copy to. + * \param[in] src IPv4 or IPv6 address and port data. + * \return 0 on success, negative if src does not indicate AF_INET nor AF_INET6 (or if the conversion fails, which + * should not be possible in practice). + */ +int osmo_sockaddr_str_from_sockaddr(struct osmo_sockaddr_str *sockaddr_str, const struct sockaddr_storage *src) +{ + const struct sockaddr_in *sin = (void*)src; + const struct sockaddr_in6 *sin6 = (void*)src; + if (!sockaddr_str) + return -ENOSPC; + if (!src) + return -EINVAL; + if (sin->sin_family == AF_INET) + return osmo_sockaddr_str_from_sockaddr_in(sockaddr_str, sin); + if (sin6->sin6_family == AF_INET6) + return osmo_sockaddr_str_from_sockaddr_in6(sockaddr_str, sin6); + return -EINVAL; +} + +/*! Convert osmo_sockaddr_str address string to IPv4 address data. + * \param[in] sockaddr_str The instance to convert the IP of. + * \param[out] dst IPv4 address data to write to. + * \return 0 on success, negative on error (e.g. invalid IPv4 address string). + */ +int osmo_sockaddr_str_to_in_addr(const struct osmo_sockaddr_str *sockaddr_str, struct in_addr *dst) +{ + int rc; + if (!sockaddr_str) + return -EINVAL; + if (!dst) + return -ENOSPC; + if (sockaddr_str->af != AF_INET) + return -EAFNOSUPPORT; + rc = inet_pton(AF_INET, sockaddr_str->ip, dst); + if (rc != 1) + return -EINVAL; + return 0; +} + +/*! Convert osmo_sockaddr_str address string to IPv6 address data. + * \param[in] sockaddr_str The instance to convert the IP of. + * \param[out] dst IPv6 address data to write to. + * \return 0 on success, negative on error (e.g. invalid IPv6 address string). + */ +int osmo_sockaddr_str_to_in6_addr(const struct osmo_sockaddr_str *sockaddr_str, struct in6_addr *dst) +{ + int rc; + if (!sockaddr_str) + return -EINVAL; + if (!dst) + return -ENOSPC; + if (sockaddr_str->af != AF_INET6) + return -EINVAL; + rc = inet_pton(AF_INET6, sockaddr_str->ip, dst); + if (rc != 1) + return -EINVAL; + return 0; +} + +/*! Convert osmo_sockaddr_str address string to IPv4 address data in host-byte-order. + * \param[in] sockaddr_str The instance to convert the IP of. + * \param[out] dst IPv4 address data in 32bit host-byte-order format to write to. + * \return 0 on success, negative on error (e.g. invalid IPv4 address string). + */ +int osmo_sockaddr_str_to_32(const struct osmo_sockaddr_str *sockaddr_str, uint32_t *ip) +{ + int rc; + struct in_addr addr; + if (!sockaddr_str) + return -EINVAL; + if (!ip) + return -ENOSPC; + rc = osmo_sockaddr_str_to_in_addr(sockaddr_str, &addr); + if (rc) + return rc; + *ip = addr.s_addr; + return 0; +} + +/*! Convert osmo_sockaddr_str address string to IPv4 address data in network-byte-order. + * \param[in] sockaddr_str The instance to convert the IP of. + * \param[out] dst IPv4 address data in 32bit network-byte-order format to write to. + * \return 0 on success, negative on error (e.g. invalid IPv4 address string). + */ +int osmo_sockaddr_str_to_32n(const struct osmo_sockaddr_str *sockaddr_str, uint32_t *ip) +{ + int rc; + uint32_t ip_h; + if (!sockaddr_str) + return -EINVAL; + if (!ip) + return -ENOSPC; + rc = osmo_sockaddr_str_to_32(sockaddr_str, &ip_h); + if (rc) + return rc; + *ip = osmo_htonl(ip_h); + return 0; +} + +/*! Convert osmo_sockaddr_str address string and port to IPv4 address and port data. + * \param[in] sockaddr_str The instance to convert the IP and port of. + * \param[out] dst IPv4 address and port data to write to. + * \return 0 on success, negative on error (e.g. invalid IPv4 address string). + */ +int osmo_sockaddr_str_to_sockaddr_in(const struct osmo_sockaddr_str *sockaddr_str, struct sockaddr_in *dst) +{ + if (!sockaddr_str) + return -EINVAL; + if (!dst) + return -ENOSPC; + if (sockaddr_str->af != AF_INET) + return -EINVAL; + *dst = (struct sockaddr_in){ + .sin_family = sockaddr_str->af, + .sin_port = osmo_htons(sockaddr_str->port), + }; + return osmo_sockaddr_str_to_in_addr(sockaddr_str, &dst->sin_addr); +} + +/*! Convert osmo_sockaddr_str address string and port to IPv6 address and port data. + * \param[in] sockaddr_str The instance to convert the IP and port of. + * \param[out] dst IPv6 address and port data to write to. + * \return 0 on success, negative on error (e.g. invalid IPv6 address string). + */ +int osmo_sockaddr_str_to_sockaddr_in6(const struct osmo_sockaddr_str *sockaddr_str, struct sockaddr_in6 *dst) +{ + if (!sockaddr_str) + return -EINVAL; + if (!dst) + return -ENOSPC; + if (sockaddr_str->af != AF_INET6) + return -EINVAL; + *dst = (struct sockaddr_in6){ + .sin6_family = sockaddr_str->af, + .sin6_port = osmo_htons(sockaddr_str->port), + }; + return osmo_sockaddr_str_to_in6_addr(sockaddr_str, &dst->sin6_addr); +} + +/*! Convert osmo_sockaddr_str address string and port to IPv4 or IPv6 address and port data. + * Depending on sockaddr_str->af, dst will be handled as struct sockaddr_in or struct sockaddr_in6. + * \param[in] sockaddr_str The instance to convert the IP and port of. + * \param[out] dst IPv4/IPv6 address and port data to write to. + * \return 0 on success, negative on error (e.g. invalid IP address string for the family indicated by sockaddr_str->af). + */ +int osmo_sockaddr_str_to_sockaddr(const struct osmo_sockaddr_str *sockaddr_str, struct sockaddr_storage *dst) +{ + if (!sockaddr_str) + return -EINVAL; + if (!dst) + return -ENOSPC; + switch (sockaddr_str->af) { + case AF_INET: + return osmo_sockaddr_str_to_sockaddr_in(sockaddr_str, (void*)dst); + case AF_INET6: + return osmo_sockaddr_str_to_sockaddr_in6(sockaddr_str, (void*)dst); + default: + return -EINVAL; + } +} + +/*! @} */ +#endif // HAVE_NETINET_IN_H diff --git a/tests/Makefile.am b/tests/Makefile.am index ab3728f..88bcd7e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,6 +30,7 @@ tdef/tdef_test tdef/tdef_vty_test_config_root \ tdef/tdef_vty_test_config_subnode \ tdef/tdef_vty_test_dynamic \ + sockaddr_str/sockaddr_str_test \ $(NULL) if ENABLE_MSGFILE @@ -236,6 +237,9 @@ tdef_tdef_vty_test_dynamic_SOURCES = tdef/tdef_vty_test_dynamic.c tdef_tdef_vty_test_dynamic_LDADD = $(LDADD) $(top_builddir)/src/vty/libosmovty.la +sockaddr_str_sockaddr_str_test_SOURCES = sockaddr_str/sockaddr_str_test.c +sockaddr_str_sockaddr_str_test_LDADD = $(LDADD) + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -304,6 +308,7 @@ tdef/tdef_vty_test_config_root.vty \ tdef/tdef_vty_test_config_subnode.vty \ tdef/tdef_vty_test_dynamic.vty \ + sockaddr_str/sockaddr_str_test.ok \ $(NULL) DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c diff --git a/tests/sockaddr_str/sockaddr_str_test.c b/tests/sockaddr_str/sockaddr_str_test.c new file mode 100644 index 0000000..d2e7944 --- /dev/null +++ b/tests/sockaddr_str/sockaddr_str_test.c @@ -0,0 +1,239 @@ +/* tests for osmo_sockaddr_str API of libmsomcore */ +/* + * (C) 2019 by sysmocom - s.f.m.c. GmbH + * + * Author: neels at hofmeyr.de + * + * All Rights Reserved + * + * SPDX-License-Identifier: GPL-2.0+ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include +#include +#include + +struct osmo_sockaddr_str oip_data[] = { + { .af = AF_INET, .ip = "1.2.3.4", .port = 5 }, + { .af = AF_INET, .ip = "0.0.0.0", .port = 0 }, + { .af = AF_INET, .ip = "255.255.255.255", .port = 65535 }, + { .af = AF_INET, .ip = "0.0.0.256", .port = 1 }, + { .af = AF_INET, .ip = "not an ip address", .port = 1 }, + { .af = AF_INET6, .ip = "1:2:3::4", .port = 5 }, + { .af = AF_INET6, .ip = "::", .port = 0 }, + { .af = AF_INET6, .ip = "::1", .port = 0 }, + { .af = AF_INET6, .ip = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", .port = 65535 }, + { .af = AF_INET6, .ip = "FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF", .port = 65535 }, + { .af = AF_INET6, .ip = "::fffff", .port = 1 }, + { .af = AF_INET6, .ip = "not an ip address", .port = 1 }, + + { .af = AF_INET6, .ip = "1.2.3.4", .port = 5 }, + { .af = AF_INET, .ip = "1:2:3::4", .port = 5 }, + { .af = AF_UNSPEC, .ip = "1.2.3.4", .port = 5 }, + { .af = AF_INET, .ip = "", .port = 5 }, + { .af = AF_INET6, .ip = "", .port = 5 }, + { .af = AF_INET, .ip = "1.2.3.4", .port = 0 }, + { .af = AF_INET, .ip = "1.2.3:4:5", .port = 0 }, + { .af = AF_INET6, .ip = "::1:10.9.8.7", .port = 1 }, +}; + +const char *af_name(int af) +{ + switch (af) { + case AF_INET: + return "AF_INET"; + case AF_INET6: + return "AF_INET6"; + case AF_UNSPEC: + return "AF_UNSPEC"; + default: + return "?"; + } +} + +static const struct value_string err_names[] = { + { -EINVAL, "-EINVAL" }, + {} +}; + +static inline const char *err_name(int err) +{ return get_value_string(err_names, err); } + +static inline const char *rc_name(int rc) +{ + if (!rc) + return "rc == 0"; + if (rc < 0) + return "rc < 0"; + return "rc > 0"; +} + +void dump_oip(const struct osmo_sockaddr_str *oip) +{ + printf("{ .af = %s, .ip = %s, .port = %u }\n", af_name(oip->af), osmo_quote_str(oip->ip, -1), oip->port); +} + +void sockaddr_str_test_conversions() +{ + int i; + char buf[1024]; + +#define hexdump(what) \ + osmo_hexdump_buf(buf, sizeof(buf), (void*)(&what), sizeof(what), "", false) + + for (i = 0; i < ARRAY_SIZE(oip_data); i++) { + struct osmo_sockaddr_str *x = &oip_data[i]; + int rc; + printf("\n\n"); + dump_oip(x); + + printf(" osmo_sockaddr_str_is_set() = %s\n", osmo_sockaddr_str_is_set(x) ? "true" : "false"); + + { + struct in_addr a = {}; + + rc = osmo_sockaddr_str_to_in_addr(x, &a); + printf(" osmo_sockaddr_str_to_in_addr() %s in_addr=%s\n", rc_name(rc), hexdump(a)); + + if (rc == 0) { + struct osmo_sockaddr_str back; + rc = osmo_sockaddr_str_from_in_addr(&back, &a, x->port); + printf(" -> osmo_sockaddr_str_from_in_addr() %s ", rc_name(rc)); + dump_oip(&back); + if (memcmp(x, &back, sizeof(back))) + printf(" DIFFERS!\n"); + } + } + + { + struct in6_addr a = {}; + + rc = osmo_sockaddr_str_to_in6_addr(x, &a); + printf(" osmo_sockaddr_str_to_in6_addr() %s in6_addr=%s\n", rc_name(rc), hexdump(a)); + + if (rc == 0) { + struct osmo_sockaddr_str back; + rc = osmo_sockaddr_str_from_in6_addr(&back, &a, x->port); + printf(" -> osmo_sockaddr_str_from_in6_addr() %s ", rc_name(rc)); + dump_oip(&back); + if (memcmp(x, &back, sizeof(back))) + printf(" DIFFERS!\n"); + } + } + + { + uint32_t a = 0; + + rc = osmo_sockaddr_str_to_32(x, &a); + printf(" osmo_sockaddr_str_to_32() %s uint32_t=0x%x\n", rc_name(rc), a); + + if (rc == 0) { + struct osmo_sockaddr_str back; + rc = osmo_sockaddr_str_from_32(&back, a, x->port); + printf(" -> osmo_sockaddr_str_from_32() %s ", rc_name(rc)); + dump_oip(&back); + if (memcmp(x, &back, sizeof(back))) + printf(" DIFFERS!\n"); + } + } + + { + uint32_t a = 0; + + rc = osmo_sockaddr_str_to_32n(x, &a); + printf(" osmo_sockaddr_str_to_32n() %s uint32_t=0x%x\n", rc_name(rc), a); + + if (rc == 0) { + struct osmo_sockaddr_str back; + rc = osmo_sockaddr_str_from_32n(&back, a, x->port); + printf(" -> osmo_sockaddr_str_from_32n() %s ", rc_name(rc)); + dump_oip(&back); + if (memcmp(x, &back, sizeof(back))) + printf(" DIFFERS!\n"); + } + } + + { + struct sockaddr_in a = {}; + + rc = osmo_sockaddr_str_to_sockaddr_in(x, &a); + printf(" osmo_sockaddr_str_to_sockaddr_in() %s sockaddr_in=%s\n", rc_name(rc), hexdump(a)); + + if (rc == 0) { + struct osmo_sockaddr_str back; + rc = osmo_sockaddr_str_from_sockaddr_in(&back, &a); + printf(" -> osmo_sockaddr_str_from_sockaddr_in() %s ", rc_name(rc)); + dump_oip(&back); + if (memcmp(x, &back, sizeof(back))) + printf(" DIFFERS!\n"); + } + } + + { + struct sockaddr_in6 a = {}; + + rc = osmo_sockaddr_str_to_sockaddr_in6(x, &a); + printf(" osmo_sockaddr_str_to_sockaddr_in6() %s sockaddr_in6=%s\n", rc_name(rc), hexdump(a)); + + if (rc == 0) { + struct osmo_sockaddr_str back; + rc = osmo_sockaddr_str_from_sockaddr_in6(&back, &a); + printf(" -> osmo_sockaddr_str_from_sockaddr_in6() %s ", rc_name(rc)); + dump_oip(&back); + if (memcmp(x, &back, sizeof(back))) + printf(" DIFFERS!\n"); + } + } + + { + struct sockaddr_storage a = {}; + + rc = osmo_sockaddr_str_to_sockaddr(x, &a); + printf(" osmo_sockaddr_str_to_sockaddr() %s sockaddr_storage=%s\n", rc_name(rc), hexdump(a)); + + if (rc == 0) { + struct osmo_sockaddr_str back; + rc = osmo_sockaddr_str_from_sockaddr(&back, &a); + printf(" -> osmo_sockaddr_str_from_sockaddr() %s ", rc_name(rc)); + dump_oip(&back); + if (memcmp(x, &back, sizeof(back))) + printf(" DIFFERS!\n"); + } + } + + { + struct osmo_sockaddr_str from_str; + rc = osmo_sockaddr_str_from_str(&from_str, x->ip, x->port); + printf(" osmo_sockaddr_str_from_str() %s ", rc_name(rc)); + dump_oip(&from_str); + if (rc == 0 && memcmp(x, &from_str, sizeof(from_str))) + printf(" DIFFERS!\n"); + } + } + +} + +int main(int argc, char **argv) +{ + sockaddr_str_test_conversions(); + return 0; +} + diff --git a/tests/sockaddr_str/sockaddr_str_test.ok b/tests/sockaddr_str/sockaddr_str_test.ok new file mode 100644 index 0000000..d69314d --- /dev/null +++ b/tests/sockaddr_str/sockaddr_str_test.ok @@ -0,0 +1,288 @@ + + +{ .af = AF_INET, .ip = "1.2.3.4", .port = 5 } + osmo_sockaddr_str_is_set() = true + osmo_sockaddr_str_to_in_addr() rc == 0 in_addr=01020304 + -> osmo_sockaddr_str_from_in_addr() rc == 0 { .af = AF_INET, .ip = "1.2.3.4", .port = 5 } + osmo_sockaddr_str_to_in6_addr() rc < 0 in6_addr=00000000000000000000000000000000 + osmo_sockaddr_str_to_32() rc == 0 uint32_t=0x4030201 + -> osmo_sockaddr_str_from_32() rc == 0 { .af = AF_INET, .ip = "1.2.3.4", .port = 5 } + osmo_sockaddr_str_to_32n() rc == 0 uint32_t=0x1020304 + -> osmo_sockaddr_str_from_32n() rc == 0 { .af = AF_INET, .ip = "1.2.3.4", .port = 5 } + osmo_sockaddr_str_to_sockaddr_in() rc == 0 sockaddr_in=02000005010203040000000000000000 + -> osmo_sockaddr_str_from_sockaddr_in() rc == 0 { .af = AF_INET, .ip = "1.2.3.4", .port = 5 } + osmo_sockaddr_str_to_sockaddr_in6() rc < 0 sockaddr_in6=00000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr() rc == 0 sockaddr_storage=0200000501020304000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + -> osmo_sockaddr_str_from_sockaddr() rc == 0 { .af = AF_INET, .ip = "1.2.3.4", .port = 5 } + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET, .ip = "1.2.3.4", .port = 5 } + + +{ .af = AF_INET, .ip = "0.0.0.0", .port = 0 } + osmo_sockaddr_str_is_set() = false + osmo_sockaddr_str_to_in_addr() rc == 0 in_addr=00000000 + -> osmo_sockaddr_str_from_in_addr() rc == 0 { .af = AF_INET, .ip = "0.0.0.0", .port = 0 } + osmo_sockaddr_str_to_in6_addr() rc < 0 in6_addr=00000000000000000000000000000000 + osmo_sockaddr_str_to_32() rc == 0 uint32_t=0x0 + -> osmo_sockaddr_str_from_32() rc == 0 { .af = AF_INET, .ip = "0.0.0.0", .port = 0 } + osmo_sockaddr_str_to_32n() rc == 0 uint32_t=0x0 + -> osmo_sockaddr_str_from_32n() rc == 0 { .af = AF_INET, .ip = "0.0.0.0", .port = 0 } + osmo_sockaddr_str_to_sockaddr_in() rc == 0 sockaddr_in=02000000000000000000000000000000 + -> osmo_sockaddr_str_from_sockaddr_in() rc == 0 { .af = AF_INET, .ip = "0.0.0.0", .port = 0 } + osmo_sockaddr_str_to_sockaddr_in6() rc < 0 sockaddr_in6=00000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr() rc == 0 sockaddr_storage=0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + -> osmo_sockaddr_str_from_sockaddr() rc == 0 { .af = AF_INET, .ip = "0.0.0.0", .port = 0 } + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET, .ip = "0.0.0.0", .port = 0 } + + +{ .af = AF_INET, .ip = "255.255.255.255", .port = 65535 } + osmo_sockaddr_str_is_set() = true + osmo_sockaddr_str_to_in_addr() rc == 0 in_addr=ffffffff + -> osmo_sockaddr_str_from_in_addr() rc == 0 { .af = AF_INET, .ip = "255.255.255.255", .port = 65535 } + osmo_sockaddr_str_to_in6_addr() rc < 0 in6_addr=00000000000000000000000000000000 + osmo_sockaddr_str_to_32() rc == 0 uint32_t=0xffffffff + -> osmo_sockaddr_str_from_32() rc == 0 { .af = AF_INET, .ip = "255.255.255.255", .port = 65535 } + osmo_sockaddr_str_to_32n() rc == 0 uint32_t=0xffffffff + -> osmo_sockaddr_str_from_32n() rc == 0 { .af = AF_INET, .ip = "255.255.255.255", .port = 65535 } + osmo_sockaddr_str_to_sockaddr_in() rc == 0 sockaddr_in=0200ffffffffffff0000000000000000 + -> osmo_sockaddr_str_from_sockaddr_in() rc == 0 { .af = AF_INET, .ip = "255.255.255.255", .port = 65535 } + osmo_sockaddr_str_to_sockaddr_in6() rc < 0 sockaddr_in6=00000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr() rc == 0 sockaddr_storage=0200ffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + -> osmo_sockaddr_str_from_sockaddr() rc == 0 { .af = AF_INET, .ip = "255.255.255.255", .port = 65535 } + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET, .ip = "255.255.255.255", .port = 65535 } + + +{ .af = AF_INET, .ip = "0.0.0.256", .port = 1 } + osmo_sockaddr_str_is_set() = true + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc < 0 in6_addr=00000000000000000000000000000000 + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=02000001000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc < 0 sockaddr_in6=00000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr() rc < 0 sockaddr_storage=0200000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET, .ip = "0.0.0.256", .port = 1 } + + +{ .af = AF_INET, .ip = "not an ip address", .port = 1 } + osmo_sockaddr_str_is_set() = true + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc < 0 in6_addr=00000000000000000000000000000000 + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=02000001000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc < 0 sockaddr_in6=00000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr() rc < 0 sockaddr_storage=0200000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_from_str() rc < 0 { .af = AF_UNSPEC, .ip = "not an ip address", .port = 1 } + + +{ .af = AF_INET6, .ip = "1:2:3::4", .port = 5 } + osmo_sockaddr_str_is_set() = true + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc == 0 in6_addr=00010002000300000000000000000004 + -> osmo_sockaddr_str_from_in6_addr() rc == 0 { .af = AF_INET6, .ip = "1:2:3::4", .port = 5 } + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=00000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc == 0 sockaddr_in6=0a000005000000000001000200030000000000000000000400000000 + -> osmo_sockaddr_str_from_sockaddr_in6() rc == 0 { .af = AF_INET6, .ip = "1:2:3::4", .port = 5 } + osmo_sockaddr_str_to_sockaddr() rc == 0 sockaddr_storage=0a00000500000000000100020003000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + -> osmo_sockaddr_str_from_sockaddr() rc == 0 { .af = AF_INET6, .ip = "1:2:3::4", .port = 5 } + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET6, .ip = "1:2:3::4", .port = 5 } + + +{ .af = AF_INET6, .ip = "::", .port = 0 } + osmo_sockaddr_str_is_set() = false + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc == 0 in6_addr=00000000000000000000000000000000 + -> osmo_sockaddr_str_from_in6_addr() rc == 0 { .af = AF_INET6, .ip = "::", .port = 0 } + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=00000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc == 0 sockaddr_in6=0a000000000000000000000000000000000000000000000000000000 + -> osmo_sockaddr_str_from_sockaddr_in6() rc == 0 { .af = AF_INET6, .ip = "::", .port = 0 } + osmo_sockaddr_str_to_sockaddr() rc == 0 sockaddr_storage=0a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + -> osmo_sockaddr_str_from_sockaddr() rc == 0 { .af = AF_INET6, .ip = "::", .port = 0 } + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET6, .ip = "::", .port = 0 } + + +{ .af = AF_INET6, .ip = "::1", .port = 0 } + osmo_sockaddr_str_is_set() = false + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc == 0 in6_addr=00000000000000000000000000000001 + -> osmo_sockaddr_str_from_in6_addr() rc == 0 { .af = AF_INET6, .ip = "::1", .port = 0 } + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=00000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc == 0 sockaddr_in6=0a000000000000000000000000000000000000000000000100000000 + -> osmo_sockaddr_str_from_sockaddr_in6() rc == 0 { .af = AF_INET6, .ip = "::1", .port = 0 } + osmo_sockaddr_str_to_sockaddr() rc == 0 sockaddr_storage=0a00000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + -> osmo_sockaddr_str_from_sockaddr() rc == 0 { .af = AF_INET6, .ip = "::1", .port = 0 } + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET6, .ip = "::1", .port = 0 } + + +{ .af = AF_INET6, .ip = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", .port = 65535 } + osmo_sockaddr_str_is_set() = true + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc == 0 in6_addr=ffffffffffffffffffffffffffffffff + -> osmo_sockaddr_str_from_in6_addr() rc == 0 { .af = AF_INET6, .ip = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", .port = 65535 } + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=00000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc == 0 sockaddr_in6=0a00ffff00000000ffffffffffffffffffffffffffffffff00000000 + -> osmo_sockaddr_str_from_sockaddr_in6() rc == 0 { .af = AF_INET6, .ip = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", .port = 65535 } + osmo_sockaddr_str_to_sockaddr() rc == 0 sockaddr_storage=0a00ffff00000000ffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + -> osmo_sockaddr_str_from_sockaddr() rc == 0 { .af = AF_INET6, .ip = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", .port = 65535 } + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET6, .ip = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", .port = 65535 } + + +{ .af = AF_INET6, .ip = "FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF", .port = 65535 } + osmo_sockaddr_str_is_set() = true + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc == 0 in6_addr=ffffffffffffffffffffffffffffffff + -> osmo_sockaddr_str_from_in6_addr() rc == 0 { .af = AF_INET6, .ip = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", .port = 65535 } + DIFFERS! + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=00000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc == 0 sockaddr_in6=0a00ffff00000000ffffffffffffffffffffffffffffffff00000000 + -> osmo_sockaddr_str_from_sockaddr_in6() rc == 0 { .af = AF_INET6, .ip = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", .port = 65535 } + DIFFERS! + osmo_sockaddr_str_to_sockaddr() rc == 0 sockaddr_storage=0a00ffff00000000ffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + -> osmo_sockaddr_str_from_sockaddr() rc == 0 { .af = AF_INET6, .ip = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", .port = 65535 } + DIFFERS! + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET6, .ip = "FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF", .port = 65535 } + + +{ .af = AF_INET6, .ip = "::fffff", .port = 1 } + osmo_sockaddr_str_is_set() = true + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc < 0 in6_addr=00000000000000000000000000000000 + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=00000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc < 0 sockaddr_in6=0a000001000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr() rc < 0 sockaddr_storage=0a00000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET6, .ip = "::fffff", .port = 1 } + + +{ .af = AF_INET6, .ip = "not an ip address", .port = 1 } + osmo_sockaddr_str_is_set() = true + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc < 0 in6_addr=00000000000000000000000000000000 + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=00000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc < 0 sockaddr_in6=0a000001000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr() rc < 0 sockaddr_storage=0a00000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_from_str() rc < 0 { .af = AF_UNSPEC, .ip = "not an ip address", .port = 1 } + + +{ .af = AF_INET6, .ip = "1.2.3.4", .port = 5 } + osmo_sockaddr_str_is_set() = true + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc < 0 in6_addr=00000000000000000000000000000000 + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=00000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc < 0 sockaddr_in6=0a000005000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr() rc < 0 sockaddr_storage=0a00000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET, .ip = "1.2.3.4", .port = 5 } + DIFFERS! + + +{ .af = AF_INET, .ip = "1:2:3::4", .port = 5 } + osmo_sockaddr_str_is_set() = true + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc < 0 in6_addr=00000000000000000000000000000000 + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=02000005000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc < 0 sockaddr_in6=00000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr() rc < 0 sockaddr_storage=0200000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET6, .ip = "1:2:3::4", .port = 5 } + DIFFERS! + + +{ .af = AF_UNSPEC, .ip = "1.2.3.4", .port = 5 } + osmo_sockaddr_str_is_set() = false + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc < 0 in6_addr=00000000000000000000000000000000 + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=00000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc < 0 sockaddr_in6=00000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr() rc < 0 sockaddr_storage=0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET, .ip = "1.2.3.4", .port = 5 } + DIFFERS! + + +{ .af = AF_INET, .ip = "", .port = 5 } + osmo_sockaddr_str_is_set() = false + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc < 0 in6_addr=00000000000000000000000000000000 + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=02000005000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc < 0 sockaddr_in6=00000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr() rc < 0 sockaddr_storage=0200000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_from_str() rc < 0 { .af = AF_UNSPEC, .ip = "", .port = 5 } + + +{ .af = AF_INET6, .ip = "", .port = 5 } + osmo_sockaddr_str_is_set() = false + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc < 0 in6_addr=00000000000000000000000000000000 + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=00000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc < 0 sockaddr_in6=0a000005000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr() rc < 0 sockaddr_storage=0a00000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_from_str() rc < 0 { .af = AF_UNSPEC, .ip = "", .port = 5 } + + +{ .af = AF_INET, .ip = "1.2.3.4", .port = 0 } + osmo_sockaddr_str_is_set() = false + osmo_sockaddr_str_to_in_addr() rc == 0 in_addr=01020304 + -> osmo_sockaddr_str_from_in_addr() rc == 0 { .af = AF_INET, .ip = "1.2.3.4", .port = 0 } + osmo_sockaddr_str_to_in6_addr() rc < 0 in6_addr=00000000000000000000000000000000 + osmo_sockaddr_str_to_32() rc == 0 uint32_t=0x4030201 + -> osmo_sockaddr_str_from_32() rc == 0 { .af = AF_INET, .ip = "1.2.3.4", .port = 0 } + osmo_sockaddr_str_to_32n() rc == 0 uint32_t=0x1020304 + -> osmo_sockaddr_str_from_32n() rc == 0 { .af = AF_INET, .ip = "1.2.3.4", .port = 0 } + osmo_sockaddr_str_to_sockaddr_in() rc == 0 sockaddr_in=02000000010203040000000000000000 + -> osmo_sockaddr_str_from_sockaddr_in() rc == 0 { .af = AF_INET, .ip = "1.2.3.4", .port = 0 } + osmo_sockaddr_str_to_sockaddr_in6() rc < 0 sockaddr_in6=00000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr() rc == 0 sockaddr_storage=0200000001020304000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + -> osmo_sockaddr_str_from_sockaddr() rc == 0 { .af = AF_INET, .ip = "1.2.3.4", .port = 0 } + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET, .ip = "1.2.3.4", .port = 0 } + + +{ .af = AF_INET, .ip = "1.2.3:4:5", .port = 0 } + osmo_sockaddr_str_is_set() = false + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc < 0 in6_addr=00000000000000000000000000000000 + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=02000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc < 0 sockaddr_in6=00000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr() rc < 0 sockaddr_storage=0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET6, .ip = "1.2.3:4:5", .port = 0 } + DIFFERS! + + +{ .af = AF_INET6, .ip = "::1:10.9.8.7", .port = 1 } + osmo_sockaddr_str_is_set() = true + osmo_sockaddr_str_to_in_addr() rc < 0 in_addr=00000000 + osmo_sockaddr_str_to_in6_addr() rc == 0 in6_addr=0000000000000000000000010a090807 + -> osmo_sockaddr_str_from_in6_addr() rc == 0 { .af = AF_INET6, .ip = "::1:a09:807", .port = 1 } + DIFFERS! + osmo_sockaddr_str_to_32() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_32n() rc < 0 uint32_t=0x0 + osmo_sockaddr_str_to_sockaddr_in() rc < 0 sockaddr_in=00000000000000000000000000000000 + osmo_sockaddr_str_to_sockaddr_in6() rc == 0 sockaddr_in6=0a000001000000000000000000000000000000010a09080700000000 + -> osmo_sockaddr_str_from_sockaddr_in6() rc == 0 { .af = AF_INET6, .ip = "::1:a09:807", .port = 1 } + DIFFERS! + osmo_sockaddr_str_to_sockaddr() rc == 0 sockaddr_storage=0a000001000000000000000000000000000000010a0908070000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + -> osmo_sockaddr_str_from_sockaddr() rc == 0 { .af = AF_INET6, .ip = "::1:a09:807", .port = 1 } + DIFFERS! + osmo_sockaddr_str_from_str() rc == 0 { .af = AF_INET6, .ip = "::1:10.9.8.7", .port = 1 } diff --git a/tests/testsuite.at b/tests/testsuite.at index 0093403..db2003f 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -331,3 +331,9 @@ cat $abs_srcdir/tdef/tdef_test.ok > expout AT_CHECK([$abs_top_builddir/tests/tdef/tdef_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([sockaddr_str]) +AT_KEYWORDS([sockaddr_str]) +cat $abs_srcdir/sockaddr_str/sockaddr_str_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/sockaddr_str/sockaddr_str_test], [0], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/13123 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63 Gerrit-Change-Number: 13123 Gerrit-PatchSet: 11 Gerrit-Owner: Neels Hofmeyr Gerrit-Assignee: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 13:47:19 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 13:47:19 +0000 Subject: Change in libosmocore[master]: add osmo_use_count API In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13121 ) Change subject: add osmo_use_count API ...................................................................... add osmo_use_count API Provide a common implementation of use counting that supports naming each user as well as counting more than just one use per user, depending on the rules the caller implies. In osmo-msc, we were originally using a simple int counter to see whether a connection is still in use or should be discarded. For clarity, we later added names to each user in the form of a bitmask of flags, to figure out exactly which users are still active: for logging and to debug double get / double put bugs. This however is still not adequate, since there may be more than one CM Service Request pending. Also, it is a specialized implementation that is not re-usable. With this generalized implementation, we can: - fix the problem of inadequate counting of multiple concurrent CM Service Requests (more than one use count per user category), - directly use arbitrary names for uses like __func__ or "foo" (no need to define enums and value_string[]s), - re-use the same code for e.g. vlr_subscr and get fairly detailed VLR susbscriber usage logging for free. Change-Id: Ife31e6798b4e728a23913179e346552a7dd338c0 --- M include/Makefile.am A include/osmocom/core/use_count.h M src/Makefile.am A src/use_count.c M tests/Makefile.am M tests/testsuite.at A tests/use_count/use_count_test.c A tests/use_count/use_count_test.err A tests/use_count/use_count_test.ok 9 files changed, 1,031 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/Makefile.am b/include/Makefile.am index 6ed7fe6..7b9e347 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -53,6 +53,7 @@ osmocom/core/utils.h \ osmocom/core/write_queue.h \ osmocom/core/sockaddr_str.h \ + osmocom/core/use_count.h \ osmocom/crypt/auth.h \ osmocom/crypt/gprs_cipher.h \ osmocom/ctrl/control_cmd.h \ diff --git a/include/osmocom/core/use_count.h b/include/osmocom/core/use_count.h new file mode 100644 index 0000000..6a4bf1f --- /dev/null +++ b/include/osmocom/core/use_count.h @@ -0,0 +1,228 @@ +/*! \file use_count.h + * Generic object usage counter API (get, put and deallocate on zero count). + */ +/* + * (C) 2019 by sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * SPDX-License-Identifier: GPL-2.0+ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include +#include + +#include + +/*! \defgroup use_count Use Counter + * @{ + * \file use_count.h + */ + +struct osmo_use_count_entry; + +/*! Invoked when a use count changes. + * + * The implementation is free to trigger actions on arbitrary use count changes, typically to free the + * use_count->talloc_object when the total use count reaches zero. + * + * The implementation may modify use_count_entry->count, for example for handling of get()/put() bugs, to clamp specific use + * tokens to specific counts, or to prevent the caller from put()ting into negative counts. When returning an error, + * there is no implicit undo -- if errors need to be corrected, this function is responsible for that. + * + * Be aware: use token strings are not copied, and use count entries usually remain listed also when they reach a zero + * count. This is trivially perfectly ok when using string literals as use tokens. It is also possible to use + * dynamically allocated string tokens, but should a use token string become invalid memory when reaching zero count, it + * is the responsibility of this function to set the use_count_entry->use = NULL; this is required to avoid subsequent + * osmo_use_count_get_put() invocations from calling strcmp() on invalid memory. (Setting use = NULL cannot be done + * implicitly after this callback invocation, because callback implementations are allowed to completely deallocate the + * talloc_object and the use_count list entries, and setting use = NULL after that would be a use-after-free.) + * + * \param[in] use_count_entry Use count entry that is being modified. + * \param[in] old_use_count Use count the item had before the change in use count. + * \param[in] file Source file string, passed in as __FILE__ from macro osmo_use_count_get_put(). + * \param[in] line Source file line, passed in as __LINE__ from macro osmo_use_count_get_put(). + * \return 0 on success, negative if any undesired use count is reached; this rc will be returned by + * osmo_use_count_get_put(). + */ +typedef int (* osmo_use_count_cb_t )(struct osmo_use_count_entry *use_count_entry, int32_t old_use_count, + const char *file, int line); + +/*! Use counter state for one used object, managing N distinct named counters. + * + * Manage any number of uses of an object, with name tokens given to each use. + * + * A typical use tracking done by a single instance of this struct may look like: + * "VLR subscr MSISDN-23 + SMS-receiver: now used by 6 (attached,2*SMS-receiver,SMS-pending,SMS,Paging)" + * (This is a DREF log statement from an osmo-msc run delivering an SMS.) + * + * Use tokens are given as const char* strings. Typically string literals like "foo", __func__, or also NULL. Tokens may + * be dynamically allocated or static char[] buffers as long as they are guaranteed to remain unchanged while referenced + * by an osmo_use_count_entry. (Breakage occurs if one token magically changes to equal another listed token.) + * + * Instead of using string literals in the code directly, callers should use a #define, so that typos are caught at + * compile time rather than introducing obscure failures that are hard to spot for humans -- don't use foo_get("bar") + * and foo_put("bar"), but '#define FOO_USE_BAR "bar"' for foo_get(FOO_USE_BAR) and foo_put(FOO_USE_BAR). + * + * Counts are int32_t values, a separate count per use token string. Counts can be negative, though in the typical use + * case are only positive or 0. Enforcing a range is entirely up to the osmo_use_count_cb_t() implementation. + * + * The talloc_object must be a pointer eligible to be a talloc context, i.e. either obtained from a function like + * talloc_zero() or NULL. talloc_object is typically a pointer to the object that this struct is a member of. Use count + * entries may be allocated as talloc children of this (see also "Avoiding dynamic allocation" below). + * + * The use_cb() implementation allows to trigger actions when reaching specific use counts, e.g. deallocate when + * reaching a total sum across all use tokens of zero. + * + * On initialization, this struct can be left fully zero initialized (the llist_head use_counts is implicitly + * initialized upon the first osmo_use_count_get_put()). Usually, set only a talloc_object and a use_cb, though neither + * is strictly required. + * + * Avoiding dynamic allocation: dynamic allocation can be avoided completely by providing sufficient static use count + * entries with osmo_use_count_make_static_entries(). Otherwise, each new use token will dynamically allocate a new + * osmo_use_count_entry; note that once allocated, these entries stay around even if they reached an entry count of + * zero, and will be re-used for subsequent use count tokens. So even if not using osmo_use_count_make_static_entries(), + * each osmo_use_count will keep dynamic allocations at a minimum. See also the documentation for osmo_use_count_cb_t. + * + * List traversal considerations: your typical use count list would max at about six entries in practice. Traversing six + * llist->next pointers is less effort than doing a common strlen(). + * + * Obtaining the total use count: osmo_use_count_total() traverses all use token entries and forms a sum. It is trivial + * to keep a separate total count that completely avoids the need for calling this function, which is entirely up to the + * individual osmo_use_count_cb_t() implementation. The optimization gained is usually not worth it, though. + * + * Use token comparison considerations: strcmp() to compare use tokens is a fairly good tradeoff: + * - when the strings differ, strcmp() usually exits on the first or second character. + * - when the strings are identical, they are usually the exact same char* address (from compile-time string constant), + * meaning that strcmp() is completely skipped. + * (quote: "if (e->use == use || (use && e->use && !strcmp(e->use, use)))") + * - if we specified compile-time string constant use as requirement, we wouldn't need strcmp() at all, but this + * minuscule overhead has the benefit of complete correctness for any kinds of use token strings. + * + * Example: + * + * struct foo { + * struct osmo_use_count use_count; + * }; + * + * // Convenience macros for struct foo instances. These are strict about use count errors. + * #define foo_get(FOO, USE) OSMO_ASSERT( osmo_use_count_get_put(&(FOO)->use_count, USE, 1) == 0 ); + * #define foo_put(FOO, USE) OSMO_ASSERT( osmo_use_count_get_put(&(FOO)->use_count, USE, -1) == 0 ); + * + * int foo_use_cb(struct osmo_use_count_entry *use_count_entry, int32_t old_use_count, const char *file, int line) + * { + * struct foo *foo = use_count_entry->use_count->talloc_object; + * if (osmo_use_count_total(&use_count_entry->use_count) == 0) + * talloc_free(foo); + * } + * + * // The function name is a convenient use token: + * void rx_stop_baz_request(struct foo *foo) + * { + * foo_get(foo, __func__); + * + * foo_put(foo, "baz"); + * printf("Stopped Bazing (%p)\n", foo); + * + * foo_put(foo, __func__); + * } + * + * void use_count_example() + * { + * struct foo *foo = talloc_zero(ctx, struct foo); + * *foo = (struct foo){ + * .use_count = { + * .talloc_object = foo, + * .use_cb = foo_use_cb, + * }, + * }; + * + * foo_get(foo, "bar"); // one osmo_use_count_entry was allocated + * foo_get(foo, "baz"); // a second osmo_use_count_entry was allocated + * foo_get(foo, "baz"); // still two entries + * + * printf("use: %s\n", osmo_use_count_name_buf(namebuf, sizeof(namebuf), &foo->use_count)); + * // "use: 3 (bar,2*baz)" + * + * foo_put(foo, "bar"); // still two entries, one entry is idle ("bar"=0) + * foo_put(foo, "baz"); + * rx_stop_baz_request(foo); + * // Final "baz" was put(), foo_use_cb() deallocated object foo, as well as all use count entries. + * }; + */ +struct osmo_use_count { + /*! Context to talloc-allocate use count entries from (if at all necessary); back-pointer to the owning object + * for osmo_use_count_cb_t implementations. */ + void *talloc_object; + /*! If not NULL, this is invoked for each use count change. */ + osmo_use_count_cb_t use_cb; + /*! List of use tokens. No need to touch this, the llist is initialized implicitly. */ + struct llist_head use_counts; +}; + +/*! One named counter in the list managed by osmo_use_count. + * Gets created as necessary by osmo_use_count_get_put(). The total current use count of an object is the sum of all + * individual osmo_use_count_entry->count. + * + * object <--backpointer-+ + * t| .osmo_use_count | + * a| .talloc_object ------------+ + * l| .use_counts llist: use count + * l|-> - osmo_use_count_entry: "foo" 1 + * o|-> - osmo_use_count_entry: "bar" 3 + * c|-> - osmo_use_count_entry: "baz" 0 (currently unused entry) + */ +struct osmo_use_count_entry { + /*! Entry in osmo_use_count->use_counts. */ + struct llist_head entry; + /*! Parent use count and backpointer to the talloc_object. */ + struct osmo_use_count *use_count; + /*! Use token string that was passed to osmo_use_count_get_put(). */ + const char *use; + /*! Current use count amount for only this use token string. + * If zero, this entry is currently unused and kept around to avoid frequent de-/allocation. */ + int32_t count; +}; + +/*! Change the use count for a given use token. + * \param USE_LIST A struct osmo_use_count*, e.g. &my_obj->use_count. + * \param USE A use token: arbitrary string (const char*). This must remain valid memory, e.g. string constants. + * \param CHANGE Signed integer value to add to the use count: positive means get(), negative means put(). + * \return Negative on range violations or USE_LIST == NULL, the use_cb()'s return value, or 0 on success. + */ +#define osmo_use_count_get_put(USE_LIST, USE, CHANGE) \ + _osmo_use_count_get_put(USE_LIST, USE, CHANGE, __FILE__, __LINE__) + +int _osmo_use_count_get_put(struct osmo_use_count *uc, const char *use, int32_t change, + const char *file, int line); + +const char *osmo_use_count_name_buf(char *buf, size_t buf_len, const struct osmo_use_count *uc); + +int32_t osmo_use_count_total(const struct osmo_use_count *uc); +int32_t osmo_use_count_by(const struct osmo_use_count *uc, const char *use); + +struct osmo_use_count_entry *osmo_use_count_find(const struct osmo_use_count *uc, const char *use); +void osmo_use_count_free(struct osmo_use_count_entry *use_count_entry); + +void osmo_use_count_make_static_entries(struct osmo_use_count *uc, struct osmo_use_count_entry *buf, + size_t buf_n_entries); + +/*! @} */ diff --git a/src/Makefile.am b/src/Makefile.am index 1fae8b0..aaf2233 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,6 +26,7 @@ isdnhdlc.c \ tdef.c \ sockaddr_str.c \ + use_count.c \ $(NULL) if HAVE_SSSE3 diff --git a/src/use_count.c b/src/use_count.c new file mode 100644 index 0000000..453d2ae --- /dev/null +++ b/src/use_count.c @@ -0,0 +1,279 @@ +/*! \file use_count.c + * Generic object usage counter Implementation (get, put and deallocate on zero count). + */ +/* + * (C) 2019 by sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * SPDX-License-Identifier: GPL-2.0+ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include + +#include +#include +#include + +/*! \addtogroup use_count + * + * Generic object usage counter (get, put and deallocate on zero count). + * + * For an example and a detailed description, see struct osmo_use_count. + * + * @{ + * \file use_count.c + */ + +/*! Add two int32_t but make sure to min- and max-clamp at INT32_MIN and INT32_MAX, respectively. */ +static inline bool count_safe(int32_t *val_p, int32_t add) +{ + int32_t val = *val_p; + + /* A simpler implementation would just let the integer overflow and compare with previous value afterwards, but + * that causes runtime errors in the address sanitizer. So let's just do this without tricks. */ + if (add < 0 && val < 0 && val - INT32_MIN < -add) { + *val_p = INT32_MIN; + return false; + } + + if (add > 0 && val > 0 && INT32_MAX - val < add) { + *val_p = INT32_MAX; + return false; + } + + *val_p = val + add; + return true; +} + +/*! Return the sum of all use counts, min- and max-clamped at INT32_MIN and INT32_MAX. + * \param[in] uc Use counts to sum up. + * \return Accumulated counts, or 0 if uc is NULL. + */ +int32_t osmo_use_count_total(const struct osmo_use_count *uc) +{ + struct osmo_use_count_entry *e; + int32_t total = 0; + + if (!uc || !uc->use_counts.next) + return 0; + + llist_for_each_entry(e, &uc->use_counts, entry) { + count_safe(&total, e->count); + } + return total; +} + +/*! Return use count by a single use token. + * \param[in] uc Use counts to look up in. + * \param[in] use Use token. + * \return Use count, or 0 if uc is NULL or use token is not present. + */ +int32_t osmo_use_count_by(const struct osmo_use_count *uc, const char *use) +{ + const struct osmo_use_count_entry *e; + if (!uc) + return 0; + e = osmo_use_count_find(uc, use); + if (!e) + return 0; + return e->count; +} + +/*! Write a comprehensive listing of use counts to a string buffer. + * Reads like "12 (3*barring,fighting,8*kungfoo)". + * \param[inout] buf Destination buffer. + * \param[in] buf_len sizeof(buf). + * \param[in] uc Use counts to print. + * \return buf, always nul-terminated (except when buf_len < 1). + */ +const char *osmo_use_count_name_buf(char *buf, size_t buf_len, const struct osmo_use_count *uc) +{ + int32_t count = osmo_use_count_total(uc); + struct osmo_strbuf sb = { .buf = buf, .len = buf_len }; + struct osmo_use_count_entry *e; + bool first; + + OSMO_STRBUF_PRINTF(sb, "%" PRId32 " (", count); + + first = true; + llist_for_each_entry(e, &uc->use_counts, entry) { + if (!e->count) + continue; + if (!first) + OSMO_STRBUF_PRINTF(sb, ","); + first = false; + if (e->count != 1) + OSMO_STRBUF_PRINTF(sb, "%" PRId32 "*", e->count); + OSMO_STRBUF_PRINTF(sb, "%s", e->use ? : "NULL"); + } + if (first) + OSMO_STRBUF_PRINTF(sb, "-"); + OSMO_STRBUF_PRINTF(sb, ")"); + return buf; +} + +/* Return a use token's use count entry -- probably you want osmo_use_count_by() instead. + * \param[in] uc Use counts to look up in. + * \param[in] use Use token. + * \return matching entry, or NULL if not present. + */ +struct osmo_use_count_entry *osmo_use_count_find(const struct osmo_use_count *uc, const char *use) +{ + struct osmo_use_count_entry *e; + if (!uc->use_counts.next) + return NULL; + llist_for_each_entry(e, &uc->use_counts, entry) { + if (e->use == use || (use && e->use && !strcmp(e->use, use))) + return e; + } + return NULL; +} + +/*! Find a use count entry that currently has zero count, and re-use that for this new use token. */ +static struct osmo_use_count_entry *osmo_use_count_repurpose_zero_entry(struct osmo_use_count *uc, const char *use) +{ + struct osmo_use_count_entry *e; + if (!uc->use_counts.next) + return NULL; + llist_for_each_entry(e, &uc->use_counts, entry) { + if (!e->count) { + e->use = use; + return e; + } + } + return NULL; +} + +/*! Allocate a new use count entry, happens implicitly in osmo_use_count_get_put(). */ +static struct osmo_use_count_entry *osmo_use_count_create(struct osmo_use_count *uc, const char *use) +{ + struct osmo_use_count_entry *e = talloc_zero(uc->talloc_object, struct osmo_use_count_entry); + if (!e) + return NULL; + *e = (struct osmo_use_count_entry){ + .use_count = uc, + .use = use, + }; + if (!uc->use_counts.next) + INIT_LLIST_HEAD(&uc->use_counts); + llist_add_tail(&e->entry, &uc->use_counts); + return e; +} + +/*! Deallocate a use count entry. + * Normally, this is not necessary -- it is ok and even desirable to leave use count entries around even when they reach + * a count of zero, until the use_count->talloc_object deallocates and removes all of them in one flush. This avoids + * repeated allocation and deallocation for use tokens, because use count entries that have reached zero count are + * repurposed for any other use tokens. A cleanup makes sense only if a very large number of differing use tokens surged + * at the same time, and the owning object will not be deallocated soon; if so, this should be done by the + * osmo_use_count_cb_t implementation. + * + * osmo_use_count_free() must *not* be called on use count entries that were added by + * osmo_use_count_make_static_entries(). This is the responsibility of the osmo_use_count_cb_t() implementation. + * + * \param[in] use_count_entry Use count entry to unlist and free. + */ +void osmo_use_count_free(struct osmo_use_count_entry *use_count_entry) +{ + if (!use_count_entry) + return; + llist_del(&use_count_entry->entry); + talloc_free(use_count_entry); +} + +/*! Implementation for osmo_use_count_get_put(), which can also be directly invoked to pass source file information. For + * arguments besides file and line, see osmo_use_count_get_put(). + * \param[in] file Source file path, as in __FILE__. + * \param[in] line Source file line, as in __LINE__. + */ +int _osmo_use_count_get_put(struct osmo_use_count *uc, const char *use, int32_t change, + const char *file, int line) +{ + struct osmo_use_count_entry *e; + int32_t old_use_count; + if (!change) + return 0; + + e = osmo_use_count_find(uc, use); + if (!e) + e = osmo_use_count_repurpose_zero_entry(uc, use); + if (!e) + e = osmo_use_count_create(uc, use); + if (!e) + return -ENOMEM; + + if (!e->count) { + /* move to end */ + llist_del(&e->entry); + llist_add_tail(&e->entry, &uc->use_counts); + } + + old_use_count = e->count; + if (!count_safe(&e->count, change)) { + e->count = old_use_count; + return -ERANGE; + } + + if (uc->use_cb) + return uc->use_cb(e, old_use_count, file, line); + return 0; +} + +/*! Add N static use token entries to avoid dynamic allocation of use count tokens. + * When not using this function, use count entries are talloc allocated from uc->talloc_object as talloc context. This + * means that there are small dynamic allocations for each use count token. osmo_use_count_get_put() normally leaves + * zero-count entries around and re-purposes them later, so the number of small allocations is at most the number of + * concurrent differently-named uses of the same object. If that is not enough, this function allows completely avoiding + * dynamic use count allocations, by adding N static entries with a zero count and a NULL use token. They will be used + * by osmo_use_count_get_put(), and, if the caller avoids using osmo_use_count_free(), the osmo_use_count implementation + * never deallocates them. The idea is that the entries are members of the uc->talloc_object, or that they will by other + * means be implicitly deallocated by the talloc_object. It is fine to call + * osmo_use_count_make_static_entries(buf_n_entries=N) and later have more than N concurrent uses, i.e. it is no problem + * to mix static and dynamic entries. To completely avoid dynamic use count entries, N has to >= the maximum number of + * concurrent differently-named uses that will occur in the lifetime of the talloc_object. + * + * struct my_object { + * struct osmo_use_count use_count; + * struct osmo_use_count_entry use_count_buf[3]; // planning for 3 concurrent users + * }; + * + * void example() { + * struct my_object *o = talloc_zero(ctx, struct my_object); + * osmo_use_count_make_static_entries(&o->use_count, o->use_count_buf, ARRAY_SIZE(o->use_count_buf)); + * } + */ +void osmo_use_count_make_static_entries(struct osmo_use_count *uc, struct osmo_use_count_entry *buf, + size_t buf_n_entries) +{ + size_t idx; + if (!uc->use_counts.next) + INIT_LLIST_HEAD(&uc->use_counts); + for (idx = 0; idx < buf_n_entries; idx++) { + struct osmo_use_count_entry *e = &buf[idx]; + *e = (struct osmo_use_count_entry){ + .use_count = uc, + }; + llist_add_tail(&e->entry, &uc->use_counts); + } +} + +/*! @} */ diff --git a/tests/Makefile.am b/tests/Makefile.am index 88bcd7e..d123ee2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -31,6 +31,7 @@ tdef/tdef_vty_test_config_subnode \ tdef/tdef_vty_test_dynamic \ sockaddr_str/sockaddr_str_test \ + use_count/use_count_test \ $(NULL) if ENABLE_MSGFILE @@ -240,6 +241,9 @@ sockaddr_str_sockaddr_str_test_SOURCES = sockaddr_str/sockaddr_str_test.c sockaddr_str_sockaddr_str_test_LDADD = $(LDADD) +use_count_use_count_test_SOURCES = use_count/use_count_test.c +use_count_use_count_test_LDADD = $(LDADD) + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -309,6 +313,7 @@ tdef/tdef_vty_test_config_subnode.vty \ tdef/tdef_vty_test_dynamic.vty \ sockaddr_str/sockaddr_str_test.ok \ + use_count/use_count_test.ok use_count/use_count_test.err \ $(NULL) DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c diff --git a/tests/testsuite.at b/tests/testsuite.at index db2003f..5a6e802 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -337,3 +337,10 @@ cat $abs_srcdir/sockaddr_str/sockaddr_str_test.ok > expout AT_CHECK([$abs_top_builddir/tests/sockaddr_str/sockaddr_str_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([use_count]) +AT_KEYWORDS([use_count]) +cat $abs_srcdir/use_count/use_count_test.ok > expout +cat $abs_srcdir/use_count/use_count_test.err > experr +AT_CHECK([$abs_top_builddir/tests/use_count/use_count_test], [0], [expout], [experr]) +AT_CLEANUP diff --git a/tests/use_count/use_count_test.c b/tests/use_count/use_count_test.c new file mode 100644 index 0000000..0b081c9 --- /dev/null +++ b/tests/use_count/use_count_test.c @@ -0,0 +1,339 @@ +/* Test implementation for osmo_use_count API. */ +/* + * (C) 2019 by sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * SPDX-License-Identifier: GPL-2.0+ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include + +static void *ctx = NULL; + +#define log(fmt, args...) fprintf(stderr, fmt, ##args) + +enum { + DFOO, +}; + +#define FOO_USE_BARRING "barring" +#define FOO_USE_FIGHTING "fighting" +#define FOO_USE_KUNG "kungfoo" +#define FOO_USE_RELEASING "releasing" + +LLIST_HEAD(all_foo); + +struct foo { + struct llist_head entry; + struct osmo_fsm_inst *fi; + struct osmo_use_count use_count; + struct osmo_use_count_entry use_count_buf[10]; +}; + +enum foo_fsm_events { + FOO_EV_UNUSED, +}; + +static char name_buf[1024]; +#define use_count_name(UL) osmo_use_count_name_buf(name_buf, sizeof(name_buf), UL) + +int foo_use_cb(struct osmo_use_count_entry *use_count_entry, int32_t old_use_count, + const char *file, int line) +{ + struct osmo_use_count *use_count = use_count_entry->use_count; + struct foo *foo = use_count->talloc_object; + const char *use = use_count_entry->use; + int32_t new_use_count = use_count_entry->count; + + if (use && (!strcmp(use, FOO_USE_BARRING) || !strcmp(use, FOO_USE_RELEASING)) + && new_use_count > 1) { + LOGPFSMLSRC(foo->fi, LOGL_ERROR, file, line, + "Attempt to get more than one %s\n", use); + /* Fix the use count */ + use_count_entry->count = 1; + return -ERANGE; + } + + LOGPFSMLSRC(foo->fi, LOGL_NOTICE, file, line, "%s %+d %s: now used by %s\n", + foo->fi->id, new_use_count - old_use_count, use ? : "NULL", use_count_name(use_count)); + + if (new_use_count < 0) { + LOGPFSMLSRC(foo->fi, LOGL_ERROR, file, line, "Negative use count on %s: %s\n", + use ? : "NULL", use_count_name(use_count)); + /* Let it pass for the sake of this test */ + } + + if (osmo_use_count_total(use_count) == 0) + osmo_fsm_inst_dispatch(foo->fi, FOO_EV_UNUSED, NULL); + return 0; +} + +#define foo_get_put(FOO, USE, CHANGE) do { \ + int rc = osmo_use_count_get_put(&(FOO)->use_count, USE, CHANGE); \ + if (rc) \ + log("osmo_use_count_get_put(%s, %s, %d) returned error: %d %s\n", \ + (FOO)->fi->id, USE ? : "NULL", CHANGE, rc, strerror(-rc)); \ + } while(0) + +#define foo_get(FOO, USE) foo_get_put(FOO, USE, 1) +#define foo_put(FOO, USE) foo_get_put(FOO, USE, -1) + +enum foo_fsm_states { + FOO_ST_IN_USE, + FOO_ST_IN_RELEASE, +}; + +void foo_fsm_in_use(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + OSMO_ASSERT(event == FOO_EV_UNUSED); + osmo_fsm_inst_state_chg(fi, FOO_ST_IN_RELEASE, 0, 0); +} + +void foo_fsm_in_release_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct foo *foo = fi->priv; + foo_get(foo, FOO_USE_RELEASING); +} + +void foo_fsm_in_release(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + OSMO_ASSERT(event == FOO_EV_UNUSED); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); +} + + +#define S(x) (1 << (x)) + +static const struct osmo_fsm_state foo_fsm_states[] = { + [FOO_ST_IN_USE] = { + .name = "IN_USE", + .in_event_mask = 0 + | S(FOO_EV_UNUSED) + , + .out_state_mask = 0 + | S(FOO_ST_IN_RELEASE) + , + .action = foo_fsm_in_use, + }, + [FOO_ST_IN_RELEASE] = { + .name = "IN_RELEASE", + .in_event_mask = 0 + | S(FOO_EV_UNUSED) + , + .out_state_mask = 0 + , + .onenter = foo_fsm_in_release_onenter, + .action = foo_fsm_in_release, + }, +}; + +static const struct value_string foo_fsm_event_names[] = { + OSMO_VALUE_STRING(FOO_EV_UNUSED), + {} +}; + +void foo_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) +{ + struct foo *foo = fi->priv; + llist_del(&foo->entry); +} + +static struct osmo_fsm foo_fsm = { + .name = "foo", + .states = foo_fsm_states, + .event_names = foo_fsm_event_names, + .num_states = ARRAY_SIZE(foo_fsm_states), + .log_subsys = DFOO, + .cleanup = foo_cleanup, +}; + +static struct foo *foo_alloc(const char *name, size_t static_entries) +{ + struct foo *foo; + struct osmo_fsm_inst *fi = osmo_fsm_inst_alloc(&foo_fsm, ctx, NULL, LOGL_DEBUG, name); + OSMO_ASSERT(fi); + OSMO_ASSERT(static_entries <= ARRAY_SIZE(foo->use_count_buf)); + + foo = talloc_zero(fi, struct foo); + *foo = (struct foo){ + .fi = fi, + .use_count = { + .talloc_object = foo, + .use_cb = foo_use_cb, + }, + }; + fi->priv = foo; + + osmo_use_count_make_static_entries(&foo->use_count, foo->use_count_buf, static_entries); + + llist_add_tail(&foo->entry, &all_foo); + return foo; +} + +void print_foos() +{ + int count = 0; + struct foo *foo; + fprintf(stderr, "\nall use counts:\n"); + llist_for_each_entry(foo, &all_foo, entry) { + fprintf(stderr, "%s: %s\n", foo->fi->id, use_count_name(&foo->use_count)); + count++; + } + fprintf(stderr, "%d foos\n\n", count); +} + +static void test_use_count_fsm() +{ + struct foo *a, *b, *c; + log("\n%s()\n", __func__); + + a = foo_alloc("a", 0); + b = foo_alloc("b", 2); + c = foo_alloc("c", 10); + print_foos(); + + log("A few gets and puts, logging source file information\n"); + log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_BASENAME); + foo_get(a, FOO_USE_BARRING); + + foo_get(b, FOO_USE_BARRING); + foo_get(b, FOO_USE_FIGHTING); + + print_foos(); + + log("Attempt to get more than one on limited 'barring' user:\n"); + foo_get(b, FOO_USE_BARRING); + print_foos(); + + log("Put away one user of b\n"); + foo_put(b, FOO_USE_BARRING); + print_foos(); + + log("(no longer log source file information)\n"); + log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE); + + log("Test null use token\n"); + foo_get(a, NULL); + print_foos(); + foo_put(a, NULL); + print_foos(); + + log("Put away last user of a, goes to RELEASING state and waits for a hypothetic async release process\n"); + foo_put(a, FOO_USE_BARRING); + print_foos(); + + log("Async releasing of a is done, will dealloc\n"); + foo_put(a, FOO_USE_RELEASING); + print_foos(); + + log("Use b multiple times\n"); + foo_get(b, FOO_USE_KUNG); + foo_get(b, FOO_USE_KUNG); + + foo_put(b, FOO_USE_KUNG); + foo_get(b, FOO_USE_KUNG); + + foo_get(b, FOO_USE_KUNG); + print_foos(); + + log("Test range: set kung-fu to INT32_MAX-1, then get three more; total count gets max-clamped to INT32_MAX\n"); + foo_get_put(b, FOO_USE_KUNG, INT32_MAX-1 - osmo_use_count_by(&b->use_count, FOO_USE_KUNG)); + print_foos(); + foo_get(b, FOO_USE_KUNG); + foo_get(b, FOO_USE_KUNG); + foo_get(b, FOO_USE_KUNG); + foo_get_put(b, FOO_USE_FIGHTING, 2); + foo_get_put(b, FOO_USE_KUNG, -3); + foo_put(b, FOO_USE_KUNG); + foo_put(b, FOO_USE_KUNG); + foo_get(b, FOO_USE_FIGHTING); + foo_get(b, FOO_USE_FIGHTING); + foo_get(b, FOO_USE_FIGHTING); + print_foos(); + + log("Release all uses of b\n"); + foo_get_put(b, FOO_USE_KUNG, - osmo_use_count_by(&b->use_count, FOO_USE_KUNG)); + foo_get_put(b, FOO_USE_FIGHTING, - osmo_use_count_by(&b->use_count, FOO_USE_FIGHTING)); + + log("Signal async release as done\n"); + foo_put(b, FOO_USE_RELEASING); + print_foos(); + + log("Release something not gotten before: a get/put bug goes into negative count\n"); + foo_put(c, FOO_USE_KUNG); + print_foos(); + log("More negative\n"); + foo_put(c, FOO_USE_KUNG); + foo_put(c, FOO_USE_KUNG); + print_foos(); + + log("Also release c\n"); + foo_get_put(c, FOO_USE_KUNG, 4); + foo_put(c, FOO_USE_KUNG); + log("Signal async release as done\n"); + foo_put(c, FOO_USE_RELEASING); + print_foos(); +} + +static const struct log_info_cat default_categories[] = { + [DFOO] = { + .name = "DFOO", + .description = "FOO", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, +}; + +static const struct log_info log_info = { + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; + + +int main(int argc, char **argv) +{ + ctx = talloc_named_const(NULL, 0, "use_count_test.c"); + + osmo_fsm_log_addr(false); + + osmo_init_logging2(ctx, &log_info); + + log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_BASENAME); + log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE); + log_set_print_filename_pos(osmo_stderr_target, LOG_FILENAME_POS_LINE_END); + log_set_print_category(osmo_stderr_target, 1); + log_set_print_category_hex(osmo_stderr_target, 0); + log_set_print_level(osmo_stderr_target, 1); + log_set_use_color(osmo_stderr_target, 0); + + osmo_fsm_register(&foo_fsm); + + test_use_count_fsm(); + + return EXIT_SUCCESS; +} diff --git a/tests/use_count/use_count_test.err b/tests/use_count/use_count_test.err new file mode 100644 index 0000000..97e74a5 --- /dev/null +++ b/tests/use_count/use_count_test.err @@ -0,0 +1,171 @@ + +test_use_count_fsm() +DFOO DEBUG foo(a){IN_USE}: Allocated +DFOO DEBUG foo(b){IN_USE}: Allocated +DFOO DEBUG foo(c){IN_USE}: Allocated + +all use counts: +a: 0 (-) +b: 0 (-) +c: 0 (-) +3 foos + +A few gets and puts, logging source file information +DFOO NOTICE foo(a){IN_USE}: a +1 barring: now used by 1 (barring) (use_count_test.c:223) +DFOO NOTICE foo(b){IN_USE}: b +1 barring: now used by 1 (barring) (use_count_test.c:225) +DFOO NOTICE foo(b){IN_USE}: b +1 fighting: now used by 2 (barring,fighting) (use_count_test.c:226) + +all use counts: +a: 1 (barring) +b: 2 (barring,fighting) +c: 0 (-) +3 foos + +Attempt to get more than one on limited 'barring' user: +DFOO ERROR foo(b){IN_USE}: Attempt to get more than one barring (use_count_test.c:231) +osmo_use_count_get_put(b, barring, 1) returned error: -34 Numerical result out of range + +all use counts: +a: 1 (barring) +b: 2 (barring,fighting) +c: 0 (-) +3 foos + +Put away one user of b +DFOO NOTICE foo(b){IN_USE}: b -1 barring: now used by 1 (fighting) (use_count_test.c:235) + +all use counts: +a: 1 (barring) +b: 1 (fighting) +c: 0 (-) +3 foos + +(no longer log source file information) +Test null use token +DFOO NOTICE foo(a){IN_USE}: a +1 NULL: now used by 2 (barring,NULL) + +all use counts: +a: 2 (barring,NULL) +b: 1 (fighting) +c: 0 (-) +3 foos + +DFOO NOTICE foo(a){IN_USE}: a -1 NULL: now used by 1 (barring) + +all use counts: +a: 1 (barring) +b: 1 (fighting) +c: 0 (-) +3 foos + +Put away last user of a, goes to RELEASING state and waits for a hypothetic async release process +DFOO NOTICE foo(a){IN_USE}: a -1 barring: now used by 0 (-) +DFOO DEBUG foo(a){IN_USE}: Received Event FOO_EV_UNUSED +DFOO DEBUG foo(a){IN_USE}: state_chg to IN_RELEASE +DFOO NOTICE foo(a){IN_RELEASE}: a +1 releasing: now used by 1 (releasing) + +all use counts: +a: 1 (releasing) +b: 1 (fighting) +c: 0 (-) +3 foos + +Async releasing of a is done, will dealloc +DFOO NOTICE foo(a){IN_RELEASE}: a -1 releasing: now used by 0 (-) +DFOO DEBUG foo(a){IN_RELEASE}: Received Event FOO_EV_UNUSED +DFOO DEBUG foo(a){IN_RELEASE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DFOO DEBUG foo(a){IN_RELEASE}: Freeing instance +DFOO DEBUG foo(a){IN_RELEASE}: Deallocated + +all use counts: +b: 1 (fighting) +c: 0 (-) +2 foos + +Use b multiple times +DFOO NOTICE foo(b){IN_USE}: b +1 kungfoo: now used by 2 (fighting,kungfoo) +DFOO NOTICE foo(b){IN_USE}: b +1 kungfoo: now used by 3 (fighting,2*kungfoo) +DFOO NOTICE foo(b){IN_USE}: b -1 kungfoo: now used by 2 (fighting,kungfoo) +DFOO NOTICE foo(b){IN_USE}: b +1 kungfoo: now used by 3 (fighting,2*kungfoo) +DFOO NOTICE foo(b){IN_USE}: b +1 kungfoo: now used by 4 (fighting,3*kungfoo) + +all use counts: +b: 4 (fighting,3*kungfoo) +c: 0 (-) +2 foos + +Test range: set kung-fu to INT32_MAX-1, then get three more; total count gets max-clamped to INT32_MAX +DFOO NOTICE foo(b){IN_USE}: b +2147483643 kungfoo: now used by 2147483647 (fighting,2147483646*kungfoo) + +all use counts: +b: 2147483647 (fighting,2147483646*kungfoo) +c: 0 (-) +2 foos + +DFOO NOTICE foo(b){IN_USE}: b +1 kungfoo: now used by 2147483647 (fighting,2147483647*kungfoo) +osmo_use_count_get_put(b, kungfoo, 1) returned error: -34 Numerical result out of range +osmo_use_count_get_put(b, kungfoo, 1) returned error: -34 Numerical result out of range +DFOO NOTICE foo(b){IN_USE}: b +2 fighting: now used by 2147483647 (3*fighting,2147483647*kungfoo) +DFOO NOTICE foo(b){IN_USE}: b -3 kungfoo: now used by 2147483647 (3*fighting,2147483644*kungfoo) +DFOO NOTICE foo(b){IN_USE}: b -1 kungfoo: now used by 2147483646 (3*fighting,2147483643*kungfoo) +DFOO NOTICE foo(b){IN_USE}: b -1 kungfoo: now used by 2147483645 (3*fighting,2147483642*kungfoo) +DFOO NOTICE foo(b){IN_USE}: b +1 fighting: now used by 2147483646 (4*fighting,2147483642*kungfoo) +DFOO NOTICE foo(b){IN_USE}: b +1 fighting: now used by 2147483647 (5*fighting,2147483642*kungfoo) +DFOO NOTICE foo(b){IN_USE}: b +1 fighting: now used by 2147483647 (6*fighting,2147483642*kungfoo) + +all use counts: +b: 2147483647 (6*fighting,2147483642*kungfoo) +c: 0 (-) +2 foos + +Release all uses of b +DFOO NOTICE foo(b){IN_USE}: b -2147483642 kungfoo: now used by 6 (6*fighting) +DFOO NOTICE foo(b){IN_USE}: b -6 fighting: now used by 0 (-) +DFOO DEBUG foo(b){IN_USE}: Received Event FOO_EV_UNUSED +DFOO DEBUG foo(b){IN_USE}: state_chg to IN_RELEASE +DFOO NOTICE foo(b){IN_RELEASE}: b +1 releasing: now used by 1 (releasing) +Signal async release as done +DFOO NOTICE foo(b){IN_RELEASE}: b -1 releasing: now used by 0 (-) +DFOO DEBUG foo(b){IN_RELEASE}: Received Event FOO_EV_UNUSED +DFOO DEBUG foo(b){IN_RELEASE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DFOO DEBUG foo(b){IN_RELEASE}: Freeing instance +DFOO DEBUG foo(b){IN_RELEASE}: Deallocated + +all use counts: +c: 0 (-) +1 foos + +Release something not gotten before: a get/put bug goes into negative count +DFOO NOTICE foo(c){IN_USE}: c -1 kungfoo: now used by -1 (-1*kungfoo) +DFOO ERROR foo(c){IN_USE}: Negative use count on kungfoo: -1 (-1*kungfoo) + +all use counts: +c: -1 (-1*kungfoo) +1 foos + +More negative +DFOO NOTICE foo(c){IN_USE}: c -1 kungfoo: now used by -2 (-2*kungfoo) +DFOO ERROR foo(c){IN_USE}: Negative use count on kungfoo: -2 (-2*kungfoo) +DFOO NOTICE foo(c){IN_USE}: c -1 kungfoo: now used by -3 (-3*kungfoo) +DFOO ERROR foo(c){IN_USE}: Negative use count on kungfoo: -3 (-3*kungfoo) + +all use counts: +c: -3 (-3*kungfoo) +1 foos + +Also release c +DFOO NOTICE foo(c){IN_USE}: c +4 kungfoo: now used by 1 (kungfoo) +DFOO NOTICE foo(c){IN_USE}: c -1 kungfoo: now used by 0 (-) +DFOO DEBUG foo(c){IN_USE}: Received Event FOO_EV_UNUSED +DFOO DEBUG foo(c){IN_USE}: state_chg to IN_RELEASE +DFOO NOTICE foo(c){IN_RELEASE}: c +1 releasing: now used by 1 (releasing) +Signal async release as done +DFOO NOTICE foo(c){IN_RELEASE}: c -1 releasing: now used by 0 (-) +DFOO DEBUG foo(c){IN_RELEASE}: Received Event FOO_EV_UNUSED +DFOO DEBUG foo(c){IN_RELEASE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DFOO DEBUG foo(c){IN_RELEASE}: Freeing instance +DFOO DEBUG foo(c){IN_RELEASE}: Deallocated + +all use counts: +0 foos + diff --git a/tests/use_count/use_count_test.ok b/tests/use_count/use_count_test.ok new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/use_count/use_count_test.ok -- To view, visit https://gerrit.osmocom.org/13121 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ife31e6798b4e728a23913179e346552a7dd338c0 Gerrit-Change-Number: 13121 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Max -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 13:50:30 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 13:50:30 +0000 Subject: Change in libosmocore[master]: fsm: add flag to ensure osmo_fsm_inst_term() happens only once In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13545 ) Change subject: fsm: add flag to ensure osmo_fsm_inst_term() happens only once ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13545/1/include/osmocom/core/fsm.h File include/osmocom/core/fsm.h: https://gerrit.osmocom.org/#/c/13545/1/include/osmocom/core/fsm.h at 118 PS1, Line 118: bool terminating; > one could use some "uint32_t flags" member and have a single-bit enum type flag in case we'd expect [?] I see, but IMHO saving a few bytes of ram is not worth the trouble -- To view, visit https://gerrit.osmocom.org/13545 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0c02d76a86f90c49e0eae2f85db64704c96a7674 Gerrit-Change-Number: 13545 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Mon, 08 Apr 2019 13:50:30 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 13:55:21 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 13:55:21 +0000 Subject: Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13392 to look at the new patch set (#7). Change subject: fsm: support graceful osmo_fsm_inst_term() cascades ...................................................................... fsm: support graceful osmo_fsm_inst_term() cascades Add global flag osmo_fsm_term_safely() -- if set to true, enable the following behavior: Detect osmo_fsm_inst_term() occuring within osmo_fsm_inst_term(): - collect deallocations until the outermost osmo_fsm_inst_term() is done. - call osmo_fsm_inst_free() *after* dispatching the parent event. If a struct osmo_fsm_inst enters osmo_fsm_inst_term() while another is already within osmo_fsm_inst_term(), do not directly deallocate it, but talloc-reparent it to a separate talloc context, to be deallocated with the outermost FSM inst. The effect is that all osmo_fsm_inst freed within an osmo_fsm_inst_term() cascade will stay allocated until all osmo_fsm_inst_term() are complete and all of them will be deallocated at the same time. Mark the deferred deallocation state as __thread in an attempt to make cascaded deallocation handling threadsafe. Keep the enable/disable flag separate, so that it is global and not per-thread. The feature is showcased by fsm_dealloc_test.c: with this feature, all of those wild deallocation scenarios succeed. Make fsm_dealloc_test a normal regression test in testsuite.at. Rationale: It is difficult to gracefully handle deallocations of groups of FSM instances that reference each other. As soon as one child dispatching a cleanup event causes its parent to deallocate before fsm.c was ready for it, deallocation will hit a use-after-free. Before this patch, by using parent_term events and distinct "terminating" FSM states, parent/child FSMs can be taught to wait for all children to deallocate before deallocating the parent. But as soon as a non-child / non-parent FSM instance is involved, or actually any other cleanup() action that triggers parent FSMs or parent talloc contexts to become unused, it is near impossible to think of all possible deallocation events ricocheting, and to avoid running into freeing FSM instances that were still in the middle of osmo_fsm_inst_term(), or FSM instances to enter osmo_fsm_inst_term() more than once. This patch makes deallocation of "all possible" setups of complex cross referencing FSM instances easy to handle correctly, without running into use-after-free or double free situations, and, notably, without changing calling code. Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 --- M include/osmocom/core/fsm.h M src/fsm.c M tests/Makefile.am M tests/fsm/fsm_dealloc_test.c M tests/fsm/fsm_dealloc_test.err M tests/testsuite.at 6 files changed, 3,503 insertions(+), 301 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/13392/7 -- To view, visit https://gerrit.osmocom.org/13392 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 Gerrit-Change-Number: 13392 Gerrit-PatchSet: 7 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 14:08:21 2019 From: gerrit-no-reply at lists.osmocom.org (Rafael Diniz) Date: Mon, 8 Apr 2019 14:08:21 +0000 Subject: Change in osmo-pcu[master]: Fix help message formatting of osmo-pcu. In-Reply-To: References: Message-ID: Rafael Diniz has posted comments on this change. ( https://gerrit.osmocom.org/13542 ) Change subject: Fix help message formatting of osmo-pcu. ...................................................................... Patch Set 3: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/13542/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13542/1//COMMIT_MSG at 7 PS1, Line 7: Fix help message formatting of osmo-pcu. > In general, all our commits make something better ;) [?] Removed the "better" assumption. https://gerrit.osmocom.org/#/c/13542/1/src/pcu_main.cpp File src/pcu_main.cpp: https://gerrit.osmocom.org/#/c/13542/1/src/pcu_main.cpp at 81 PS1, Line 81: \ > This dot could be also removed. Done. -- To view, visit https://gerrit.osmocom.org/13542 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f Gerrit-Change-Number: 13542 Gerrit-PatchSet: 3 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Rafael Diniz Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 08 Apr 2019 14:08:21 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 14:13:32 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 14:13:32 +0000 Subject: Change in osmo-msc[master]: sgs_iface: fix nullpointer dereference In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13513 ) Change subject: sgs_iface: fix nullpointer dereference ...................................................................... Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13513/2/src/libmsc/sgs_iface.c File src/libmsc/sgs_iface.c: https://gerrit.osmocom.org/#/c/13513/2/src/libmsc/sgs_iface.c at 304 PS2, Line 304: LOGP(LOGL_NOTICE, DSGS, "Cannot transmit %s: connection dead. Discarding\n", (could also do the NULL check in the log macro, which would solve all possible null dereferences from SGC logging everywhere) -- To view, visit https://gerrit.osmocom.org/13513 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6 Gerrit-Change-Number: 13513 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-Comment-Date: Mon, 08 Apr 2019 14:13:32 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 14:20:17 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 14:20:17 +0000 Subject: Change in osmo-msc[master]: a_iface_bssap: check bssmap length field In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13307 ) Change subject: a_iface_bssap: check bssmap length field ...................................................................... Patch Set 5: > I had a look at your code. To me it looks ok to discard the whole message if there is excess data as it either means that the message was damaged of the receiving end has some significant problems. However, the ticket that is related to the task says that the message should only be truncated: http://osmocom.org/issues/3806 Ah ok, I've adopted this patch's truncation on my branch as: if (msgb_l3len(bssmap) > h->length) { LOG_NAS_A_DEC(nas_dec, LOGL_NOTICE, "There are %u extra bytes after the BSSMAP data, truncating\n", msgb_l3len(bssmap) - h->length); msgb_l3trim(bssmap, h->length); } -- To view, visit https://gerrit.osmocom.org/13307 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3b89dd5a66ec83b03860b58b6b8eb58007f433a4 Gerrit-Change-Number: 13307 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-Comment-Date: Mon, 08 Apr 2019 14:20:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 14:25:38 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Apr 2019 14:25:38 +0000 Subject: Change in osmo-msc[master]: sgs_iface: fix nullpointer dereference In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/13513 ) Change subject: sgs_iface: fix nullpointer dereference ...................................................................... Patch Set 2: (1 comment) > (1 comment) https://gerrit.osmocom.org/#/c/13513/2/src/libmsc/sgs_iface.c File src/libmsc/sgs_iface.c: https://gerrit.osmocom.org/#/c/13513/2/src/libmsc/sgs_iface.c at 304 PS2, Line 304: LOGP(LOGL_NOTICE, DSGS, "Cannot transmit %s: connection dead. Discarding\n", > (could also do the NULL check in the log macro, which would solve all possible null dereferences fro [?] I don't think that this would be a good idea since it would cover up problems like this. -- To view, visit https://gerrit.osmocom.org/13513 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6 Gerrit-Change-Number: 13513 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-Comment-Date: Mon, 08 Apr 2019 14:25:38 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 14:44:59 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Apr 2019 14:44:59 +0000 Subject: Change in osmo-hlr[master]: USSD: don't use gsm0480_msgb_alloc_name() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13548 ) Change subject: USSD: don't use gsm0480_msgb_alloc_name() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13548/1/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13548/1/src/hlr_ussd.c at 244 PS1, Line 244: resp_msg = msgb_alloc_headroom(4000, 64, __func__); just wndering why do we need so much space/headroom. Why did you choose this number? -- To view, visit https://gerrit.osmocom.org/13548 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icdab40c6a933888eb9f51bee9c5264c8919dbf7b Gerrit-Change-Number: 13548 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 08 Apr 2019 14:44:59 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 14:46:44 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Apr 2019 14:46:44 +0000 Subject: Change in osmo-hlr[master]: Cosmetic: gsup_route_find: comment addr, addrlen In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13549 ) Change subject: Cosmetic: gsup_route_find: comment addr, addrlen ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13549 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb Gerrit-Change-Number: 13549 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 08 Apr 2019 14:46:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 14:57:11 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 14:57:11 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 7: (2 comments) https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c at 248 PS7, Line 248: ss->vlr_number_len = strlen(subscr.vlr_number) + 1; > (I still don't like the +1 on the strlen, I think we may need to discuss the blob plan separately so [?] Me neither, but at least I've documented the current state here: https://gerrit.osmocom.org/#/c/osmo-hlr/+/13549/ https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c at 562 PS7, Line 562: if (gsup->source_name) { Why do you think we can skip this patch chunk? This is how I've interpreted your comment [1]: > For all MO USSD sessions, store the originating MSC's vlr_name in ss-> on the first message coming in from the MSC/VLR. ...and isn't the only place where we know if a message is MO USSD or MT USSD right here? And if we do skip it, where should ss->vlr_number get filled out instead? [1]: https://gerrit.osmocom.org/#/c/osmo-hlr/+/13479/5/src/hlr_ussd.c at 175 -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 7 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 14:57:11 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 14:59:00 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 14:59:00 +0000 Subject: Change in osmo-hlr[master]: USSD: fix routing to multiple MSC In-Reply-To: References: Message-ID: osmith has uploaded a new patch set (#8) to the change originally created by Neels Hofmeyr. ( https://gerrit.osmocom.org/13479 ) Change subject: USSD: fix routing to multiple MSC ...................................................................... USSD: fix routing to multiple MSC hlr_ussd.c so far hardcoded osmo-msc's default IPA-name and hence was only able to negotiate USSD sessions to - a single osmo-msc - that has no custom IPA-name set. Fix: correctly route USSD to any number of MSC with any custom IPA names. Resolve the right MSC's IPA name from the USSD session's IMSI, using hlr_subscriber->vlr_number to determine the right GSUP peer. Cache it in ss_session->vlr_number to have at most one db hit for routing per session. Related: OS#3710 Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 --- M src/hlr_ussd.c 1 file changed, 35 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/79/13479/8 -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 8 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 14:59:00 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 14:59:00 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13515 to look at the new patch set (#8). Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... USSD: save MO USSD's originating MSC's vlr_number Save the source MSC/VLR in ss_session, so we can send "invalid IMSI" messages to the originating MSC. Related: OS#3710 Depends: Ic00b0601eacff6d72927cea51767801142ee75db (libosmocore.git) Change-Id: If5a65f471672949192061c5fe396603611123bc1 --- M src/hlr_ussd.c 1 file changed, 16 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/13515/8 -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 8 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 14:59:04 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 14:59:04 +0000 Subject: Change in osmo-hlr[master]: USSD: fix routing to multiple MSC In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13479 ) Change subject: USSD: fix routing to multiple MSC ...................................................................... Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c at 171 PS7, Line 171: vlr_number > In the current state I would agree, but I know where this is coming from. [?] Done -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 7 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 14:59:04 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 15:04:32 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 15:04:32 +0000 Subject: Change in osmo-hlr[master]: USSD: don't use gsm0480_msgb_alloc_name() In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13548 ) Change subject: USSD: don't use gsm0480_msgb_alloc_name() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13548/1/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13548/1/src/hlr_ussd.c at 244 PS1, Line 244: resp_msg = msgb_alloc_headroom(4000, 64, __func__); > just wndering why do we need so much space/headroom. [?] To match what osmo_gsup_client_msgb_alloc() is doing, so the server messages have the same size as the client messages. -- To view, visit https://gerrit.osmocom.org/13548 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icdab40c6a933888eb9f51bee9c5264c8919dbf7b Gerrit-Change-Number: 13548 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 15:04:32 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 15:04:57 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 15:04:57 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c at 562 PS7, Line 562: if (gsup->source_name) { > Why do you think we can skip this patch chunk? This is how I've interpreted your comment [1]: [?] gsup->source_name and gsup->destination_name are only included in messages that need routing, i.e. currently exactly for inter-MSC E-interface messages. No other messages contain a source name IE. Here we are in USSD negotiation land, a completely separate level from inter-MSC routing. For USSD, you always have the VLR/MSC directly talking to the osmo-hlr, and there is the single GSUP connection on which the response should go back. So that would be stored on the MO USSD request coming in. Otherwise we would lookup the database's vlr_number for the subscriber, but IIUC that doesn't apply here. Definitely never source_name. -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 7 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 15:04:57 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 15:10:48 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 15:10:48 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 7: (2 comments) https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c at 538 PS7, Line 538: } Need to store ss->vlr_number from conn->* here https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c at 562 PS7, Line 562: if (gsup->source_name) { > gsup->source_name and gsup->destination_name are only included in messages that need routing, i.e. [?] and drop this chunk -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 7 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 15:10:48 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 15:20:56 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 8 Apr 2019 15:20:56 +0000 Subject: Change in osmo-hlr[master]: Cosmetic: gsup_route_find: comment addr, addrlen In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13549 ) Change subject: Cosmetic: gsup_route_find: comment addr, addrlen ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13549 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb Gerrit-Change-Number: 13549 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 08 Apr 2019 15:20:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 15:21:23 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 8 Apr 2019 15:21:23 +0000 Subject: Change in osmo-pcu[master]: Fix help message formatting of osmo-pcu. In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13542 ) Change subject: Fix help message formatting of osmo-pcu. ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13542 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f Gerrit-Change-Number: 13542 Gerrit-PatchSet: 3 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Rafael Diniz Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 08 Apr 2019 15:21:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 15:25:21 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Apr 2019 15:25:21 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 7: (3 comments) https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c at 538 PS7, Line 538: } > Need to store ss->vlr_number from conn->* here wrong again! :/ the function is also called for GSUP from the EUSE, so in fact the place below looks correct. Sorry for the confusion. https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c at 562 PS7, Line 562: if (gsup->source_name) { > and drop this chunk ok so this place is correct, but use conn->where_ever_you_find_the_peers_ipa_name https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c at 569 PS7, Line 569: } else { with the limitation that I don't understand this else case -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 7 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 15:25:21 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 15:34:58 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 15:34:58 +0000 Subject: Change in osmo-hlr[master]: Cosmetic: gsup_route_find: comment addr, addrlen In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13549 ) Change subject: Cosmetic: gsup_route_find: comment addr, addrlen ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13549 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb Gerrit-Change-Number: 13549 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 15:34:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 15:35:01 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 8 Apr 2019 15:35:01 +0000 Subject: Change in osmo-hlr[master]: Cosmetic: gsup_route_find: comment addr, addrlen In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13549 ) Change subject: Cosmetic: gsup_route_find: comment addr, addrlen ...................................................................... Cosmetic: gsup_route_find: comment addr, addrlen Describe the addr, addrlen parameters in gsup_route_find() and (more commonly used) osmo_gsup_addr_send(). Without this description, it is easy to get the parameters wrong and have routes not being found, as shown with debug prints like these: gsup_route_find: addr, addrlen: "MSC-13-37-00-00-00-00", 21 gsup_route_find: comparing with: "MSC-13-37-00-00-00-00\0", 22 Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb --- M src/gsup_router.c M src/gsup_send.c 2 files changed, 15 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Vadim Yanitskiy: Looks good to me, but someone else must approve osmith: Looks good to me, approved diff --git a/src/gsup_router.c b/src/gsup_router.c index 16ea202..4fedd38 100644 --- a/src/gsup_router.c +++ b/src/gsup_router.c @@ -33,7 +33,13 @@ struct osmo_gsup_conn *conn; }; -/* find a route for the given address */ +/*! Find a route for the given address. + * \param[in] gs gsup server + * \param[in] addr IPA name of the client (SGSN, MSC/VLR). Although this is passed like a blob, together with the + * length, it must be nul-terminated! This is for legacy reasons, see the discussion here: + * https://gerrit.osmocom.org/#/c/osmo-hlr/+/13048/ + * \param[in] addrlen length of addr, *including the nul-byte* (strlen(addr) + 1). + */ struct osmo_gsup_conn *gsup_route_find(struct osmo_gsup_server *gs, const uint8_t *addr, size_t addrlen) { diff --git a/src/gsup_send.c b/src/gsup_send.c index b2c4e02..889cf63 100644 --- a/src/gsup_send.c +++ b/src/gsup_send.c @@ -26,7 +26,14 @@ #include -/* Send a msgb to a given address using routing */ +/*! Send a msgb to a given address using routing. + * \param[in] gs gsup server + * \param[in] addr IPA name of the client (SGSN, MSC/VLR). Although this is passed like a blob, together with the + * length, it must be nul-terminated! This is for legacy reasons, see the discussion here: + * https://gerrit.osmocom.org/#/c/osmo-hlr/+/13048/ + * \param[in] addrlen length of addr, *including the nul-byte* (strlen(addr) + 1). + * \param[in] msg message buffer + */ int osmo_gsup_addr_send(struct osmo_gsup_server *gs, const uint8_t *addr, size_t addrlen, struct msgb *msg) -- To view, visit https://gerrit.osmocom.org/13549 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb Gerrit-Change-Number: 13549 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 17:47:39 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 8 Apr 2019 17:47:39 +0000 Subject: Change in osmo-hlr[master]: USSD: fix routing to multiple MSC In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13479 ) Change subject: USSD: fix routing to multiple MSC ...................................................................... Patch Set 8: (2 comments) Just a few final recommendations, looks fine to me ;) https://gerrit.osmocom.org/#/c/13479/8/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13479/8/src/hlr_ussd.c at 239 PS8, Line 239: for IMSI %s This is redundant, LOGPSS() does print IMSI. https://gerrit.osmocom.org/#/c/13479/8/src/hlr_ussd.c at 248 PS8, Line 248: LOGP LOGPSS()? There will be no need to print "for subscriber %s...". -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 8 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 08 Apr 2019 17:47:39 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 19:11:19 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Apr 2019 19:11:19 +0000 Subject: Change in osmo-gsm-tester[master]: Revert "modem: workaround ofono crash" Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13550 Change subject: Revert "modem: workaround ofono crash" ...................................................................... Revert "modem: workaround ofono crash" We already updated our ofono branch to current master (after 1.28), and this fix is not longer required, as stated in ticket OS#3064. Related: OS#3064 This reverts commit f8d12196f05b20aa28b3103db26ea37ba6849362. Change-Id: I884f6d4f3df4f3b4e2ac05e4dba2ad8704697521 --- M src/osmo_gsm_tester/modem.py 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/50/13550/1 diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py index 7e58e32..2d539eb 100644 --- a/src/osmo_gsm_tester/modem.py +++ b/src/osmo_gsm_tester/modem.py @@ -590,7 +590,6 @@ req_ifaces = self._required_ifaces() if self.is_powered(): self.dbg('Power cycling') - MainLoop.sleep(self, 1.0) # workaround for ofono bug OS#3064 self.power_off() else: self.dbg('Powering on') -- To view, visit https://gerrit.osmocom.org/13550 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I884f6d4f3df4f3b4e2ac05e4dba2ad8704697521 Gerrit-Change-Number: 13550 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 8 19:28:03 2019 From: gerrit-no-reply at lists.osmocom.org (Rafael Diniz) Date: Mon, 8 Apr 2019 19:28:03 +0000 Subject: Change in osmo-pcu[master]: Fix help message formatting of osmo-pcu. In-Reply-To: References: Message-ID: Rafael Diniz has submitted this change and it was merged. ( https://gerrit.osmocom.org/13542 ) Change subject: Fix help message formatting of osmo-pcu. ...................................................................... Fix help message formatting of osmo-pcu. Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f --- M src/pcu_main.cpp 1 file changed, 8 insertions(+), 8 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, approved Rafael Diniz: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index c39c337..1003e3c 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -65,20 +65,20 @@ static void print_help() { - printf( "Some useful options:\n" - " -h --help this text\n" + printf( "Options:\n" + " -h --help This text\n" " -c --config-file Specify the filename of the config " "file\n" - " -m --mcc MCC use given MCC instead of value " + " -m --mcc MCC Use given MCC instead of value " "provided by BTS\n" - " -n --mnc MNC use given MNC instead of value " + " -n --mnc MNC Use given MNC instead of value " "provided by BTS\n" - " -V --version print version\n" - " -r --realtime PRIO Use SCHED_RR with the specified " + " -V --version Print version\n" + " -r --realtime PRIO Use SCHED_RR with the specified " "priority\n" - " -D --daemonize Fork the process into a background" + " -D --daemonize Fork the process into a background " "daemon\n" - " -i --gsmtap-ip The destination IP used for GSMTAP.\n" + " -i --gsmtap-ip The destination IP used for GSMTAP\n" ); } -- To view, visit https://gerrit.osmocom.org/13542 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f Gerrit-Change-Number: 13542 Gerrit-PatchSet: 4 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Rafael Diniz Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 03:20:45 2019 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Tue, 9 Apr 2019 03:20:45 +0000 Subject: Change in osmo-ci[master]: jenkins docker: Install lcov and lcov-cobertura Message-ID: Vasil Velichkov has uploaded this change for review. ( https://gerrit.osmocom.org/13551 Change subject: jenkins docker: Install lcov and lcov-cobertura ...................................................................... jenkins docker: Install lcov and lcov-cobertura They are used for generating code coverage reports Change-Id: I26896a9807e756b1f935cd3ed524d25ee22efaed --- M docker/Dockerfile_osmocom_jenkins.amd64 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/51/13551/1 diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64 index f87d80d..3f499ad 100644 --- a/docker/Dockerfile_osmocom_jenkins.amd64 +++ b/docker/Dockerfile_osmocom_jenkins.amd64 @@ -66,3 +66,7 @@ dpkg-reconfigure --frontend=noninteractive locales && \ update-locale LANG=en_US.UTF-8 ENV LANG en_US.UTF-8 + +# Code coverage tools +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y lcov +RUN pip3 install git+https://github.com/eriwen/lcov-to-cobertura-xml/ -- To view, visit https://gerrit.osmocom.org/13551 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I26896a9807e756b1f935cd3ed524d25ee22efaed Gerrit-Change-Number: 13551 Gerrit-PatchSet: 1 Gerrit-Owner: Vasil Velichkov -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 03:28:44 2019 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Tue, 9 Apr 2019 03:28:44 +0000 Subject: Change in libosmocore[master]: Add code coverage support In-Reply-To: References: Message-ID: Vasil Velichkov has posted comments on this change. ( https://gerrit.osmocom.org/13496 ) Change subject: Add code coverage support ...................................................................... Patch Set 4: > https://jenkins.osmocom.org/jenkins/job/gerrit-libosmocore/1795/ : FAILURE > checking for lcov... no checking for genhtml... no configure: error: To enable code coverage reporting you must have lcov installed Just added installation of lcov and lcov_cobertura to osmo-ci/docker/Dockerfile_osmocom_jenkins.amd64 in https://gerrit.osmocom.org/c/osmo-ci/+/13551 -- To view, visit https://gerrit.osmocom.org/13496 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c Gerrit-Change-Number: 13496 Gerrit-PatchSet: 4 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: Vasil Velichkov Gerrit-Comment-Date: Tue, 09 Apr 2019 03:28:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 06:32:28 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Apr 2019 06:32:28 +0000 Subject: Change in osmo-ci[master]: jenkins docker: Install lcov and lcov-cobertura In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13551 ) Change subject: jenkins docker: Install lcov and lcov-cobertura ...................................................................... Patch Set 1: Hi Vasil, could you outline somewhere (mailinglist? maybe a wiki page?) how this would work together? This Dockerfile which you're patching is used for build verification of gerrit patches. Do you want to run coverage reports on every build of every patch before commit? I would argue it makes more sense to have coverage reports done once per day? I really appreciate you investing time on this, I just want to know how everything fits together before merging individual changes before knowing the bigger picture. Thanks! -- To view, visit https://gerrit.osmocom.org/13551 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I26896a9807e756b1f935cd3ed524d25ee22efaed Gerrit-Change-Number: 13551 Gerrit-PatchSet: 1 Gerrit-Owner: Vasil Velichkov Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 09 Apr 2019 06:32:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 06:33:49 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Apr 2019 06:33:49 +0000 Subject: Change in osmo-gsm-tester[master]: Revert "modem: workaround ofono crash" In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13550 ) Change subject: Revert "modem: workaround ofono crash" ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13550 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I884f6d4f3df4f3b4e2ac05e4dba2ad8704697521 Gerrit-Change-Number: 13550 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 09 Apr 2019 06:33:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 06:59:36 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 9 Apr 2019 06:59:36 +0000 Subject: Change in osmo-sgsn[master]: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/13544 ) Change subject: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. ...................................................................... Patch Set 3: Code-Review+2 TS 25.413: 8.5.1: says a IU Release Command should be sent in "Completion of transaction between UE and CN." I'ven't looked into the whole problem of sending a release. Because the problem might bigger than this single Attach Complete, but I rather would like to merge it now. -- To view, visit https://gerrit.osmocom.org/13544 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Gerrit-Change-Number: 13544 Gerrit-PatchSet: 3 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 09 Apr 2019 06:59:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 07:07:33 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 9 Apr 2019 07:07:33 +0000 Subject: Change in osmo-sgsn[master]: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/13544 ) Change subject: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. ...................................................................... Patch Set 3: I expect that we have a similiar problem on IUcs. -- To view, visit https://gerrit.osmocom.org/13544 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Gerrit-Change-Number: 13544 Gerrit-PatchSet: 3 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 09 Apr 2019 07:07:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 07:56:02 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Apr 2019 07:56:02 +0000 Subject: Change in libosmocore[master]: gsm_utils.c: fix Doxygen description for gsm_get_octet_len() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13552 Change subject: gsm_utils.c: fix Doxygen description for gsm_get_octet_len() ...................................................................... gsm_utils.c: fix Doxygen description for gsm_get_octet_len() Change-Id: Id6fd2cd33be1cb7cd7ff6a43bfcfb1f368304522 --- M src/gsm/gsm_utils.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/52/13552/1 diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index f2bf57b..01cf2ce 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -185,10 +185,10 @@ return -1; } -/*! \brife Compute number of octets from number of septets, - * for instance: 47 septets needs 41,125 = 42 octets - * \param[in sept_len Number of Septets - * \returns Number of octets required */ +/*! Compute number of octets from number of septets. + * For instance: 47 septets need 41,125 = 42 octets. + * \param[in] sept_len Number of septets + * \returns Number of octets required */ uint8_t gsm_get_octet_len(const uint8_t sept_len){ int octet_len = (sept_len * 7) / 8; if ((sept_len * 7) % 8 != 0) -- To view, visit https://gerrit.osmocom.org/13552 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id6fd2cd33be1cb7cd7ff6a43bfcfb1f368304522 Gerrit-Change-Number: 13552 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 08:04:50 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 9 Apr 2019 08:04:50 +0000 Subject: Change in osmo-hlr[master]: USSD: fix routing to multiple MSC In-Reply-To: References: Message-ID: osmith has uploaded a new patch set (#9) to the change originally created by Neels Hofmeyr. ( https://gerrit.osmocom.org/13479 ) Change subject: USSD: fix routing to multiple MSC ...................................................................... USSD: fix routing to multiple MSC hlr_ussd.c so far hardcoded osmo-msc's default IPA-name and hence was only able to negotiate USSD sessions to - a single osmo-msc - that has no custom IPA-name set. Fix: correctly route USSD to any number of MSC with any custom IPA names. Resolve the right MSC's IPA name from the USSD session's IMSI, using hlr_subscriber->vlr_number to determine the right GSUP peer. Cache it in ss_session->vlr_number to have at most one db hit for routing per session. Related: OS#3710 Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 --- M src/hlr_ussd.c 1 file changed, 33 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/79/13479/9 -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 08:04:50 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 9 Apr 2019 08:04:50 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13515 to look at the new patch set (#9). Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... USSD: save MO USSD's originating MSC's vlr_number Save the source IPA name in ss_session, so we can send "invalid IMSI" messages to the originating MSC. Related: OS#3710 Change-Id: If5a65f471672949192061c5fe396603611123bc1 --- M src/gsup_router.c M src/gsup_router.h M src/hlr_ussd.c 3 files changed, 48 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/13515/9 -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 9 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 08:05:22 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 9 Apr 2019 08:05:22 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 8: (2 comments) https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c at 562 PS7, Line 562: if (gsup->source_name) { > ok so this place is correct, but use conn->where_ever_you_find_the_peers_ipa_name Done https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c at 569 PS7, Line 569: } else { TL;DR of handle_ussd() [1] is: > return -ENOTSUP; So I think it is fine to only care about ss->vlr_number in the "if (ss_op_is_ussd(req.opcode)) {" case. [1]: https://git.osmocom.org/osmo-hlr/tree/src/hlr_ussd.c?id=f7d3251d9ac4ba29fc2cebc55106c2400d8a9423#n395 -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 8 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 09 Apr 2019 08:05:22 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 08:15:38 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Apr 2019 08:15:38 +0000 Subject: Change in libosmocore[master]: gsm_03_40.h: define max SM-TP-UDL (User-Data-Length) values Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13553 Change subject: gsm_03_40.h: define max SM-TP-UDL (User-Data-Length) values ...................................................................... gsm_03_40.h: define max SM-TP-UDL (User-Data-Length) values As per 3GPP TS 03.40, section 9.2.3.16 "TP-User-Data-Length (TP-UDL)" field may contain up to 140 octets (or 140 * 8 / 7 = 160 septets). Change-Id: I54f88d2908ac47228813fb8c049f4264e5145241 --- M include/osmocom/gsm/protocol/gsm_03_40.h 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/53/13553/1 diff --git a/include/osmocom/gsm/protocol/gsm_03_40.h b/include/osmocom/gsm/protocol/gsm_03_40.h index a65203f..33a5c59 100644 --- a/include/osmocom/gsm/protocol/gsm_03_40.h +++ b/include/osmocom/gsm/protocol/gsm_03_40.h @@ -3,6 +3,11 @@ #pragma once +/* SM-TP-UD (User-Data) field may contain up to 140 octets + * (or 140 * 8 / 7 = 160 septets). See section 9.2.3.24. */ +#define GSM340_UDL_OCT_MAX 140 /*!< Maximum TP-UD length (in octets) for 7-bit encoding */ +#define GSM340_UDL_SPT_MAX 160 /*!< Maximum TP-UD length (in seplets) for 8-bit and UCS-2 encoding */ + /** * 9.1.2.5 Type Of Number */ -- To view, visit https://gerrit.osmocom.org/13553 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I54f88d2908ac47228813fb8c049f4264e5145241 Gerrit-Change-Number: 13553 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 08:19:51 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 9 Apr 2019 08:19:51 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13515 to look at the new patch set (#10). Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... USSD: save MO USSD's originating MSC's vlr_number Save the source IPA name in ss_session, so we can send "invalid IMSI" messages to the originating MSC. Remove the fixed size from ss->vlr_number (we don't know the size of the IPA name when it does not come from the database). Add ss->vlr_number_len to give osmo_gsup_addr_send() the format it expects, and to have one less place in the code where the IPA names are not stored as blob. Looking up the IPA name from struct osmo_gsup_conn could either be done like in osmo_gsup_server_ccm_cb() by reading the IPA IEs (which has a FIXME comment), or by finding the route associated with conn. I went with the latter approach, because it seems cleaner to me. Related: OS#3710 Change-Id: If5a65f471672949192061c5fe396603611123bc1 --- M src/gsup_router.c M src/gsup_router.h M src/hlr_ussd.c 3 files changed, 47 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/13515/10 -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 10 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 08:24:30 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 9 Apr 2019 08:24:30 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 10: (1 comment) https://gerrit.osmocom.org/#/c/13515/10/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13515/10/src/hlr_ussd.c at 566 PS10, Line 566: LOGPSS(ss, LOGL_DEBUG, "Destination IPA name retrieved from GSUP route: %s\n", : osmo_quote_str((const char *)ss->vlr_number, ss->vlr_number_len)); I have verified that this message shows up in the log, with the correct IPA name, and that *#100# is still working :) -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 10 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 09 Apr 2019 08:24:30 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 08:28:21 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Apr 2019 08:28:21 +0000 Subject: Change in osmo-hlr[master]: USSD: fix routing to multiple MSC In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13479 ) Change subject: USSD: fix routing to multiple MSC ...................................................................... Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 09 Apr 2019 08:28:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 08:34:31 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 9 Apr 2019 08:34:31 +0000 Subject: Change in osmo-hlr[master]: USSD: fix routing to multiple MSC In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13479 ) Change subject: USSD: fix routing to multiple MSC ...................................................................... USSD: fix routing to multiple MSC hlr_ussd.c so far hardcoded osmo-msc's default IPA-name and hence was only able to negotiate USSD sessions to - a single osmo-msc - that has no custom IPA-name set. Fix: correctly route USSD to any number of MSC with any custom IPA names. Resolve the right MSC's IPA name from the USSD session's IMSI, using hlr_subscriber->vlr_number to determine the right GSUP peer. Cache it in ss_session->vlr_number to have at most one db hit for routing per session. Related: OS#3710 Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 --- M src/hlr_ussd.c 1 file changed, 33 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, approved diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index cc6aa8a..ea69cd9 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -34,6 +34,7 @@ #include "gsup_server.h" #include "gsup_router.h" #include "logging.h" +#include "db.h" /*********************************************************************** * core data structures expressing config from VTY @@ -166,6 +167,9 @@ const struct hlr_iuse *iuse; } u; + /* subscriber's vlr_number, will be looked up once per session and cached here */ + char vlr_number[32]; + /* we don't keep a pointer to the osmo_gsup_{route,conn} towards the MSC/VLR here, * as this might change during inter-VLR hand-over, and we simply look-up the serving MSC/VLR * every time we receive an USSD component from the EUSE */ @@ -222,6 +226,33 @@ * handling functions for encoding SS messages + wrapping them in GSUP ***********************************************************************/ +/* Resolve the target MSC by ss->imsi and send GSUP message. */ +static int ss_gsup_send(struct ss_session *ss, struct osmo_gsup_server *gs, struct msgb *msg) +{ + struct hlr_subscriber subscr = {}; + int rc; + + /* Use vlr_number as looked up by the caller, or look up now. */ + if (!ss->vlr_number[0]) { + rc = db_subscr_get_by_imsi(g_hlr->dbc, ss->imsi, &subscr); + if (rc < 0) { + LOGPSS(ss, LOGL_ERROR, "Cannot find subscriber, cannot route GSUP message\n"); + msgb_free(msg); + return -EINVAL; + } + osmo_strlcpy(ss->vlr_number, subscr.vlr_number, sizeof(ss->vlr_number)); + } + + if (!ss->vlr_number[0]) { + LOGPSS(ss, LOGL_ERROR, "Cannot send GSUP message, no VLR number stored for subscriber\n"); + msgb_free(msg); + return -EINVAL; + } + + LOGPSS(ss, LOGL_DEBUG, "Tx SS/USSD to VLR '%s'\n", ss->vlr_number); + return osmo_gsup_addr_send(gs, (uint8_t *)ss->vlr_number, strlen(ss->vlr_number) + 1, msg); +} + static int ss_tx_to_ms(struct ss_session *ss, enum osmo_gsup_message_type gsup_msg_type, bool final, struct msgb *ss_msg) @@ -246,8 +277,7 @@ osmo_gsup_encode(resp_msg, &resp); msgb_free(ss_msg); - /* FIXME: resolve this based on the database vlr_addr */ - return osmo_gsup_addr_send(g_hlr->gs, (uint8_t *)"MSC-00-00-00-00-00-00", 22, resp_msg); + return ss_gsup_send(ss, g_hlr->gs, resp_msg); } #if 0 @@ -433,8 +463,7 @@ OSMO_ASSERT(msg_out); /* Received from EUSE, Forward to VLR */ osmo_gsup_encode(msg_out, gsup); - /* FIXME: resolve this based on the database vlr_addr */ - osmo_gsup_addr_send(conn->server, (uint8_t *)"MSC-00-00-00-00-00-00", 22, msg_out); + ss_gsup_send(ss, conn->server, msg_out); } else { /* Received from VLR (MS) */ if (ss->is_external) { -- To view, visit https://gerrit.osmocom.org/13479 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 Gerrit-Change-Number: 13479 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 08:53:25 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Apr 2019 08:53:25 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 10: (2 comments) https://gerrit.osmocom.org/#/c/13515/10/src/gsup_router.c File src/gsup_router.c: https://gerrit.osmocom.org/#/c/13515/10/src/gsup_router.c at 50 PS10, Line 50: gsup_route_find_by_conn Doxygen comment is missing. https://gerrit.osmocom.org/#/c/13515/10/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13515/10/src/hlr_ussd.c at 566 PS10, Line 566: LOGPSS(ss, LOGL_DEBUG, "Destination IPA name retrieved from GSUP route: %s\n", : osmo_quote_str((const char *)ss->vlr_number, ss->vlr_number_len)); > I have verified that this message shows up in the log, with the correct IPA name, and that *#100# is [?] Did you check if TTCN-3 test cases pass after this change? As far as I can see, the IPA name is only being stored for 'unstructured' SS (i.e. USSD), but what about 'structured' SS (e.g. call forwarding, call waiting, etc.)? -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 10 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 09 Apr 2019 08:53:25 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 09:11:53 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Apr 2019 09:11:53 +0000 Subject: Change in osmo-sgsn[master]: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13544 ) Change subject: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. ...................................................................... Patch Set 3: Code-Review+2 > I expect that we have a similiar problem on IUcs. I don't think so. Due to the nature of dedicated channels, we have a very clear idea when to release it or not (even on 2G). -- To view, visit https://gerrit.osmocom.org/13544 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Gerrit-Change-Number: 13544 Gerrit-PatchSet: 3 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 09 Apr 2019 09:11:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 09:11:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Apr 2019 09:11:54 +0000 Subject: Change in osmo-sgsn[master]: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13544 ) Change subject: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. ...................................................................... gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. UE expects to receive Iu-ReleaseCommand after Attach Complete. If it doesn't receive it, then it sends Iu-ReleaseRequest after a timeout which makes the "PS Activation" process long. Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Related: OS#3908 --- M src/gprs/gprs_gmm.c 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: lynxis lazus: Looks good to me, approved Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index cc6ea4a..b0c5902 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -2035,6 +2035,13 @@ goto null_mmctx; /* only in case SGSN offered new P-TMSI */ LOGMMCTXP(LOGL_INFO, mmctx, "-> ATTACH COMPLETE\n"); + +#ifdef BUILD_IU + if (mmctx->iu.ue_ctx) { + ranap_iu_tx_release(mmctx->iu.ue_ctx, NULL); + } +#endif + mmctx_timer_stop(mmctx, 3350); mmctx->t3350_mode = GMM_T3350_MODE_NONE; mmctx->p_tmsi_old = 0; -- To view, visit https://gerrit.osmocom.org/13544 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Gerrit-Change-Number: 13544 Gerrit-PatchSet: 3 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 09:12:18 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Apr 2019 09:12:18 +0000 Subject: Change in libosmocore[master]: gsm_03_40.h: define max SM-TP-UDL (User-Data-Length) values In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13553 ) Change subject: gsm_03_40.h: define max SM-TP-UDL (User-Data-Length) values ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13553 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I54f88d2908ac47228813fb8c049f4264e5145241 Gerrit-Change-Number: 13553 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 09 Apr 2019 09:12:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 09:12:46 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Apr 2019 09:12:46 +0000 Subject: Change in libosmocore[master]: gsm_utils.c: fix Doxygen description for gsm_get_octet_len() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13552 ) Change subject: gsm_utils.c: fix Doxygen description for gsm_get_octet_len() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13552 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id6fd2cd33be1cb7cd7ff6a43bfcfb1f368304522 Gerrit-Change-Number: 13552 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Tue, 09 Apr 2019 09:12:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 09:15:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Apr 2019 09:15:08 +0000 Subject: Change in libosmocore[master]: fsm: add flag to ensure osmo_fsm_inst_term() happens only once In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13545 ) Change subject: fsm: add flag to ensure osmo_fsm_inst_term() happens only once ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13545 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0c02d76a86f90c49e0eae2f85db64704c96a7674 Gerrit-Change-Number: 13545 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 09 Apr 2019 09:15:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 09:20:11 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Apr 2019 09:20:11 +0000 Subject: Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13392 ) Change subject: fsm: support graceful osmo_fsm_inst_term() cascades ...................................................................... Patch Set 7: Code-Review+1 (2 comments) it might make sense to expose the value of this global flag variable in the fsm VTY code, so that "show fsm" would give you an indication? https://gerrit.osmocom.org/#/c/13392/4/src/fsm.c File src/fsm.c: https://gerrit.osmocom.org/#/c/13392/4/src/fsm.c at 409 PS4, Line 409: */ > So after all it seems like a bad idea to do this optimization. We > don't want to risk our sanity, right. ACK https://gerrit.osmocom.org/#/c/13392/7/src/fsm.c File src/fsm.c: https://gerrit.osmocom.org/#/c/13392/7/src/fsm.c at 105 PS7, Line 105: = {}; I'm not sure you can do this to a __thread variable. The initializer is likely only applied at compile time and the thread-local copy is generated at runtime? But well, maybe it simply works. Why do you want to have a {} here anyway? As per the ABI spec, all 'static' variables are zero-initialized, always. -- To view, visit https://gerrit.osmocom.org/13392 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 Gerrit-Change-Number: 13392 Gerrit-PatchSet: 7 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 09 Apr 2019 09:20:11 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 09:39:27 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Tue, 9 Apr 2019 09:39:27 +0000 Subject: Change in osmo-sgsn[master]: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. In-Reply-To: References: Message-ID: Mykola Shchetinin has posted comments on this change. ( https://gerrit.osmocom.org/13544 ) Change subject: gsm0408_rcv_gmm: send Iu-ReleaseCommand upon receiving Attach Complete. ...................................................................... Patch Set 3: Cool. Then that resolves the issue OS#3908. It doesn't seem that I can close it. -- To view, visit https://gerrit.osmocom.org/13544 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib5053e3cd655d08ff3fd0fefa48325fabb1797c8 Gerrit-Change-Number: 13544 Gerrit-PatchSet: 3 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 09 Apr 2019 09:39:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 09:44:57 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Apr 2019 09:44:57 +0000 Subject: Change in osmo-gsm-tester[master]: Revert "modem: workaround ofono crash" In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13550 ) Change subject: Revert "modem: workaround ofono crash" ...................................................................... Revert "modem: workaround ofono crash" We already updated our ofono branch to current master (after 1.28), and this fix is not longer required, as stated in ticket OS#3064. Related: OS#3064 This reverts commit f8d12196f05b20aa28b3103db26ea37ba6849362. Change-Id: I884f6d4f3df4f3b4e2ac05e4dba2ad8704697521 --- M src/osmo_gsm_tester/modem.py 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py index 7e58e32..2d539eb 100644 --- a/src/osmo_gsm_tester/modem.py +++ b/src/osmo_gsm_tester/modem.py @@ -590,7 +590,6 @@ req_ifaces = self._required_ifaces() if self.is_powered(): self.dbg('Power cycling') - MainLoop.sleep(self, 1.0) # workaround for ofono bug OS#3064 self.power_off() else: self.dbg('Powering on') -- To view, visit https://gerrit.osmocom.org/13550 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I884f6d4f3df4f3b4e2ac05e4dba2ad8704697521 Gerrit-Change-Number: 13550 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 10:55:30 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Apr 2019 10:55:30 +0000 Subject: Change in osmo-msc[master]: sms_queue: Print dest msisdn instead of unknown subscriber Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13554 Change subject: sms_queue: Print dest msisdn instead of unknown subscriber ...................................................................... sms_queue: Print dest msisdn instead of unknown subscriber If subscriber is NULL, vlr_subscr_msisdn_or_name() returns string "unknown", which is less informative than printing destination msisdn expected for the queued sms. This happens for instance if an sms was queued with Store&Forward and destination subscriber is not currently registered Change-Id: I4b8b54c9c41b17d4e1fa7ece63aa91a98036ef11 --- M src/libmsc/sms_queue.c 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/54/13554/1 diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index 274c712..d1a3018 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -192,6 +192,8 @@ } } +static const char* + /* Find the next pending SMS by cycling through the recipients. We could also * cycle through the pending SMS, but that might cause us to keep trying to * send SMS to the same few subscribers repeatedly while not servicing other @@ -205,6 +207,7 @@ int wrapped = 0; int sanity = 100; char started_with_msisdn[last_msisdn_buflen]; + char *subscr_name; OSMO_STRLCPY_ARRAY(started_with_msisdn, last_msisdn); @@ -227,9 +230,11 @@ /* Is the subscriber attached? If not, go to next SMS */ if (!sms->receiver || !sms->receiver->lu_complete) { + subscr_name = sms->receiver ? vlr_subscr_msisdn_or_name(sms->receiver) : + sms->dst.addr; LOGP(DLSMS, LOGL_DEBUG, - "Subscriber %s is not attached, skipping SMS %llu\n", - vlr_subscr_msisdn_or_name(sms->receiver), sms->id); + "Subscriber %s%s is not attached, skipping SMS %llu\n", + sms->receiver ? "" : "MSISDN-", subscr_name, sms->id); sms_free(sms); continue; } -- To view, visit https://gerrit.osmocom.org/13554 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4b8b54c9c41b17d4e1fa7ece63aa91a98036ef11 Gerrit-Change-Number: 13554 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 11:00:36 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 9 Apr 2019 11:00:36 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13515 to look at the new patch set (#11). Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... USSD: save MO USSD's originating MSC's vlr_number Save the source IPA name in ss_session, so we can send "invalid IMSI" messages to the originating MSC. Remove the fixed size from ss->vlr_number (we don't know the size of the IPA name when it does not come from the database). Add ss->vlr_number_len to give osmo_gsup_addr_send() the format it expects, and to have one less place in the code where the IPA names are not stored as blob. Looking up the IPA name from struct osmo_gsup_conn could either be done like in osmo_gsup_server_ccm_cb() by reading the IPA IEs (which has a FIXME comment), or by finding the route associated with conn. I went with the latter approach, because it seems cleaner to me. Related: OS#3710 Change-Id: If5a65f471672949192061c5fe396603611123bc1 --- M src/gsup_router.c M src/gsup_router.h M src/hlr_ussd.c 3 files changed, 52 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/13515/11 -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 11 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 11:01:29 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 9 Apr 2019 11:01:29 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 10: (2 comments) https://gerrit.osmocom.org/#/c/13515/10/src/gsup_router.c File src/gsup_router.c: https://gerrit.osmocom.org/#/c/13515/10/src/gsup_router.c at 50 PS10, Line 50: gsup_route_find_by_conn > Doxygen comment is missing. Done https://gerrit.osmocom.org/#/c/13515/10/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13515/10/src/hlr_ussd.c at 566 PS10, Line 566: LOGPSS(ss, LOGL_DEBUG, "Destination IPA name retrieved from GSUP route: %s\n", : osmo_quote_str((const char *)ss->vlr_number, ss->vlr_number_len)); > Did you check if TTCN-3 test cases pass after this change? [?] Neels also pointed this out and I thought it was only needed for USSD. But you are right, it is needed for the unstructured SS too, or else the TTCN3 test will fail. This is fixed in patchset 11. Also all TTCN3 tests pass there again. Regarding TTCN3, it would have been better if I also checked the previous patch that has been merged to master [1], because this one causes several failures. Probably because vlr_number is not set in the testdb that osmo-hlr is running with, and since MSC-00... isn't hardcoded anymore, it doesn't know where to send the messages :\ [1]: https://gerrit.osmocom.org/#/c/osmo-hlr/+/13479/ -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 10 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 09 Apr 2019 11:01:29 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 11:03:22 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 9 Apr 2019 11:03:22 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 11: To clarify: when this patch will be merged, the ttcn3-hlr-tests will pass again. -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 11 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 09 Apr 2019 11:03:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 11:19:10 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Apr 2019 11:19:10 +0000 Subject: Change in osmo-msc[master]: sms_queue: Print dest msisdn instead of unknown subscriber In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13554 to look at the new patch set (#2). Change subject: sms_queue: Print dest msisdn instead of unknown subscriber ...................................................................... sms_queue: Print dest msisdn instead of unknown subscriber If subscriber is NULL, vlr_subscr_msisdn_or_name() returns string "unknown", which is less informative than printing destination msisdn expected for the queued sms. This happens for instance if an sms was queued with Store&Forward and destination subscriber is not currently registered Change-Id: I4b8b54c9c41b17d4e1fa7ece63aa91a98036ef11 --- M src/libmsc/sms_queue.c 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/54/13554/2 -- To view, visit https://gerrit.osmocom.org/13554 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b8b54c9c41b17d4e1fa7ece63aa91a98036ef11 Gerrit-Change-Number: 13554 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 11:19:11 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Apr 2019 11:19:11 +0000 Subject: Change in osmo-msc[master]: gsm_04_11: Log MT sms dst subscriber Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13555 Change subject: gsm_04_11: Log MT sms dst subscriber ...................................................................... gsm_04_11: Log MT sms dst subscriber Change-Id: I483ac61067f51d03f6f476821d8664da3d1f17b2 --- M src/libmsc/gsm_04_11.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/55/13555/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index ccb2610..9fb3a4e 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -1061,7 +1061,8 @@ struct gsm_trans *trans; int tid; - LOGP(DLSMS, LOGL_INFO, "Going to send a MT SMS\n"); + LOGP(DLSMS, LOGL_INFO, "Going to send a MT SMS to %s\n", + vlr_subscr_msisdn_or_name(vsub)); /* Generate a new transaction ID */ tid = trans_assign_trans_id(net, vsub, GSM48_PDISC_SMS); -- To view, visit https://gerrit.osmocom.org/13555 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I483ac61067f51d03f6f476821d8664da3d1f17b2 Gerrit-Change-Number: 13555 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 11:27:39 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Apr 2019 11:27:39 +0000 Subject: Change in osmo-msc[master]: sms_queue: Print dest msisdn instead of unknown subscriber In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13554 to look at the new patch set (#3). Change subject: sms_queue: Print dest msisdn instead of unknown subscriber ...................................................................... sms_queue: Print dest msisdn instead of unknown subscriber If subscriber is NULL, vlr_subscr_msisdn_or_name() returns string "unknown", which is less informative than printing destination msisdn expected for the queued sms. This happens for instance if an sms was queued with Store&Forward and destination subscriber is not currently registered Change-Id: I4b8b54c9c41b17d4e1fa7ece63aa91a98036ef11 --- M src/libmsc/sms_queue.c 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/54/13554/3 -- To view, visit https://gerrit.osmocom.org/13554 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b8b54c9c41b17d4e1fa7ece63aa91a98036ef11 Gerrit-Change-Number: 13554 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 11:29:28 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Apr 2019 11:29:28 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 11: Code-Review-1 (3 comments) -1 for missing talloc_strdup(). Didn't notice this before... https://gerrit.osmocom.org/#/c/13515/11/src/gsup_router.c File src/gsup_router.c: https://gerrit.osmocom.org/#/c/13515/11/src/gsup_router.c at 54 PS11, Line 54: struct just noticed (cosmetic, not a merge blocker): const. https://gerrit.osmocom.org/#/c/13515/11/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13515/11/src/hlr_ussd.c at 542 PS11, Line 542: gsup_rt->addr I think you also need to use talloc_strdup() here, so this would be consistent with ss_gsup_send(). Otherwise somebody would shoot himself / herself in the foot calling talloc_free(). https://gerrit.osmocom.org/#/c/13515/11/src/hlr_ussd.c at 546 PS11, Line 546: else Please use the { ... } brackets here too, so readability++. -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 11 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 09 Apr 2019 11:29:28 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 11:50:27 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 9 Apr 2019 11:50:27 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13515 to look at the new patch set (#12). Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... USSD: save MO USSD's originating MSC's vlr_number Save the source IPA name in ss_session, so we can send "invalid IMSI" messages to the originating MSC. Remove the fixed size from ss->vlr_number (we don't know the size of the IPA name when it does not come from the database). Add ss->vlr_number_len to give osmo_gsup_addr_send() the format it expects, and to have one less place in the code where the IPA names are not stored as blob. Looking up the IPA name from struct osmo_gsup_conn could either be done like in osmo_gsup_server_ccm_cb() by reading the IPA IEs (which has a FIXME comment), or by finding the route associated with conn. I went with the latter approach, because it seems cleaner to me. Related: OS#3710 Change-Id: If5a65f471672949192061c5fe396603611123bc1 --- M src/gsup_router.c M src/gsup_router.h M src/hlr_ussd.c 3 files changed, 53 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/13515/12 -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 12 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 11:51:52 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 9 Apr 2019 11:51:52 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 12: (3 comments) https://gerrit.osmocom.org/#/c/13515/11/src/gsup_router.c File src/gsup_router.c: https://gerrit.osmocom.org/#/c/13515/11/src/gsup_router.c at 54 PS11, Line 54: const > just noticed (cosmetic, not a merge blocker): const. Done https://gerrit.osmocom.org/#/c/13515/11/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13515/11/src/hlr_ussd.c at 542 PS11, Line 542: (uint8_t *)ta > I think you also need to use talloc_strdup() here, so this would be consistent with ss_gsup_send(). [?] Done https://gerrit.osmocom.org/#/c/13515/11/src/hlr_ussd.c at 546 PS11, Line 546: else > Please use the { ... } brackets here too, so readability++. Done -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 12 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 09 Apr 2019 11:51:52 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 12:11:00 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Apr 2019 12:11:00 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 12: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 12 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 09 Apr 2019 12:11:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 12:45:33 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Apr 2019 12:45:33 +0000 Subject: Change in osmo-msc[master]: sms_queue: Print dest msisdn instead of unknown subscriber In-Reply-To: References: Message-ID: Vadim Yanitskiy has uploaded a new patch set (#4) to the change originally created by Pau Espin Pedrol. ( https://gerrit.osmocom.org/13554 ) Change subject: sms_queue: Print dest msisdn instead of unknown subscriber ...................................................................... sms_queue: Print dest msisdn instead of unknown subscriber If subscriber is NULL, vlr_subscr_msisdn_or_name() returns string "unknown", which is less informative than printing destination msisdn expected for the queued sms. This happens for instance if an sms was queued with Store&Forward and destination subscriber is not currently registered Change-Id: I4b8b54c9c41b17d4e1fa7ece63aa91a98036ef11 --- M src/libmsc/sms_queue.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/54/13554/4 -- To view, visit https://gerrit.osmocom.org/13554 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b8b54c9c41b17d4e1fa7ece63aa91a98036ef11 Gerrit-Change-Number: 13554 Gerrit-PatchSet: 4 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 12:47:44 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Apr 2019 12:47:44 +0000 Subject: Change in osmo-msc[master]: gsm_04_11: Log MT sms dst subscriber In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13555 ) Change subject: gsm_04_11: Log MT sms dst subscriber ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13555/2/src/libmsc/gsm_04_11.c File src/libmsc/gsm_04_11.c: https://gerrit.osmocom.org/#/c/13555/2/src/libmsc/gsm_04_11.c at 1065 PS2, Line 1065: vlr_subscr_msisdn_or_name Logically, this is not a continuation of the format string, so it could be space-aligned with "DLSMS, ...". -- To view, visit https://gerrit.osmocom.org/13555 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I483ac61067f51d03f6f476821d8664da3d1f17b2 Gerrit-Change-Number: 13555 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 09 Apr 2019 12:47:44 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 13:15:57 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 9 Apr 2019 13:15:57 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 12: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13515/12/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13515/12/src/hlr_ussd.c at 247 PS12, Line 247: ss->vlr_number_len = strlen(subscr.vlr_number) + 1; reading this still hurts my eyes. I wish we could get rid of this weird duality, but ok for sake of not blocking this patch on a completely separate issue. -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 12 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 09 Apr 2019 13:15:57 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 13:19:16 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 9 Apr 2019 13:19:16 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... Patch Set 12: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 12 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 09 Apr 2019 13:19:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 13:19:19 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 9 Apr 2019 13:19:19 +0000 Subject: Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13515 ) Change subject: USSD: save MO USSD's originating MSC's vlr_number ...................................................................... USSD: save MO USSD's originating MSC's vlr_number Save the source IPA name in ss_session, so we can send "invalid IMSI" messages to the originating MSC. Remove the fixed size from ss->vlr_number (we don't know the size of the IPA name when it does not come from the database). Add ss->vlr_number_len to give osmo_gsup_addr_send() the format it expects, and to have one less place in the code where the IPA names are not stored as blob. Looking up the IPA name from struct osmo_gsup_conn could either be done like in osmo_gsup_server_ccm_cb() by reading the IPA IEs (which has a FIXME comment), or by finding the route associated with conn. I went with the latter approach, because it seems cleaner to me. Related: OS#3710 Change-Id: If5a65f471672949192061c5fe396603611123bc1 --- M src/gsup_router.c M src/gsup_router.h M src/hlr_ussd.c 3 files changed, 53 insertions(+), 14 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, but someone else must approve osmith: Looks good to me, approved diff --git a/src/gsup_router.c b/src/gsup_router.c index 4fedd38..df978ba 100644 --- a/src/gsup_router.c +++ b/src/gsup_router.c @@ -25,13 +25,7 @@ #include "logging.h" #include "gsup_server.h" - -struct gsup_route { - struct llist_head list; - - uint8_t *addr; - struct osmo_gsup_conn *conn; -}; +#include "gsup_router.h" /*! Find a route for the given address. * \param[in] gs gsup server @@ -53,6 +47,22 @@ return NULL; } +/*! Find a GSUP connection's route (to read the IPA address from the route). + * \param[in] conn GSUP connection + * \return GSUP route + */ +struct gsup_route *gsup_route_find_by_conn(const struct osmo_gsup_conn *conn) +{ + struct gsup_route *gr; + + llist_for_each_entry(gr, &conn->server->routes, list) { + if (gr->conn == conn) + return gr; + } + + return NULL; +} + /* add a new route for the given address to the given conn */ int gsup_route_add(struct osmo_gsup_conn *conn, const uint8_t *addr, size_t addrlen) { diff --git a/src/gsup_router.h b/src/gsup_router.h index 282531d..bff484e 100644 --- a/src/gsup_router.h +++ b/src/gsup_router.h @@ -3,9 +3,18 @@ #include #include "gsup_server.h" +struct gsup_route { + struct llist_head list; + + uint8_t *addr; + struct osmo_gsup_conn *conn; +}; + struct osmo_gsup_conn *gsup_route_find(struct osmo_gsup_server *gs, const uint8_t *addr, size_t addrlen); +struct gsup_route *gsup_route_find_by_conn(const struct osmo_gsup_conn *conn); + /* add a new route for the given address to the given conn */ int gsup_route_add(struct osmo_gsup_conn *conn, const uint8_t *addr, size_t addrlen); diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index ea69cd9..56a5a95 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -167,8 +167,11 @@ const struct hlr_iuse *iuse; } u; - /* subscriber's vlr_number, will be looked up once per session and cached here */ - char vlr_number[32]; + /* subscriber's vlr_number + * MO USSD: originating MSC's vlr_number + * MT USSD: looked up once per session and cached here */ + uint8_t *vlr_number; + size_t vlr_number_len; /* we don't keep a pointer to the osmo_gsup_{route,conn} towards the MSC/VLR here, * as this might change during inter-VLR hand-over, and we simply look-up the serving MSC/VLR @@ -233,24 +236,26 @@ int rc; /* Use vlr_number as looked up by the caller, or look up now. */ - if (!ss->vlr_number[0]) { + if (!ss->vlr_number) { rc = db_subscr_get_by_imsi(g_hlr->dbc, ss->imsi, &subscr); if (rc < 0) { LOGPSS(ss, LOGL_ERROR, "Cannot find subscriber, cannot route GSUP message\n"); msgb_free(msg); return -EINVAL; } - osmo_strlcpy(ss->vlr_number, subscr.vlr_number, sizeof(ss->vlr_number)); + ss->vlr_number = (uint8_t *)talloc_strdup(ss, subscr.vlr_number); + ss->vlr_number_len = strlen(subscr.vlr_number) + 1; } - if (!ss->vlr_number[0]) { + /* Check for empty string (all vlr_number strings end in "\0", because otherwise gsup_route_find() fails) */ + if (ss->vlr_number_len == 1) { LOGPSS(ss, LOGL_ERROR, "Cannot send GSUP message, no VLR number stored for subscriber\n"); msgb_free(msg); return -EINVAL; } - LOGPSS(ss, LOGL_DEBUG, "Tx SS/USSD to VLR '%s'\n", ss->vlr_number); - return osmo_gsup_addr_send(gs, (uint8_t *)ss->vlr_number, strlen(ss->vlr_number) + 1, msg); + LOGPSS(ss, LOGL_DEBUG, "Tx SS/USSD to VLR %s\n", osmo_quote_str((char *)ss->vlr_number, ss->vlr_number_len)); + return osmo_gsup_addr_send(gs, ss->vlr_number, ss->vlr_number_len, msg); } static int ss_tx_to_ms(struct ss_session *ss, enum osmo_gsup_message_type gsup_msg_type, @@ -500,6 +505,7 @@ struct hlr *hlr = conn->server->priv; struct ss_session *ss; struct ss_request req = {0}; + struct gsup_route *gsup_rt; LOGP(DSS, LOGL_DEBUG, "%s/0x%08x: Process SS (%s)\n", gsup->imsi, gsup->session_id, osmo_gsup_session_state_name(gsup->session_state)); @@ -529,6 +535,20 @@ gsup->imsi, gsup->session_id); goto out_err; } + /* Get IPA name from VLR conn and save as ss->vlr_number */ + if (!conn_is_euse(conn)) { + gsup_rt = gsup_route_find_by_conn(conn); + if (gsup_rt) { + ss->vlr_number = (uint8_t *)talloc_strdup(ss, (const char *)gsup_rt->addr); + ss->vlr_number_len = strlen((const char *)gsup_rt->addr) + 1; + LOGPSS(ss, LOGL_DEBUG, "Destination IPA name retrieved from GSUP route: %s\n", + osmo_quote_str((const char *)ss->vlr_number, ss->vlr_number_len)); + } else { + LOGPSS(ss, LOGL_NOTICE, "Could not find GSUP route, therefore can't set the destination" + " IPA name. We'll try to look it up later, but this should not" + " have happened.\n"); + } + } if (ss_op_is_ussd(req.opcode)) { if (conn_is_euse(conn)) { /* EUSE->VLR: MT USSD. EUSE is known ('conn'), VLR is to be resolved */ -- To view, visit https://gerrit.osmocom.org/13515 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1 Gerrit-Change-Number: 13515 Gerrit-PatchSet: 12 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 14:48:20 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Apr 2019 14:48:20 +0000 Subject: Change in osmo-hlr[master]: USSD: don't use gsm0480_msgb_alloc_name() In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13548 ) Change subject: USSD: don't use gsm0480_msgb_alloc_name() ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13548 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icdab40c6a933888eb9f51bee9c5264c8919dbf7b Gerrit-Change-Number: 13548 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 09 Apr 2019 14:48:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 14:49:39 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Apr 2019 14:49:39 +0000 Subject: Change in osmo-msc[master]: sms_queue: Print dest msisdn instead of unknown subscriber In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13554 ) Change subject: sms_queue: Print dest msisdn instead of unknown subscriber ...................................................................... Patch Set 4: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/13554/3/src/libmsc/sms_queue.c File src/libmsc/sms_queue.c: https://gerrit.osmocom.org/#/c/13554/3/src/libmsc/sms_queue.c at 235 PS3, Line 235: Maybe we can just print MSISDN in any case? -- To view, visit https://gerrit.osmocom.org/13554 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4b8b54c9c41b17d4e1fa7ece63aa91a98036ef11 Gerrit-Change-Number: 13554 Gerrit-PatchSet: 4 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 09 Apr 2019 14:49:39 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 15:39:13 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 9 Apr 2019 15:39:13 +0000 Subject: Change in osmo-ttcn3-hacks[master]: SGsAP_Templates: Remove invalid template. Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13556 Change subject: SGsAP_Templates: Remove invalid template. ...................................................................... SGsAP_Templates: Remove invalid template. The Template tr_SGsAP_RESET_IND is invalid since it requires vlr and mme name at once, which is not a valid constellation in the real world. Lets have two separate templates, one for MME and VLR, just like we have it already with the ts_ versions of the templates. Change-Id: Ifdf6030bb42ebd99c2030d600e87127e3619d7ad Related: OS#3859 --- M library/SGsAP_Templates.ttcn 1 file changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/56/13556/1 diff --git a/library/SGsAP_Templates.ttcn b/library/SGsAP_Templates.ttcn index 457481e..428924f 100644 --- a/library/SGsAP_Templates.ttcn +++ b/library/SGsAP_Templates.ttcn @@ -659,10 +659,18 @@ vLR_Name := ts_SGsAP_IE_VlrName(vlr_name) } } -template PDU_SGsAP tr_SGsAP_RESET_IND(template octetstring mme_name, template octetstring vlr_name) := { + +template PDU_SGsAP tr_SGsAP_RESET_IND_MME(template octetstring mme_name) := { sGsAP_RESET_INDICATION := { messageType := '00010101'B, mME_Name := tr_SGsAP_IE_MmeName(mme_name), + vLR_Name := omit + } +} +template PDU_SGsAP tr_SGsAP_RESET_IND_VLR(template octetstring vlr_name) := { + sGsAP_RESET_INDICATION := { + messageType := '00010101'B, + mME_Name := omit, vLR_Name := tr_SGsAP_IE_VlrName(vlr_name) } } -- To view, visit https://gerrit.osmocom.org/13556 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ifdf6030bb42ebd99c2030d600e87127e3619d7ad Gerrit-Change-Number: 13556 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 15:39:14 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 9 Apr 2019 15:39:14 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: allow disabeling GSUP Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13557 Change subject: MSC_Tests: allow disabeling GSUP ...................................................................... MSC_Tests: allow disabeling GSUP The GSUP link between testsuit and osmo-msc is currently on by default and can not be disabled. However, there may be situations where a missing GSUP connection must be simulated. Lets add add a parameter to disable GSUP if necessary. Change-Id: I7c86aa0a906a0d7e8be765f9109a65b4b4387bc6 Related: OS#3859 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 21 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/57/13557/1 diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index c7a4a71..8e5c5f2 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -73,7 +73,8 @@ integer ipa_ctrl_port, boolean ipa_ctrl_enable, boolean mm_info, - boolean sgsap_enable + boolean sgsap_enable, + boolean gsup_enable }; /* get a one-octet bitmaks of supported algorithms based on Classmark information */ diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index c7c61eb..1a6e8f7 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -210,11 +210,17 @@ vc_MGCP.start(MGCP_Emulation.main(ops, pars, id)); } +function ForwardUnitdataCallback(PDU_SGsAP msg) +runs on SGsAP_Emulation_CT return template PDU_SGsAP { + SGsAP_CLIENT.send(msg); + return omit; +} + function f_init_sgsap(charstring id) runs on MTC_CT { id := id & "-SGsAP"; var SGsAPOps ops := { create_cb := refers(SGsAP_Emulation.ExpectedCreateCallback), - unitdata_cb := refers(SGsAP_Emulation.DummyUnitdataCallback) + unitdata_cb := refers(ForwardUnitdataCallback) } var SGsAP_conn_parameters pars := { remote_ip := mp_msc_ip, @@ -258,7 +264,7 @@ } } -function f_init(integer num_bsc := 1, boolean sgsap := false) runs on MTC_CT { +function f_init(integer num_bsc := 1, boolean sgsap := false, boolean gsup := true) runs on MTC_CT { if (g_initialized == true) { return; @@ -281,7 +287,10 @@ f_ipa_ctrl_start(mp_msc_ip, mp_msc_ctrl_port); f_init_mncc("MSC_Test"); f_init_mgcp("MSC_Test"); - f_init_gsup("MSC_Test"); + + if (gsup == true) { + f_init_gsup("MSC_Test"); + } f_init_smpp("MSC_Test"); if (sgsap == true) { @@ -476,7 +485,7 @@ type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; /* FIXME: move into BSC_ConnectionHandler? */ -function f_init_pars(integer imsi_suffix, boolean sgsap := false) runs on MTC_CT return BSC_ConnHdlrPars { +function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup := true) runs on MTC_CT return BSC_ConnHdlrPars { var BSC_ConnHdlrNetworkPars net_pars := { kc_support := '0A'O, /* A5/1 and A5/3 enabled */ expect_tmsi := true, @@ -501,7 +510,8 @@ ipa_ctrl_port := mp_msc_ctrl_port, ipa_ctrl_enable := true, mm_info := mp_mm_info, - sgsap_enable := sgsap + sgsap_enable := sgsap, + gsup_enable := gsup }; return pars; } @@ -521,8 +531,10 @@ connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); /* GSUP part */ - connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); - connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); + if (pars.gsup_enable == true) { + connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); + connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); + } /* SMPP part */ connect(vc_conn:SMPP, vc_SMPP:SMPP_CLIENT); connect(vc_conn:SMPP_PROC, vc_SMPP:SMPP_PROC); -- To view, visit https://gerrit.osmocom.org/13557 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7c86aa0a906a0d7e8be765f9109a65b4b4387bc6 Gerrit-Change-Number: 13557 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 15:39:14 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 9 Apr 2019 15:39:14 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: Add testcase to simulate VLR/HLR failure (SGsAP) Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13558 Change subject: MSC_Tests: Add testcase to simulate VLR/HLR failure (SGsAP) ...................................................................... MSC_Tests: Add testcase to simulate VLR/HLR failure (SGsAP) Currently we do not simulate a situation where the HLR is unreachable to the MSC. Lets add a test wehere the HLR is disconnected and an LU via SGsAP is tried. The SGs interface should then carry out a reset procedure. Change-Id: I830d0b936cbe9d73d1e0b1f4792c2be3d0b08cb9 Related: OS#3859 --- M msc/MSC_Tests.ttcn M msc/expected-results.xml 2 files changed, 39 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/58/13558/1 diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 1a6e8f7..13d1ddb 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -4627,6 +4627,43 @@ vc_conn.done; } +/* Simulate an HLR/VLR failure */ +private function f_tc_sgsap_vlr_failure(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + var octetstring mme_name := f_enc_dns_hostname(mp_mme_name); + var octetstring vlr_name := f_enc_dns_hostname(mp_vlr_name); + + var PDU_SGsAP lur; + + f_init_handler(pars); + + /* Attempt location update (which is expected to fail) */ + lur := valueof(ts_SGsAP_LU_REQ(g_pars.imsi, mme_name, IMSI_attach, + ts_SGsAP_LAI('901'H, '70'H, 2342))); + SGsAP.send(lur); + + /* Respond to SGsAP-RESET-INDICATION from VLR */ + alt { + [] SGsAP.receive(tr_SGsAP_RESET_IND_VLR(vlr_name)); { + SGsAP.send(valueof(ts_SGsAP_RESET_ACK_MME(mme_name))); + setverdict(pass); + } + [] SGsAP.receive { + setverdict(fail, "Received unexpected message on SGs"); + } + } + + f_sleep(1.0); + setverdict(pass); +} +testcase TC_sgsap_vlr_failure() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(1, true, false); + pars := f_init_pars(11811, true, false); + vc_conn := f_start_handler_with_pars(refers(f_tc_sgsap_vlr_failure), pars); + vc_conn.done; +} + /* SGs TODO: * LU attempt for IMSI without NAM_PS in HLR * LU attempt with AUTH FAIL due to invalid RES/SRES @@ -4729,6 +4766,7 @@ execute( TC_sgsap_unsol_ud() ); execute( TC_bssap_lu_sgsap_lu_and_mt_call() ); execute( TC_sgsap_lu_and_mt_call() ); + execute( TC_sgsap_vlr_failure() ); /* Run this last: at the time of writing this test crashes the MSC */ execute( TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug() ); diff --git a/msc/expected-results.xml b/msc/expected-results.xml index 2c0083c..78b0099 100644 --- a/msc/expected-results.xml +++ b/msc/expected-results.xml @@ -90,6 +90,7 @@ + Tguard timeout -- To view, visit https://gerrit.osmocom.org/13558 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I830d0b936cbe9d73d1e0b1f4792c2be3d0b08cb9 Gerrit-Change-Number: 13558 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 15:43:45 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 9 Apr 2019 15:43:45 +0000 Subject: Change in osmo-msc[master]: sgs_iface: detect and react to VLR/HLR failure Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13559 Change subject: sgs_iface: detect and react to VLR/HLR failure ...................................................................... sgs_iface: detect and react to VLR/HLR failure The HLR (which is connected via the GSUP interface) may fail and disconnect. On the next location update the VLR will try to talk to the HLR and fail. This failure event is not communicated towards the SGs related code and the SGs-association will remain in the LA-PRESENT state forever. Lets add code to report the problem to the SGs code and trigger a RESET an the SGs interface. - Add a flag to report an HLR problem back to the SGs code - Fix the FSM that controls the reset - Make sure the all SGs associations are reset when the failure occurs. Change-Id: Icc7df92879728bc98c85fc1d5d8b4c6246501b12 Related: OS#3859 --- M include/osmocom/msc/vlr_sgs.h M src/libmsc/sgs_iface.c M src/libvlr/vlr.c M src/libvlr/vlr_sgs_fsm.c 4 files changed, 50 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/59/13559/1 diff --git a/include/osmocom/msc/vlr_sgs.h b/include/osmocom/msc/vlr_sgs.h index cc07807..615b56c 100644 --- a/include/osmocom/msc/vlr_sgs.h +++ b/include/osmocom/msc/vlr_sgs.h @@ -72,6 +72,7 @@ /* This callback function is called when an SGs location update is complete */ struct sgs_lu_response { bool accepted; + bool error; struct vlr_subscr *vsub; }; typedef void (*vlr_sgs_lu_response_cb_t) (struct sgs_lu_response *response); diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c index 450d552..6ee2075 100644 --- a/src/libmsc/sgs_iface.c +++ b/src/libmsc/sgs_iface.c @@ -369,15 +369,26 @@ unsigned int new_id_len = 0; uint8_t resp_msg_type; + /* Determine message type that is sent next (needed for logging) */ if (response->accepted) resp_msg_type = SGSAP_MSGT_LOC_UPD_ACK; + else if(response->error) + resp_msg_type = SGSAP_MSGT_RESET_IND; else resp_msg_type = SGSAP_MSGT_LOC_UPD_REJ; + /* Determine MME */ mme = sgs_mme_ctx_by_vsub(vsub, resp_msg_type); if (!mme) return; + /* Handle error (HLR failure) */ + if (response->error) { + osmo_fsm_inst_dispatch(mme->fi, SGS_VLRR_E_START_RESET, NULL); + return; + } + + /* Handle LU accept/reject */ if (response->accepted) { if (vsub->tmsi_new != GSM_RESERVED_TMSI) { new_id_len = gsm48_generate_mid_from_tmsi(new_id, vsub->tmsi_new); @@ -1101,6 +1112,10 @@ reset_params.vlr_name_present = true; reset_ind = gsm29118_create_reset_ind(&reset_params); sgs_tx(sgc, reset_ind); + + /* Perform a reset of the SGS FSM of all subscribers that are present in the VLR */ + vlr_sgs_reset(gsm_network->vlr); + osmo_fsm_inst_state_chg(fi, SGS_VLRR_ST_WAIT_ACK, sgs->cfg.timer[SGS_STATE_TS11], 11); break; default: @@ -1168,6 +1183,7 @@ static struct osmo_fsm sgs_vlr_reset_fsm = { .name = "SGs-VLR-RESET", .states = sgs_vlr_reset_fsm_states, + .num_states = ARRAY_SIZE(sgs_vlr_reset_fsm_states), .allstate_event_mask = S(SGS_VLRR_E_START_RESET), .allstate_action = sgs_vlr_reset_fsm_allstate, .timer_cb = sgs_vlr_reset_fsm_timer_cb, diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index cd4209d..957b7e7 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -864,7 +864,7 @@ static int vlr_subscr_handle_lu_res(struct vlr_subscr *vsub, const struct osmo_gsup_message *gsup) { - struct sgs_lu_response sgs_lu_response; + struct sgs_lu_response sgs_lu_response = {0}; bool sgs_lu_in_progress = false; if (vsub->sgs_fsm->state == SGS_UE_ST_LA_UPD_PRES) @@ -895,7 +895,7 @@ static int vlr_subscr_handle_lu_err(struct vlr_subscr *vsub, const struct osmo_gsup_message *gsup) { - struct sgs_lu_response sgs_lu_response; + struct sgs_lu_response sgs_lu_response = {0}; bool sgs_lu_in_progress = false; if (vsub->sgs_fsm->state == SGS_UE_ST_LA_UPD_PRES) diff --git a/src/libvlr/vlr_sgs_fsm.c b/src/libvlr/vlr_sgs_fsm.c index ee1d748..053701e 100644 --- a/src/libvlr/vlr_sgs_fsm.c +++ b/src/libvlr/vlr_sgs_fsm.c @@ -47,24 +47,6 @@ {0, NULL} }; -/* Initiate location update and change to SGS_UE_ST_LA_UPD_PRES state */ -static void perform_lu(struct osmo_fsm_inst *fi) -{ - struct vlr_subscr *vsub = fi->priv; - int rc; - osmo_fsm_inst_state_chg(fi, SGS_UE_ST_LA_UPD_PRES, 0, 0); - vsub->ms_not_reachable_flag = false; - - /* Note: At the moment we allocate a new TMSI on each LU. */ - rc = vlr_subscr_alloc_tmsi(vsub); - if (rc != 0) - LOGPFSML(fi, LOGL_ERROR, "(sub %s) VLR LU tmsi allocation failed\n", vlr_subscr_name(vsub)); - - rc = vlr_subscr_req_lu(vsub); - if (rc != 0) - LOGPFSML(fi, LOGL_ERROR, "(sub %s) HLR LU request failed\n", vlr_subscr_name(vsub)); -} - /* Send the SGs Association to NULL state immediately */ static void to_null(struct osmo_fsm_inst *fi) { @@ -84,6 +66,37 @@ osmo_timer_del(&vsub->sgs.Ts5); } +/* Initiate location update and change to SGS_UE_ST_LA_UPD_PRES state */ +static void perform_lu(struct osmo_fsm_inst *fi) +{ + struct vlr_subscr *vsub = fi->priv; + struct sgs_lu_response sgs_lu_response = {0}; + int rc; + + /* Note: At the moment we allocate a new TMSI on each LU. */ + rc = vlr_subscr_alloc_tmsi(vsub); + if (rc != 0) { + LOGPFSML(fi, LOGL_ERROR, "(sub %s) VLR LU tmsi allocation failed\n", vlr_subscr_name(vsub)); + goto error; + } + + rc = vlr_subscr_req_lu(vsub); + if (rc != 0) { + LOGPFSML(fi, LOGL_ERROR, "(sub %s) HLR LU request failed\n", vlr_subscr_name(vsub)); + goto error; + } + + osmo_fsm_inst_state_chg(fi, SGS_UE_ST_LA_UPD_PRES, 0, 0); + vsub->ms_not_reachable_flag = false; + return; + +error: + to_null(fi); + sgs_lu_response.error = true; + sgs_lu_response.vsub = vsub; + vsub->sgs.response_cb(&sgs_lu_response); +} + /* Respawn a pending paging (Timer is reset and a new paging request is sent) */ static void respawn_paging(struct vlr_subscr *vsub) { -- To view, visit https://gerrit.osmocom.org/13559 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Icc7df92879728bc98c85fc1d5d8b4c6246501b12 Gerrit-Change-Number: 13559 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Tue Apr 9 20:25:12 2019 From: admin at opensuse.org (OBS Notification) Date: Tue, 09 Apr 2019 20:25:12 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-netif in Raspbian_9.0/armv7l In-Reply-To: References: Message-ID: <5cacffb5e7786_29b052e5f411063d7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/Raspbian_9.0/armv7l Package network:osmocom:nightly/libosmo-netif failed to build in Raspbian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly libosmo-netif Last lines of build log: [ 328s] +non-reconnecting test step 0 [client OK, server OK], FD reg 1 [ 328s] --- expout 2019-04-09 20:24:40.195000000 +0000 [ 328s] +++ /usr/src/packages/BUILD/tests/testsuite.dir/at-groups/1/stdout 2019-04-09 20:24:49.305000000 +0000 [ 328s] @@ -44,8 +44,6 @@ [ 328s] [OK|OK] Server's read_cb_srv(): received 29(29) bytes: 44 6f 68 2c 20 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 73 65 72 76 65 72 20 3a 2d 44 [ 328s] [OK|OK] Server's read_cb_srv(): sent 11 bytes message: 72 65 61 64 5f 63 62 5f 73 72 76 [ 328s] [OK|OK] Server's read_cb_srv(): force client disconnect on subsequent call [ 328s] -[OK] Client's read_cb_cli(): callback triggered [ 328s] -[OK] Client's read_cb_cli(): 0-byte read, auto-reconnect will be triggered if enabled [ 328s] non-reconnecting test complete. [ 328s] [ 328s] Stream tests completed [ 328s] 1. testsuite.at:4: 1. stream_test (testsuite.at:4): FAILED (testsuite.at:8) [ 328s] debian/rules:27: recipe for target 'override_dh_auto_test' failed [ 328s] make[1]: *** [override_dh_auto_test] Error 1 [ 328s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 328s] debian/rules:13: recipe for target 'build' failed [ 328s] make: *** [build] Error 2 [ 328s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 328s] [ 328s] obs-arm-5 failed "build libosmo-netif_0.4.0.25.e380.dsc" at Tue Apr 9 20:24:51 UTC 2019. [ 328s] [ 328s] ### VM INTERACTION START ### [ 331s] [ 302.894028] sysrq: SysRq : Power Off [ 331s] [ 302.909773] reboot: Power down [ 331s] ### VM INTERACTION END ### [ 331s] [ 331s] obs-arm-5 failed "build libosmo-netif_0.4.0.25.e380.dsc" at Tue Apr 9 20:24:55 UTC 2019. [ 331s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Apr 9 20:28:55 2019 From: admin at opensuse.org (OBS Notification) Date: Tue, 09 Apr 2019 20:28:55 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-netif in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5cad00a18a46f_29b052e5f41107686@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/Debian_8.0/x86_64 Package network:osmocom:nightly/libosmo-netif failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-netif Last lines of build log: [ 173s] | #define HAVE_DLFCN_H 1 [ 173s] | #define LT_OBJDIR ".libs/" [ 173s] | #define STDC_HEADERS 1 [ 173s] | #define HAVE_EXECINFO_H 1 [ 173s] | #define HAVE_SYS_SELECT_H 1 [ 173s] | #define HAVE_SYS_SOCKET_H 1 [ 173s] | #define HAVE_SYSLOG_H 1 [ 173s] | #define HAVE_CTYPE_H 1 [ 173s] | #define HAVE_LIBSCTP 1 [ 173s] | #define HAVE_PCAP_H 1 [ 173s] | [ 173s] | configure: exit 0 [ 173s] [ 173s] debian/rules:27: recipe for target 'override_dh_auto_test' failed [ 173s] make[1]: *** [override_dh_auto_test] Error 1 [ 173s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 173s] debian/rules:13: recipe for target 'build' failed [ 173s] make: *** [build] Error 2 [ 173s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 173s] [ 173s] morla5 failed "build libosmo-netif_0.4.0.25.e380.dsc" at Tue Apr 9 20:28:40 UTC 2019. [ 173s] [ 173s] ### VM INTERACTION START ### [ 174s] Powering off. [ 174s] [ 159.041173] reboot: Power down [ 174s] ### VM INTERACTION END ### [ 174s] [ 174s] morla5 failed "build libosmo-netif_0.4.0.25.e380.dsc" at Tue Apr 9 20:28:42 UTC 2019. [ 174s] -- 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 Apr 9 22:00:23 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Apr 2019 22:00:23 +0000 Subject: Change in osmo-msc[master]: smpp_smsc: Call destroy_tlv() when using build_tlv() Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13560 Change subject: smpp_smsc: Call destroy_tlv() when using build_tlv() ...................................................................... smpp_smsc: Call destroy_tlv() when using build_tlv() The libsmpp34 build_tlv() function is allocating dynamic memory which we need to release again by claling destroy_tlv(). Change-Id: Iacc74c9948fb10fa79c0dd7b0cb72d4adbefdeed Closes: OS#3912 --- M src/libmsc/smpp_smsc.c 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/60/13560/1 diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c index 2350d84..3bfb81a 100644 --- a/src/libmsc/smpp_smsc.c +++ b/src/libmsc/smpp_smsc.c @@ -520,7 +520,9 @@ tlv.value.val16 = esme->smpp_version; build_tlv(&bind_r.tlv, &tlv); - return PACK_AND_SEND(esme, &bind_r); + rc = PACK_AND_SEND(esme, &bind_r); + destroy_tlv(bind_r.tlv); + return rc; } /*! \brief handle an incoming SMPP BIND TRANSCEIVER */ @@ -632,6 +634,7 @@ { struct alert_notification_t alert; struct tlv_t tlv; + int rc; memset(&alert, 0, sizeof(alert)); alert.command_length = 0; @@ -652,7 +655,9 @@ alert.source_addr_npi, get_value_string(smpp_avail_strs, avail_status)); - return PACK_AND_SEND(esme, &alert); + rc = PACK_AND_SEND(esme, &alert); + destroy_tlv(alert.tlv); + return rc; } /* \brief send a DELIVER-SM message to given ESME */ -- To view, visit https://gerrit.osmocom.org/13560 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iacc74c9948fb10fa79c0dd7b0cb72d4adbefdeed Gerrit-Change-Number: 13560 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 22:17:50 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Apr 2019 22:17:50 +0000 Subject: Change in osmo-msc[master]: sms_queue: Print dest msisdn instead of unknown subscriber In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13554 ) Change subject: sms_queue: Print dest msisdn instead of unknown subscriber ...................................................................... sms_queue: Print dest msisdn instead of unknown subscriber If subscriber is NULL, vlr_subscr_msisdn_or_name() returns string "unknown", which is less informative than printing destination msisdn expected for the queued sms. This happens for instance if an sms was queued with Store&Forward and destination subscriber is not currently registered Change-Id: I4b8b54c9c41b17d4e1fa7ece63aa91a98036ef11 --- M src/libmsc/sms_queue.c 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, approved diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index 274c712..afd878f 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -228,8 +228,10 @@ /* Is the subscriber attached? If not, go to next SMS */ if (!sms->receiver || !sms->receiver->lu_complete) { LOGP(DLSMS, LOGL_DEBUG, - "Subscriber %s is not attached, skipping SMS %llu\n", - vlr_subscr_msisdn_or_name(sms->receiver), sms->id); + "Subscriber %s%s is not attached, skipping SMS %llu\n", + sms->receiver ? "" : "MSISDN-", + sms->receiver ? vlr_subscr_msisdn_or_name(sms->receiver) + : sms->dst.addr, sms->id); sms_free(sms); continue; } -- To view, visit https://gerrit.osmocom.org/13554 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4b8b54c9c41b17d4e1fa7ece63aa91a98036ef11 Gerrit-Change-Number: 13554 Gerrit-PatchSet: 4 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 22:22:46 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Apr 2019 22:22:46 +0000 Subject: Change in libsmpp34[master]: Allow application to override heap allocations Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13561 Change subject: Allow application to override heap allocations ...................................................................... Allow application to override heap allocations Let's introduce a mechanism by which libsmpp34-using applications can override the memory allocator functions. This allows us e.g. in the Osmocom context to use talloc which aids us in debugging memory leaks. Closes: OS#3913 Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 --- M src/Makefile.am A src/smpp34_heap.c A src/smpp34_heap.h M src/smpp34_params.c M src/smpp34_unpack.c 5 files changed, 85 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/61/13561/1 diff --git a/src/Makefile.am b/src/Makefile.am index 67550f3..55097c4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -10,6 +10,7 @@ $(LIBRARY_SOURCE_DIR)/smpp34.h \ $(LIBRARY_SOURCE_DIR)/smpp34_dumpBuf.c \ $(LIBRARY_SOURCE_DIR)/smpp34_dumpPdu.c \ + $(LIBRARY_SOURCE_DIR)/smpp34_heap.c \ $(LIBRARY_SOURCE_DIR)/smpp34_pack.c \ $(LIBRARY_SOURCE_DIR)/smpp34_unpack.c \ $(LIBRARY_SOURCE_DIR)/smpp34_structs.c \ @@ -19,6 +20,7 @@ include_HEADERS = \ $(LIBRARY_SOURCE_DIR)/smpp34.h \ + $(LIBRARY_SOURCE_DIR)/smpp34_heap.h \ $(LIBRARY_SOURCE_DIR)/smpp34_structs.h \ $(LIBRARY_SOURCE_DIR)/smpp34_params.h diff --git a/src/smpp34_heap.c b/src/smpp34_heap.c new file mode 100644 index 0000000..921beff --- /dev/null +++ b/src/smpp34_heap.c @@ -0,0 +1,54 @@ +#include +#include +#include + +#include "smpp34_heap.h" + +static void *smpp34_libc_malloc(size_t sz) +{ + return malloc(sz); +} + +static void *smpp34_libc_realloc(void *ptr, size_t sz) +{ + return realloc(ptr, sz); +} + +static void smpp34_libc_free(void *ptr) +{ + return free(ptr); +} + +static bool allocator_used = false; + +static struct smpp34_memory_functions smpp34_allocator = { + .malloc_fun = smpp34_libc_malloc, + .realloc_fun = smpp34_libc_realloc, + .free_fun = smpp34_libc_free, +}; + +void smpp34_set_memory_functions(struct smpp34_memory_functions *mf) +{ + if (allocator_used) { + fprintf(stderr, "%s must be called before first use of smpp34_malloc\n", __func__); + return; + } + smpp34_allocator = *mf; +} + +void *smpp34_malloc(size_t sz) +{ + allocator_used = true; + return smpp34_allocator.malloc_fun(sz); +} + +void *smpp34_realloc(void *ptr, size_t sz) +{ + allocator_used = true; + return smpp34_allocator.realloc_fun(ptr, sz); +} + +void smpp34_free(void *ptr) +{ + smpp34_allocator.free_fun(ptr); +} diff --git a/src/smpp34_heap.h b/src/smpp34_heap.h new file mode 100644 index 0000000..c17334d --- /dev/null +++ b/src/smpp34_heap.h @@ -0,0 +1,15 @@ +#pragma once +#include + +/* override the allocator with these methods; to be called BEFORE allocating anything */ +struct smpp34_memory_functions { + void * (*malloc_fun)(size_t sz); + void * (*realloc_fun)(void *ptr, size_t sz); + void (*free_fun)(void *ptr); +}; + +void smpp34_set_memory_functions(struct smpp34_memory_functions *mf); + +void *smpp34_malloc(size_t sz); +void *smpp34_realloc(void *ptr, size_t sz); +void smpp34_free(void *ptr); diff --git a/src/smpp34_params.c b/src/smpp34_params.c index a91f9eb..e7eb680 100644 --- a/src/smpp34_params.c +++ b/src/smpp34_params.c @@ -27,15 +27,16 @@ #include "smpp34.h" #include "smpp34_structs.h" +#include "smpp34_heap.h" int build_udad( udad_t **dest, udad_t *source ) { /* Build new DAD-Chain ************************************************/ - udad_t *dummy = (udad_t*)malloc(sizeof( udad_t )); + udad_t *dummy = (udad_t*)smpp34_malloc(sizeof( udad_t )); if( dummy == NULL ){ - printf("Error in malloc()\n" ); + printf("Error in smpp34_malloc()\n" ); return( -1 ); }; memcpy(dummy, source, sizeof( udad_t )); @@ -54,7 +55,7 @@ /* Destroy DAD-Chain **************************************************/ while( sourceList != NULL ){ i = sourceList->next; - free((void*)sourceList); + smpp34_free((void*)sourceList); sourceList = i; }; @@ -68,9 +69,9 @@ { /* Build new DAD-Chain ************************************************/ - dad_t *dummy = (dad_t*)malloc(sizeof( dad_t )); + dad_t *dummy = (dad_t*)smpp34_malloc(sizeof( dad_t )); if( dummy == NULL ){ - printf("Error in malloc()\n" ); + printf("Error in smpp34_malloc()\n" ); return( -1 ); }; memcpy(dummy, source, sizeof( dad_t )); @@ -89,7 +90,7 @@ /* Destroy DAD-Chain **************************************************/ while( sourceList != NULL ){ i = sourceList->next; - free((void*)sourceList); + smpp34_free((void*)sourceList); sourceList = i; }; @@ -102,9 +103,9 @@ { /* Build new TLV-Chain ************************************************/ - tlv_t *dummy = (tlv_t*)malloc(sizeof( tlv_t )); + tlv_t *dummy = (tlv_t*)smpp34_malloc(sizeof( tlv_t )); if( dummy == NULL ){ - printf("Error in malloc()\n" ); + printf("Error in smpp34_malloc()\n" ); return( -1 ); }; memcpy(dummy, source, sizeof( tlv_t )); @@ -123,7 +124,7 @@ /* Destroy TLV-Chain **************************************************/ while( sourceList != NULL ){ i = sourceList->next; - free((void*)sourceList); + smpp34_free((void*)sourceList); sourceList = i; }; diff --git a/src/smpp34_unpack.c b/src/smpp34_unpack.c index 749a037..ec73d35 100644 --- a/src/smpp34_unpack.c +++ b/src/smpp34_unpack.c @@ -31,6 +31,7 @@ #include "smpp34.h" #include "smpp34_structs.h" #include "smpp34_params.h" +#include "smpp34_heap.h" /* GLOBALS ********************************************************************/ /* EXTERN *********************************************************************/ @@ -179,7 +180,7 @@ #define TLV( inst, tlv3, do_tlv ){\ tlv_t *aux_tlv = NULL;\ while( (aux - ini) < t1->command_length ){\ - aux_tlv = (tlv_t *) malloc(sizeof( tlv_t ));\ + aux_tlv = (tlv_t *) smpp34_malloc(sizeof( tlv_t ));\ memset(aux_tlv, 0, sizeof(tlv_t));\ do_tlv( aux_tlv );\ aux_tlv->next = inst tlv3;\ @@ -191,7 +192,7 @@ udad_t *aux_udad = NULL;\ int c = 0;\ while( c < t1->no_unsuccess ){\ - aux_udad = (udad_t *) malloc(sizeof( udad_t ));\ + aux_udad = (udad_t *) smpp34_malloc(sizeof( udad_t ));\ memset(aux_udad, 0, sizeof(udad_t));\ do_udad( aux_udad );\ aux_udad->next = inst udad3;\ @@ -204,7 +205,7 @@ dad_t *aux_dad = NULL;\ int c = 0;\ while( c < t1->number_of_dests ){\ - aux_dad = (dad_t *) malloc(sizeof( dad_t ));\ + aux_dad = (dad_t *) smpp34_malloc(sizeof( dad_t ));\ memset(aux_dad, 0, sizeof(dad_t));\ do_dad( aux_dad );\ aux_dad->next = inst dad3;\ -- To view, visit https://gerrit.osmocom.org/13561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Gerrit-Change-Number: 13561 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 22:32:36 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Apr 2019 22:32:36 +0000 Subject: Change in libsmpp34[master]: Allow application to override heap allocations In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13561 to look at the new patch set (#2). Change subject: Allow application to override heap allocations ...................................................................... Allow application to override heap allocations Let's introduce a mechanism by which libsmpp34-using applications can override the memory allocator functions. This allows us e.g. in the Osmocom context to use talloc which aids us in debugging memory leaks. Closes: OS#3913 Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 --- M src/Makefile.am A src/smpp34_heap.c A src/smpp34_heap.h M src/smpp34_params.c M src/smpp34_unpack.c 5 files changed, 85 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/61/13561/2 -- To view, visit https://gerrit.osmocom.org/13561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Gerrit-Change-Number: 13561 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: fixeria -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 22:33:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Apr 2019 22:33:13 +0000 Subject: Change in libsmpp34[master]: Allow application to override heap allocations In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13561 to look at the new patch set (#3). Change subject: Allow application to override heap allocations ...................................................................... Allow application to override heap allocations Let's introduce a mechanism by which libsmpp34-using applications can override the memory allocator functions. This allows us e.g. in the Osmocom context to use talloc which aids us in debugging memory leaks. Closes: OS#3913 Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 --- M TODO-RELEASE M src/Makefile.am A src/smpp34_heap.c A src/smpp34_heap.h M src/smpp34_params.c M src/smpp34_unpack.c 6 files changed, 86 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/61/13561/3 -- To view, visit https://gerrit.osmocom.org/13561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Gerrit-Change-Number: 13561 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: fixeria -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 9 22:35:56 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Apr 2019 22:35:56 +0000 Subject: Change in osmo-msc[master]: smpp: Make libsmpp34 use talloc for its allocations Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13562 Change subject: smpp: Make libsmpp34 use talloc for its allocations ...................................................................... smpp: Make libsmpp34 use talloc for its allocations We are just introducing smpp34_set_memory_functions() in libsmpp34 to allow applications like OsmoMSC to provide their own heap allocator callback functions. Let's used this to integrate with talloc and hence allow talloc tracking/debugging for libsmpp34 internal allocations. Depends: libsmpp34 Change-Id I3656117115e89638c093bfbcbc4369ce302f7a94 Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Related: OS#3913 --- M src/libmsc/smpp_openbsc.c 1 file changed, 27 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/62/13562/1 diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 9156445..b80b473 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -48,6 +49,31 @@ #include "smpp_smsc.h" +/* talloc integration for libsmpp34 */ + +static struct smsc *g_smsc; + +static void *smpp34_talloc_malloc(size_t sz) +{ + return talloc_size(g_smsc, sz); +} + +static void *smpp34_talloc_realloc(void *ptr, size_t sz) +{ + return talloc_realloc_size(g_smsc, ptr, sz); +} + +static void smpp34_talloc_free(void *ptr) +{ + talloc_free(ptr); +} + +static const struct smpp34_memory_functions smpp34_talloc = { + .malloc_fun = smpp34_talloc_malloc, + .realloc_fun = smpp34_talloc_realloc, + .free_fun = smpp34_talloc_free, +}; + /*! \brief find vlr_subscr for a given SMPP NPI/TON/Address */ static struct vlr_subscr *subscr_by_dst(struct gsm_network *net, uint8_t npi, uint8_t ton, @@ -739,8 +765,6 @@ deliver.sequence_number); } -static struct smsc *g_smsc; - int smpp_route_smpp_first(struct gsm_sms *sms, struct ran_conn *conn) { return g_smsc->smpp_first; @@ -779,6 +803,7 @@ LOGP(DSMPP, LOGL_FATAL, "Cannot allocate smsc struct\n"); return -1; } + smpp34_set_memory_functions(&smpp34_talloc); return smpp_vty_init(); } -- To view, visit https://gerrit.osmocom.org/13562 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Gerrit-Change-Number: 13562 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 03:09:18 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 03:09:18 +0000 Subject: Change in osmo-msc[master]: smpp_smsc: Call destroy_tlv() when using build_tlv() In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13560 ) Change subject: smpp_smsc: Call destroy_tlv() when using build_tlv() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13560 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iacc74c9948fb10fa79c0dd7b0cb72d4adbefdeed Gerrit-Change-Number: 13560 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: fixeria Gerrit-Comment-Date: Wed, 10 Apr 2019 03:09:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 07:43:05 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 07:43:05 +0000 Subject: Change in osmo-ttcn3-hacks[master]: SGsAP_Templates: Remove invalid template. In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13556 ) Change subject: SGsAP_Templates: Remove invalid template. ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13556 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ifdf6030bb42ebd99c2030d600e87127e3619d7ad Gerrit-Change-Number: 13556 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 10 Apr 2019 07:43:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 08:04:00 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Apr 2019 08:04:00 +0000 Subject: Change in osmo-msc[master]: smpp_smsc: Call destroy_tlv() when using build_tlv() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13560 ) Change subject: smpp_smsc: Call destroy_tlv() when using build_tlv() ...................................................................... Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/13560/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13560/1//COMMIT_MSG at 10 PS1, Line 10: which we need to release again by claling destroy_tlv(). typo: calling -- To view, visit https://gerrit.osmocom.org/13560 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iacc74c9948fb10fa79c0dd7b0cb72d4adbefdeed Gerrit-Change-Number: 13560 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: fixeria Gerrit-Comment-Date: Wed, 10 Apr 2019 08:04:00 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 08:28:59 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Apr 2019 08:28:59 +0000 Subject: Change in libsmpp34[master]: Allow application to override heap allocations In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13561 ) Change subject: Allow application to override heap allocations ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Gerrit-Change-Number: 13561 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: fixeria Gerrit-Comment-Date: Wed, 10 Apr 2019 08:28:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 08:30:34 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Apr 2019 08:30:34 +0000 Subject: Change in osmo-msc[master]: smpp: Make libsmpp34 use talloc for its allocations In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13562 ) Change subject: smpp: Make libsmpp34 use talloc for its allocations ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13562 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Gerrit-Change-Number: 13562 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 10 Apr 2019 08:30:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 08:52:06 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 08:52:06 +0000 Subject: Change in osmo-ttcn3-hacks[master]: ggsn: Verify that there are no duplicate PCO protocolIDs Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13563 Change subject: ggsn: Verify that there are no duplicate PCO protocolIDs ...................................................................... ggsn: Verify that there are no duplicate PCO protocolIDs Introduce a function to verify there's no duplicate ProtocolIDs in the PCO returned from the GGSN. Change-Id: I9d439dab1696196cd125f4d7113b426f1711a405 Related: OS#3914 --- M ggsn_tests/GGSN_Tests.ttcn 1 file changed, 25 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/63/13563/1 diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 398aed3..9370904 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -726,6 +726,21 @@ T_default.stop; } + /* ensure that every given protocol Identifier exist only exactly once in the PCO */ + function f_PCO_ensure_no_duplicates(ProtConfigOptions pco) { + var OCT2List protocol_ids := {}; + var integer i, j; + for (i := 0; i < lengthof(pco.protocols); i := i+1) { + var OCT2 id := pco.protocols[i].protocolID; + for (j := 0; j < lengthof(protocol_ids); j := j+1) { + if (id == protocol_ids[j]) { + setverdict(fail, "Duplicate ProtocolID ", id, " already present in ", pco.protocols); + } + } + protocol_ids := protocol_ids & { id }; + } + } + /* Test IPv6 context activation for dynamic IPv6 EUA without request of IPv6 DNS */ testcase TC_pdp6_act_deact() runs on GT_CT { f_init(); @@ -743,6 +758,7 @@ ctx.pco_req := valueof(ts_PCO_IPv6_DNS); f_pdp_ctx_act(ctx); + f_PCO_ensure_no_duplicates(ctx.pco_neg); /* verify PCO contains both primary and secondary DNS */ var OCT4 ggsn_ip6_dns1 := f_inet6_addr(m_ggsn_ip6_dns1); if (not match(f_PCO_extract_proto(ctx.pco_neg, '0003'O, 1), ggsn_ip6_dns1)) { @@ -765,6 +781,7 @@ ctx.pco_req := valueof(ts_PCO_IPv6_DNS); f_pdp_ctx_act(ctx); + f_PCO_ensure_no_duplicates(ctx.pco_neg); //f_send_gtpu(ctx, c_router_solicit); //f_send_gtpu(ctx, c_neigh_solicit); @@ -865,6 +882,7 @@ var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); ctx.pco_req := valueof(ts_PCO_IPv4_DNS_IPCP); f_pdp_ctx_act(ctx); + f_PCO_ensure_no_duplicates(ctx.pco_neg); /* verify IPCP is at all contained */ if (not match(ctx.pco_neg, tr_PCO_Contains('8021'O))) { setverdict(fail, "IPCP not found in PCO"); @@ -888,6 +906,7 @@ ctx.pco_req := valueof(ts_PCO_IPv4_DNS_CONT); f_pdp_ctx_act(ctx); + f_PCO_ensure_no_duplicates(ctx.pco_neg); /* verify PCO contains both primary and secondary DNS */ var OCT4 ggsn_ip4_dns1 := f_inet_addr(m_ggsn_ip4_dns1); if (not match(f_PCO_extract_proto(ctx.pco_neg, '000d'O, 1), ggsn_ip4_dns1)) { @@ -910,6 +929,7 @@ ctx.pco_req := valueof(ts_PCO_IPv4_DNS_CONT); f_pdp_ctx_act(ctx); + f_PCO_ensure_no_duplicates(ctx.pco_neg); var OCT4 dns1_addr := f_PCO_extract_proto(ctx.pco_neg, '000d'O); /* Check if we can use valid global src addr, should work */ @@ -986,6 +1006,7 @@ /* PCO with primary DNS only */ ctx.pco_req := valueof(ts_PCO_IPv4_PRI_DNS_IPCP); f_pdp_ctx_act(ctx); + f_PCO_ensure_no_duplicates(ctx.pco_neg); pco_neg_dns := f_PCO_extract_proto(ctx.pco_neg, '8021'O, 1); pco_neg_dns_expected := '0200000A8106'O & ggsn_ip4_dns1 /* Note: The prepended hex bytes encode the following information: @@ -1063,10 +1084,12 @@ var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet46, valueof(t_EuaIPv4Dynv6Dyn))); ctx.pco_req := valueof(ts_PCO_IPv4_DNS_IPCP); f_pdp_ctx_act(ctx); + f_PCO_ensure_no_duplicates(ctx.pco_neg); /* verify IPCP is at all contained */ if (not match(ctx.pco_neg, tr_PCO_Contains('8021'O))) { setverdict(fail, "IPCP not found in PCO"); } + f_PCO_ensure_no_duplicates(ctx.pco_neg); /* verify IPCP contains both primary and secondary IPv4 DNS */ var IpcpPacket ipcp := dec_IpcpPacket(f_PCO_extract_proto(ctx.pco_neg, '8021'O)); if (not match(ipcp, tr_IPCP_Ack_DNS(0, ggsn_ip4_dns1, ggsn_ip4_dns2))) { @@ -1101,6 +1124,7 @@ ctx.pco_req := valueof(ts_PCO_IPv4_DNS_CONT); f_pdp_ctx_act(ctx); + f_PCO_ensure_no_duplicates(ctx.pco_neg); /* verify PCO contains both primary and secondary IPv4 DNS */ var OCT4 ggsn_ip4_dns1 := f_inet_addr(m_ggsn_ip4_dns1); if (not match(f_PCO_extract_proto(ctx.pco_neg, '000d'O, 1), ggsn_ip4_dns1)) { @@ -1123,6 +1147,7 @@ ctx.pco_req := valueof(ts_PCO_IPv6_DNS); f_pdp_ctx_act(ctx); + f_PCO_ensure_no_duplicates(ctx.pco_neg); /* verify PCO contains both primary and secondary IPv6 DNS */ var OCT4 ggsn_ip6_dns1 := f_inet6_addr(m_ggsn_ip6_dns1); if (not match(f_PCO_extract_proto(ctx.pco_neg, '0003'O, 1), ggsn_ip6_dns1)) { -- To view, visit https://gerrit.osmocom.org/13563 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9d439dab1696196cd125f4d7113b426f1711a405 Gerrit-Change-Number: 13563 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 08:52:06 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 08:52:06 +0000 Subject: Change in osmo-ttcn3-hacks[master]: ggsn: Add TC_pdp4_act_deact_ipcp_pap_broken() Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13564 Change subject: ggsn: Add TC_pdp4_act_deact_ipcp_pap_broken() ...................................................................... ggsn: Add TC_pdp4_act_deact_ipcp_pap_broken() This test case reproduces a real-world PCO capture including a broken PAP AuthenticationReq. It triggers some weird behavior in OsmoGGSN 1.3.0 where it would send duplicate IPCP repsonses and no PAP response. Change-Id: Ie89d984ed9e26fbbb2e4914bdb8623446d462a4c Related: OS#3914 --- M ggsn_tests/GGSN_Tests.ttcn M library/GTP_Templates.ttcn 2 files changed, 40 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/64/13564/1 diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 9370904..c42ee21 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -899,6 +899,35 @@ f_pdp_ctx_del(ctx, '1'B); } + /* Test PDP context activation for dynamic IPv4 EUA with IPv4 DNS in IPCP + PAP authentication (broken) */ + testcase TC_pdp4_act_deact_ipcp_pap_broken() runs on GT_CT { + f_init(); + var OCT4 ggsn_ip4_dns1 := f_inet_addr(m_ggsn_ip4_dns1); + var OCT4 ggsn_ip4_dns2 := f_inet_addr(m_ggsn_ip4_dns2); + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + ctx.pco_req := valueof(ts_PCO_PAP_IPv4_DNS); + f_pdp_ctx_act(ctx); + f_PCO_ensure_no_duplicates(ctx.pco_neg); + /* verify IPCP is at all contained */ + if (not match(ctx.pco_neg, tr_PCO_Contains('8021'O))) { + setverdict(fail, "IPCP not found in PCO"); + } + /* verify IPCP contains both primary and secondary DNS */ + var IpcpPacket ipcp := dec_IpcpPacket(f_PCO_extract_proto(ctx.pco_neg, '8021'O)); + if (not match(ipcp, tr_IPCP_Ack_DNS(0, ggsn_ip4_dns1, ggsn_ip4_dns2))) { + if (not match(ipcp, tr_IPCP_Ack_DNS(0))) { + setverdict(fail, "Primary/Secondary DNS PCO IPCP option not found"); + } else { + setverdict(fail, "Primary/Secondary DNS PCO IPCP option found but not matching expected values"); + } + } + /* verify that PAP is contained */ + if (not match(ctx.pco_neg, tr_PCO_Contains('8023'O))) { + setverdict(fail, "IPCP not found in PCO"); + } + f_pdp_ctx_del(ctx, '1'B); + } + /* Test PDP context activation for dynamic IPv4 EUA with IPv4 DNS in PCO */ testcase TC_pdp4_act_deact_pcodns() runs on GT_CT { f_init(); diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index bd39e27..e1f19f1 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -460,6 +460,17 @@ lengthProtoID := ?, protoIDContents := ? } + template ProtocolElement ts_PCOelem_PAP_broken := { + protocolID := 'C023'O, + lengthProtoID := 60, + protoIDContents := '0100003c0444435338323700bc1c08087c1508083e00790000150808fd06000001000000000000000000000000000000000000000000000000000000'O + } + template ProtConfigOptions ts_PCO_PAP_IPv4_DNS modifies ts_PCO := { + protocols := { + ts_PCOelem_PAP_broken, + { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := enc_IpcpPacket(valueof(ts_IPCP_ReqDNS)) } + } + } template ProtConfigOptions tr_PCO_Contains(OCT2 prot_id) modifies tr_PCO := { protocols := { *, tr_PCO_Proto(prot_id), * } } -- To view, visit https://gerrit.osmocom.org/13564 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie89d984ed9e26fbbb2e4914bdb8623446d462a4c Gerrit-Change-Number: 13564 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 09:01:16 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 09:01:16 +0000 Subject: Change in osmo-msc[master]: smpp_smsc: Call destroy_tlv() when using build_tlv() In-Reply-To: References: Message-ID: Vadim Yanitskiy has uploaded a new patch set (#2) to the change originally created by Harald Welte. ( https://gerrit.osmocom.org/13560 ) Change subject: smpp_smsc: Call destroy_tlv() when using build_tlv() ...................................................................... smpp_smsc: Call destroy_tlv() when using build_tlv() The libsmpp34 build_tlv() function is allocating dynamic memory which we need to release again by calling destroy_tlv(). Change-Id: Iacc74c9948fb10fa79c0dd7b0cb72d4adbefdeed Closes: OS#3912 --- M src/libmsc/smpp_smsc.c 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/60/13560/2 -- To view, visit https://gerrit.osmocom.org/13560 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iacc74c9948fb10fa79c0dd7b0cb72d4adbefdeed Gerrit-Change-Number: 13560 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: fixeria -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 09:01:27 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 09:01:27 +0000 Subject: Change in osmo-msc[master]: smpp_smsc: Call destroy_tlv() when using build_tlv() In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13560 ) Change subject: smpp_smsc: Call destroy_tlv() when using build_tlv() ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13560 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iacc74c9948fb10fa79c0dd7b0cb72d4adbefdeed Gerrit-Change-Number: 13560 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: fixeria Gerrit-Comment-Date: Wed, 10 Apr 2019 09:01:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 10:33:58 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Apr 2019 10:33:58 +0000 Subject: Change in osmo-msc[master]: smpp_smsc: Call destroy_tlv() when using build_tlv() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13560 ) Change subject: smpp_smsc: Call destroy_tlv() when using build_tlv() ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13560 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iacc74c9948fb10fa79c0dd7b0cb72d4adbefdeed Gerrit-Change-Number: 13560 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: fixeria Gerrit-Comment-Date: Wed, 10 Apr 2019 10:33:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 10:51:06 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 10:51:06 +0000 Subject: Change in libsmpp34[master]: Allow application to override default heap allocator In-Reply-To: References: Message-ID: Vadim Yanitskiy has uploaded a new patch set (#4) to the change originally created by Harald Welte. ( https://gerrit.osmocom.org/13561 ) Change subject: Allow application to override default heap allocator ...................................................................... Allow application to override default heap allocator Let's introduce a mechanism by which libsmpp34-using applications can override the memory allocator functions. This allows us e.g. in the Osmocom context to use talloc which aids us in debugging memory leaks. Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Closes: OS#3913 --- M TODO-RELEASE M src/Makefile.am A src/smpp34_heap.c A src/smpp34_heap.h M src/smpp34_params.c M src/smpp34_unpack.c 6 files changed, 110 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/61/13561/4 -- To view, visit https://gerrit.osmocom.org/13561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Gerrit-Change-Number: 13561 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: fixeria -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 10:51:06 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 10:51:06 +0000 Subject: Change in libsmpp34[master]: configure.ac: enable kernel style compile messages Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13565 Change subject: configure.ac: enable kernel style compile messages ...................................................................... configure.ac: enable kernel style compile messages Change-Id: I96a5d808e2a199c33a1c9eef77da3a040e305689 --- M configure.ac 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/65/13565/1 diff --git a/configure.ac b/configure.ac index 8ecbb77..2c974f8 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,9 @@ AM_INIT_AUTOMAKE([foreign]) AM_CONFIG_HEADER([aux_config/config.h]) +dnl kernel style compile messages +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + dnl include release helper RELMAKE='-include osmo-release.mk' AC_SUBST([RELMAKE]) -- To view, visit https://gerrit.osmocom.org/13565 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I96a5d808e2a199c33a1c9eef77da3a040e305689 Gerrit-Change-Number: 13565 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 10:53:23 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 10:53:23 +0000 Subject: Change in osmo-msc[master]: smpp_smsc: Call destroy_tlv() when using build_tlv() In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13560 ) Change subject: smpp_smsc: Call destroy_tlv() when using build_tlv() ...................................................................... smpp_smsc: Call destroy_tlv() when using build_tlv() The libsmpp34 build_tlv() function is allocating dynamic memory which we need to release again by calling destroy_tlv(). Change-Id: Iacc74c9948fb10fa79c0dd7b0cb72d4adbefdeed Closes: OS#3912 --- M src/libmsc/smpp_smsc.c 1 file changed, 7 insertions(+), 2 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c index 2350d84..3bfb81a 100644 --- a/src/libmsc/smpp_smsc.c +++ b/src/libmsc/smpp_smsc.c @@ -520,7 +520,9 @@ tlv.value.val16 = esme->smpp_version; build_tlv(&bind_r.tlv, &tlv); - return PACK_AND_SEND(esme, &bind_r); + rc = PACK_AND_SEND(esme, &bind_r); + destroy_tlv(bind_r.tlv); + return rc; } /*! \brief handle an incoming SMPP BIND TRANSCEIVER */ @@ -632,6 +634,7 @@ { struct alert_notification_t alert; struct tlv_t tlv; + int rc; memset(&alert, 0, sizeof(alert)); alert.command_length = 0; @@ -652,7 +655,9 @@ alert.source_addr_npi, get_value_string(smpp_avail_strs, avail_status)); - return PACK_AND_SEND(esme, &alert); + rc = PACK_AND_SEND(esme, &alert); + destroy_tlv(alert.tlv); + return rc; } /* \brief send a DELIVER-SM message to given ESME */ -- To view, visit https://gerrit.osmocom.org/13560 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iacc74c9948fb10fa79c0dd7b0cb72d4adbefdeed Gerrit-Change-Number: 13560 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: fixeria -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 10:58:02 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 10:58:02 +0000 Subject: Change in osmo-msc[master]: smpp: Make libsmpp34 use talloc for its allocations In-Reply-To: References: Message-ID: Vadim Yanitskiy has uploaded a new patch set (#2) to the change originally created by Harald Welte. ( https://gerrit.osmocom.org/13562 ) Change subject: smpp: Make libsmpp34 use talloc for its allocations ...................................................................... smpp: Make libsmpp34 use talloc for its allocations We are just introducing smpp34_set_memory_functions() in libsmpp34 to allow applications like OsmoMSC to provide their own heap allocator callback functions. Let's used this to integrate with talloc and hence allow talloc tracking/debugging for libsmpp34 internal allocations. Depends: libsmpp34 Change-Id I3656117115e89638c093bfbcbc4369ce302f7a94 Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Related: OS#3913 --- M src/libmsc/smpp_openbsc.c 1 file changed, 27 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/62/13562/2 -- To view, visit https://gerrit.osmocom.org/13562 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Gerrit-Change-Number: 13562 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 11:03:23 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 11:03:23 +0000 Subject: Change in libosmocore[master]: gsm_03_40.h: define max SM-TP-UDL (User-Data-Length) values In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13553 ) Change subject: gsm_03_40.h: define max SM-TP-UDL (User-Data-Length) values ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13553 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I54f88d2908ac47228813fb8c049f4264e5145241 Gerrit-Change-Number: 13553 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 10 Apr 2019 11:03:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 11:03:26 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 11:03:26 +0000 Subject: Change in libosmocore[master]: gsm_03_40.h: define max SM-TP-UDL (User-Data-Length) values In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13553 ) Change subject: gsm_03_40.h: define max SM-TP-UDL (User-Data-Length) values ...................................................................... gsm_03_40.h: define max SM-TP-UDL (User-Data-Length) values As per 3GPP TS 03.40, section 9.2.3.16 "TP-User-Data-Length (TP-UDL)" field may contain up to 140 octets (or 140 * 8 / 7 = 160 septets). Change-Id: I54f88d2908ac47228813fb8c049f4264e5145241 --- M include/osmocom/gsm/protocol/gsm_03_40.h 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_03_40.h b/include/osmocom/gsm/protocol/gsm_03_40.h index a65203f..33a5c59 100644 --- a/include/osmocom/gsm/protocol/gsm_03_40.h +++ b/include/osmocom/gsm/protocol/gsm_03_40.h @@ -3,6 +3,11 @@ #pragma once +/* SM-TP-UD (User-Data) field may contain up to 140 octets + * (or 140 * 8 / 7 = 160 septets). See section 9.2.3.24. */ +#define GSM340_UDL_OCT_MAX 140 /*!< Maximum TP-UD length (in octets) for 7-bit encoding */ +#define GSM340_UDL_SPT_MAX 160 /*!< Maximum TP-UD length (in seplets) for 8-bit and UCS-2 encoding */ + /** * 9.1.2.5 Type Of Number */ -- To view, visit https://gerrit.osmocom.org/13553 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I54f88d2908ac47228813fb8c049f4264e5145241 Gerrit-Change-Number: 13553 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 11:06:30 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 11:06:30 +0000 Subject: Change in libsmpp34[master]: configure.ac: enable kernel style compile messages In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13565 ) Change subject: configure.ac: enable kernel style compile messages ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13565 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I96a5d808e2a199c33a1c9eef77da3a040e305689 Gerrit-Change-Number: 13565 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 10 Apr 2019 11:06:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 13:11:58 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Apr 2019 13:11:58 +0000 Subject: Change in libsmpp34[master]: configure.ac: enable kernel style compile messages In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13565 ) Change subject: configure.ac: enable kernel style compile messages ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13565 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I96a5d808e2a199c33a1c9eef77da3a040e305689 Gerrit-Change-Number: 13565 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 10 Apr 2019 13:11:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 13:13:27 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Apr 2019 13:13:27 +0000 Subject: Change in libsmpp34[master]: Allow application to override default heap allocator In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13561 ) Change subject: Allow application to override default heap allocator ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/13561/4/src/smpp34_heap.c File src/smpp34_heap.c: https://gerrit.osmocom.org/#/c/13561/4/src/smpp34_heap.c at 2 PS4, Line 2: * Copyright (C) 2019 Raul Tremsal Why this copyright here? -- To view, visit https://gerrit.osmocom.org/13561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Gerrit-Change-Number: 13561 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: fixeria Gerrit-Comment-Date: Wed, 10 Apr 2019 13:13:27 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 13:16:11 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Apr 2019 13:16:11 +0000 Subject: Change in osmo-msc[master]: smpp: Make libsmpp34 use talloc for its allocations In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13562 ) Change subject: smpp: Make libsmpp34 use talloc for its allocations ...................................................................... Patch Set 2: (1 comment) Was there some communication with the original author before you changed API names? This is confusing for reviewers and a bit rude imho, specially since you didn't explain your intention with this kind of change. https://gerrit.osmocom.org/#/c/13562/2//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13562/2//COMMIT_MSG at 9 PS2, Line 9: We are just introducing smpp34_set_memory_functions() in libsmpp34 You forgot to update this reference when changing API names -- To view, visit https://gerrit.osmocom.org/13562 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Gerrit-Change-Number: 13562 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 10 Apr 2019 13:16:11 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 13:52:20 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 13:52:20 +0000 Subject: Change in libsmpp34[master]: Allow application to override default heap allocator In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13561 ) Change subject: Allow application to override default heap allocator ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/13561/4/src/smpp34_heap.c File src/smpp34_heap.c: https://gerrit.osmocom.org/#/c/13561/4/src/smpp34_heap.c at 2 PS4, Line 2: * Copyright (C) 2019 Raul Tremsal > Why this copyright here? Oh, sure, thanks! -- To view, visit https://gerrit.osmocom.org/13561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Gerrit-Change-Number: 13561 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-CC: fixeria Gerrit-Comment-Date: Wed, 10 Apr 2019 13:52:20 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 13:53:44 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 13:53:44 +0000 Subject: Change in osmo-ggsn[master]: process_pco() const-ify 'apn' argument Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13566 Change subject: process_pco() const-ify 'apn' argument ...................................................................... process_pco() const-ify 'apn' argument Change-Id: I2a96b0fbe077c7c49342553de0880bfc58318669 --- M ggsn/ggsn.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/66/13566/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 39695b9..2ee9b1a 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -503,7 +503,7 @@ } /* construct an IPCP PCO response from request*/ -static void build_ipcp_pco(struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) +static void build_ipcp_pco(const struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) { const struct in46_addr *dns1 = &apn->v4.cfg.dns[0]; const struct in46_addr *dns2 = &apn->v4.cfg.dns[1]; @@ -559,7 +559,7 @@ } /* process one PCO request from a MS/UE, putting together the proper responses */ -static void process_pco(struct apn_ctx *apn, struct pdp_t *pdp) +static void process_pco(const struct apn_ctx *apn, struct pdp_t *pdp) { struct msgb *msg = msgb_alloc(256, "PCO"); struct ippoolm_t *peer_v4 = pdp_get_peer_ipv(pdp, false); @@ -573,7 +573,7 @@ if (pco_contains_proto(&pdp->pco_req, 0, PCO_P_DNS_IPv6_ADDR, 0)) { for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { - struct in46_addr *i46a = &apn->v6.cfg.dns[i]; + const 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); @@ -582,7 +582,7 @@ if (pco_contains_proto(&pdp->pco_req, 0, PCO_P_DNS_IPv4_ADDR, 0)) { for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { - struct in46_addr *i46a = &apn->v4.cfg.dns[i]; + const 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); -- To view, visit https://gerrit.osmocom.org/13566 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2a96b0fbe077c7c49342553de0880bfc58318669 Gerrit-Change-Number: 13566 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 13:53:44 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 13:53:44 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Remove magic numbers from pco_contains_proto() Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13567 Change subject: ggsn: Remove magic numbers from pco_contains_proto() ...................................................................... ggsn: Remove magic numbers from pco_contains_proto() Let's remove some magic numbers and use a data structure to describe the PCO element header. Change-Id: I9871ffced677320aa82438332bfdb951ab129f04 --- M ggsn/ggsn.c 1 file changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/67/13567/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 2ee9b1a..c31831a 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -462,18 +462,23 @@ PCO_P_REL_DATA_SVC = 0x0018, }; +struct pco_element { + uint16_t protocol_id; /* network byte order */ + uint8_t length; /* length of data below */ + uint8_t data[0]; +} __attribute__((packed)); + /* determine if PCO contains given protocol */ static uint8_t *pco_contains_proto(struct ul255_t *pco, size_t offset, uint16_t prot, size_t prot_minlen) { - uint8_t *cur = pco->v + 1 + offset; + uint8_t *cur = pco->v + 1 /*length*/ + offset; /* iterate over PCO and check if protocol contained */ - while (cur + 3 <= pco->v + pco->l) { - uint16_t cur_prot = osmo_load16be(cur); - uint8_t cur_len = cur[2]; - if (cur_prot == prot && cur_len >= prot_minlen) + while (cur + sizeof(struct pco_element) <= pco->v + pco->l) { + const struct pco_element *elem = (const struct pco_element *)cur; + if (ntohs(elem->protocol_id) == prot && elem->length >= prot_minlen) return cur; - cur += cur_len + 3; + cur += elem->length + sizeof(struct pco_element); } return NULL; } -- To view, visit https://gerrit.osmocom.org/13567 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9871ffced677320aa82438332bfdb951ab129f04 Gerrit-Change-Number: 13567 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 13:53:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 13:53:45 +0000 Subject: Change in osmo-ggsn[master]: ggsn: const-ify input / read-only arguments of PCO related functions Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13568 Change subject: ggsn: const-ify input / read-only arguments of PCO related functions ...................................................................... ggsn: const-ify input / read-only arguments of PCO related functions Change-Id: Ia0877988180ded4e3c033d7f1fb6e1c2acd60163 --- M ggsn/ggsn.c 1 file changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/68/13568/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c31831a..2c0d64e 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -413,9 +413,10 @@ } __attribute__ ((packed)); /* determine if IPCP contains given option */ -static uint8_t *ipcp_contains_option(uint8_t *ipcp, size_t ipcp_len, enum ipcp_options opt, size_t opt_minlen) +static const uint8_t *ipcp_contains_option(const uint8_t *ipcp, size_t ipcp_len, + enum ipcp_options opt, size_t opt_minlen) { - uint8_t *cur_opt = ipcp + sizeof(struct ipcp_hdr); + const uint8_t *cur_opt = ipcp + sizeof(struct ipcp_hdr); /* iterate over Options and check if protocol contained */ while (cur_opt + 2 <= ipcp + ipcp_len) { @@ -469,9 +470,10 @@ } __attribute__((packed)); /* determine if PCO contains given protocol */ -static uint8_t *pco_contains_proto(struct ul255_t *pco, size_t offset, uint16_t prot, size_t prot_minlen) +static const uint8_t *pco_contains_proto(const struct ul255_t *pco, size_t offset, + uint16_t prot, size_t prot_minlen) { - uint8_t *cur = pco->v + 1 /*length*/ + offset; + const uint8_t *cur = pco->v + 1 /*length*/ + offset; /* iterate over PCO and check if protocol contained */ while (cur + sizeof(struct pco_element) <= pco->v + pco->l) { @@ -512,9 +514,9 @@ { const struct in46_addr *dns1 = &apn->v4.cfg.dns[0]; const struct in46_addr *dns2 = &apn->v4.cfg.dns[1]; - uint8_t *ipcp; + const uint8_t *ipcp, *pco_ipcp; uint16_t ipcp_len; - uint8_t *len1, *len2, *pco_ipcp; + uint8_t *len1, *len2; unsigned int len_appended; ptrdiff_t consumed; size_t remain, offset = 0; -- To view, visit https://gerrit.osmocom.org/13568 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia0877988180ded4e3c033d7f1fb6e1c2acd60163 Gerrit-Change-Number: 13568 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 13:53:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 13:53:45 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Remove magic numbers from ipcp_contains_option() Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13569 Change subject: ggsn: Remove magic numbers from ipcp_contains_option() ...................................................................... ggsn: Remove magic numbers from ipcp_contains_option() Let's remove some magic numbers and use a data structure instead. Change-Id: I5b1abc6f403f85986407e9e8359924dfcb58031a --- M ggsn/ggsn.c 1 file changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/69/13569/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 2c0d64e..2d1368b 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -419,14 +419,15 @@ const uint8_t *cur_opt = ipcp + sizeof(struct ipcp_hdr); /* iterate over Options and check if protocol contained */ - while (cur_opt + 2 <= ipcp + ipcp_len) { - uint8_t type = cur_opt[0]; - uint8_t len = cur_opt[1]; /* length value includes 2 bytes type/length */ - if (len < 2) + while (cur_opt + sizeof(struct ipcp_option_hdr) <= ipcp + ipcp_len) { + const struct ipcp_option_hdr *cur_opt_hdr = (const struct ipcp_option_hdr *)cur_opt; + /* length value includes 2 bytes type/length */ + if (cur_opt_hdr->len < sizeof(struct ipcp_option_hdr)) return NULL; - if (type == opt && len >= 2 + opt_minlen) + if (cur_opt_hdr->type == opt && + cur_opt_hdr->len >= sizeof(struct ipcp_option_hdr) + opt_minlen) return cur_opt; - cur_opt += len; + cur_opt += cur_opt_hdr->len; } return NULL; } -- To view, visit https://gerrit.osmocom.org/13569 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5b1abc6f403f85986407e9e8359924dfcb58031a Gerrit-Change-Number: 13569 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 13:53:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 13:53:45 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Fix build_ipcp_pco() in presence of invalid IPCP content Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13570 Change subject: ggsn: Fix build_ipcp_pco() in presence of invalid IPCP content ...................................................................... ggsn: Fix build_ipcp_pco() in presence of invalid IPCP content When build_ipcp_pco() iterated over the PCO list, it didn't use the "outer" pco length as an increment, but used the "inner" IPCP length. If an IPCP message with an invalid "inner" length was being processed (see pcap file attached to OS#3914), the PCO iteration beyond that broken IPCP would fail, possibly rendering false hits. Let's make pco_contains_proto() return a pointer to the the pco_element, so that the caller can use the outer length as an increment. Change-Id: I8e9cffde092c8c5824abfaeecb742afcf949802c Related: OS#3914 --- M ggsn/ggsn.c 1 file changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/70/13570/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 2d1368b..eac7e16 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -471,8 +471,8 @@ } __attribute__((packed)); /* determine if PCO contains given protocol */ -static const uint8_t *pco_contains_proto(const struct ul255_t *pco, size_t offset, - uint16_t prot, size_t prot_minlen) +static const struct pco_element *pco_contains_proto(const struct ul255_t *pco, size_t offset, + uint16_t prot, size_t prot_minlen) { const uint8_t *cur = pco->v + 1 /*length*/ + offset; @@ -480,7 +480,7 @@ while (cur + sizeof(struct pco_element) <= pco->v + pco->l) { const struct pco_element *elem = (const struct pco_element *)cur; if (ntohs(elem->protocol_id) == prot && elem->length >= prot_minlen) - return cur; + return elem; cur += elem->length + sizeof(struct pco_element); } return NULL; @@ -515,7 +515,8 @@ { const struct in46_addr *dns1 = &apn->v4.cfg.dns[0]; const struct in46_addr *dns2 = &apn->v4.cfg.dns[1]; - const uint8_t *ipcp, *pco_ipcp; + const struct pco_element *pco_ipcp; + const uint8_t *ipcp; uint16_t ipcp_len; uint8_t *len1, *len2; unsigned int len_appended; @@ -527,7 +528,7 @@ while (pco_ipcp) { uint8_t *start = msg->tail; - ipcp = (pco_ipcp + 3); /* 2=type + 1=len */ + ipcp = pco_ipcp->data; consumed = (ipcp - &pdp->pco_req.v[0]); remain = sizeof(pdp->pco_req.v) - consumed; ipcp_len = osmo_load16be(ipcp + 2); /* 1=code + 1=id */ @@ -560,7 +561,7 @@ *len1 = len_appended - 3; *len2 = len_appended - 3; - offset += 3 + ipcp_len; + offset += sizeof(pco_ipcp) + pco_ipcp->length; pco_ipcp = pco_contains_proto(&pdp->pco_req, offset, PCO_P_IPCP, sizeof(struct ipcp_hdr)); } -- To view, visit https://gerrit.osmocom.org/13570 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8e9cffde092c8c5824abfaeecb742afcf949802c Gerrit-Change-Number: 13570 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 13:54:01 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 13:54:01 +0000 Subject: Change in libsmpp34[master]: Allow application to override default heap allocator In-Reply-To: References: Message-ID: Vadim Yanitskiy has uploaded a new patch set (#5) to the change originally created by Harald Welte. ( https://gerrit.osmocom.org/13561 ) Change subject: Allow application to override default heap allocator ...................................................................... Allow application to override default heap allocator Let's introduce a mechanism by which libsmpp34-using applications can override the memory allocator functions. This allows us e.g. in the Osmocom context to use talloc which aids us in debugging memory leaks. Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Closes: OS#3913 --- M TODO-RELEASE M src/Makefile.am A src/smpp34_heap.c A src/smpp34_heap.h M src/smpp34_params.c M src/smpp34_unpack.c 6 files changed, 110 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/61/13561/5 -- To view, visit https://gerrit.osmocom.org/13561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Gerrit-Change-Number: 13561 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-CC: fixeria -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 14:03:18 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 14:03:18 +0000 Subject: Change in osmo-msc[master]: smpp: Make libsmpp34 use talloc for its allocations In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13562 ) Change subject: smpp: Make libsmpp34 use talloc for its allocations ...................................................................... Patch Set 2: Hi Pau, Harald, > Was there some communication with the original author before you changed API names? > This is confusing for reviewers and a bit rude imho, specially since you didn't > explain your intention with this kind of change. There was no. For some reason, I thought that this change is also assigned to me... You're right, sorry for that. My intention was to make the symbol names a bit shorter, and a bit closer to what I remember from similar API of SQLite3 (where one can use SQLITE_CONFIG_MALLOC). Please let me know whether I should rollback to the previous version. -- To view, visit https://gerrit.osmocom.org/13562 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Gerrit-Change-Number: 13562 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 10 Apr 2019 14:03:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 14:04:29 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 14:04:29 +0000 Subject: Change in osmo-ggsn[master]: process_pco() const-ify 'apn' argument In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13566 ) Change subject: process_pco() const-ify 'apn' argument ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13566 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2a96b0fbe077c7c49342553de0880bfc58318669 Gerrit-Change-Number: 13566 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 10 Apr 2019 14:04:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 14:50:00 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Apr 2019 14:50:00 +0000 Subject: Change in osmo-msc[master]: libmsc/ran_conn.c: send S_SUBSCR_ATTACHED after RAN_CONN_S_ACCEPTED Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13571 Change subject: libmsc/ran_conn.c: send S_SUBSCR_ATTACHED after RAN_CONN_S_ACCEPTED ...................................................................... libmsc/ran_conn.c: send S_SUBSCR_ATTACHED after RAN_CONN_S_ACCEPTED Change-Id: Id5bc2d1d488a0ab92fd72e9cef6250e6794807a9 --- M src/libmsc/ran_conn.c M src/libmsc/sms_queue.c M tests/msc_vlr/msc_vlr_test_authen_reuse.err M tests/msc_vlr/msc_vlr_test_call.err M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_ss.err M tests/msc_vlr/msc_vlr_test_umts_authen.err 10 files changed, 65 insertions(+), 45 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/71/13571/1 diff --git a/src/libmsc/ran_conn.c b/src/libmsc/ran_conn.c index e54e542..3f75314 100644 --- a/src/libmsc/ran_conn.c +++ b/src/libmsc/ran_conn.c @@ -79,27 +79,18 @@ } } +/* TODO: get rid of this function... */ static void evaluate_acceptance_outcome(struct osmo_fsm_inst *fi, bool conn_accepted) { struct ran_conn *conn = fi->priv; update_counters(fi, conn_accepted); - /* Trigger transactions that we paged for */ - if (conn->complete_layer3_type == COMPLETE_LAYER3_PAGING_RESP) { - subscr_paging_dispatch(GSM_HOOK_RR_PAGING, - conn_accepted ? GSM_PAGING_SUCCEEDED : GSM_PAGING_EXPIRED, + if (conn->complete_layer3_type == COMPLETE_LAYER3_PAGING_RESP + && !conn_accepted) { + subscr_paging_dispatch(GSM_HOOK_RR_PAGING, GSM_PAGING_EXPIRED, NULL, conn, conn->vsub); } - - if (conn->complete_layer3_type == COMPLETE_LAYER3_CM_SERVICE_REQ - && conn_accepted) { - conn->received_cm_service_request = true; - ran_conn_get(conn, RAN_CONN_USE_CM_SERVICE); - } - - if (conn_accepted) - osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_ATTACHED, conn->vsub); } static void log_close_event(struct osmo_fsm_inst *fi, uint32_t event, void *data) @@ -272,6 +263,23 @@ * The LU expiry timer will restart once the connection is closed. */ conn->vsub->expire_lu = VLR_SUBSCRIBER_NO_EXPIRATION; + switch (conn->complete_layer3_type) { + case COMPLETE_LAYER3_CM_SERVICE_REQ: + conn->received_cm_service_request = true; + ran_conn_get(conn, RAN_CONN_USE_CM_SERVICE); + break; + case COMPLETE_LAYER3_PAGING_RESP: + subscr_paging_dispatch(GSM_HOOK_RR_PAGING, GSM_PAGING_SUCCEEDED, + NULL, conn, conn->vsub); + break; + default: + break; + } + + /* Notify all sub-systems that a subscriber is available, so + * they can e.g. initiate a MT SMS delivery or RRLP request. */ + osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_ATTACHED, conn->vsub); + if (!ran_conn_fsm_has_active_transactions(fi)) osmo_fsm_inst_dispatch(fi, RAN_CONN_E_UNUSED, NULL); } diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index afd878f..f1d6279 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -404,8 +404,9 @@ static int sub_ready_for_sm(struct gsm_network *net, struct vlr_subscr *vsub) { - struct gsm_sms *sms; struct gsm_sms_pending *pending; + struct ran_conn *conn; + struct gsm_sms *sms; /* * The code used to be very clever and tried to submit @@ -430,6 +431,17 @@ return 0; } + /* Check if RAN connection was used for Location Updating */ + conn = connection_for_subscr(vsub); + if (!conn) { + LOGP(DMSC, LOGL_ERROR, "S_SUBSCR_ATTACHED, but no RAN connection?!?\n"); + return -EINVAL; + } + if (conn->complete_layer3_type == COMPLETE_LAYER3_LU) { + /* FIXME: distinguish IMSI Attach and periodical LU! */ + return 0; + } + /* Now try to deliver any pending SMS to this sub */ sms = db_sms_get_unsent_for_subscr(vsub, UINT_MAX); if (!sms) diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.err b/tests/msc_vlr/msc_vlr_test_authen_reuse.err index 1a57097..468c8e9 100644 --- a/tests/msc_vlr/msc_vlr_test_authen_reuse.err +++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.err @@ -247,8 +247,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 @@ -356,8 +356,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 @@ -692,8 +692,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 - Concluding CM Service Request @@ -814,8 +814,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 - Concluding CM Service Request @@ -1123,8 +1123,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 @@ -1218,8 +1218,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 @@ -1313,8 +1313,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 @@ -1649,8 +1649,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 - Concluding CM Service Request @@ -1757,8 +1757,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 - Concluding CM Service Request @@ -1865,8 +1865,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 - Concluding CM Service Request @@ -2188,8 +2188,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 @@ -2538,8 +2538,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 - Concluding CM Service Request diff --git a/tests/msc_vlr/msc_vlr_test_call.err b/tests/msc_vlr/msc_vlr_test_call.err index f190c31..ee5a6f9 100644 --- a/tests/msc_vlr/msc_vlr_test_call.err +++ b/tests/msc_vlr/msc_vlr_test_call.err @@ -260,8 +260,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 --- @@ -1385,8 +1385,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 --- @@ -1734,8 +1734,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 --- diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index 6a67833..843115a 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -236,8 +236,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000004620:MSISDN-46071 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF IMSI-901700000004620:MSISDN-46071: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 @@ -758,8 +758,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 @@ -2379,8 +2379,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000010650:MSISDN-42342 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF IMSI-901700000010650:MSISDN-42342: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index ef77391..c513b49 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -265,8 +265,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 - Concluding CM Service Request @@ -840,8 +840,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 - Concluding CM Service Request @@ -2123,8 +2123,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 - Concluding CM Service Request @@ -2649,8 +2649,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000004620:MSISDN-42342: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000004620:MSISDN-42342: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 - Concluding CM Service Request @@ -3185,8 +3185,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000004620:MSISDN-42342: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000004620:MSISDN-42342: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 - Concluding CM Service Request diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 96d1ad7..00d233e 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -145,8 +145,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000004620:MSISDN-46071 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_NEW}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + cm_service == 2 (0x9: compl_l3,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_NEW}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + cm_service == 2 (0x9: compl_l3,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF VLR subscr IMSI-901700000004620:MSISDN-46071 usage decreases to: 2 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMPLETE_LAYER_3 @@ -539,8 +539,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_NEW}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + cm_service == 2 (0x9: compl_l3,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_NEW}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + cm_service == 2 (0x9: compl_l3,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 usage decreases to: 2 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMPLETE_LAYER_3 diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index 2147e84..3771d55 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -667,8 +667,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000004620:MSISDN-46071 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_NEW}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + cm_service == 2 (0x9: compl_l3,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_NEW}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + cm_service == 2 (0x9: compl_l3,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF VLR subscr IMSI-901700000004620:MSISDN-46071 usage decreases to: 2 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMPLETE_LAYER_3 @@ -859,8 +859,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000004620:MSISDN-46071 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_NEW}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + cm_service == 2 (0x9: compl_l3,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_NEW}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + cm_service == 2 (0x9: compl_l3,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF VLR subscr IMSI-901700000004620:MSISDN-46071 usage decreases to: 2 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMPLETE_LAYER_3 @@ -1055,8 +1055,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000004620:MSISDN-46071 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_NEW}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + cm_service == 2 (0x9: compl_l3,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_NEW}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + cm_service == 2 (0x9: compl_l3,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF VLR subscr IMSI-901700000004620:MSISDN-46071 usage decreases to: 2 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMPLETE_LAYER_3 diff --git a/tests/msc_vlr/msc_vlr_test_ss.err b/tests/msc_vlr/msc_vlr_test_ss.err index a801f9e..6728082 100644 --- a/tests/msc_vlr/msc_vlr_test_ss.err +++ b/tests/msc_vlr/msc_vlr_test_ss.err @@ -138,8 +138,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000004620:MSISDN-46071 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_NEW}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + cm_service == 2 (0x9: compl_l3,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_NEW}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + cm_service == 2 (0x9: compl_l3,cm_service) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF VLR subscr IMSI-901700000004620:MSISDN-46071 usage decreases to: 2 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMPLETE_LAYER_3 diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index ee9eeba..33844d7 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -253,8 +253,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED - sending CM Service Accept for IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 2 (0xa: dtap,cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 @@ -779,8 +779,8 @@ DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_WAIT_CIPH}: state_chg to PR_ARQ_S_DONE DVLR Process_Access_Request_VLR(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){PR_ARQ_S_DONE}: Process Access Request result: PASSED DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED -DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_AUTH_CIPH}: state_chg to RAN_CONN_S_ACCEPTED +DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + cm_service == 1 (0x8: cm_service) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: ran_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 - Concluding CM Service Request -- To view, visit https://gerrit.osmocom.org/13571 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id5bc2d1d488a0ab92fd72e9cef6250e6794807a9 Gerrit-Change-Number: 13571 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 15:50:45 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 15:50:45 +0000 Subject: Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13392 ) Change subject: fsm: support graceful osmo_fsm_inst_term() cascades ...................................................................... Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/13392/7/src/fsm.c File src/fsm.c: https://gerrit.osmocom.org/#/c/13392/7/src/fsm.c at 105 PS7, Line 105: = {}; > I'm not sure you can do this to a __thread variable. [?] just to be explicit ... because the concept that all static variables are guaranteed to be zero initialized is still new to me and I haven't settled into trusting that yet. I can drop it... This is the first time I come across __thread, I don't know anything about it. -- To view, visit https://gerrit.osmocom.org/13392 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 Gerrit-Change-Number: 13392 Gerrit-PatchSet: 7 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 10 Apr 2019 15:50:45 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 15:54:52 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 15:54:52 +0000 Subject: Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13392 ) Change subject: fsm: support graceful osmo_fsm_inst_term() cascades ...................................................................... Patch Set 7: > it might make sense to expose the value of this global flag variable in the fsm VTY code, so that "show fsm" would give you an indication? So far we have 'show fsm all' and 'show fsm NAME', i.e. shows individual FSMs. There is nothing yet showing global FSM state that applies to all FSMs. Let's leave it to a later patch if the need comes up? -- To view, visit https://gerrit.osmocom.org/13392 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 Gerrit-Change-Number: 13392 Gerrit-PatchSet: 7 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 10 Apr 2019 15:54:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:50:41 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:50:41 +0000 Subject: Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades 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/13392 to look at the new patch set (#8). Change subject: fsm: support graceful osmo_fsm_inst_term() cascades ...................................................................... fsm: support graceful osmo_fsm_inst_term() cascades Add global flag osmo_fsm_term_safely() -- if set to true, enable the following behavior: Detect osmo_fsm_inst_term() occuring within osmo_fsm_inst_term(): - collect deallocations until the outermost osmo_fsm_inst_term() is done. - call osmo_fsm_inst_free() *after* dispatching the parent event. If a struct osmo_fsm_inst enters osmo_fsm_inst_term() while another is already within osmo_fsm_inst_term(), do not directly deallocate it, but talloc-reparent it to a separate talloc context, to be deallocated with the outermost FSM inst. The effect is that all osmo_fsm_inst freed within an osmo_fsm_inst_term() cascade will stay allocated until all osmo_fsm_inst_term() are complete and all of them will be deallocated at the same time. Mark the deferred deallocation state as __thread in an attempt to make cascaded deallocation handling threadsafe. Keep the enable/disable flag separate, so that it is global and not per-thread. The feature is showcased by fsm_dealloc_test.c: with this feature, all of those wild deallocation scenarios succeed. Make fsm_dealloc_test a normal regression test in testsuite.at. Rationale: It is difficult to gracefully handle deallocations of groups of FSM instances that reference each other. As soon as one child dispatching a cleanup event causes its parent to deallocate before fsm.c was ready for it, deallocation will hit a use-after-free. Before this patch, by using parent_term events and distinct "terminating" FSM states, parent/child FSMs can be taught to wait for all children to deallocate before deallocating the parent. But as soon as a non-child / non-parent FSM instance is involved, or actually any other cleanup() action that triggers parent FSMs or parent talloc contexts to become unused, it is near impossible to think of all possible deallocation events ricocheting, and to avoid running into freeing FSM instances that were still in the middle of osmo_fsm_inst_term(), or FSM instances to enter osmo_fsm_inst_term() more than once. This patch makes deallocation of "all possible" setups of complex cross referencing FSM instances easy to handle correctly, without running into use-after-free or double free situations, and, notably, without changing calling code. Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 --- M include/osmocom/core/fsm.h M src/fsm.c M tests/Makefile.am M tests/fsm/fsm_dealloc_test.c M tests/fsm/fsm_dealloc_test.err M tests/testsuite.at 6 files changed, 3,503 insertions(+), 301 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/13392/8 -- To view, visit https://gerrit.osmocom.org/13392 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 Gerrit-Change-Number: 13392 Gerrit-PatchSet: 8 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:50:41 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:50:41 +0000 Subject: Change in libosmocore[master]: add gsm0808_create_handover_request_ack2 to add AoIP RTP addr 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/13259 to look at the new patch set (#9). Change subject: add gsm0808_create_handover_request_ack2 to add AoIP RTP addr ...................................................................... add gsm0808_create_handover_request_ack2 to add AoIP RTP addr osmo-bsc so far omits the AoIP Transport Layer Address from its Handover Request Acknowledge message, which breaks inter-BSC Handover for AoIP. Allow fixing that. One quirk I really don't like about this: I would prefer to directly use struct sockaddr_storage as a member of the struct gsm0808_handover_request_ack. Even though struct sockaddr_storage appears in various function signatures, the gsm0808.c actually also gets built on embedded systems that lack arpa/inet.h (for me indicated by the ARM build job on jenkins). Compiling gsm0808.c works only because the actual coding of struct sockaddr_storage is implemented in gsm0808_util.c, which (apparently) does not get built on embedded and hence, even though there are undefined references to e.g. gsm0808_enc_aoip_trasp_addr() it works. Related: I4a5acdb2d4a0b947cc0c62067a67be88a3d467ff (osmo-bsc) Change-Id: Ia71542ea37d4fd2c9fb9b40357db7aeb111ec576 --- M include/osmocom/gsm/gsm0808.h M src/gsm/gsm0808.c M src/gsm/libosmogsm.map 3 files changed, 60 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/59/13259/9 -- To view, visit https://gerrit.osmocom.org/13259 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia71542ea37d4fd2c9fb9b40357db7aeb111ec576 Gerrit-Change-Number: 13259 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:50:44 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:50:44 +0000 Subject: Change in libosmocore[master]: make osmo_sockaddr_str_is_set() NULL-safe Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13572 Change subject: make osmo_sockaddr_str_is_set() NULL-safe ...................................................................... make osmo_sockaddr_str_is_set() NULL-safe Obviously a NULL pointer should return false instead of segfaulting. Change-Id: Iac025cf4d556cbed99f3924cd9ca05a05881cd9a --- M src/sockaddr_str.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/13572/1 diff --git a/src/sockaddr_str.c b/src/sockaddr_str.c index c9d9a94..d683c7d 100644 --- a/src/sockaddr_str.c +++ b/src/sockaddr_str.c @@ -60,7 +60,8 @@ */ bool osmo_sockaddr_str_is_set(const struct osmo_sockaddr_str *sockaddr_str) { - return *sockaddr_str->ip + return sockaddr_str + && *sockaddr_str->ip && sockaddr_str->port && (sockaddr_str->af == AF_INET || sockaddr_str->af == AF_INET6); } -- To view, visit https://gerrit.osmocom.org/13572 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iac025cf4d556cbed99f3924cd9ca05a05881cd9a Gerrit-Change-Number: 13572 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:50:44 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:50:44 +0000 Subject: Change in libosmocore[master]: add osmo_{escape, quote}_str_buf2() for OSMO_STRBUF_APPEND() use Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13573 Change subject: add osmo_{escape,quote}_str_buf2() for OSMO_STRBUF_APPEND() use ...................................................................... add osmo_{escape,quote}_str_buf2() for OSMO_STRBUF_APPEND() use To be able to append an escaped or quoted string using OSMO_STRBUF_APPEND(), the function signature must be like snprintf: buf and size are first arguments, return value is characters-that-would-be-written. Add osmo_escape_str_buf2() and osmo_quote_str_buf2() to match this signature. To avoid code duplication, implement osmo_quote_str_buf() and osmo_escape_str_buf() by calling the new functions. I decided to allow slight changes to the behavior for current osmo_escape_str() and osmo_escape_str_buf(), because impact on callers is minimal: (1) The new implementation uses OSMO_STRBUF_*, and in consequence osmo_quote_str() no longer prints an ending double quote after truncated strings; Before, a truncated output was, sic: "this string is trunca" and now this becomes, sic: "this string is truncat I decided to not keep the old behavior because it is questionable to begin with. It looks like the string actually ended at the truncation boundary instead of the reason being not enough space in the output buffer. (2) The new osmo_escape_str_buf2() function obviously cannot pass-thru an unchanged char* if no escaping was needed. Sacrifice this tiny optimization feature to avoid code duplication: - it is an unnoticeable optimization, - the caller anyway always passes a string buffer, - the feature caused handling strings and buffers differently depending on their content (i.e. code that usually writes out strings in full length "suddenly" truncates because a non-printable character is contained, etc.) I considered adding a skip_if_unescaped flag to the osmo_quote_str_buf2() function signature, but in the end decided that the API clutter is not worth having for all the above reasons. Adjust tests to accomodate above changes. Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae --- M TODO-RELEASE M include/osmocom/core/utils.h M src/utils.c M tests/utils/utils_test.c M tests/utils/utils_test.ok 5 files changed, 110 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/13573/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 5ddc57a..7c81e32 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -11,3 +11,11 @@ libosmogb gprs_nsvc Adding sig_weight and data_weight members for IP-SNS support libosmogb various new symbols Adding functions related to IP-SNS support libosmocore osmo_fsm_inst Add flag proc.terminating (ABI change) +libosmocore osmo_escape_str(), These now always copy to the buffer instead of returning the + osmo_escape_str_buf() unchanged input string when no chars needed escaping, hence + returned strings might now also be truncated even if all chars were printable. +libosmocore osmo_escape_str_buf2() New function signature similar to snprintf(), for use with OSMO_STRBUF_APPEND(). +libosmocore osmo_quote_str(), On string truncation, these used to print a closing quote '"' after the + osmo_quote_str_buf() truncated string. This is no longer the case. e.g. a string 'truncated' in a + 9-char buffer used to print '"trunca"\0', which now becomes '"truncat\0'. +libosmocore osmo_quote_str_buf2() New function signature similar to snprintf(), for use with OSMO_STRBUF_APPEND(). diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index e19649a..ecb04b5 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -138,9 +138,11 @@ bool osmo_separated_identifiers_valid(const char *str, const char *sep_chars); const char *osmo_escape_str(const char *str, int len); -char *osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize); +const char *osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize); +int osmo_escape_str_buf2(char *buf, size_t bufsize, const char *str, int in_len); const char *osmo_quote_str(const char *str, int in_len); -char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize); +const char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize); +int osmo_quote_str_buf2(char *buf, size_t bufsize, const char *str, int in_len); uint32_t osmo_isqrt32(uint32_t x); diff --git a/src/utils.c b/src/utils.c index b50ceab..7def0b8 100644 --- a/src/utils.c +++ b/src/utils.c @@ -557,22 +557,74 @@ * \param[inout] buf string buffer to write escaped characters to. * \param[in] bufsize size of \a buf. * \returns buf containing an escaped representation, possibly truncated. + * \returns buf containing an escaped representation, possibly truncated, + * or "(null)" if str == NULL, or "(error)" in case of errors. */ -char *osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize) +const char *osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize) { - int in_pos = 0; - int next_unprintable = 0; - int out_pos = 0; - char *out = buf; - /* -1 to leave space for a final \0 */ - int out_len = bufsize-1; - + int rc; if (!str) return "(null)"; + rc = osmo_escape_str_buf2(buf, bufsize, str, in_len); + if (!buf || rc < 0) + return "(error)"; + return buf; +} + +/*! Copy N characters to a buffer with a function signature useful for OSMO_STRBUF_APPEND(). + * Similarly to snprintf(), the result is always nul terminated (except if buf is NULL or bufsize is 0). + * \param[out] buf Target buffer. + * \param[in] bufsize sizeof(buf). + * \param[in] str String to copy. + * \param[in] n Maximum number of non-nul characters to copy. + * \return Number of characters that would be written if bufsize were large enough excluding '\0' (like snprintf()). + */ +int osmo_print_n(char *buf, size_t bufsize, const char *str, size_t n) +{ + size_t write_n; + + if (!str) + str = ""; + + n = strnlen(str, n); + + if (!buf || !bufsize) + return n; + write_n = n; + if (write_n >= bufsize) + write_n = bufsize - 1; + if (write_n) + strncpy(buf, str, write_n); + buf[write_n] = '\0'; + + return n; +} + +/*! Return the string with all non-printable characters escaped. + * The function signature is suitable for OSMO_STRBUF_APPEND(). + * \param[out] buf string buffer to write escaped characters to. + * \param[in] bufsize sizeof(buf). + * \param[in] str A string that may contain any characters. + * \param[in] in_len Pass -1 to print until nul char, or >= 0 to force a length (also past nul chars). + * \return Number of characters that would be written if bufsize were large enough excluding '\0' (like snprintf()). + */ +int osmo_escape_str_buf2(char *buf, size_t bufsize, const char *str, int in_len) +{ + struct osmo_strbuf sb = { .buf = buf, .len = bufsize }; + int in_pos = 0; + int next_unprintable = 0; + + if (!str) + in_len = 0; + if (in_len < 0) in_len = strlen(str); + /* Make sure of '\0' termination */ + if (!in_len) + OSMO_STRBUF_PRINTF(sb, "%s", ""); + while (in_pos < in_len) { for (next_unprintable = in_pos; next_unprintable < in_len && isprint((int)str[next_unprintable]) @@ -580,24 +632,16 @@ && str[next_unprintable] != '\\'; next_unprintable++); - if (next_unprintable == in_len && in_pos == 0) { - osmo_strlcpy(buf, str, bufsize); - return buf; - } + OSMO_STRBUF_APPEND(sb, osmo_print_n, &str[in_pos], next_unprintable - in_pos); + in_pos = next_unprintable; - while (in_pos < next_unprintable && out_pos < out_len) - out[out_pos++] = str[in_pos++]; - - if (out_pos == out_len || in_pos == in_len) + if (in_pos == in_len) goto done; switch (str[next_unprintable]) { #define BACKSLASH_CASE(c, repr) \ case c: \ - if (out_pos > out_len-2) \ - goto done; \ - out[out_pos++] = '\\'; \ - out[out_pos++] = repr; \ + OSMO_STRBUF_PRINTF(sb, "\\%c", repr); \ break BACKSLASH_CASE('\n', 'n'); @@ -613,19 +657,14 @@ #undef BACKSLASH_CASE default: - out_pos += snprintf(&out[out_pos], out_len - out_pos, "\\%u", (unsigned char)str[in_pos]); - if (out_pos > out_len) { - out_pos = out_len; - goto done; - } + OSMO_STRBUF_PRINTF(sb, "\\%u", (unsigned char)str[in_pos]); break; } in_pos ++; } done: - out[out_pos] = '\0'; - return out; + return sb.chars_needed; } /*! Return the string with all non-printable characters escaped. @@ -639,24 +678,41 @@ return osmo_escape_str_buf(str, in_len, namebuf, sizeof(namebuf)); } +/*! Like osmo_escape_str_buf2(), but returns double-quotes around a string, or "NULL" for a NULL string. + * This allows passing any char* value and get its C representation as string. + * The function signature is suitable for OSMO_STRBUF_APPEND(). + * \param[out] buf string buffer to write escaped characters to. + * \param[in] bufsize sizeof(buf). + * \param[in] str A string that may contain any characters. + * \param[in] in_len Pass -1 to print until nul char, or >= 0 to force a length. + * \return Number of characters that would be written if bufsize were large enough excluding '\0' (like snprintf()). + */ +int osmo_quote_str_buf2(char *buf, size_t bufsize, const char *str, int in_len) +{ + struct osmo_strbuf sb = { .buf = buf, .len = bufsize }; + if (!str) + OSMO_STRBUF_PRINTF(sb, "NULL"); + else { + OSMO_STRBUF_PRINTF(sb, "\""); + OSMO_STRBUF_APPEND(sb, osmo_escape_str_buf2, str, in_len); + OSMO_STRBUF_PRINTF(sb, "\""); + } + return sb.chars_needed; +} + /*! Like osmo_escape_str(), but returns double-quotes around a string, or "NULL" for a NULL string. * This allows passing any char* value and get its C representation as string. * \param[in] str A string that may contain any characters. * \param[in] in_len Pass -1 to print until nul char, or >= 0 to force a length. * \returns buf containing a quoted and escaped representation, possibly truncated. */ -char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize) +const char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize) { - int l; if (!str) return "NULL"; - if (bufsize < 3) - return ""; - buf[0] = '"'; - osmo_escape_str_buf(str, in_len, buf + 1, bufsize - 2); - l = strlen(buf); - buf[l] = '"'; - buf[l+1] = '\0'; /* both osmo_escape_str_buf() and max_len above ensure room for '\0' */ + if (!buf || !bufsize) + return "(error)"; + osmo_quote_str_buf2(buf, bufsize, str, in_len); return buf; } diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index 211b4d1..d27cdf5 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -585,7 +585,7 @@ printf("- never passthru:\n"); res = osmo_quote_str(printable, -1); - if (res != printable) + if (strcmp(res, printable)) printf("NOT passed through. '%s'\n", res); else printf("passed through unchanged '%s'\n", res); @@ -596,14 +596,14 @@ printf("- truncation when too long:\n"); memset(in_buf, 'x', sizeof(in_buf)); in_buf[0] = '\a'; - in_buf[5] = 'E'; + in_buf[6] = 'E'; memset(out_buf, 0x7f, sizeof(out_buf)); printf("'%s'\n", osmo_quote_str_buf((const char *)in_buf, sizeof(in_buf), out_buf, 10)); OSMO_ASSERT(out_buf[10] == 0x7f); printf("- always truncation, even when no escaping needed:\n"); memset(in_buf, 'x', sizeof(in_buf)); - in_buf[6] = 'E'; /* dst has 10, less 2 quotes and nul, leaves 7, i.e. in[6] is last */ + in_buf[7] = 'E'; /* dst has 10, less 1 quote and nul, leaves 8, i.e. in[7] is last */ in_buf[20] = '\0'; memset(out_buf, 0x7f, sizeof(out_buf)); printf("'%s'\n", osmo_quote_str_buf((const char *)in_buf, -1, out_buf, 10)); diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok index 5783eb1..e30fc5b 100644 --- a/tests/utils/utils_test.ok +++ b/tests/utils/utils_test.ok @@ -258,11 +258,11 @@ - zero length: '""' - truncation when too long: -'"\axxxxE"' +'"\axxxxxE' - always truncation, even when no escaping needed: -'"xxxxxxE"' +'"xxxxxxxE' - try to feed too little buf for quoting: -'' +'"' - NULL string becomes a "NULL" literal: 'NULL' -- To view, visit https://gerrit.osmocom.org/13573 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae Gerrit-Change-Number: 13573 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:50:44 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:50:44 +0000 Subject: Change in libosmocore[master]: add identifier sanitation for setting FSM instance ids Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13574 Change subject: add identifier sanitation for setting FSM instance ids ...................................................................... add identifier sanitation for setting FSM instance ids We often compose FSM instance IDs from context information, for example placing an MSISDN string or IP:port information in the FSM instance id, using osmo_fsm_inst_update_id_f(). This fails if any characters are contained that don't pass osmo_identifier_valid(). Hence it is the task of the caller to make sure only characters allowed in an FSM id are applied. Provide API to trivially allow this by replacing illegal chars: - osmo_identifier_sanitize_buf(), with access to the same set of illegal characters defined in utils.c, - osmo_fsm_inst_update_id_f_sanitize() implicitly replaces non-identifier chars. This makes it easy to add strings like '192.168.0.1:2342' or '+4987654321' to an FSM instance id, without adding string mangling to each place that sets an id; e.g. replacing with '-' to yield '192-168-0-1:2342' or '-4987654321'. Change-Id: Ia40a6f3b2243c95fe428a080b938e11d8ab771a7 --- M include/osmocom/core/fsm.h M include/osmocom/core/utils.h M src/fsm.c M src/utils.c 4 files changed, 54 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/13574/1 diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index c9e1e0c..41d01a5 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -220,6 +220,7 @@ int osmo_fsm_inst_update_id(struct osmo_fsm_inst *fi, const char *id); int osmo_fsm_inst_update_id_f(struct osmo_fsm_inst *fi, const char *fmt, ...); +int osmo_fsm_inst_update_id_f_sanitize(struct osmo_fsm_inst *fi, char replace_with, const char *fmt, ...); const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event); const char *osmo_fsm_inst_name(struct osmo_fsm_inst *fi); diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index ecb04b5..3f28eec 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -136,6 +136,7 @@ bool osmo_identifier_valid(const char *str); bool osmo_separated_identifiers_valid(const char *str, const char *sep_chars); +void osmo_identifier_sanitize_buf(char *str, const char *sep_chars, char replace_with); const char *osmo_escape_str(const char *str, int len); const char *osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize); diff --git a/src/fsm.c b/src/fsm.c index b6912c6..c32767b 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -364,6 +364,35 @@ return 0; } +/*! Change id of the FSM instance using a string format, and ensuring a valid id. + * Replace any characters that are not permitted as FSM identifier with replace_with. + * \param[in] fi FSM instance. + * \param[in] replace_with Character to use instead of non-permitted FSM id characters. + * Make sure to choose a legal character, e.g. '-'. + * \param[in] fmt format string to compose new ID. + * \param[in] ... variable argument list for format string. + * \returns 0 if the ID was updated, otherwise -EINVAL. + */ +int osmo_fsm_inst_update_id_f_sanitize(struct osmo_fsm_inst *fi, char replace_with, const char *fmt, ...) +{ + char *id = NULL; + va_list ap; + int rc; + + if (!fmt) + return osmo_fsm_inst_update_id(fi, NULL); + + va_start(ap, fmt); + id = talloc_vasprintf(fi, fmt, ap); + va_end(ap); + + osmo_identifier_sanitize_buf(id, NULL, replace_with); + + rc = osmo_fsm_inst_update_id(fi, id); + talloc_free(id); + return rc; +} + /*! allocate a new instance of a specified FSM * \param[in] fsm Descriptor of the FSM * \param[in] ctx talloc context from which to allocate memory diff --git a/src/utils.c b/src/utils.c index 7def0b8..8ea51ed 100644 --- a/src/utils.c +++ b/src/utils.c @@ -510,6 +510,8 @@ return true; } +static const char osmo_identifier_illegal_chars[] = "., {}[]()<>|~\\^`'\"?=;/+*&%$#!"; + /*! Determine if a given identifier is valid, i.e. doesn't contain illegal chars * \param[in] str String to validate * \param[in] sep_chars Permitted separation characters between identifiers. @@ -518,7 +520,6 @@ bool osmo_separated_identifiers_valid(const char *str, const char *sep_chars) { /* characters that are illegal in names */ - static const char illegal_chars[] = "., {}[]()<>|~\\^`'\"?=;/+*&%$#!"; unsigned int i; size_t len; @@ -535,7 +536,7 @@ if (!isprint((int)str[i])) return false; /* check for some explicit reserved control characters */ - if (strchr(illegal_chars, str[i])) + if (strchr(osmo_identifier_illegal_chars, str[i])) return false; } @@ -551,7 +552,26 @@ return osmo_separated_identifiers_valid(str, NULL); } -/*! Return the string with all non-printable characters escapeda, in user-supplied buffer. +/*! Replace characters in the given string buffer so that it is guaranteed to pass osmo_separated_identifiers_valid(). + * To guarantee passing osmo_separated_identifiers_valid(), replace_with must not itself be an illegal character. If in + * doubt, use '-'. + * \param[inout] str Identifier to sanitize, must be nul terminated and in a writable buffer. + * \param[in] sep_chars Additional characters that are allowed besides osmo_identifier_illegal_chars. + * \param[in] replace_with Replace any illegal characters with this character. + */ +void osmo_identifier_sanitize_buf(char *str, const char *sep_chars, char replace_with) +{ + char *pos; + if (!str) + return; + for (pos = str; *pos; pos++) { + if (strchr(osmo_identifier_illegal_chars, *pos) + || (sep_chars && strchr(sep_chars, *pos))) + *pos = replace_with; + } +} + +/*! Return the string with all non-printable characters escaped. * \param[in] str A string that may contain any characters. * \param[in] len Pass -1 to print until nul char, or >= 0 to force a length. * \param[inout] buf string buffer to write escaped characters to. -- To view, visit https://gerrit.osmocom.org/13574 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia40a6f3b2243c95fe428a080b938e11d8ab771a7 Gerrit-Change-Number: 13574 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:50:45 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:50:45 +0000 Subject: Change in libosmocore[master]: add OSMO_IMSI_SIZE Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13575 Change subject: add OSMO_IMSI_SIZE ...................................................................... add OSMO_IMSI_SIZE Various places in our code base figure out how many char they need to safely store an IMSI. An IMSI can have a checksum digit, which is not reflected by GSM23003_IMSI_MAX_DIGITS. And we usually needs a terminating \0. Instead of having a magic +2 repeated every so often, rather define OSMO_IMSI_SIZE to contain both checksum digit and nul char, and have the explanatory comment with it here in libosmocore. Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 --- M include/osmocom/gsm/protocol/gsm_23_003.h 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/13575/1 diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h b/include/osmocom/gsm/protocol/gsm_23_003.h index babd0f4..9dcf4ac 100644 --- a/include/osmocom/gsm/protocol/gsm_23_003.h +++ b/include/osmocom/gsm/protocol/gsm_23_003.h @@ -5,6 +5,9 @@ /* Chapter 2.2 */ #define GSM23003_IMSI_MAX_DIGITS 15 #define GSM23003_IMSI_MIN_DIGITS 6 +/*! The char[] buffer size to completely contain an IMSI including the optional checksum digit as well as the + * terminating nul character. */ +#define OSMO_IMSI_SIZE (GSM23003_IMSI_MAX_DIGITS+2) /* Chapter 2.4 */ #define GSM23003_TMSI_NUM_BYTES 4 /* Chapter 2.5 */ -- To view, visit https://gerrit.osmocom.org/13575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 Gerrit-Change-Number: 13575 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:50:45 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:50:45 +0000 Subject: Change in libosmocore[master]: GSUP: add Kind IE Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13576 Change subject: GSUP: add Kind IE ...................................................................... GSUP: add Kind IE osmo-msc and osmo-hlr have distinct subsystems handling incoming GSUP messages. So far we decide entirely by message type which code path should handle a GSUP message. Thus no GSUP message type may be re-used across subsystems. If we add a GSUP message to indicate a routing error, it would have to be a distinct message type for subscriber management, another one for SMS, another one for USSD... To allow introducing common message types, introduce a GSUP Kind IE. In the presence of this IE, GSUP handlers can trivially direct a received message to the right code path. If it is missing, handlers can fall back to the previous switch(message_type) method. Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c M src/gsm/libosmogsm.map M tests/gsup/gsup_test.c M tests/gsup/gsup_test.err 5 files changed, 47 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/13576/1 diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 29ea11a..d123da5 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -68,6 +68,7 @@ OSMO_GSUP_FREEZE_PTMSI_IE = 0x07, OSMO_GSUP_MSISDN_IE = 0x08, OSMO_GSUP_HLR_NUMBER_IE = 0x09, + OSMO_GSUP_KIND_IE = 0x0a, OSMO_GSUP_PDP_CONTEXT_ID_IE = 0x10, OSMO_GSUP_PDP_TYPE_IE = 0x11, OSMO_GSUP_ACCESS_POINT_NAME_IE = 0x12, @@ -229,6 +230,21 @@ size_t pdp_charg_enc_len; }; +enum osmo_gsup_kind { + OSMO_GSUP_KIND_UNSET = 0, + OSMO_GSUP_KIND_SUBSCRIBER_MANAGEMENT = 1, + OSMO_GSUP_KIND_SMS = 2, + OSMO_GSUP_KIND_USSD = 3, + OSMO_GSUP_KIND_INTER_MSC = 4, + /* Keep this as last entry with a value of max(enum osmo_gsup_kind) + 1. + * This value shall serve as the size for an array to aid de-muxing all known GSUP kinds. */ + OSMO_GSUP_KIND_ARRAYSIZE +}; + +extern const struct value_string osmo_gsup_kind_names[]; +static inline const char *osmo_gsup_kind_name(enum osmo_gsup_kind val) +{ return get_value_string(osmo_gsup_kind_names, val); } + /*! parsed/decoded GSUP protocol message */ struct osmo_gsup_message { enum osmo_gsup_message_type message_type; @@ -286,6 +302,11 @@ const uint8_t *imei_enc; size_t imei_enc_len; enum osmo_gsup_imei_result imei_result; + + /*! Indicate the subsystem kind to trivially dispatch incoming GSUP messages to the right code paths. + * Inter-MSC messages are *required* to set a kind = OSMO_GSUP_KIND_INTER_MSC. For older message kinds, this may + * be omitted (for backwards compatibility only -- if in doubt, include it). */ + enum osmo_gsup_kind kind; }; int osmo_gsup_decode(const uint8_t *data, size_t data_len, diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index a089322..ea79e91 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -477,6 +477,10 @@ gsup_msg->imei_result = osmo_decode_big_endian(value, value_len) + 1; break; + case OSMO_GSUP_KIND_IE: + gsup_msg->kind = osmo_decode_big_endian(value, value_len); + break; + default: LOGP(DLGSUP, LOGL_NOTICE, "GSUP IE type %d unknown\n", iei); @@ -718,7 +722,21 @@ msgb_tlv_put(msg, OSMO_GSUP_IMEI_RESULT_IE, sizeof(u8), &u8); } + if (gsup_msg->kind != OSMO_GSUP_KIND_UNSET) { + u8 = gsup_msg->kind; + msgb_tlv_put(msg, OSMO_GSUP_KIND_IE, sizeof(u8), &u8); + } + return 0; } +const struct value_string osmo_gsup_kind_names[] = { + { OSMO_GSUP_KIND_UNSET, "unset" }, + { OSMO_GSUP_KIND_SUBSCRIBER_MANAGEMENT, "Subscriber-Management" }, + { OSMO_GSUP_KIND_SMS, "SMS" }, + { OSMO_GSUP_KIND_USSD, "USSD" }, + { OSMO_GSUP_KIND_INTER_MSC, "Inter-MSC" }, + {} +}; + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index a69fb60..659cfe6 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -567,6 +567,7 @@ osmo_gsup_decode; osmo_gsup_message_type_names; osmo_gsup_session_state_names; +osmo_gsup_kind_names; osmo_gsup_get_err_msg_type; osmo_gsup_sms_encode_sm_rp_da; diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c index 4ad7431..3e27e99 100644 --- a/tests/gsup/gsup_test.c +++ b/tests/gsup/gsup_test.c @@ -11,6 +11,7 @@ #define TEST_IMSI_IE 0x01, 0x08, 0x21, 0x43, 0x65, 0x87, 0x09, 0x21, 0x43, 0xf5 #define TEST_IMSI_STR "123456789012345" +#define TEST_KIND_SUBSCR_IE 0xa, 0x1, 0x1 static void test_gsup_messages_dec_enc(void) { @@ -20,7 +21,8 @@ static const uint8_t send_auth_info_req[] = { 0x08, - TEST_IMSI_IE + TEST_IMSI_IE, + TEST_KIND_SUBSCR_IE }; static const uint8_t send_auth_info_err[] = { diff --git a/tests/gsup/gsup_test.err b/tests/gsup/gsup_test.err index 225735e..9283823 100644 --- a/tests/gsup/gsup_test.err +++ b/tests/gsup/gsup_test.err @@ -1,5 +1,5 @@ - generated message: 08 01 08 21 43 65 87 09 21 43 f5 - original message: 08 01 08 21 43 65 87 09 21 43 f5 + generated message: 08 01 08 21 43 65 87 09 21 43 f5 0a 01 01 + original message: 08 01 08 21 43 65 87 09 21 43 f5 0a 01 01 IMSI: 123456789012345 generated message: 09 01 08 21 43 65 87 09 21 43 f5 02 01 07 original message: 09 01 08 21 43 65 87 09 21 43 f5 02 01 07 @@ -73,7 +73,7 @@ generated message: 32 01 08 21 43 65 87 09 21 43 f5 51 01 00 original message: 32 01 08 21 43 65 87 09 21 43 f5 51 01 00 IMSI: 123456789012345 - message 0: tested 11 truncations, 11 parse failures + message 0: tested 14 truncations, 13 parse failures message 1: tested 14 truncations, 13 parse failures message 2: tested 83 truncations, 81 parse failures message 3: tested 11 truncations, 11 parse failures @@ -99,7 +99,7 @@ message 23: tested 14 truncations, 13 parse failures message 24: tested 14 truncations, 13 parse failures DLGSUP Stopping DLGSUP logging - message 0: tested 2816 modifications, 510 parse failures + message 0: tested 3584 modifications, 771 parse failures message 1: tested 3584 modifications, 770 parse failures message 2: tested 21248 modifications, 2575 parse failures message 3: tested 2816 modifications, 510 parse failures -- To view, visit https://gerrit.osmocom.org/13576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef Gerrit-Change-Number: 13576 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:50:46 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:50:46 +0000 Subject: Change in libosmocore[master]: BSSMAP: tweaks Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13577 Change subject: BSSMAP: tweaks ...................................................................... BSSMAP: tweaks Change two instances of Speech Version values to enum gsm0808_permitted_speech. It is often not trivial to find the right values for a uint8_t member, giving the enum name makes it a lot easier/safer to use. In gsm0808_create_handover_required(), use msgb_tv_put() so that the enum's storage size doesn't matter. (Already used for handover_performed) Fix typo in doc of gsm0808_create_handover_required(). Change-Id: I6387836bab76e1fa42daa0f42ab94fc14b70b112 --- M TODO-RELEASE M include/osmocom/gsm/gsm0808.h M src/gsm/gsm0808.c 3 files changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/13577/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 7c81e32..db3be49 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -19,3 +19,5 @@ osmo_quote_str_buf() truncated string. This is no longer the case. e.g. a string 'truncated' in a 9-char buffer used to print '"trunca"\0', which now becomes '"truncat\0'. libosmocore osmo_quote_str_buf2() New function signature similar to snprintf(), for use with OSMO_STRBUF_APPEND(). +libosmogsm gsm0808_handover_required Storage size changed, speech_version_used now an enum. + gsm0808_handover_performed Storage size changed, speech_version_chosen now an enum. diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h index a1345c3..0f2bf1f 100644 --- a/include/osmocom/gsm/gsm0808.h +++ b/include/osmocom/gsm/gsm0808.h @@ -133,7 +133,7 @@ uint8_t current_channel_type_1; bool speech_version_used_present; - uint8_t speech_version_used; + enum gsm0808_permitted_speech speech_version_used; bool old_bss_to_new_bss_info_present; struct gsm0808_old_bss_to_new_bss_info old_bss_to_new_bss_info; @@ -196,7 +196,7 @@ uint8_t chosen_encr_alg; bool speech_version_chosen_present; - uint8_t speech_version_chosen; + enum gsm0808_permitted_speech speech_version_chosen; bool speech_codec_chosen_present; struct gsm0808_speech_codec speech_codec_chosen; diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index 4873076..3307a5d 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -822,7 +822,7 @@ /*! Create BSSMAP HANDOVER REQUIRED message. * \param[in] params All information to be encoded. - * \returns newly allocated msgb with BSSMAP REQUIRED message. */ + * \returns newly allocated msgb with BSSMAP HANDOVER REQUIRED message. */ struct msgb *gsm0808_create_handover_required(const struct gsm0808_handover_required *params) { struct msgb *msg; @@ -846,7 +846,7 @@ /* Speech Version (Used), 3.2.2.51 */ if (params->speech_version_used_present) - msgb_tv_fixed_put(msg, GSM0808_IE_SPEECH_VERSION, 1, ¶ms->speech_version_used); + msgb_tv_put(msg, GSM0808_IE_SPEECH_VERSION, params->speech_version_used); if (params->old_bss_to_new_bss_info_present) put_old_bss_to_new_bss_information(msg, ¶ms->old_bss_to_new_bss_info); -- To view, visit https://gerrit.osmocom.org/13577 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6387836bab76e1fa42daa0f42ab94fc14b70b112 Gerrit-Change-Number: 13577 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:50:46 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:50:46 +0000 Subject: Change in libosmocore[master]: BSSMAP: add messages for inter-BSC and inter-MSC Handover Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13578 Change subject: BSSMAP: add messages for inter-BSC and inter-MSC Handover ...................................................................... BSSMAP: add messages for inter-BSC and inter-MSC Handover Change-Id: I9dac375331f6bea744769e973725d58e35f87226 --- M include/osmocom/gsm/gsm0808.h M src/gsm/gsm0808.c M src/gsm/libosmogsm.map 3 files changed, 241 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/13578/1 diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h index a6c5239..b31f07d 100644 --- a/include/osmocom/gsm/gsm0808.h +++ b/include/osmocom/gsm/gsm0808.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #define BSSMAP_MSG_SIZE 1024 @@ -143,6 +144,56 @@ }; struct msgb *gsm0808_create_handover_required(const struct gsm0808_handover_required *params); +/*! 3GPP TS 48.008 ?3.2.1.37 HANDOVER REQUIRED REJECT */ +struct gsm0808_handover_required_reject { + uint16_t cause; + + /* more items are defined in the spec and may be added later */ + bool more_items; /*< always set this to false */ +}; +struct msgb *gsm0808_create_handover_required_reject(const struct gsm0808_handover_required_reject *params); + +/*! 3GPP TS 48.008 ?3.2.1.8 HANDOVER REQUEST */ +struct gsm0808_handover_request { + struct gsm0808_channel_type channel_type; + struct gsm0808_encrypt_info encryption_information; + struct osmo_gsm48_classmark classmark_information; + struct gsm0808_cell_id cell_identifier_serving; + struct gsm0808_cell_id cell_identifier_target; + enum gsm0808_cause cause; + + bool current_channel_type_1_present; + uint8_t current_channel_type_1; + + enum gsm0808_permitted_speech speech_version_used; + + uint8_t chosen_encryption_algorithm_serving; + + /*! Pass either old_bss_to_new_bss_info or old_bss_to_new_bss_info_raw. */ + bool old_bss_to_new_bss_info_present; + struct gsm0808_old_bss_to_new_bss_info old_bss_to_new_bss_info; + /*! To feed the Old BSS to New BSS Information IE unchanged from the Handover Required message without having to + * decode it. Pass either old_bss_to_new_bss_info or old_bss_to_new_bss_info_raw. Omit the TL part. */ + const uint8_t *old_bss_to_new_bss_info_raw; + uint8_t old_bss_to_new_bss_info_raw_len; + + const char *imsi; + + const struct sockaddr_storage *aoip_transport_layer; + + const struct gsm0808_speech_codec_list *codec_list_msc_preferred; + + bool call_id_present; + uint32_t call_id; + + const uint8_t *global_call_reference; + uint8_t global_call_reference_len; + + /* more items are defined in the spec and may be added later */ + bool more_items; /*!< always set this to false */ +}; +struct msgb *gsm0808_create_handover_request(const struct gsm0808_handover_request *params); + struct gsm0808_handover_request_ack { const uint8_t *l3_info; uint8_t l3_info_len; @@ -170,7 +221,22 @@ uint8_t chosen_channel, uint8_t chosen_encr_alg, uint8_t chosen_speech_version); +struct gsm0808_handover_command { + const uint8_t *l3_info; + uint8_t l3_info_len; + + struct gsm0808_cell_id cell_identifier; + + const uint8_t *new_bss_to_old_bss_info_raw; + size_t new_bss_to_old_bss_info_raw_len; + + /* more items are defined in the spec and may be added later */ + bool more_items; /*!< always set this to false */ +}; +struct msgb *gsm0808_create_handover_command(const struct gsm0808_handover_command *params); + struct msgb *gsm0808_create_handover_detect(); +struct msgb *gsm0808_create_handover_succeeded(); struct gsm0808_handover_complete { bool rr_cause_present; diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index b46977b..3c77c77 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -857,6 +857,129 @@ return msg; } +/*! Create BSSMAP HANDOVER REQUIRED REJECT message. + * \returns newly allocated msgb with BSSMAP HANDOVER REQUIRED REJECT message. */ +struct msgb *gsm0808_create_handover_required_reject(const struct gsm0808_handover_required_reject *params) +{ + struct msgb *msg; + + msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, "BSSMAP-HANDOVER-REQUIRED-REJECT"); + if (!msg) + return NULL; + + /* Message Type, 3.2.2.1 */ + msgb_v_put(msg, BSS_MAP_MSG_HANDOVER_REQUIRED_REJECT); + + /* Cause, 3.2.2.5 */ + gsm0808_enc_cause(msg, params->cause); + + /* prepend the header */ + msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg)); + + return msg; +} + +/*! Create BSSMAP HANDOVER REQUEST message, 3GPP TS 48.008 3.2.1.8. + * Sent from the MSC to the potential new target cell during inter-BSC handover, or to the target MSC during inter-MSC + * handover. + */ +struct msgb *gsm0808_create_handover_request(const struct gsm0808_handover_request *params) +{ + struct msgb *msg; + + msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, "BSSMAP-HANDOVER-REQUEST"); + if (!msg) + return NULL; + + /* Message Type, 3.2.2.1 */ + msgb_v_put(msg, BSS_MAP_MSG_HANDOVER_RQST); + + /* Channel Type 3.2.2.11 */ + gsm0808_enc_channel_type(msg, ¶ms->channel_type); + + /* Encryption Information 3.2.2.10 */ + gsm0808_enc_encrypt_info(msg, ¶ms->encryption_information); + + /* Classmark Information 1 3.2.2.30 or Classmark Information 2 3.2.2.19 (Classmark 2 wins) */ + if (params->classmark_information.classmark2_len) { + msgb_tlv_put(msg, GSM0808_IE_CLASSMARK_INFORMATION_T2, + params->classmark_information.classmark2_len, + (const uint8_t*)¶ms->classmark_information.classmark2); + } else if (params->classmark_information.classmark1_set) { + msgb_tlv_put(msg, GSM0808_IE_CLASSMARK_INFORMATION_TYPE_1, + sizeof(params->classmark_information.classmark1), + (const uint8_t*)¶ms->classmark_information.classmark1); + } + /* (Classmark 3 possibly follows below) */ + + /* Cell Identifier (Serving) , 3.2.2.17 */ + gsm0808_enc_cell_id(msg, ¶ms->cell_identifier_serving); + + /* Cell Identifier (Target) , 3.2.2.17 */ + gsm0808_enc_cell_id(msg, ¶ms->cell_identifier_target); + + /* Cause, 3.2.2.5 */ + gsm0808_enc_cause(msg, params->cause); + + /* Classmark Information 3 3.2.2.20 */ + if (params->classmark_information.classmark3_len) { + msgb_tlv_put(msg, GSM0808_IE_CLASSMARK_INFORMATION_T3, + params->classmark_information.classmark3_len, + (const uint8_t*)¶ms->classmark_information.classmark3); + } + + /* Current Channel type 1 3.2.2.49 */ + if (params->current_channel_type_1_present) + msgb_tv_fixed_put(msg, GSM0808_IE_CURRENT_CHANNEL_TYPE_1, 1, ¶ms->current_channel_type_1); + + /* Speech Version (Used), 3.2.2.51 */ + if (params->speech_version_used) { + msgb_tv_put(msg, GSM0808_IE_SPEECH_VERSION, params->speech_version_used); + } + + /* Chosen Encryption Algorithm (Serving) 3.2.2.44 */ + if (params->chosen_encryption_algorithm_serving) + msgb_tv_put(msg, GSM0808_IE_CHOSEN_ENCR_ALG, params->chosen_encryption_algorithm_serving); + + /* Old BSS to New BSS Information 3.2.2.58 */ + if (params->old_bss_to_new_bss_info_raw && params->old_bss_to_new_bss_info_raw_len) { + msgb_tlv_put(msg, GSM0808_IE_OLD_BSS_TO_NEW_BSS_INFORMATION, + params->old_bss_to_new_bss_info_raw_len, + params->old_bss_to_new_bss_info_raw); + } else if (params->old_bss_to_new_bss_info_present) { + put_old_bss_to_new_bss_information(msg, ¶ms->old_bss_to_new_bss_info); + } + + /* IMSI 3.2.2.6 */ + if (params->imsi) { + uint8_t mid_buf[GSM48_MI_SIZE + 2]; + int mid_len = gsm48_generate_mid_from_imsi(mid_buf, params->imsi); + msgb_tlv_put(msg, GSM0808_IE_IMSI, mid_len - 2, mid_buf + 2); + } + + if (params->aoip_transport_layer) + gsm0808_enc_aoip_trasp_addr(msg, params->aoip_transport_layer); + + if (params->codec_list_msc_preferred) + gsm0808_enc_speech_codec_list(msg, params->codec_list_msc_preferred); + + if (params->call_id_present) { + uint8_t val[4]; + osmo_store32le(params->call_id, val); + msgb_tv_fixed_put(msg, GSM0808_IE_CALL_ID, 4, val); + } + + if (params->global_call_reference && params->global_call_reference_len) { + msgb_tlv_put(msg, GSM0808_IE_GLOBAL_CALL_REF, + params->global_call_reference_len, params->global_call_reference); + } + + /* prepend header with final length */ + msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg)); + + return msg; +} + /*! Create BSSMAP HANDOVER REQUEST ACKNOWLEDGE message, 3GPP TS 48.008 3.2.1.10. * Sent from the MT BSC back to the MSC when it has allocated an lchan to handover to. * l3_info is the RR Handover Command that the MO BSC sends to the MS to move over. */ @@ -914,6 +1037,35 @@ return gsm0808_create_handover_request_ack2(¶ms); } +/*! Create BSSMAP HANDOVER COMMAND message, 3GPP TS 48.008 3.2.1.11. + * Sent from the MSC to the old BSS to transmit the RR Handover Command received from the new BSS. */ +struct msgb *gsm0808_create_handover_command(const struct gsm0808_handover_command *params) +{ + struct msgb *msg; + + msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, "BSSMAP-HANDOVER-COMMAND"); + if (!msg) + return NULL; + + /* Message Type, 3.2.2.1 */ + msgb_v_put(msg, BSS_MAP_MSG_HANDOVER_CMD); + + msgb_tlv_put(msg, GSM0808_IE_LAYER_3_INFORMATION, params->l3_info_len, params->l3_info); + + if (params->cell_identifier.id_discr != CELL_IDENT_NO_CELL) + gsm0808_enc_cell_id(msg, ¶ms->cell_identifier); + + if (params->new_bss_to_old_bss_info_raw + && params->new_bss_to_old_bss_info_raw_len) + msgb_tlv_put(msg, GSM0808_IE_NEW_BSS_TO_OLD_BSS_INFO, params->new_bss_to_old_bss_info_raw_len, + params->new_bss_to_old_bss_info_raw); + + /* prepend header with final length */ + msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg)); + + return msg; +} + /*! Create BSSMAP HANDOVER DETECT message, 3GPP TS 48.008 3.2.1.40. * Sent from the MT BSC back to the MSC when the MS has sent a handover RACH request and the MT BSC has * received the Handover Detect message. */ @@ -934,6 +1086,25 @@ return msg; } +/*! Create BSSMAP HANDOVER SUCCEEDED message, 3GPP TS 48.008 3.2.1.13. + * Sent from the MSC back to the old BSS to notify that the MS has successfully accessed the new BSS. */ +struct msgb *gsm0808_create_handover_succeeded() +{ + struct msgb *msg; + + msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, "BSSMAP-HANDOVER-DETECT"); + if (!msg) + return NULL; + + /* Message Type, 3.2.2.1 */ + msgb_v_put(msg, BSS_MAP_MSG_HANDOVER_SUCCEEDED); + + /* prepend header with final length */ + msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg)); + + return msg; +} + /*! Create BSSMAP HANDOVER COMPLETE message, 3GPP TS 48.008 3.2.1.12. * Sent from the MT BSC back to the MSC when the MS has fully settled into the new lchan. */ struct msgb *gsm0808_create_handover_complete(const struct gsm0808_handover_complete *params) diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 5e1b58e..1e40af7 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -183,9 +183,13 @@ gsm0808_create_reset_ack; gsm0808_create_sapi_reject; gsm0808_create_handover_required; +gsm0808_create_handover_required_reject; +gsm0808_create_handover_request; gsm0808_create_handover_request_ack; gsm0808_create_handover_request_ack2; +gsm0808_create_handover_command; gsm0808_create_handover_detect; +gsm0808_create_handover_succeeded; gsm0808_create_handover_complete; gsm0808_create_handover_failure; gsm0808_create_handover_performed; -- To view, visit https://gerrit.osmocom.org/13578 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9dac375331f6bea744769e973725d58e35f87226 Gerrit-Change-Number: 13578 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:50:46 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:50:46 +0000 Subject: Change in libosmocore[master]: add gsm48_decode_bcd_number2() from osmo-msc Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13579 Change subject: add gsm48_decode_bcd_number2() from osmo-msc ...................................................................... add gsm48_decode_bcd_number2() from osmo-msc gsm48_decode_bcd_number() is unable to provide proper bounds validation of input and output data, hence osmo-msc's vlr.c introduced a static decode_bcd_number_safe() a long time ago. Move to libosmocore. I need to use the same function to decode an MSISDN during inter-MSC Handover, instead of making it public in osmo-msc, rather deprecate the unsafe function and provide a safer version for all callers. Mark the old one deprecated. Change-Id: Idb6ae6e2f3bea11ad420dae14d021ac36d99e921 --- M include/osmocom/gsm/gsm48_ie.h M src/gsm/gsm48_ie.c M src/gsm/libosmogsm.map 3 files changed, 33 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/79/13579/1 diff --git a/include/osmocom/gsm/gsm48_ie.h b/include/osmocom/gsm/gsm48_ie.h index f7cc24e..71050df 100644 --- a/include/osmocom/gsm/gsm48_ie.h +++ b/include/osmocom/gsm/gsm48_ie.h @@ -13,7 +13,11 @@ /* decode a 'called/calling/connect party BCD number' as in 10.5.4.7 */ int gsm48_decode_bcd_number(char *output, int output_len, - const uint8_t *bcd_lv, int h_len); + const uint8_t *bcd_lv, int h_len) + OSMO_DEPRECATED("Use gsm48_decode_bcd_number2() for improved bounds checking"); +int gsm48_decode_bcd_number2(char *output, size_t output_len, + const uint8_t *bcd_lv, size_t input_len, + size_t h_len); /* convert a ASCII phone number to 'called/calling/connect party BCD number' */ int gsm48_encode_bcd_number(uint8_t *bcd_lv, uint8_t max_len, diff --git a/src/gsm/gsm48_ie.c b/src/gsm/gsm48_ie.c index ffe3eba..049f5dc 100644 --- a/src/gsm/gsm48_ie.c +++ b/src/gsm/gsm48_ie.c @@ -46,7 +46,7 @@ '8', '9', '*', '#', 'a', 'b', 'c', '\0' }; -/*! decode a 'called/calling/connect party BCD number' as in 10.5.4.7 +/*! Like gsm48_decode_bcd_number2() but with less airtight bounds checking. * \param[out] Caller-provided output buffer * \param[in] bcd_lv Length-Value portion of to-be-decoded IE * \param[in] h_len Length of an optional heder between L and V portion @@ -76,6 +76,32 @@ return 0; } +/*! Decode a 'called/calling/connect party BCD number' as in 10.5.4.7. + * \param[out] output Caller-provided output buffer. + * \param[in] output_len sizeof(output). + * \param[in] bcd_lv Length-Value part of to-be-decoded IE. + * \param[in] input_len Size of the buffer to read the IE from. + * \param[in] h_len Length of an optional header between L and V parts. + * \return 0 in case of success, negative on error. Errors checked: no or too little input data, no or too little + * output buffer size, IE length exceeds input data size, decoded number exceeds size of the output buffer. The output + * is guaranteed to be nul terminated iff output_len > 0. + */ +int gsm48_decode_bcd_number2(char *output, size_t output_len, + const uint8_t *bcd_lv, size_t input_len, + size_t h_len) +{ + uint8_t len; + if (output_len < 1) + return -ENOSPC; + *output = '\0'; + if (input_len < 1) + return -EIO; + len = bcd_lv[0]; + if (input_len < len) + return -EIO; + return gsm48_decode_bcd_number(output, output_len, bcd_lv, h_len); +} + /*! convert a single ASCII character to call-control BCD */ static int asc_to_bcd(const char asc) { diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 1e40af7..b8c92ce 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -307,6 +307,7 @@ gsm48_encode_ra; gsm48_hdr_gmm_cipherable; gsm48_decode_bcd_number; +gsm48_decode_bcd_number2; gsm48_decode_bearer_cap; gsm48_decode_called; gsm48_decode_callerid; -- To view, visit https://gerrit.osmocom.org/13579 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Idb6ae6e2f3bea11ad420dae14d021ac36d99e921 Gerrit-Change-Number: 13579 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:50:47 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:50:47 +0000 Subject: Change in libosmocore[master]: add osmo_bssap_tlv_parse2() for multiple identical T Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13580 Change subject: add osmo_bssap_tlv_parse2() for multiple identical T ...................................................................... add osmo_bssap_tlv_parse2() for multiple identical T In BSSMAP messages, at least the Cell Identifier IE can appear more than once. We have tlv_parse2() which allows decoding into an array of tlv_parsed to cleanly handle multiple occurences. Hence add osmo_bssap_tlv_parse2() which supports multiple occurences. An alternative would be to directly call tlv_parse2() with gsm0808_att_tlvdef() when multiple T occurences are needed, and I'm not really sure why osmo_bssap_tlv_parse() exists in the first place. But because it does, add a similar definition that is capable of handling multiple IEs with identical Tag discriminator. Change-Id: Ib9a2095f7498dc2cda2a57154b2dbe4621df72f8 --- M include/osmocom/gsm/gsm0808.h 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/13580/1 diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h index b31f07d..a4e63a9 100644 --- a/include/osmocom/gsm/gsm0808.h +++ b/include/osmocom/gsm/gsm0808.h @@ -305,6 +305,9 @@ /*! Parse BSSAP TLV structure using \ref tlv_parse */ #define osmo_bssap_tlv_parse(dec, buf, len) tlv_parse(dec, gsm0808_att_tlvdef(), buf, len, 0, 0) +/*! Parse BSSAP TLV structure using \ref tlv_parse2 */ +#define osmo_bssap_tlv_parse2(dec, dec_multiples, buf, len) \ + tlv_parse2(dec, dec_multiples, gsm0808_att_tlvdef(), buf, len, 0, 0) const char *gsm0808_bssmap_name(uint8_t msg_type); const char *gsm0808_bssap_name(uint8_t msg_type); -- To view, visit https://gerrit.osmocom.org/13580 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9a2095f7498dc2cda2a57154b2dbe4621df72f8 Gerrit-Change-Number: 13580 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:50:47 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:50:47 +0000 Subject: Change in libosmocore[master]: add vty_is_active() Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13581 Change subject: add vty_is_active() ...................................................................... add vty_is_active() For async callbacks it is useful to determine whether a given VTY pointer is still valid. For example, in osmo-msc, a silent call can be triggered by VTY, which causes a Paging. The paging_cb then writes to the VTY console that the silent call has succeeded. Unless the telnet vty session has already ended, in which case osmo-msc crashes; e.g. from an osmo_interact_vty.py command invocation. With this function, osmo-msc can ask whether the vty pointer passed to the paging callback is still active, and skip vty_out() if not. Change-Id: I42cf2af47283dd42c101faae0fac293c3a68d599 --- M include/osmocom/vty/vty.h M src/vty/telnet_interface.c 2 files changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/81/13581/1 diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h index 8d2e1b3..03a2924 100644 --- a/include/osmocom/vty/vty.h +++ b/include/osmocom/vty/vty.h @@ -2,6 +2,7 @@ #include #include +#include #include @@ -192,6 +193,7 @@ void vty_reset (void); struct vty *vty_new (void); struct vty *vty_create (int vty_sock, void *priv); +bool vty_is_active(struct vty *vty); int vty_out (struct vty *, const char *, ...) VTY_PRINTF_ATTRIBUTE(2, 3); int vty_out_va(struct vty *vty, const char *format, va_list ap); int vty_out_newline(struct vty *); diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c index dc23b12..a1fc999 100644 --- a/src/vty/telnet_interface.c +++ b/src/vty/telnet_interface.c @@ -197,6 +197,16 @@ return 0; } +bool vty_is_active(struct vty *vty) +{ + struct telnet_connection *connection; + llist_for_each_entry(connection, &active_connections, entry) { + if (connection->vty == vty) + return true; + } + return false; +} + /*! callback from core VTY code about VTY related events */ void vty_event(enum event event, int sock, struct vty *vty) { -- To view, visit https://gerrit.osmocom.org/13581 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I42cf2af47283dd42c101faae0fac293c3a68d599 Gerrit-Change-Number: 13581 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:56:32 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:56:32 +0000 Subject: Change in osmo-bsc[master]: lchan activation: add explicit encryption info to activation Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13582 Change subject: lchan activation: add explicit encryption info to activation ...................................................................... lchan activation: add explicit encryption info to activation For intra-BSC handover, the previous encryption is copied from the old lchan, which of course is not available during inter-BSC handover. Hence the lchan activation info needs to include an explicit encryption information, and we must not rely on the presence of the previous lchan to copy encryption information from. Add struct lchan_activate_info.encr to allow passing encryption info through lchan_activate() without requiring a previous struct gsm_lchan to be present. Instead of copying from the old lchan, always copy encryption info to lchan_activate_info, and during activation, just before sending the Channel Activation, copy the lchan_activate_info.encr to the new lchan. This prepares for upcoming I5b269f50bd2092516bfdf87746196983d3ac49d1 which obtains the encryption information from an intra-BSC-incoming Handover Request message. Related: OS#3842 Related: I5b269f50bd2092516bfdf87746196983d3ac49d1 Change-Id: Ib3d259a5711add65ab7298bfa3977855a17a1642 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c 4 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/82/13582/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 47ca5e8..ba28a6b 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -528,6 +528,7 @@ /* This always is for a specific lchan, so its lchan->type indicates full or half rate. * When a dyn TS was selected, the lchan->type has been set to the desired rate. */ enum gsm48_chan_mode chan_mode; + struct gsm_encr encr; /* AMR config */ uint16_t s15_s0; bool requires_voice_stream; diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index c17b555..9c0c400 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -484,6 +484,7 @@ .activ_for = FOR_ASSIGNMENT, .for_conn = conn, .chan_mode = conn->lchan->ch_mode_rate.chan_mode, + .encr = conn->lchan->encr, .s15_s0 = conn->lchan->ch_mode_rate.s15_s0, .requires_voice_stream = conn->assignment.requires_voice_stream, .msc_assigned_cic = req->msc_assigned_cic, diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index a3d25d6..9c86b70 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -358,6 +358,7 @@ .activ_for = FOR_HANDOVER, .for_conn = conn, .chan_mode = conn->lchan->tch_mode, + .encr = conn->lchan->encr, .requires_voice_stream = conn->lchan->mgw_endpoint_ci_bts ? true : false, .msc_assigned_cic = conn->ho.inter_bsc_in.msc_assigned_cic, .re_use_mgw_endpoint_from_lchan = conn->lchan, diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 2b7dc97..7af2ea0 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -518,14 +518,6 @@ lchan->conn = info->for_conn; - if (old_lchan) - lchan->encr = old_lchan->encr; - else { - lchan->encr = (struct gsm_encr){ - .alg_id = RSL_ENC_ALG_A5(0), /* no encryption */ - }; - } - /* If there is a previous lchan, and the new lchan is on the same cell as previous one, * take over power and TA values. Otherwise, use max power and zero TA. */ if (old_lchan && old_lchan->ts->trx->bts == bts) { @@ -585,14 +577,17 @@ use_mgwep_ci = lchan_use_mgw_endpoint_ci_bts(lchan); LOG_LCHAN(lchan, LOGL_INFO, - "Activation requested: %s voice=%s MGW-ci=%s type=%s tch-mode=%s\n", + "Activation requested: %s voice=%s MGW-ci=%s type=%s tch-mode=%s encr-alg=A5/%u ck=%s\n", lchan_activate_mode_name(lchan->activate.info.activ_for), lchan->activate.info.requires_voice_stream ? "yes" : "no", lchan->activate.info.requires_voice_stream ? (use_mgwep_ci ? mgwep_ci_name(use_mgwep_ci) : "new") : "none", gsm_lchant_name(lchan->type), - gsm48_chan_mode_name(lchan->tch_mode)); + gsm48_chan_mode_name(lchan->tch_mode), + (lchan->activate.info.encr.alg_id ? : 1)-1, + lchan->activate.info.encr.key_len ? osmo_hexdump_nospc(lchan->activate.info.encr.key, + lchan->activate.info.encr.key_len) : "none"); /* Ask for the timeslot to make ready for this lchan->type. * We'll receive LCHAN_EV_TS_READY or LCHAN_EV_TS_ERROR in response. */ @@ -657,6 +652,8 @@ break; } + lchan->encr = lchan->activate.info.encr; + rc = rsl_tx_chan_activ(lchan, act_type, ho_ref); if (rc) lchan_fail_to(LCHAN_ST_UNUSED, "Tx Chan Activ failed: %s (%d)", strerror(-rc), rc); -- To view, visit https://gerrit.osmocom.org/13582 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3d259a5711add65ab7298bfa3977855a17a1642 Gerrit-Change-Number: 13582 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:56:33 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:56:33 +0000 Subject: Change in osmo-bsc[master]: Handover Request: also parse Chosen Algorithm IE, pass to lchan activ... Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13583 Change subject: Handover Request: also parse Chosen Algorithm IE, pass to lchan activation ...................................................................... Handover Request: also parse Chosen Algorithm IE, pass to lchan activation During inter-BSC-incoming, the MSC sends the chosen encryption algorithm in the Handover Request message. Actually parse this Chosen Encryption Algorithm IE. Place the chosen algorithm and the CK into lchan_activate_info->encr so that the new lchan will use the same ciphering on this new BSS as it did on the old BSS. Change-Id: I5b269f50bd2092516bfdf87746196983d3ac49d1 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/handover_fsm.c 2 files changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/83/13583/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index ba28a6b..131a53e 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -179,6 +179,10 @@ struct gsm0808_speech_codec_list scl; struct gsm0808_encrypt_info ei; struct gsm_classmark classmark; + /* chosen_encr_alg reflects the encoded value as in RSL_ENC_ALG_A5(a5_numer): + * chosen_encr_alg == 1 means A5/0 i.e. no encryption, chosen_encr_alg == 4 means A5/3. + * chosen_encr_alg == 0 means no such IE was present. */ + uint8_t chosen_encr_alg; struct gsm0808_cell_id cell_id_serving; char cell_id_serving_name[64]; struct gsm0808_cell_id cell_id_target; diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 9c86b70..421c32e 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -432,6 +432,17 @@ "Missing mandatory IE: 3GPP mandates either Classmark Information 1 or 2" " in BSSMAP Handover Request, but neither are present. Will continue without.\n"); + if ((e = TLVP_GET(tp, GSM0808_IE_CHOSEN_ENCR_ALG))) { + req->chosen_encr_alg = e->val[0]; + if (req->chosen_encr_alg < 1 || req->chosen_encr_alg > 8) + LOG_HO(conn, LOGL_ERROR, "Chosen Encryption Algorithm (Serving) is invalid: %u\n", + req->chosen_encr_alg); + } + + LOG_HO(conn, LOGL_DEBUG, "Handover Request encryption info: chosen=A5/%u key=%s\n", + (req->chosen_encr_alg ? : 1) - 1, req->ei.key_len? + osmo_hexdump_nospc(req->ei.key, req->ei.key_len) : "none"); + if (TLVP_PRESENT(tp, GSM0808_IE_AOIP_TRASP_ADDR)) { int rc; unsigned int u; @@ -611,6 +622,24 @@ .msc_assigned_cic = req->msc_assigned_cic, }; + if (req->chosen_encr_alg) { + info.encr.alg_id = req->chosen_encr_alg; + if (info.encr.alg_id > 1 && !req->ei.key_len) { + ho_fail(HO_RESULT_ERROR, "Chosen Encryption Algorithm (Serving) reflects A5/%u" + " but there is no key (Encryption Information)", info.encr.alg_id - 1); + return; + } + } + + if (req->ei.key_len) { + if (req->ei.key_len > sizeof(info.encr.key)) { + ho_fail(HO_RESULT_ERROR, "Encryption Information IE key length is too large: %u\n", + req->ei.key_len); + } + memcpy(info.encr.key, req->ei.key, req->ei.key_len); + info.encr.key_len = req->ei.key_len; + } + lchan_activate(ho->new_lchan, &info); } -- To view, visit https://gerrit.osmocom.org/13583 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5b269f50bd2092516bfdf87746196983d3ac49d1 Gerrit-Change-Number: 13583 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:56:33 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:56:33 +0000 Subject: Change in osmo-bsc[master]: fix inter-BSC-HO-incoming for AoIP (1/2) Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13584 Change subject: fix inter-BSC-HO-incoming for AoIP (1/2) ...................................................................... fix inter-BSC-HO-incoming for AoIP (1/2) Move the HO_ST_WAIT_MGW_ENDPOINT_TO_MSC state up to right after the lchan is done establishing. For AoIP, the local RTP address towards the MSC already needs to be known before the Handover Request Acknowledge is sent, so the AoIP Transport Layer Address IE can be included. This patch only modifies the handover FSM, a subsequent patch adds the IE. Change-Id: I4a5acdb2d4a0b947cc0c62067a67be88a3d467ff --- M include/osmocom/bsc/handover_fsm.h M src/osmo-bsc/handover_fsm.c 2 files changed, 106 insertions(+), 85 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/84/13584/1 diff --git a/include/osmocom/bsc/handover_fsm.h b/include/osmocom/bsc/handover_fsm.h index 4db0890..7c2145e 100644 --- a/include/osmocom/bsc/handover_fsm.h +++ b/include/osmocom/bsc/handover_fsm.h @@ -28,10 +28,10 @@ HO_ST_NOT_STARTED, HO_ST_WAIT_LCHAN_ACTIVE, + HO_ST_WAIT_MGW_ENDPOINT_TO_MSC, HO_ST_WAIT_RR_HO_DETECT, HO_ST_WAIT_RR_HO_COMPLETE, HO_ST_WAIT_LCHAN_ESTABLISHED, - HO_ST_WAIT_MGW_ENDPOINT_TO_MSC, /* The inter-BSC Outgoing Handover FSM has completely separate states, but since it makes sense for it * to also live in conn->ho.fi, it should share the same event enum. From there it is merely @@ -46,11 +46,11 @@ HO_EV_LCHAN_ACTIVE, HO_EV_LCHAN_ESTABLISHED, HO_EV_LCHAN_ERROR, + HO_EV_MSC_MGW_OK, + HO_EV_MSC_MGW_FAIL, HO_EV_RR_HO_DETECT, HO_EV_RR_HO_COMPLETE, HO_EV_RR_HO_FAIL, - HO_EV_MSC_MGW_OK, - HO_EV_MSC_MGW_FAIL, HO_EV_CONN_RELEASING, HO_OUT_EV_BSSMAP_HO_COMMAND, diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 421c32e..3b5a660 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -161,10 +161,10 @@ static const struct state_timeout ho_fsm_timeouts[32] = { [HO_ST_WAIT_LCHAN_ACTIVE] = { .T = 23042 }, + [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { .T = 23042 }, [HO_ST_WAIT_RR_HO_DETECT] = { .T = 23042 }, [HO_ST_WAIT_RR_HO_COMPLETE] = { .T = 23042 }, [HO_ST_WAIT_LCHAN_ESTABLISHED] = { .T = 23042 }, - [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { .T = 23042 }, [HO_OUT_ST_WAIT_HO_COMMAND] = { .T = 7 }, [HO_OUT_ST_WAIT_CLEAR] = { .T = 8 }, }; @@ -876,10 +876,24 @@ static void ho_fsm_wait_lchan_active(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + struct handover *ho = &conn->ho; switch (event) { case HO_EV_LCHAN_ACTIVE: - ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); + /* - If the lchan is voiceless, no need to even think about the MGW. + * - If this is an intra-BSC Handover, we already have an RTP stream towards the MSC and aren't + * touching it. + * - If we're on SCCPlite, the MSC manages the MGW endpoint, all we do is the BTS side CI, so we can + * skip the part that would CRCX towards the MSC. + * So create an MSC side endpoint CI only if a voice lchan is established for an incoming inter-BSC + * handover on AoIP. Otherwise go on to send a Handover Command and wait for the Detect. + */ + if (ho->new_lchan->activate.info.requires_voice_stream + && (ho->scope & HO_INTER_BSC_IN) + && gscon_is_aoip(conn)) + ho_fsm_state_chg(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC); + else + ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); return; case HO_EV_LCHAN_ERROR: @@ -892,6 +906,76 @@ } } +/* Only for voice, only for inter-BSC Handover into this BSC, and only for AoIP: + * + * Establish the MGW endpoint CI that points towards the MSC. This needs to happen after the lchan (lchan_rtp_fsm) has + * created an MGW endpoint with the first CRCX, so that an endpoint is available, and before sending the Handover + * Request Acknowledge, so that the RTP address and port established towards the MSC can be included in the Handover + * Request Acknowledge message. + * (For SCCPlite, the MSC manages the CN side endpoint CI itself, and we don't need to send any RTP address in the + * Handover Request Acknowledge.) + * + * Actually, it should be possible to kick this off even above in handover_start_inter_bsc_in(), to do the CRCX towards + * the MSC at the same time as establishing the lchan. The gscon_ensure_mgw_endpoint() doesn't care which one of + * lchan_rtp_fsm or handover_start_inter_bsc_in() calls it first. The benefit would be that we'd send out the Handover + * Command ever so slightly sooner -- which isn't critical really, because a) how long does a CRCX take, milliseconds? + * and b) the time critical part is *after* the Handover Command was kicked off to keep the transition between cells as + * short as possible. The drawback of doing this earlier is code complexity: receiving the HO_EV_MSC_MGW_OK / + * HO_EV_MSC_MGW_FAIL events would need to be juggled in between the HO_EV_LCHAN_ACTIVE / HO_EV_LCHAN_ERROR. So the + * decision for now is to leave it here. + */ +static void ho_fsm_wait_mgw_endpoint_to_msc_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + struct handover *ho = &conn->ho; + + if (!gscon_connect_mgw_to_msc(conn, + ho->new_lchan, + ho->inter_bsc_in.msc_assigned_rtp_addr, + ho->inter_bsc_in.msc_assigned_rtp_port, + fi, + HO_EV_MSC_MGW_OK, + HO_EV_MSC_MGW_FAIL, + NULL, + &ho->created_ci_for_msc)) { + ho_fail(HO_RESULT_ERROR, + "Unable to connect MGW endpoint to the MSC side"); + } +} + +static void ho_fsm_wait_mgw_endpoint_to_msc(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + const struct mgcp_conn_peer *mgw_info; + + switch (event) { + + case HO_EV_MSC_MGW_OK: + /* Ensure the endpoint is really there, and log it. This state is only entered for AoIP connections, see + * ho_fsm_wait_lchan_active() above. */ + mgw_info = mgwep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); + if (!mgw_info) { + ho_fail(HO_RESULT_ERROR, + "Unable to retrieve RTP port info allocated by MGW for" + " the MSC side."); + return; + } + LOG_HO(conn, LOGL_DEBUG, "MGW's MSC side CI: %s:%u\n", + mgw_info->addr, mgw_info->port); + ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); + return; + + case HO_EV_MSC_MGW_FAIL: + ho_fail(HO_RESULT_ERROR, + "Unable to connect MGW endpoint to the MSC side"); + return; + + default: + OSMO_ASSERT(false); + } +} + + static void ho_fsm_wait_rr_ho_detect_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { int rc; @@ -1009,24 +1093,24 @@ } } -static void ho_fsm_post_lchan_established(struct osmo_fsm_inst *fi); - static void ho_fsm_wait_lchan_established_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { struct gsm_subscriber_connection *conn = ho_fi_conn(fi); if (conn->ho.fi && lchan_state_is(conn->ho.new_lchan, LCHAN_ST_ESTABLISHED)) { LOG_HO(conn, LOGL_DEBUG, "lchan already established earlier\n"); - ho_fsm_post_lchan_established(fi); + ho_success(); } } static void ho_fsm_wait_lchan_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + switch (event) { case HO_EV_LCHAN_ESTABLISHED: - ho_fsm_post_lchan_established(fi); + ho_success(); break; default: @@ -1034,69 +1118,6 @@ } } -static void ho_fsm_post_lchan_established(struct osmo_fsm_inst *fi) -{ - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - struct handover *ho = &conn->ho; - - if (ho->new_lchan->activate.info.requires_voice_stream - && (ho->scope & HO_INTER_BSC_IN)) - ho_fsm_state_chg(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC); - else - ho_success(); -} - -static void ho_fsm_wait_mgw_endpoint_to_msc_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - struct handover *ho = &conn->ho; - - if (!gscon_connect_mgw_to_msc(conn, - ho->new_lchan, - ho->inter_bsc_in.msc_assigned_rtp_addr, - ho->inter_bsc_in.msc_assigned_rtp_port, - fi, - HO_EV_MSC_MGW_OK, - HO_EV_MSC_MGW_FAIL, - NULL, - &ho->created_ci_for_msc)) { - ho_fail(HO_RESULT_ERROR, - "Unable to connect MGW endpoint to the MSC side"); - } -} - -static void ho_fsm_wait_mgw_endpoint_to_msc(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - switch (event) { - - case HO_EV_MSC_MGW_OK: - /* For AoIP, we created the MGW endpoint. Ensure it is really there, and log it. */ - if (gscon_is_aoip(conn)) { - const struct mgcp_conn_peer *mgw_info; - mgw_info = mgwep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); - if (!mgw_info) { - ho_fail(HO_RESULT_ERROR, - "Unable to retrieve RTP port info allocated by MGW for" - " the MSC side."); - return; - } - LOG_HO(conn, LOGL_DEBUG, "MGW's MSC side CI: %s:%u\n", - mgw_info->addr, mgw_info->port); - } - ho_success(); - return; - - case HO_EV_MSC_MGW_FAIL: - ho_fail(HO_RESULT_ERROR, - "Unable to connect MGW endpoint to the MSC side"); - return; - - default: - OSMO_ASSERT(false); - } -} - /* Inter-BSC OUT */ static void handover_start_inter_bsc_out(struct gsm_subscriber_connection *conn, @@ -1185,6 +1206,19 @@ , .out_state_mask = 0 | S(HO_ST_WAIT_LCHAN_ACTIVE) + | S(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC) + | S(HO_ST_WAIT_RR_HO_DETECT) + , + }, + [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { + .name = "WAIT_MGW_ENDPOINT_TO_MSC", + .onenter = ho_fsm_wait_mgw_endpoint_to_msc_onenter, + .action = ho_fsm_wait_mgw_endpoint_to_msc, + .in_event_mask = 0 + | S(HO_EV_MSC_MGW_OK) + | S(HO_EV_MSC_MGW_FAIL) + , + .out_state_mask = 0 | S(HO_ST_WAIT_RR_HO_DETECT) , }, @@ -1222,20 +1256,7 @@ .in_event_mask = 0 | S(HO_EV_LCHAN_ESTABLISHED) , - .out_state_mask = 0 - | S(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC) - , }, - [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { - .name = "WAIT_MGW_ENDPOINT_TO_MSC", - .onenter = ho_fsm_wait_mgw_endpoint_to_msc_onenter, - .action = ho_fsm_wait_mgw_endpoint_to_msc, - .in_event_mask = 0 - | S(HO_EV_MSC_MGW_OK) - | S(HO_EV_MSC_MGW_FAIL) - , - }, - [HO_OUT_ST_WAIT_HO_COMMAND] = { .name = "inter-BSC-OUT:WAIT_HO_COMMAND", .action = ho_out_fsm_wait_ho_command, -- To view, visit https://gerrit.osmocom.org/13584 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4a5acdb2d4a0b947cc0c62067a67be88a3d467ff Gerrit-Change-Number: 13584 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 17:56:33 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 17:56:33 +0000 Subject: Change in osmo-bsc[master]: fix inter-BSC-HO-incoming for AoIP (2/2) Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13585 Change subject: fix inter-BSC-HO-incoming for AoIP (2/2) ...................................................................... fix inter-BSC-HO-incoming for AoIP (2/2) For AoIP, the AoIP Transport Layer Address IE must be included in the Handover Request Acknowledge message, so the MSC can send RTP to the right place. Add this IE for AoIP. Depends: Ia71542ea37d4fd2c9fb9b40357db7aeb111ec576 (libosmocore) Depends: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63 (libosmocore) Change-Id: Ia05e37da125eb6e7b7be9b974b73261bd72de1f4 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 32 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/85/13585/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 65618fd..4849b1d 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -40,8 +40,10 @@ #include #include #include +#include #include #include +#include #define IP_V4_ADDR_LEN 4 @@ -1185,14 +1187,38 @@ { struct msgb *msg; struct gsm_lchan *new_lchan = conn->ho.new_lchan; + struct sockaddr_storage ss; + struct gsm0808_handover_request_ack params = { + .l3_info = rr_ho_command->data, + .l3_info_len = rr_ho_command->len, + .chosen_channel_present = true, + .chosen_channel = gsm0808_chosen_channel(new_lchan->type, new_lchan->tch_mode), + .chosen_encr_alg = new_lchan->encr.alg_id, + .chosen_speech_version = gsm0808_permitted_speech(new_lchan->type, new_lchan->tch_mode), + }; + + if (gscon_is_aoip(conn)) { + struct osmo_sockaddr_str to_msc_rtp; + const struct mgcp_conn_peer *rtp_info = mgwep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); + if (!rtp_info) { + LOG_HO(conn, LOGL_ERROR, + "Handover Request Acknowledge: no RTP address known to send as" + " AoIP Transport Layer Address\n"); + return -EINVAL; + } + if (osmo_sockaddr_str_from_str(&to_msc_rtp, rtp_info->addr, rtp_info->port)) { + LOG_HO(conn, LOGL_ERROR, "Handover Request Acknowledge: cannot encode AoIP Transport Layer\n"); + return -EINVAL; + } + if (osmo_sockaddr_str_to_sockaddr(&to_msc_rtp, &ss)) { + LOG_HO(conn, LOGL_ERROR, "Handover Request Acknowledge: cannot encode AoIP Transport Layer\n"); + return -EINVAL; + } + params.aoip_transport_layer = &ss; + } LOG_HO(conn, LOGL_DEBUG, "Sending BSSMAP Handover Request Acknowledge\n"); - msg = gsm0808_create_handover_request_ack(rr_ho_command->data, rr_ho_command->len, - gsm0808_chosen_channel(new_lchan->type, - new_lchan->tch_mode), - new_lchan->encr.alg_id, - gsm0808_permitted_speech(new_lchan->type, - new_lchan->tch_mode)); + msg = gsm0808_create_handover_request_ack2(¶ms); msgb_free(rr_ho_command); if (!msg) return -ENOMEM; -- To view, visit https://gerrit.osmocom.org/13585 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia05e37da125eb6e7b7be9b974b73261bd72de1f4 Gerrit-Change-Number: 13585 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 18:03:09 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 18:03:09 +0000 Subject: Change in osmo-hlr[master]: osmo-hlr: allow configuring db path from cfg file Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13586 Change subject: osmo-hlr: allow configuring db path from cfg file ...................................................................... osmo-hlr: allow configuring db path from cfg file So far, the cmdline argument was the only way to set a database config file. Add a similar config to VTY as 'hlr' / 'database'. The cmdline arg is stronger than the 'database' cfg item. DB is not reloaded from VTY command. Change-Id: I87b8673324e1e6225afb758fb4963ff3279ea3d8 --- M src/hlr.c M src/hlr.h M src/hlr_vty.c 3 files changed, 23 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/86/13586/1 diff --git a/src/hlr.c b/src/hlr.c index ce8c388..836d57b 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -621,7 +621,7 @@ bool db_upgrade; } cmdline_opts = { .config_file = "osmo-hlr.cfg", - .db_file = "hlr.db", + .db_file = NULL, .daemonize = false, .db_upgrade = false, }; @@ -736,6 +736,7 @@ INIT_LLIST_HEAD(&g_hlr->iuse_list); INIT_LLIST_HEAD(&g_hlr->ss_sessions); INIT_LLIST_HEAD(&g_hlr->ussd_routes); + osmo_talloc_replace_string(g_hlr, &g_hlr->db_file_path, HLR_DEFAULT_DB_FILE_PATH); /* Init default (call independent) SS session guard timeout value */ g_hlr->ncss_guard_timeout = NCSS_GUARD_TIMEOUT_DEFAULT; @@ -774,9 +775,12 @@ exit(1); } - g_hlr->dbc = db_open(hlr_ctx, cmdline_opts.db_file, true, cmdline_opts.db_upgrade); + if (cmdline_opts.db_file) + osmo_talloc_replace_string(g_hlr, &g_hlr->db_file_path, cmdline_opts.db_file); + + g_hlr->dbc = db_open(hlr_ctx, g_hlr->db_file_path, true, cmdline_opts.db_upgrade); if (!g_hlr->dbc) { - LOGP(DMAIN, LOGL_FATAL, "Error opening database\n"); + LOGP(DMAIN, LOGL_FATAL, "Error opening database %s\n", osmo_quote_str(g_hlr->db_file_path, -1)); exit(1); } diff --git a/src/hlr.h b/src/hlr.h index 00fa43c..e2e96a4 100644 --- a/src/hlr.h +++ b/src/hlr.h @@ -25,6 +25,8 @@ #include #include +#define HLR_DEFAULT_DB_FILE_PATH "hlr.db" + struct hlr_euse; struct hlr { @@ -32,6 +34,7 @@ struct osmo_gsup_server *gs; /* DB context */ + char *db_file_path; struct db_context *dbc; /* Control Interface */ diff --git a/src/hlr_vty.c b/src/hlr_vty.c index d0a623a..e4cc4be 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -74,6 +74,8 @@ vty_out(vty, "hlr%s", VTY_NEWLINE); if (g_hlr->store_imei) vty_out(vty, " store-imei%s", VTY_NEWLINE); + if (g_hlr->db_file_path && strcmp(g_hlr->db_file_path, HLR_DEFAULT_DB_FILE_PATH)) + vty_out(vty, " database %s%s", g_hlr->db_file_path, VTY_NEWLINE); return CMD_SUCCESS; } @@ -224,6 +226,15 @@ return CMD_SUCCESS; } +DEFUN(cfg_database, cfg_database_cmd, + "database PATH", + "Set the path to the HLR database file\n" + "Relative or absolute file system path to the database file (default is '" HLR_DEFAULT_DB_FILE_PATH "')\n") +{ + osmo_talloc_replace_string(g_hlr, &g_hlr->db_file_path, argv[0]); + return CMD_SUCCESS; +} + struct cmd_node euse_node = { EUSE_NODE, "%s(config-hlr-euse)# ", @@ -380,6 +391,8 @@ install_element(GSUP_NODE, &cfg_hlr_gsup_bind_ip_cmd); + install_element(HLR_NODE, &cfg_database_cmd); + install_element(HLR_NODE, &cfg_euse_cmd); install_element(HLR_NODE, &cfg_no_euse_cmd); install_node(&euse_node, config_write_euse); -- To view, visit https://gerrit.osmocom.org/13586 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I87b8673324e1e6225afb758fb4963ff3279ea3d8 Gerrit-Change-Number: 13586 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 18:03:09 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 18:03:09 +0000 Subject: Change in osmo-hlr[master]: add missing error log: invalid IMSI Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13587 Change subject: add missing error log: invalid IMSI ...................................................................... add missing error log: invalid IMSI Change-Id: I65e9ecac06dc6d1abb9802d621c385d3b4fab83a --- M src/hlr.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/87/13587/1 diff --git a/src/hlr.c b/src/hlr.c index 836d57b..2614f35 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -533,8 +533,10 @@ /* 3GPP TS 23.003 Section 2.2 clearly states that an IMSI with less than 5 * digits is impossible. Even 5 digits is a highly theoretical case */ - if (strlen(gsup.imsi) < 5) + if (strlen(gsup.imsi) < 5) { + LOGP(DMAIN, LOGL_ERROR, "IMSI too short: %s\n", osmo_quote_str(gsup.imsi, -1)); return gsup_send_err_reply(conn, gsup.imsi, gsup.message_type, GMM_CAUSE_INV_MAND_INFO); + } if (gsup.destination_name_len) return read_cb_forward(conn, msg, &gsup); -- To view, visit https://gerrit.osmocom.org/13587 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I65e9ecac06dc6d1abb9802d621c385d3b4fab83a Gerrit-Change-Number: 13587 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 18:03:09 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 18:03:09 +0000 Subject: Change in osmo-hlr[master]: GSUP routing: use Kind IE Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13588 Change subject: GSUP routing: use Kind IE ...................................................................... GSUP routing: use Kind IE Include the GSUP Kind from original message in routing error responses. Add the Kind to GSUP router logging. Depends: Ic397a9f2c4a7224e47cab944c72e75ca5592efef (libosmocore) Change-Id: I8dc3967d9372d63e9d57ca2608dd3316edb234a4 --- M src/hlr.c 1 file changed, 17 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/88/13588/1 diff --git a/src/hlr.c b/src/hlr.c index 2614f35..6d2f7ac 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -453,6 +453,7 @@ /* Prepare error message (before IEs get deallocated) */ gsup_err = talloc_zero(hlr_ctx, struct osmo_gsup_message); OSMO_STRLCPY_ARRAY(gsup_err->imsi, gsup->imsi); + gsup_err->kind = gsup->kind; gsup_err->destination_name = talloc_memdup(gsup_err, gsup->destination_name, gsup->destination_name_len); gsup_err->destination_name_len = gsup->destination_name_len; gsup_err->message_type = OSMO_GSUP_MSGT_E_ROUTING_ERROR; @@ -462,8 +463,9 @@ /* Check for routing IEs */ if (!gsup->source_name || !gsup->source_name_len || !gsup->destination_name || !gsup->destination_name_len) { - LOGP(DMAIN, LOGL_ERROR, "Can't forward GSUP message for IMSI %s (%s): missing routing IEs\n", - gsup->imsi, osmo_gsup_message_type_name(gsup->message_type)); + LOGP(DMAIN, LOGL_ERROR, "Can't forward GSUP message for IMSI %s (%s, kind %s): missing routing IEs\n", + gsup->imsi, osmo_gsup_message_type_name(gsup->message_type), + osmo_gsup_kind_name(gsup->kind)); goto end; } @@ -480,10 +482,11 @@ } /* Forward message without re-encoding (so we don't remove unknown IEs) */ - LOGP(DMAIN, LOGL_NOTICE, "Forwarding GSUP message for IMSI %s from %s to %s: %s\n", gsup->imsi, + LOGP(DMAIN, LOGL_NOTICE, "Forwarding GSUP message for IMSI %s from %s to %s: %s, kind %s\n", gsup->imsi, osmo_quote_str_buf((const char *)gsup->source_name, gsup->source_name_len, buf, sizeof(buf)), osmo_quote_str((const char *)gsup->destination_name, gsup->destination_name_len), - osmo_gsup_message_type_name(gsup->message_type)); + osmo_gsup_message_type_name(gsup->message_type), + osmo_gsup_kind_name(gsup->kind)); /* Remove incoming IPA header to be able to prepend and outgoing IPA header */ msgb_pull_to_l2(msg); @@ -494,16 +497,19 @@ gsup = NULL; if (ret == -ENODEV) LOGP(DMAIN, LOGL_ERROR, - "Can't forward GSUP message for IMSI %s from %s to %s (%s): destination not connected\n", gsup_err->imsi, - osmo_quote_str_buf((const char *)gsup_err->source_name, gsup_err->source_name_len, buf, sizeof(buf)), - osmo_quote_str((const char *)gsup_err->destination_name, gsup_err->destination_name_len), - osmo_gsup_message_type_name(gsup_err->message_type)); - else if (ret) - LOGP(DMAIN, LOGL_ERROR, "Can't forward GSUP message for IMSI %s from %s to %s (%s): unknown error\n", + "Can't forward GSUP message for IMSI %s from %s to %s (%s, kind %s): destination not connected\n", gsup_err->imsi, osmo_quote_str_buf((const char *)gsup_err->source_name, gsup_err->source_name_len, buf, sizeof(buf)), osmo_quote_str((const char *)gsup_err->destination_name, gsup_err->destination_name_len), - osmo_gsup_message_type_name(gsup_err->message_type)); + osmo_gsup_message_type_name(gsup_err->message_type), + osmo_gsup_kind_name(gsup_err->kind)); + else if (ret) + LOGP(DMAIN, LOGL_ERROR, "Can't forward GSUP message for IMSI %s from %s to %s (%s, kind %s): unknown error\n", + gsup_err->imsi, + osmo_quote_str_buf((const char *)gsup_err->source_name, gsup_err->source_name_len, buf, sizeof(buf)), + osmo_quote_str((const char *)gsup_err->destination_name, gsup_err->destination_name_len), + osmo_gsup_message_type_name(gsup_err->message_type), + osmo_gsup_kind_name(gsup_err->kind)); end: /* Send error back to source */ -- To view, visit https://gerrit.osmocom.org/13588 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8dc3967d9372d63e9d57ca2608dd3316edb234a4 Gerrit-Change-Number: 13588 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 18:03:10 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 18:03:10 +0000 Subject: Change in osmo-hlr[master]: use new OSMO_IMSI_SIZE Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13589 Change subject: use new OSMO_IMSI_SIZE ...................................................................... use new OSMO_IMSI_SIZE Depends: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 (libosmocore) Change-Id: I8e8fa221e97303df3c6cce96b25d31a53f67b939 --- M src/hlr_ussd.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/89/13589/1 diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index 56a5a95..3c55c42 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -150,7 +150,7 @@ /* link us to hlr->ss_sessions */ struct llist_head list; /* imsi of this session */ - char imsi[GSM23003_IMSI_MAX_DIGITS+2]; + char imsi[OSMO_IMSI_SIZE]; /* ID of this session (unique per IMSI) */ uint32_t session_id; /* state of the session */ -- To view, visit https://gerrit.osmocom.org/13589 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8e8fa221e97303df3c6cce96b25d31a53f67b939 Gerrit-Change-Number: 13589 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 18:03:57 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 18:03:57 +0000 Subject: Change in osmo-mgw[master]: move MGW endpoint FSM from osmo-bsc to here Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13590 Change subject: move MGW endpoint FSM from osmo-bsc to here ...................................................................... move MGW endpoint FSM from osmo-bsc to here Move mgw_endpoint_fsm from osmo-bsc here as osmo_mgcpc_ep_fsm. Apply various renames for consistency. Use osmo_tdef from libosmocore instead of osmo-bsc's (so far) local T_defs API. Change T23042 to T2427001, which is a slightly less arbitrary number and slightly more extendable in the future (2427 corresponds to the default MGCP port at osmo-mgw, 001 is the first MGCP timer and so far the only one). Change-Id: I9a3effd38e72841529df6c135c077116981dea36 --- M include/Makefile.am A include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h M include/osmocom/mgcp_client/mgcp_client_fsm.h M src/libosmo-mgcp-client/Makefile.am A src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c M src/libosmo-mgcp-client/mgcp_client_fsm.c 6 files changed, 810 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/90/13590/1 diff --git a/include/Makefile.am b/include/Makefile.am index c34553a..2daaf20 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,6 +4,7 @@ nobase_include_HEADERS = \ osmocom/mgcp_client/mgcp_client.h \ + osmocom/mgcp_client/mgcp_client_endpoint_fsm.h \ osmocom/mgcp_client/mgcp_client_fsm.h \ osmocom/mgcp_client/mgcp_common.h \ osmocom/mgcp/mgcp.h \ diff --git a/include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h b/include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h new file mode 100644 index 0000000..a2297b5 --- /dev/null +++ b/include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h @@ -0,0 +1,46 @@ +/* FSM to manage multiple connections of an MGW endpoint */ +#pragma once + +#include + +#define LOG_MGCPC_EP(ep, level, fmt, args...) do { \ + LOGPFSML(ep->fi, level, "%s " fmt, \ + osmo_mgcpc_ep_name(ep), ## args); \ + } while(0) + +struct osmo_mgcpc_ep; +struct osmo_mgcpc_ep_ci; +struct osmo_tdef; + +void osmo_mgcpc_ep_fsm_init(); + +struct osmo_mgcpc_ep *osmo_mgcpc_ep_alloc(struct osmo_fsm_inst *parent, uint32_t parent_term_event, + struct mgcp_client *mgcp_client, + const struct osmo_tdef *T_defs, + const char *fsm_id, + const char *endpoint_str_fmt, ...); + +struct osmo_mgcpc_ep_ci *osmo_mgcpc_ep_ci_add(struct osmo_mgcpc_ep *ep, const char *label_fmt, ...); +const struct mgcp_conn_peer *osmo_mgcpc_ep_ci_get_rtp_info(const struct osmo_mgcpc_ep_ci *ci); +bool osmo_mgcpc_ep_ci_get_crcx_info_to_sockaddr(const struct osmo_mgcpc_ep_ci *ci, struct sockaddr_storage *dest); + +void osmo_mgcpc_ep_ci_request(struct osmo_mgcpc_ep_ci *ci, + enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info, + struct osmo_fsm_inst *notify, + uint32_t event_success, uint32_t event_failure, + void *notify_data); + +static inline void osmo_mgcpc_ep_ci_dlcx(struct osmo_mgcpc_ep_ci *ci) +{ + osmo_mgcpc_ep_ci_request(ci, MGCP_VERB_DLCX, NULL, NULL, 0, 0, NULL); +} + +void osmo_mgcpc_ep_clear(struct osmo_mgcpc_ep *ep); + +const char *osmo_mgcpc_ep_name(const struct osmo_mgcpc_ep *ep); +const char *osmo_mgcpc_ep_ci_name(const struct osmo_mgcpc_ep_ci *ci); +const char *osmo_mgcpc_ep_ci_id(const struct osmo_mgcpc_ep_ci *ci); + +extern const struct value_string osmo_mgcp_verb_names[]; +static inline const char *osmo_mgcp_verb_name(enum mgcp_verb val) +{ return get_value_string(osmo_mgcp_verb_names, val); } diff --git a/include/osmocom/mgcp_client/mgcp_client_fsm.h b/include/osmocom/mgcp_client/mgcp_client_fsm.h index dabfcca..e170a25 100644 --- a/include/osmocom/mgcp_client/mgcp_client_fsm.h +++ b/include/osmocom/mgcp_client/mgcp_client_fsm.h @@ -64,3 +64,5 @@ void mgcp_conn_delete(struct osmo_fsm_inst *fi); const char *mgcp_conn_get_ci(struct osmo_fsm_inst *fi); + +const char *osmo_mgcpc_conn_peer_name(const struct mgcp_conn_peer *info); diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index e59da2f..1529853 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -30,6 +30,7 @@ mgcp_client.c \ mgcp_client_vty.c \ mgcp_client_fsm.c \ + mgcp_client_endpoint_fsm.c \ $(NULL) libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) diff --git a/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c b/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c new file mode 100644 index 0000000..a50491f --- /dev/null +++ b/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c @@ -0,0 +1,738 @@ +/* FSM to manage multiple connections of an MGW endpoint + * + * (C) 2018-2019 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +#include +#include +#include + +#include + +#include + +#define LOG_CI(ci, level, fmt, args...) do { \ + if (!ci || !ci->ep) \ + LOGP(DLGLOBAL, level, "(unknown MGW endpoint) " fmt, ## args); \ + else \ + LOG_MGCPC_EP(ci->ep, level, "CI[%d] %s%s%s: " fmt, \ + (int)(ci - ci->ep->ci), \ + ci->label ? : "-", \ + ci->mgcp_ci_str[0] ? " CI=" : "", \ + ci->mgcp_ci_str[0] ? ci->mgcp_ci_str : "", \ + ## args); \ + } while(0) + +#define LOG_CI_VERB(ci, level, fmt, args...) do { \ + if (ci->verb_info.addr[0]) \ + LOG_CI(ci, level, "%s %s:%u: " fmt, \ + osmo_mgcp_verb_name(ci->verb), ci->verb_info.addr, ci->verb_info.port, \ + ## args); \ + else \ + LOG_CI(ci, level, "%s: " fmt, \ + osmo_mgcp_verb_name(ci->verb), \ + ## args); \ + } while(0) + +enum osmo_mgcpc_ep_fsm_state { + OSMO_MGCPC_EP_ST_UNUSED = 0, + OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE, + OSMO_MGCPC_EP_ST_IN_USE, +}; + +enum osmo_mgcpc_ep_fsm_event { + _OSMO_MGCPC_EP_EV_LAST = 0, + /* and MGW response events are allocated dynamically */ +}; + +#define FIRST_CI_EVENT (_OSMO_MGCPC_EP_EV_LAST + (_OSMO_MGCPC_EP_EV_LAST & 1)) /* rounded up to even nr */ +#define USABLE_CI ((32 - FIRST_CI_EVENT)/2) +#define EV_TO_CI_IDX(event) ((event - FIRST_CI_EVENT) / 2) + +#define CI_EV_SUCCESS(ci) (FIRST_CI_EVENT + (((ci) - ci->ep->ci) * 2)) +#define CI_EV_FAILURE(ci) (CI_EV_SUCCESS(ci) + 1) + +static struct osmo_fsm osmo_mgcpc_ep_fsm; + +struct osmo_mgcpc_ep_ci { + struct osmo_mgcpc_ep *ep; + + bool occupied; + char label[64]; + struct osmo_fsm_inst *mgcp_client_fi; + + bool pending; + bool sent; + enum mgcp_verb verb; + struct mgcp_conn_peer verb_info; + struct osmo_fsm_inst *notify; + uint32_t notify_success; + uint32_t notify_failure; + void *notify_data; + + bool got_port_info; + struct mgcp_conn_peer rtp_info; + char mgcp_ci_str[MGCP_CONN_ID_LENGTH]; +}; + +struct osmo_mgcpc_ep { + struct mgcp_client *mgcp_client; + struct osmo_fsm_inst *fi; + char endpoint[MGCP_ENDPOINT_MAXLEN]; + const struct osmo_tdef *T_defs; + + struct osmo_mgcpc_ep_ci ci[USABLE_CI]; +}; + +const struct value_string osmo_mgcp_verb_names[] = { + { MGCP_VERB_CRCX, "CRCX" }, + { MGCP_VERB_MDCX, "MDCX" }, + { MGCP_VERB_DLCX, "DLCX" }, + { MGCP_VERB_AUEP, "AUEP" }, + { MGCP_VERB_RSIP, "RSIP" }, + {} +}; + +static struct osmo_mgcpc_ep_ci *osmo_mgcpc_ep_check_ci(struct osmo_mgcpc_ep_ci *ci) +{ + if (!ci) + return NULL; + if (!ci->ep) + return NULL; + if (ci < ci->ep->ci || ci >= &ci->ep->ci[USABLE_CI]) + return NULL; + return ci; +} + +static struct osmo_mgcpc_ep_ci *osmo_mgcpc_ep_ci_for_event(struct osmo_mgcpc_ep *ep, uint32_t event) +{ + int idx; + if (event < FIRST_CI_EVENT) + return NULL; + idx = EV_TO_CI_IDX(event); + if (idx >= sizeof(ep->ci)) + return NULL; + return osmo_mgcpc_ep_check_ci(&ep->ci[idx]); +} + +const char *osmo_mgcpc_ep_name(const struct osmo_mgcpc_ep *ep) +{ + if (!ep) + return "NULL"; + if (ep->endpoint[0]) + return ep->endpoint; + return osmo_fsm_inst_name(ep->fi); +} + +const char *mgcp_conn_peer_name(const struct mgcp_conn_peer *info) +{ + /* I'd be fine with a smaller buffer and accept truncation, but gcc possibly refuses to build if + * this buffer is too small. */ + static char buf[1024]; + + if (!info) + return "NULL"; + + if (info->endpoint[0] + && info->addr[0]) + snprintf(buf, sizeof(buf), "%s:%s:%u", + info->endpoint, info->addr, info->port); + else if (info->endpoint[0]) + snprintf(buf, sizeof(buf), "%s", info->endpoint); + else if (info->addr[0]) + snprintf(buf, sizeof(buf), "%s:%u", info->addr, info->port); + else + return "empty"; + return buf; +} + +const char *osmo_mgcpc_ep_ci_name(const struct osmo_mgcpc_ep_ci *ci) +{ + const struct mgcp_conn_peer *rtp_info; + + if (!ci) + return "NULL"; + + rtp_info = osmo_mgcpc_ep_ci_get_rtp_info(ci); + + if (rtp_info) + return mgcp_conn_peer_name(rtp_info); + return osmo_mgcpc_ep_name(ci->ep); +} + +const char *osmo_mgcpc_ep_ci_id(const struct osmo_mgcpc_ep_ci *ci) +{ + if (!ci || !ci->mgcp_ci_str[0]) + return NULL; + return ci->mgcp_ci_str; +} + +static struct value_string osmo_mgcpc_ep_fsm_event_names[33] = {}; + +static char osmo_mgcpc_ep_fsm_event_name_bufs[32][32] = {}; + +static void fill_event_names() +{ + int i; + for (i = 0; i < (ARRAY_SIZE(osmo_mgcpc_ep_fsm_event_names) - 1); i++) { + if (i < _OSMO_MGCPC_EP_EV_LAST) + continue; + if (i < FIRST_CI_EVENT || EV_TO_CI_IDX(i) > USABLE_CI) { + osmo_mgcpc_ep_fsm_event_names[i] = (struct value_string){i, "Unused"}; + continue; + } + snprintf(osmo_mgcpc_ep_fsm_event_name_bufs[i], sizeof(osmo_mgcpc_ep_fsm_event_name_bufs[i]), + "MGW Response for CI #%d", EV_TO_CI_IDX(i)); + osmo_mgcpc_ep_fsm_event_names[i] = (struct value_string){i, osmo_mgcpc_ep_fsm_event_name_bufs[i]}; + } +} + +/* T_defs is used to obtain an (Osmocom specific) T2427001: timeout for an MGCP response (note, 2427 corresponds to the + * default MGCP port in osmo-mgw). */ +void osmo_mgcpc_ep_fsm_init() +{ + OSMO_ASSERT(osmo_fsm_register(&osmo_mgcpc_ep_fsm) == 0); + fill_event_names(); +} + +struct osmo_mgcpc_ep *osmo_mgcpc_ep_fi_mgwep(struct osmo_fsm_inst *fi) +{ + OSMO_ASSERT(fi); + OSMO_ASSERT(fi->fsm == &osmo_mgcpc_ep_fsm); + OSMO_ASSERT(fi->priv); + return fi->priv; +} + +struct osmo_mgcpc_ep *osmo_mgcpc_ep_alloc(struct osmo_fsm_inst *parent, uint32_t parent_term_event, + struct mgcp_client *mgcp_client, + const struct osmo_tdef *T_defs, + const char *fsm_id, + const char *endpoint_str_fmt, ...) +{ + va_list ap; + struct osmo_fsm_inst *fi; + struct osmo_mgcpc_ep *ep; + int rc; + + if (!mgcp_client) + return NULL; + + fi = osmo_fsm_inst_alloc_child(&osmo_mgcpc_ep_fsm, parent, parent_term_event); + OSMO_ASSERT(fi); + + osmo_fsm_inst_update_id(fi, fsm_id); + + ep = talloc_zero(fi, struct osmo_mgcpc_ep); + OSMO_ASSERT(ep); + + *ep = (struct osmo_mgcpc_ep){ + .mgcp_client = mgcp_client, + .fi = fi, + .T_defs = T_defs, + }; + fi->priv = ep; + + va_start(ap, endpoint_str_fmt); + rc = vsnprintf(ep->endpoint, sizeof(ep->endpoint), endpoint_str_fmt ? : "", ap); + va_end(ap); + + if (rc <= 0 || rc >= sizeof(ep->endpoint)) { + LOG_MGCPC_EP(ep, LOGL_ERROR, "Endpoint name too long or too short: %s\n", + ep->endpoint); + osmo_fsm_inst_term(ep->fi, OSMO_FSM_TERM_ERROR, 0); + return NULL; + } + + return ep; +} + +struct osmo_mgcpc_ep_ci *osmo_mgcpc_ep_ci_add(struct osmo_mgcpc_ep *ep, + const char *label_fmt, ...) +{ + va_list ap; + int i; + struct osmo_mgcpc_ep_ci *ci; + + for (i = 0; i < USABLE_CI; i++) { + ci = &ep->ci[i]; + + if (ci->occupied || ci->mgcp_client_fi) + continue; + + *ci = (struct osmo_mgcpc_ep_ci){ + .ep = ep, + .occupied = true, + }; + if (label_fmt) { + va_start(ap, label_fmt); + vsnprintf(ci->label, sizeof(ci->label), label_fmt, ap); + va_end(ap); + } + return ci; + } + + LOG_MGCPC_EP(ep, LOGL_ERROR, + "Cannot allocate another endpoint, all " + OSMO_STRINGIFY_VAL(USABLE_CI) " are in use\n"); + + return NULL; +} + +static bool osmo_mgcpc_ep_fsm_check_state_chg_after_response(struct osmo_fsm_inst *fi); + +static void on_failure(struct osmo_mgcpc_ep_ci *ci) +{ + struct osmo_fsm_inst *notify = ci->notify; + uint32_t notify_failure = ci->notify_failure; + void *notify_data = ci->notify_data; + + if (!ci->occupied) + return; + + *ci = (struct osmo_mgcpc_ep_ci){ + .ep = ci->ep, + }; + + /* If this check has terminated the FSM instance, don't fire any more events to prevent use-after-free problems. + * The endpoint FSM does dispatch a term event to its parent, and everything should be cleaned like that. */ + if (!osmo_mgcpc_ep_fsm_check_state_chg_after_response(ci->ep->fi)) + return; + + if (notify) + osmo_fsm_inst_dispatch(notify, notify_failure, notify_data); +} + +static void on_success(struct osmo_mgcpc_ep_ci *ci, void *data) +{ + struct mgcp_conn_peer *rtp_info; + + if (!ci->occupied) + return; + + ci->pending = false; + + switch (ci->verb) { + case MGCP_VERB_CRCX: + /* If we sent a wildcarded endpoint name on CRCX, we need to store the resulting endpoint + * name here. Also, we receive the MGW's RTP port information. */ + rtp_info = data; + OSMO_ASSERT(rtp_info); + ci->got_port_info = true; + ci->rtp_info = *rtp_info; + osmo_strlcpy(ci->mgcp_ci_str, mgcp_conn_get_ci(ci->mgcp_client_fi), + sizeof(ci->mgcp_ci_str)); + if (rtp_info->endpoint[0]) { + int rc; + rc = osmo_strlcpy(ci->ep->endpoint, rtp_info->endpoint, + sizeof(ci->ep->endpoint)); + if (rc <= 0 || rc >= sizeof(ci->ep->endpoint)) { + LOG_CI(ci, LOGL_ERROR, "Unable to copy endpoint name '%s'\n", + rtp_info->endpoint); + osmo_mgcpc_ep_ci_dlcx(ci); + on_failure(ci); + return; + } + } + break; + + default: + break; + } + + LOG_CI(ci, LOGL_DEBUG, "received successful response to %s: RTP=%s%s\n", + osmo_mgcp_verb_name(ci->verb), + mgcp_conn_peer_name(ci->got_port_info? &ci->rtp_info : NULL), + ci->notify ? "" : " (not sending a notification)"); + + if (ci->notify) + osmo_fsm_inst_dispatch(ci->notify, ci->notify_success, ci->notify_data); + + osmo_mgcpc_ep_fsm_check_state_chg_after_response(ci->ep->fi); +} + +const struct mgcp_conn_peer *osmo_mgcpc_ep_ci_get_rtp_info(const struct osmo_mgcpc_ep_ci *ci) +{ + ci = osmo_mgcpc_ep_check_ci((struct osmo_mgcpc_ep_ci*)ci); + if (!ci) + return NULL; + if (!ci->got_port_info) + return NULL; + return &ci->rtp_info; +} + +bool osmo_mgcpc_ep_ci_get_crcx_info_to_sockaddr(const struct osmo_mgcpc_ep_ci *ci, struct sockaddr_storage *dest) +{ + const struct mgcp_conn_peer *rtp_info; + struct sockaddr_in *sin; + + rtp_info = osmo_mgcpc_ep_ci_get_rtp_info(ci); + if (!rtp_info) + return false; + + sin = (struct sockaddr_in *)dest; + + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = inet_addr(rtp_info->addr); + sin->sin_port = osmo_ntohs(rtp_info->port); + return true; +} + + +static const struct osmo_tdef_state_timeout osmo_mgcpc_ep_fsm_timeouts[32] = { + [OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE] = { .T=2427001 }, +}; + +/* Transition to a state, using the T timer defined in assignment_fsm_timeouts. + * The actual timeout value is in turn obtained from osmo_mgcpc_ep.T_defs. + * Assumes local variable fi exists. */ +#define osmo_mgcpc_ep_fsm_state_chg(state) \ + osmo_tdef_fsm_inst_state_chg(fi, state, osmo_mgcpc_ep_fsm_timeouts, \ + ((struct osmo_mgcpc_ep*)fi->priv)->T_defs, 5) + +void osmo_mgcpc_ep_ci_request(struct osmo_mgcpc_ep_ci *ci, + enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info, + struct osmo_fsm_inst *notify, + uint32_t event_success, uint32_t event_failure, + void *notify_data) +{ + struct osmo_mgcpc_ep *ep; + struct osmo_fsm_inst *fi; + struct osmo_mgcpc_ep_ci cleared_ci; + ci = osmo_mgcpc_ep_check_ci(ci); + + if (!ci) { + LOGP(DLGLOBAL, LOGL_ERROR, "Invalid MGW endpoint request: no ci\n"); + goto dispatch_error; + } + if (!verb_info && verb != MGCP_VERB_DLCX) { + LOG_CI(ci, LOGL_ERROR, "Invalid MGW endpoint request: missing verb details for %s\n", + osmo_mgcp_verb_name(verb)); + goto dispatch_error; + } + if ((verb < 0) || (verb > MGCP_VERB_RSIP)) { + LOG_CI(ci, LOGL_ERROR, "Invalid MGW endpoint request: unknown verb: %s\n", + osmo_mgcp_verb_name(verb)); + goto dispatch_error; + } + + ep = ci->ep; + fi = ep->fi; + + /* Clear volatile state by explicitly keeping those that should remain. Because we can't assign + * the char[] directly, dance through cleared_ci and copy back. */ + cleared_ci = (struct osmo_mgcpc_ep_ci){ + .ep = ep, + .mgcp_client_fi = ci->mgcp_client_fi, + .got_port_info = ci->got_port_info, + .rtp_info = ci->rtp_info, + + .occupied = true, + /* .pending = true follows below */ + .verb = verb, + .notify = notify, + .notify_success = event_success, + .notify_failure = event_failure, + .notify_data = notify_data, + }; + osmo_strlcpy(cleared_ci.label, ci->label, sizeof(cleared_ci.label)); + osmo_strlcpy(cleared_ci.mgcp_ci_str, ci->mgcp_ci_str, sizeof(cleared_ci.mgcp_ci_str)); + *ci = cleared_ci; + + LOG_CI_VERB(ci, LOGL_DEBUG, "notify=%s\n", osmo_fsm_inst_name(ci->notify)); + + if (verb_info) + ci->verb_info = *verb_info; + + if (ep->endpoint[0]) { + if (ci->verb_info.endpoint[0] && strcmp(ci->verb_info.endpoint, ep->endpoint)) + LOG_CI(ci, LOGL_ERROR, + "Warning: Requested %s on endpoint %s, but this CI is on endpoint %s." + " Using the proper endpoint instead.\n", + osmo_mgcp_verb_name(verb), ci->verb_info.endpoint, ep->endpoint); + osmo_strlcpy(ci->verb_info.endpoint, ep->endpoint, sizeof(ci->verb_info.endpoint)); + } + + switch (ci->verb) { + case MGCP_VERB_CRCX: + if (ci->mgcp_client_fi) { + LOG_CI(ci, LOGL_ERROR, "CRCX can be called only once per MGW endpoint CI\n"); + on_failure(ci); + return; + } + break; + + case MGCP_VERB_MDCX: + if (!ci->mgcp_client_fi) { + LOG_CI_VERB(ci, LOGL_ERROR, "The first verb on an unused MGW endpoint CI must be CRCX, not %s\n", + osmo_mgcp_verb_name(ci->verb)); + on_failure(ci); + return; + } + break; + + case MGCP_VERB_DLCX: + if (!ci->mgcp_client_fi) { + LOG_CI_VERB(ci, LOGL_DEBUG, "Ignoring DLCX on unused MGW endpoint CI\n"); + return; + } + break; + + default: + LOG_CI(ci, LOGL_ERROR, "This verb is not supported: %s\n", osmo_mgcp_verb_name(ci->verb)); + on_failure(ci); + return; + } + + ci->pending = true; + + LOG_CI_VERB(ci, LOGL_DEBUG, "Scheduling\n"); + + if (ep->fi->state != OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE) + osmo_mgcpc_ep_fsm_state_chg(OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE); + + return; +dispatch_error: + if (notify) + osmo_fsm_inst_dispatch(notify, event_failure, notify_data); +} + +static int send_verb(struct osmo_mgcpc_ep_ci *ci) +{ + int rc; + struct osmo_mgcpc_ep *ep = ci->ep; + + if (!ci->occupied || !ci->pending || ci->sent) + return 0; + + switch (ci->verb) { + + case MGCP_VERB_CRCX: + OSMO_ASSERT(!ci->mgcp_client_fi); + LOG_CI_VERB(ci, LOGL_DEBUG, "Sending\n"); + ci->mgcp_client_fi = mgcp_conn_create(ep->mgcp_client, ep->fi, + CI_EV_FAILURE(ci), CI_EV_SUCCESS(ci), + &ci->verb_info); + ci->sent = true; + if (!ci->mgcp_client_fi){ + LOG_CI_VERB(ci, LOGL_ERROR, "Cannot send\n"); + on_failure(ci); + } + osmo_fsm_inst_update_id(ci->mgcp_client_fi, ci->label); + break; + + case MGCP_VERB_MDCX: + OSMO_ASSERT(ci->mgcp_client_fi); + LOG_CI_VERB(ci, LOGL_DEBUG, "Sending\n"); + rc = mgcp_conn_modify(ci->mgcp_client_fi, CI_EV_SUCCESS(ci), &ci->verb_info); + ci->sent = true; + if (rc) { + LOG_CI_VERB(ci, LOGL_ERROR, "Cannot send (rc=%d %s)\n", rc, strerror(-rc)); + on_failure(ci); + } + break; + + case MGCP_VERB_DLCX: + LOG_CI(ci, LOGL_DEBUG, "Sending MGCP: %s %s\n", + osmo_mgcp_verb_name(ci->verb), ci->mgcp_ci_str); + /* The way this is designed, we actually need to forget all about the ci right away. */ + mgcp_conn_delete(ci->mgcp_client_fi); + if (ci->notify) + osmo_fsm_inst_dispatch(ci->notify, ci->notify_success, ci->notify_data); + *ci = (struct osmo_mgcpc_ep_ci){ + .ep = ep, + }; + break; + + default: + OSMO_ASSERT(false); + } + + return 1; +} + +void osmo_mgcpc_ep_clear(struct osmo_mgcpc_ep *ep) +{ + if (!ep) + return; + osmo_fsm_inst_term(ep->fi, OSMO_FSM_TERM_REGULAR, 0); +} + +static void osmo_mgcpc_ep_count(struct osmo_mgcpc_ep *ep, int *occupied, int *pending_not_sent, + int *waiting_for_response) +{ + int i; + + if (occupied) + *occupied = 0; + + if (pending_not_sent) + *pending_not_sent = 0; + + if (waiting_for_response) + *waiting_for_response = 0; + + for (i = 0; i < ARRAY_SIZE(ep->ci); i++) { + struct osmo_mgcpc_ep_ci *ci = &ep->ci[i]; + if (ci->occupied) { + if (occupied) + (*occupied)++; + } else + continue; + + if (ci->pending) + LOG_CI_VERB(ci, LOGL_DEBUG, "%s\n", + ci->sent ? "waiting for response" : "waiting to be sent"); + else + LOG_CI_VERB(ci, LOGL_DEBUG, "done (%s)\n", mgcp_conn_peer_name(osmo_mgcpc_ep_ci_get_rtp_info(ci))); + + if (ci->pending && ci->sent) + if (waiting_for_response) + (*waiting_for_response)++; + if (ci->pending && !ci->sent) + if (pending_not_sent) + (*pending_not_sent)++; + } +} + +static bool osmo_mgcpc_ep_fsm_check_state_chg_after_response(struct osmo_fsm_inst *fi) +{ + int waiting_for_response; + int occupied; + struct osmo_mgcpc_ep *ep = osmo_mgcpc_ep_fi_mgwep(fi); + + osmo_mgcpc_ep_count(ep, &occupied, NULL, &waiting_for_response); + LOG_MGCPC_EP(ep, LOGL_DEBUG, "CI in use: %d, waiting for response: %d\n", occupied, waiting_for_response); + + if (!occupied) { + /* All CI have been released. The endpoint no longer exists. Notify the parent FSM, by + * terminating. */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, 0); + return false; + } + + if (!waiting_for_response) { + if (fi->state != OSMO_MGCPC_EP_ST_IN_USE) + osmo_mgcpc_ep_fsm_state_chg(OSMO_MGCPC_EP_ST_IN_USE); + } + + return true; +} + +static void osmo_mgcpc_ep_fsm_wait_mgw_response_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + int count = 0; + int i; + struct osmo_mgcpc_ep *ep = osmo_mgcpc_ep_fi_mgwep(fi); + + for (i = 0; i < ARRAY_SIZE(ep->ci); i++) { + count += send_verb(&ep->ci[i]); + } + + LOG_MGCPC_EP(ep, LOGL_DEBUG, "Sent messages: %d\n", count); + osmo_mgcpc_ep_fsm_check_state_chg_after_response(fi); +} + +static void osmo_mgcpc_ep_fsm_handle_ci_events(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct osmo_mgcpc_ep_ci *ci; + struct osmo_mgcpc_ep *ep = osmo_mgcpc_ep_fi_mgwep(fi); + ci = osmo_mgcpc_ep_ci_for_event(ep, event); + if (ci) { + if (event == CI_EV_SUCCESS(ci)) + on_success(ci, data); + else + on_failure(ci); + } +} + +static void osmo_mgcpc_ep_fsm_in_use_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + int pending_not_sent; + struct osmo_mgcpc_ep *ep = osmo_mgcpc_ep_fi_mgwep(fi); + + osmo_mgcpc_ep_count(ep, NULL, &pending_not_sent, NULL); + if (pending_not_sent) + osmo_mgcpc_ep_fsm_state_chg(OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE); +} + +#define S(x) (1 << (x)) + +static const struct osmo_fsm_state osmo_mgcpc_ep_fsm_states[] = { + [OSMO_MGCPC_EP_ST_UNUSED] = { + .name = "UNUSED", + .in_event_mask = 0, + .out_state_mask = 0 + | S(OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE) + , + }, + [OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE] = { + .name = "WAIT_MGW_RESPONSE", + .onenter = osmo_mgcpc_ep_fsm_wait_mgw_response_onenter, + .action = osmo_mgcpc_ep_fsm_handle_ci_events, + .in_event_mask = 0xffffffff, + .out_state_mask = 0 + | S(OSMO_MGCPC_EP_ST_IN_USE) + , + }, + [OSMO_MGCPC_EP_ST_IN_USE] = { + .name = "IN_USE", + .onenter = osmo_mgcpc_ep_fsm_in_use_onenter, + .action = osmo_mgcpc_ep_fsm_handle_ci_events, + .in_event_mask = 0xffffffff, /* mgcp_client_fsm may send parent term anytime */ + .out_state_mask = 0 + | S(OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE) + , + }, +}; + +static int osmo_mgcpc_ep_fsm_timer_cb(struct osmo_fsm_inst *fi) +{ + int i; + struct osmo_mgcpc_ep *ep = osmo_mgcpc_ep_fi_mgwep(fi); + + switch (fi->T) { + default: + for (i = 0; i < ARRAY_SIZE(ep->ci); i++) { + struct osmo_mgcpc_ep_ci *ci = &ep->ci[i]; + if (!ci->occupied) + continue; + if (!(ci->pending && ci->sent)) + continue; + on_failure(ci); + } + return 0; + } + + return 0; +} + +static struct osmo_fsm osmo_mgcpc_ep_fsm = { + .name = "mgw-endpoint", + .states = osmo_mgcpc_ep_fsm_states, + .num_states = ARRAY_SIZE(osmo_mgcpc_ep_fsm_states), + .log_subsys = DLMGCP, + .event_names = osmo_mgcpc_ep_fsm_event_names, + .timer_cb = osmo_mgcpc_ep_fsm_timer_cb, + /* The FSM termination will automatically trigger any mgcp_client_fsm instances to DLCX. */ +}; diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c index 71f4310..75d583b 100644 --- a/src/libosmo-mgcp-client/mgcp_client_fsm.c +++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c @@ -700,3 +700,25 @@ } osmo_fsm_inst_dispatch(fi, EV_DLCX, mgcp_ctx); } + +const char *osmo_mgcpc_conn_peer_name(const struct mgcp_conn_peer *info) +{ + /* I'd be fine with a smaller buffer and accept truncation, but gcc possibly refuses to build if + * this buffer is too small. */ + static char buf[1024]; + + if (!info) + return "NULL"; + + if (info->endpoint[0] + && info->addr[0]) + snprintf(buf, sizeof(buf), "%s:%s:%u", + info->endpoint, info->addr, info->port); + else if (info->endpoint[0]) + snprintf(buf, sizeof(buf), "%s", info->endpoint); + else if (info->addr[0]) + snprintf(buf, sizeof(buf), "%s:%u", info->addr, info->port); + else + return "empty"; + return buf; +} -- To view, visit https://gerrit.osmocom.org/13590 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9a3effd38e72841529df6c135c077116981dea36 Gerrit-Change-Number: 13590 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 18:03:57 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 18:03:57 +0000 Subject: Change in osmo-mgw[master]: fix: multiple initial CRCX Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13591 Change subject: fix: multiple initial CRCX ...................................................................... fix: multiple initial CRCX The first CRCX responds with the actual MGW endpoint name that is assigned (at least for rtpbridge/*@mgw requests). If multiple CRCX are scheduled at the same time on a fresh MGW endpoint, both get fired with a '*' and each creates a separate MGW endpoint. Make mgcp_client_endpoint_fsm avoid this, and schedule only one CRCX at first, and the rest once the MGW endpoint name is fixated. It is thus possible to safely issue two osmo_mgcpc_ep_ci_request() at the same time. Change-Id: I92a9944acc96398acd6649f9c3c5badec5dd6dcc --- M src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c 1 file changed, 86 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/91/13591/1 diff --git a/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c b/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c index a50491f..e8ca527 100644 --- a/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c +++ b/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c @@ -101,6 +101,7 @@ struct osmo_fsm_inst *fi; char endpoint[MGCP_ENDPOINT_MAXLEN]; const struct osmo_tdef *T_defs; + bool first_crcx_complete; struct osmo_mgcpc_ep_ci ci[USABLE_CI]; }; @@ -114,6 +115,9 @@ {} }; +static void osmo_mgcpc_ep_count(struct osmo_mgcpc_ep *ep, int *occupied, int *pending_not_sent, + int *waiting_for_response); + static struct osmo_mgcpc_ep_ci *osmo_mgcpc_ep_check_ci(struct osmo_mgcpc_ep_ci *ci) { if (!ci) @@ -323,6 +327,49 @@ osmo_fsm_inst_dispatch(notify, notify_failure, notify_data); } +static int update_endpoint_name(struct osmo_mgcpc_ep_ci *ci, const char *new_endpoint_name) +{ + struct osmo_mgcpc_ep *ep = ci->ep; + int rc; + int i; + + if (!strcmp(ep->endpoint, new_endpoint_name)) { + /* Same endpoint name, nothing to do. */ + return 0; + } + + /* The endpoint name should only change on the very first CRCX response. */ + if (ep->first_crcx_complete) { + LOG_CI(ci, LOGL_ERROR, "Reponse returned mismatching endpoint name." + " This is endpoint %s, instead received %s\n", + ep->endpoint, new_endpoint_name); + on_failure(ci); + return -EINVAL; + } + + /* This is the first CRCX response, update endpoint name. */ + rc = OSMO_STRLCPY_ARRAY(ep->endpoint, new_endpoint_name); + if (rc <= 0 || rc >= sizeof(ep->endpoint)) { + LOG_CI(ci, LOGL_ERROR, "Unable to copy endpoint name %s\n", osmo_quote_str(new_endpoint_name, -1)); + osmo_mgcpc_ep_ci_dlcx(ci); + on_failure(ci); + return -ENOSPC; + } + + /* Make sure already pending requests use this updated endpoint name. */ + for (i = 0; i < ARRAY_SIZE(ep->ci); i++) { + struct osmo_mgcpc_ep_ci *other_ci = &ep->ci[i]; + if (!other_ci->occupied) + continue; + if (!other_ci->pending) + continue; + if (other_ci->sent) + continue; + OSMO_STRLCPY_ARRAY(other_ci->verb_info.endpoint, ep->endpoint); + } + return 0; +} + static void on_success(struct osmo_mgcpc_ep_ci *ci, void *data) { struct mgcp_conn_peer *rtp_info; @@ -343,17 +390,12 @@ osmo_strlcpy(ci->mgcp_ci_str, mgcp_conn_get_ci(ci->mgcp_client_fi), sizeof(ci->mgcp_ci_str)); if (rtp_info->endpoint[0]) { - int rc; - rc = osmo_strlcpy(ci->ep->endpoint, rtp_info->endpoint, - sizeof(ci->ep->endpoint)); - if (rc <= 0 || rc >= sizeof(ci->ep->endpoint)) { - LOG_CI(ci, LOGL_ERROR, "Unable to copy endpoint name '%s'\n", - rtp_info->endpoint); - osmo_mgcpc_ep_ci_dlcx(ci); - on_failure(ci); + /* On errors, this instance might already be deallocated. Make sure to not access anything after + * error. */ + if (update_endpoint_name(ci, rtp_info->endpoint)) return; - } } + ci->ep->first_crcx_complete = true; break; default: @@ -537,6 +579,7 @@ if (!ci->mgcp_client_fi){ LOG_CI_VERB(ci, LOGL_ERROR, "Cannot send\n"); on_failure(ci); + return -EINVAL; } osmo_fsm_inst_update_id(ci->mgcp_client_fi, ci->label); break; @@ -549,6 +592,7 @@ if (rc) { LOG_CI_VERB(ci, LOGL_ERROR, "Cannot send (rc=%d %s)\n", rc, strerror(-rc)); on_failure(ci); + return -EINVAL; } break; @@ -641,16 +685,47 @@ static void osmo_mgcpc_ep_fsm_wait_mgw_response_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { + static int re_enter = 0; + int rc; int count = 0; int i; struct osmo_mgcpc_ep *ep = osmo_mgcpc_ep_fi_mgwep(fi); + re_enter++; + OSMO_ASSERT(re_enter < 10); + + /* The first CRCX gives us the endpoint name in the CRCX response. So we must wait for the first CRCX endpoint + * response to come in before sending any other MGCP requests -- otherwise we might end up creating new + * endpoints instead of acting on the same. This FSM always sends out N requests and waits for all of them to + * complete before sending out new requests. Hence we're safe when the very first time at most one request is + * sent (which needs to be a CRCX). */ + for (i = 0; i < ARRAY_SIZE(ep->ci); i++) { - count += send_verb(&ep->ci[i]); + struct osmo_mgcpc_ep_ci *ci = &ep->ci[i]; + + /* Make sure that only CRCX get dispatched if no CRCX were sent yet. */ + if (!ep->first_crcx_complete) { + if (ci->occupied && ci->verb != MGCP_VERB_CRCX) + continue; + } + + rc = send_verb(&ep->ci[i]); + /* Need to be careful not to access the instance after failure. Event chains may already have + * deallocated this memory. */ + if (rc < 0) + return; + if (!rc) + continue; + count++; + /* Make sure that we wait for the first CRCX response before dispatching more requests. */ + if (!ep->first_crcx_complete) + break; } LOG_MGCPC_EP(ep, LOGL_DEBUG, "Sent messages: %d\n", count); - osmo_mgcpc_ep_fsm_check_state_chg_after_response(fi); + if (ep->first_crcx_complete) + osmo_mgcpc_ep_fsm_check_state_chg_after_response(fi); + re_enter--; } static void osmo_mgcpc_ep_fsm_handle_ci_events(struct osmo_fsm_inst *fi, uint32_t event, void *data) -- To view, visit https://gerrit.osmocom.org/13591 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I92a9944acc96398acd6649f9c3c5badec5dd6dcc Gerrit-Change-Number: 13591 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 18:05:00 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 18:05:00 +0000 Subject: Change in osmo-msc[master]: vlr_subscr: use osmo_use_count In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13136 to look at the new patch set (#3). Change subject: vlr_subscr: use osmo_use_count ...................................................................... vlr_subscr: use osmo_use_count Depends: Ife31e6798b4e728a23913179e346552a7dd338c0 (libosmocore) Change-Id: Ib06d030e8464abe415ff597d462ed40eeddef475 --- M include/osmocom/msc/db.h M include/osmocom/msc/ran_conn.h M include/osmocom/msc/sms_queue.h M include/osmocom/msc/vlr.h M include/osmocom/msc/vlr_sgs.h M src/libmsc/ctrl_commands.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_08_cc.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/msc_vty.c M src/libmsc/ran_conn.c M src/libmsc/sgs_iface.c M src/libmsc/smpp_openbsc.c M src/libmsc/sms_queue.c M src/libmsc/transaction.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M src/libvlr/vlr_sgs.c M tests/msc_vlr/msc_vlr_test_authen_reuse.c M tests/msc_vlr/msc_vlr_test_authen_reuse.err M tests/msc_vlr/msc_vlr_test_call.c M tests/msc_vlr/msc_vlr_test_call.err M tests/msc_vlr/msc_vlr_test_gsm_authen.c M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.c M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.c M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.c M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.c M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_ss.c M tests/msc_vlr/msc_vlr_test_ss.err M tests/msc_vlr/msc_vlr_test_umts_authen.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/sms_queue/sms_queue_test.c 45 files changed, 2,350 insertions(+), 2,287 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/36/13136/3 -- To view, visit https://gerrit.osmocom.org/13136 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib06d030e8464abe415ff597d462ed40eeddef475 Gerrit-Change-Number: 13136 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-CC: Max -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 18:05:02 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 18:05:02 +0000 Subject: Change in osmo-msc[master]: enable osmo_fsm_term_safely(), apply logging changes Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13592 Change subject: enable osmo_fsm_term_safely(), apply logging changes ...................................................................... enable osmo_fsm_term_safely(), apply logging changes Start using osmo_fsm_term_safely(true), the recently added feature of libosmocore's fsm.c. Deallocates in slightly changed order and with slightly modified logging. Adjust test expectations. Depends: I8eda67540a1cd444491beb7856b9fcd0a3143b18 (libosmocore) Change-Id: I195a719d9ec1f6764ee5a361244f59f0144dc253 --- M src/osmo-msc/msc_main.c M tests/msc_vlr/msc_vlr_test_authen_reuse.err M tests/msc_vlr/msc_vlr_test_call.err M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_ss.err M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c 14 files changed, 627 insertions(+), 1,140 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/92/13592/1 -- To view, visit https://gerrit.osmocom.org/13592 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I195a719d9ec1f6764ee5a361244f59f0144dc253 Gerrit-Change-Number: 13592 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 18:05:02 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 18:05:02 +0000 Subject: Change in osmo-msc[master]: gsm_04_08_cc: improve logging for CC trans Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13593 Change subject: gsm_04_08_cc: improve logging for CC trans ...................................................................... gsm_04_08_cc: improve logging for CC trans Pass trans around more functions as log context. Add missing "rx" logging for two cases. Change-Id: If79f724a2faca70023271398c618cfe490fb294e --- M src/libmsc/gsm_04_08_cc.c 1 file changed, 12 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/93/13593/1 diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c index 4475d05..62b5d12 100644 --- a/src/libmsc/gsm_04_08_cc.c +++ b/src/libmsc/gsm_04_08_cc.c @@ -1601,7 +1601,7 @@ return mncc_recvmsg(trans->net, trans, MNCC_USERINFO_IND, &user); } -static void mncc_recv_rtp(struct gsm_network *net, uint32_t callref, +static void mncc_recv_rtp(struct gsm_network *net, struct gsm_trans *trans, uint32_t callref, int cmd, uint32_t addr, uint16_t port, uint32_t payload_type, uint32_t payload_msg_type) { @@ -1617,7 +1617,7 @@ rtp->port = port; rtp->payload_type = payload_type; rtp->payload_msg_type = payload_msg_type; - mncc_recvmsg(net, NULL, cmd, (struct gsm_mncc *)data); + mncc_recvmsg(net, trans, cmd, (struct gsm_mncc *)data); } static void mncc_recv_rtp_sock(struct gsm_network *net, struct gsm_trans *trans, int cmd) @@ -1652,16 +1652,16 @@ * lchan->abis_ip.rtp_payload */ uint32_t payload_type = 0; - return mncc_recv_rtp(net, trans->callref, cmd, + return mncc_recv_rtp(net, trans, trans->callref, cmd, addr, port, payload_type, msg_type); } -static void mncc_recv_rtp_err(struct gsm_network *net, uint32_t callref, int cmd) +static void mncc_recv_rtp_err(struct gsm_network *net, struct gsm_trans *trans, uint32_t callref, int cmd) { - return mncc_recv_rtp(net, callref, cmd, 0, 0, 0, 0); + return mncc_recv_rtp(net, trans, callref, cmd, 0, 0, 0, 0); } static int tch_rtp_create(struct gsm_network *net, uint32_t callref) @@ -1672,15 +1672,16 @@ trans = trans_find_by_callref(net, callref); if (!trans) { LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); + mncc_recv_rtp_err(net, trans, callref, MNCC_RTP_CREATE); return -EIO; } log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); if (!trans->conn) { LOG_TRANS_CAT(trans, DMNCC, LOGL_NOTICE, "RTP create for trans without conn\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); + mncc_recv_rtp_err(net, trans, callref, MNCC_RTP_CREATE); return 0; } + LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "rx %s\n", get_mncc_name(MNCC_RTP_CREATE)); /* When we call msc_mgcp_call_assignment() we will trigger, depending * on the RAN type the call assignment on the A or Iu interface. @@ -1733,16 +1734,18 @@ trans = trans_find_by_callref(net, rtp->callref); if (!trans) { LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR, "RTP connect for non-existing trans\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); + mncc_recv_rtp_err(net, trans, rtp->callref, MNCC_RTP_CONNECT); return -EIO; } log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); if (!trans->conn) { LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR, "RTP connect for trans without conn\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); + mncc_recv_rtp_err(net, trans, rtp->callref, MNCC_RTP_CONNECT); return 0; } + LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "rx %s\n", get_mncc_name(MNCC_RTP_CONNECT)); + addr.s_addr = osmo_htonl(rtp->ip); return msc_mgcp_call_complete(trans, rtp->port, inet_ntoa(addr)); } -- To view, visit https://gerrit.osmocom.org/13593 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If79f724a2faca70023271398c618cfe490fb294e Gerrit-Change-Number: 13593 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 18:11:09 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 18:11:09 +0000 Subject: Change in osmo-msc[master]: sms queue: avoid repeated Paging for a failed SMS In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Keith Whyte, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13173 to look at the new patch set (#4). Change subject: sms queue: avoid repeated Paging for a failed SMS ...................................................................... sms queue: avoid repeated Paging for a failed SMS A Paging might be attempted multiple times by the MSC, but if the MSC's paging code decides that Paging failed, then that is that and pending requests should end in failure. Make the SMS code heed that. So far, sms_pending_failed() starts a new sms_queue_trigger() run. The intention behind that might have been to fill up the queue when sending SMS has failed, but the practical effect is actually bad: As current ttcn3-msc-test runs show, a failed MT SMS gets triggered multiple times in short succession, i.e. osmo-msc repeatedly sends Paging Requests for the same subscriber. This is not because Paging decides that it might succeed if we Page again -- this is a Paging failure being dispatched to the SMS code, which then in turn re-launches Paging from scratch. This special case happens actually only when there are few SMS still in the DB to be delivered. In the TTCN3 test, there is exactly one MT SMS for one subscriber, and retriggering the queue brings up the same SMS every time. See f_tc_lu_and_mt_sms_paging_and_nothing() and f_tc_sgsap_mt_sms_and_nothing() which say: "/* Expect the MSC to page exactly 10 times before giving up */" Fix: do not immediately trigger the SMS queue on a failed MT SMS. Instead, leave it up to the periodical SMS queue trigger to decide. This patch will cause the MT SMS tests in ttcn3-msc-tests to fail, because the test expectations are bogus. The patch fixing the test run is listed 'Related' below. Related: I7dce12942a65eaaf97f78ca69401c7f93faacb9e (osmo-ttcn3-hacks) Change-Id: I24bf9f1c1167efe1080ae4cf47ed2ef0bd981e49 --- M src/libmsc/sms_queue.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/73/13173/4 -- To view, visit https://gerrit.osmocom.org/13173 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I24bf9f1c1167efe1080ae4cf47ed2ef0bd981e49 Gerrit-Change-Number: 13173 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 18:11:09 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 18:11:09 +0000 Subject: Change in osmo-msc[master]: vlr_subscr: use osmo_use_count In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13136 to look at the new patch set (#4). Change subject: vlr_subscr: use osmo_use_count ...................................................................... vlr_subscr: use osmo_use_count Depends: Ife31e6798b4e728a23913179e346552a7dd338c0 (libosmocore) Change-Id: Ib06d030e8464abe415ff597d462ed40eeddef475 --- M include/osmocom/msc/db.h M include/osmocom/msc/ran_conn.h M include/osmocom/msc/sms_queue.h M include/osmocom/msc/vlr.h M include/osmocom/msc/vlr_sgs.h M src/libmsc/ctrl_commands.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_08_cc.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/msc_vty.c M src/libmsc/ran_conn.c M src/libmsc/sgs_iface.c M src/libmsc/smpp_openbsc.c M src/libmsc/sms_queue.c M src/libmsc/transaction.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M src/libvlr/vlr_sgs.c M tests/msc_vlr/msc_vlr_test_authen_reuse.c M tests/msc_vlr/msc_vlr_test_authen_reuse.err M tests/msc_vlr/msc_vlr_test_call.c M tests/msc_vlr/msc_vlr_test_call.err M tests/msc_vlr/msc_vlr_test_gsm_authen.c M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.c M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.c M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.c M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.c M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_ss.c M tests/msc_vlr/msc_vlr_test_ss.err M tests/msc_vlr/msc_vlr_test_umts_authen.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/sms_queue/sms_queue_test.c 45 files changed, 2,350 insertions(+), 2,287 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/36/13136/4 -- To view, visit https://gerrit.osmocom.org/13136 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib06d030e8464abe415ff597d462ed40eeddef475 Gerrit-Change-Number: 13136 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-CC: Max -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 18:11:09 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 18:11:09 +0000 Subject: Change in osmo-msc[master]: gsm_04_08_cc: improve logging for CC trans In-Reply-To: References: Message-ID: Neels Hofmeyr has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13593 ) Change subject: gsm_04_08_cc: improve logging for CC trans ...................................................................... gsm_04_08_cc: improve logging for CC trans Pass trans around more functions as log context. Add missing "rx" logging for two cases. Change-Id: If79f724a2faca70023271398c618cfe490fb294e --- M src/libmsc/gsm_04_08_cc.c 1 file changed, 12 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/93/13593/2 -- To view, visit https://gerrit.osmocom.org/13593 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If79f724a2faca70023271398c618cfe490fb294e Gerrit-Change-Number: 13593 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-CC: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 18:12:59 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 18:12:59 +0000 Subject: Change in osmo-hlr[master]: hlr.c: forward GSUP messages between clients In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13006 ) Change subject: hlr.c: forward GSUP messages between clients ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 Gerrit-Change-Number: 13006 Gerrit-PatchSet: 7 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 10 Apr 2019 18:12:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:32:06 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:32:06 +0000 Subject: Change in osmo-msc[master]: smpp: Make libsmpp34 use talloc for its allocations In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13562 ) Change subject: smpp: Make libsmpp34 use talloc for its allocations ...................................................................... Patch Set 2: Indeed, I would be happy if there were no changes made to my original change, including the API naming. The naming follows 1:1 how the interface of libsofia-sip works, and we provide the talloc wrappers for it in osmo-sip-connector. @vadim: please revert. -- To view, visit https://gerrit.osmocom.org/13562 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Gerrit-Change-Number: 13562 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 10 Apr 2019 22:32:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:39:20 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:39:20 +0000 Subject: Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13392 ) Change subject: fsm: support graceful osmo_fsm_inst_term() cascades ...................................................................... Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13392 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 Gerrit-Change-Number: 13392 Gerrit-PatchSet: 8 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 10 Apr 2019 22:39:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:39:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:39:45 +0000 Subject: Change in libosmocore[master]: make osmo_sockaddr_str_is_set() NULL-safe In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13572 ) Change subject: make osmo_sockaddr_str_is_set() NULL-safe ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13572 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iac025cf4d556cbed99f3924cd9ca05a05881cd9a Gerrit-Change-Number: 13572 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 10 Apr 2019 22:39:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:39:53 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:39:53 +0000 Subject: Change in libosmocore[master]: add osmo_str_startswith() In-Reply-To: References: Message-ID: Harald Welte has removed a vote on this change. Change subject: add osmo_str_startswith() ...................................................................... Removed Code-Review-1 by Max -- To view, visit https://gerrit.osmocom.org/13394 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: deleteVote Gerrit-Change-Id: Ib2ffb0e9a870dd52e081c7e66d8818057d159513 Gerrit-Change-Number: 13394 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:39:55 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:39:55 +0000 Subject: Change in libosmocore[master]: add osmo_str_startswith() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13394 ) Change subject: add osmo_str_startswith() ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13394 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib2ffb0e9a870dd52e081c7e66d8818057d159513 Gerrit-Change-Number: 13394 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Comment-Date: Wed, 10 Apr 2019 22:39:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:41:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:41:54 +0000 Subject: Change in libosmocore[master]: add osmo_{escape, quote}_str_buf2() for OSMO_STRBUF_APPEND() use In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13573 ) Change subject: add osmo_{escape,quote}_str_buf2() for OSMO_STRBUF_APPEND() use ...................................................................... Patch Set 1: I see some overlap here with my _buf changes -- To view, visit https://gerrit.osmocom.org/13573 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae Gerrit-Change-Number: 13573 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 10 Apr 2019 22:41:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:42:33 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:42:33 +0000 Subject: Change in libosmocore[master]: Add _c versions of functions that otherwise return static buffers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13311 ) Change subject: Add _c versions of functions that otherwise return static buffers ...................................................................... Add _c versions of functions that otherwise return static buffers We have a habit of returning static buffers from some functions, particularly when generating some kind of string values. This is convenient in terms of memory management, but it comes at the expense of not being thread-safe, and not allowing for two calls of the related function within one printf() statement. Let's introduce _c suffix versions of those functions where the caller passes in a talloc context from which the output buffer shall be allocated. Change-Id: I8481c19b68ff67cfa22abb93c405ebcfcb0ab19b --- M include/osmocom/core/msgb.h M include/osmocom/core/socket.h M include/osmocom/core/utils.h M include/osmocom/gprs/gprs_ns.h M include/osmocom/gsm/abis_nm.h M include/osmocom/gsm/apn.h M include/osmocom/gsm/gsm0808_utils.h M include/osmocom/gsm/gsm23003.h M include/osmocom/gsm/gsm48.h M include/osmocom/gsm/gsm_utils.h M include/osmocom/gsm/protocol/gsm_04_08.h M include/osmocom/gsm/rsl.h M include/osmocom/sim/sim.h M src/gb/gprs_ns.c M src/gb/libosmogb.map M src/gsm/abis_nm.c M src/gsm/apn.c M src/gsm/gsm0808_utils.c M src/gsm/gsm23003.c M src/gsm/gsm48.c M src/gsm/gsm_utils.c M src/gsm/libosmogsm.map M src/gsm/rsl.c M src/msgb.c M src/sim/core.c M src/socket.c M src/utils.c 27 files changed, 474 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 0c51ce2..e05d37f 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -60,6 +60,7 @@ unsigned char _data[0]; /*!< optional immediate data array */ }; +extern struct msgb *msgb_alloc_c(const void *ctx, uint16_t size, const char *name); extern struct msgb *msgb_alloc(uint16_t size, const char *name); extern void msgb_free(struct msgb *m); extern void msgb_enqueue(struct llist_head *queue, struct msgb *msg); @@ -68,9 +69,11 @@ uint16_t msgb_length(const struct msgb *msg); extern const char *msgb_hexdump(const struct msgb *msg); char *msgb_hexdump_buf(char *buf, size_t buf_len, const struct msgb *msg); +char *msgb_hexdump_c(const void *ctx, const struct msgb *msg); extern int msgb_resize_area(struct msgb *msg, uint8_t *area, int old_size, int new_size); extern struct msgb *msgb_copy(const struct msgb *msg, const char *name); +extern struct msgb *msgb_copy_c(const void *ctx, const struct msgb *msg, const char *name); static int msgb_test_invariant(const struct msgb *msg) __attribute__((pure)); /*! Free all msgbs from a queue built with msgb_enqueue(). @@ -501,6 +504,29 @@ return msgb_trim(msg, (msg->l3h - msg->data) + l3len); } +/*! Allocate message buffer with specified headroom from specified talloc context. + * \param[in] ctx talloc context from which to allocate + * \param[in] size size in bytes, including headroom + * \param[in] headroom headroom in bytes + * \param[in] name human-readable name + * \returns allocated message buffer with specified headroom + * + * This function is a convenience wrapper around \ref msgb_alloc + * followed by \ref msgb_reserve in order to create a new \ref msgb with + * user-specified amount of headroom. + */ +static inline struct msgb *msgb_alloc_headroom_c(const void *ctx, int size, int headroom, + const char *name) +{ + osmo_static_assert(size > headroom, headroom_bigger); + + struct msgb *msg = msgb_alloc_c(ctx, size, name); + if (msg) + msgb_reserve(msg, headroom); + return msg; +} + + /*! Allocate message buffer with specified headroom * \param[in] size size in bytes, including headroom * \param[in] headroom headroom in bytes diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index 4f6ed72..37b1eae 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -68,6 +68,7 @@ char *osmo_sock_get_name(const void *ctx, int fd); const char *osmo_sock_get_name2(int fd); +char *osmo_sock_get_name2_c(const void *ctx, int fd); int osmo_sock_get_name_buf(char *str, size_t str_len, int fd); int osmo_sock_get_ip_and_port(int fd, char *ip, size_t ip_len, char *port, size_t port_len, bool local); int osmo_sock_get_local_ip(int fd, char *host, size_t len); diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 6a2b7d5..51e43ee 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -56,7 +56,9 @@ char *osmo_ubit_dump_buf(char *buf, size_t buf_len, const uint8_t *bits, unsigned int len); char *osmo_ubit_dump(const uint8_t *bits, unsigned int len); char *osmo_hexdump(const unsigned char *buf, int len); +char *osmo_hexdump_c(const void *ctx, const unsigned char *buf, int len); char *osmo_hexdump_nospc(const unsigned char *buf, int len); +char *osmo_hexdump_nospc_c(const void *ctx, const unsigned char *buf, int len); const char *osmo_hexdump_buf(char *out_buf, size_t out_buf_size, const unsigned char *buf, int len, const char *delim, bool delim_after_last); @@ -73,9 +75,11 @@ size_t osmo_str_tolower_buf(char *dest, size_t dest_len, const char *src); const char *osmo_str_tolower(const char *src); +char *osmo_str_tolower_c(const void *ctx, const char *src); size_t osmo_str_toupper_buf(char *dest, size_t dest_len, const char *src); const char *osmo_str_toupper(const char *src); +char *osmo_str_toupper_c(const void *ctx, const char *src); #define OSMO_SNPRINTF_RET(ret, rem, offset, len) \ do { \ @@ -139,8 +143,10 @@ const char *osmo_escape_str(const char *str, int len); char *osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize); +char *osmo_escape_str_c(const void *ctx, const char *str, int in_len); const char *osmo_quote_str(const char *str, int in_len); char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize); +char *osmo_quote_str_c(const void *ctx, const char *str, int in_len); uint32_t osmo_isqrt32(uint32_t x); diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index ed155ff..02faa50 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -213,6 +213,7 @@ const char *gprs_ns_ll_str(const struct gprs_nsvc *nsvc); /* Return peer info in user-supplied buffer */ char *gprs_ns_ll_str_buf(char *buf, size_t buf_len, const struct gprs_nsvc *nsvc); +char *gprs_ns_ll_str_c(const void *ctx, const struct gprs_nsvc *nsvc); /* Copy the link layer info from other into nsvc */ void gprs_ns_ll_copy(struct gprs_nsvc *nsvc, struct gprs_nsvc *other); diff --git a/include/osmocom/gsm/abis_nm.h b/include/osmocom/gsm/abis_nm.h index 788727c..ab5a5d5 100644 --- a/include/osmocom/gsm/abis_nm.h +++ b/include/osmocom/gsm/abis_nm.h @@ -43,6 +43,7 @@ const char *abis_nm_dump_foh(const struct abis_om_fom_hdr *foh); char *abis_nm_dump_foh_buf(char *buf, size_t buf_len, const struct abis_om_fom_hdr *foh); +char *abis_nm_dump_foh_c(void *ctx, const struct abis_om_fom_hdr *foh); /*! write a human-readable OML header to the debug log * \param[in] ss Logging sub-system diff --git a/include/osmocom/gsm/apn.h b/include/osmocom/gsm/apn.h index 7899bb2..ab5f493 100644 --- a/include/osmocom/gsm/apn.h +++ b/include/osmocom/gsm/apn.h @@ -12,6 +12,7 @@ char *osmo_apn_qualify(unsigned int mcc, unsigned int mnc, const char *ni); char *osmo_apn_qualify_buf(char *buf, size_t buf_len, unsigned int mcc, unsigned int mnc, const char *ni); +char *osmo_apn_qualify_c(const void *ctx, unsigned int mcc, unsigned int mnc, const char *ni); /* Compose a string of the form '.mnc001.mcc002.gprs\0', returned in a * static buffer. */ @@ -19,6 +20,7 @@ const char *ni, int have_3dig_mnc); char *osmo_apn_qualify_from_imsi_buf(char *buf, size_t buf_len, const char *imsi, const char *ni, int have_3dig_mnc); +char *osmo_apn_qualify_from_imsi_c(const void *ctx, const char *imsi, const char *ni, int have_3dig_mnc); int osmo_apn_from_str(uint8_t *apn_enc, size_t max_apn_enc_len, const char *str); char *osmo_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t apn_enc_len); diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index e246967..47c4e95 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -70,6 +70,7 @@ char *osmo_lcls_dump(const struct osmo_lcls *lcls); char *osmo_lcls_dump_buf(char *buf, size_t buf_len, const struct osmo_lcls *lcls); +char *osmo_lcls_dump_c(void *ctx, const struct osmo_lcls *lcls); char *osmo_gcr_dump(const struct osmo_lcls *lcls); char *osmo_gcr_dump_buf(char *buf, size_t buf_len, const struct osmo_lcls *lcls); @@ -79,8 +80,11 @@ const char *gsm0808_cell_id_name(const struct gsm0808_cell_id *cid); const char *gsm0808_cell_id_name2(const struct gsm0808_cell_id *cid); +char *gsm0808_cell_id_name_buf(char *buf, size_t buflen, const struct gsm0808_cell_id *cid); +char *gsm0808_cell_id_name_c(const void *ctx, const struct gsm0808_cell_id *cid); const char *gsm0808_cell_id_list_name(const struct gsm0808_cell_id_list2 *cil); int gsm0808_cell_id_list_name_buf(char *buf, size_t buflen, const struct gsm0808_cell_id_list2 *cil); +char *gsm0808_cell_id_list_name_c(const void *ctx, const struct gsm0808_cell_id_list2 *cil); int gsm0808_cell_id_u_name(char *buf, size_t buflen, enum CELL_IDENT id_discr, const union gsm0808_cell_id_u *u); bool gsm0808_cell_ids_match(const struct gsm0808_cell_id *id1, const struct gsm0808_cell_id *id2, bool exact_match); @@ -254,5 +258,6 @@ const char *gsm0808_channel_type_name(const struct gsm0808_channel_type *ct); char *gsm0808_channel_type_name_buf(char *buf, size_t buf_len, const struct gsm0808_channel_type *ct); +char *gsm0808_channel_type_name_c(const void *ctx, const struct gsm0808_channel_type *ct); /*! @} */ diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h index 88c4f3c..69f00f6 100644 --- a/include/osmocom/gsm/gsm23003.h +++ b/include/osmocom/gsm/gsm23003.h @@ -106,18 +106,24 @@ const char *osmo_mcc_name(uint16_t mcc); char *osmo_mcc_name_buf(char *buf, size_t buf_len, uint16_t mcc); +const char *osmo_mcc_name_c(const void *ctx, uint16_t mcc); const char *osmo_mnc_name(uint16_t mnc, bool mnc_3_digits); char *osmo_mnc_name_buf(char *buf, size_t buf_len, uint16_t mnc, bool mnc_3_digits); +char *osmo_mnc_name_c(const void *ctx, uint16_t mnc, bool mnc_3_digits); const char *osmo_plmn_name(const struct osmo_plmn_id *plmn); const char *osmo_plmn_name2(const struct osmo_plmn_id *plmn); char *osmo_plmn_name_buf(char *buf, size_t buf_len, const struct osmo_plmn_id *plmn); +char *osmo_plmn_name_c(const void *ctx, const struct osmo_plmn_id *plmn); const char *osmo_lai_name(const struct osmo_location_area_id *lai); char *osmo_lai_name_buf(char *buf, size_t buf_len, const struct osmo_location_area_id *lai); +char *osmo_lai_name_c(const void *ctx, const struct osmo_location_area_id *lai); const char *osmo_cgi_name(const struct osmo_cell_global_id *cgi); const char *osmo_cgi_name2(const struct osmo_cell_global_id *cgi); char *osmo_cgi_name_buf(char *buf, size_t buf_len, const struct osmo_cell_global_id *cgi); +char *osmo_cgi_name_c(const void *ctx, const struct osmo_cell_global_id *cgi); const char *osmo_gummei_name(const struct osmo_gummei *gummei); char *osmo_gummei_name_buf(char *buf, size_t buf_len, const struct osmo_gummei *gummei); +char *osmo_gummei_name_c(const void *ctx, const struct osmo_gummei *gummei); void osmo_plmn_to_bcd(uint8_t *bcd_dst, const struct osmo_plmn_id *plmn); void osmo_plmn_from_bcd(const uint8_t *bcd_src, struct osmo_plmn_id *plmn); diff --git a/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index 81b2bf0..786fbc9 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -36,6 +36,7 @@ const char *rr_cause_name(uint8_t cause); const char *osmo_rai_name(const struct gprs_ra_id *rai); char *osmo_rai_name_buf(char *buf, size_t buf_len, const struct gprs_ra_id *rai); +char *osmo_rai_name_c(const void *ctx, const struct gprs_ra_id *rai); int gsm48_decode_lai(struct gsm48_loc_area_id *lai, uint16_t *mcc, uint16_t *mnc, uint16_t *lac) @@ -57,6 +58,7 @@ const char *gsm48_mi_type_name(uint8_t mi); const char *osmo_mi_name(const uint8_t *mi, uint8_t mi_len); char *osmo_mi_name_buf(char *buf, size_t buf_len, const uint8_t *mi, uint8_t mi_len); +char *osmo_mi_name_c(const void *ctx, const uint8_t *mi, uint8_t mi_len); /* Parse Routeing Area Identifier */ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf); diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h index f48cc68..37df665 100644 --- a/include/osmocom/gsm/gsm_utils.h +++ b/include/osmocom/gsm/gsm_utils.h @@ -181,6 +181,7 @@ /* Returns static buffer with string representation of a GSM Time */ char *osmo_dump_gsmtime(const struct gsm_time *tm); char *osmo_dump_gsmtime_buf(char *buf, size_t buf_len, const struct gsm_time *tm); +char *osmo_dump_gsmtime_c(const void *ctx, const struct gsm_time *tm); /* GSM TS 03.03 Chapter 2.6 */ enum gprs_tlli_type { diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index c97df16..16910c3 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -71,6 +71,7 @@ int osmo_gsm48_classmark_supports_a5(const struct osmo_gsm48_classmark *cm, uint8_t a5); const char *osmo_gsm48_classmark_a5_name(const struct osmo_gsm48_classmark *cm); char *osmo_gsm48_classmark_a5_name_buf(char *buf, size_t buf_len, const struct osmo_gsm48_classmark *cm); +char *osmo_gsm48_classmark_a5_name_c(const void *ctx, const struct osmo_gsm48_classmark *cm); void osmo_gsm48_classmark_update(struct osmo_gsm48_classmark *dst, const struct osmo_gsm48_classmark *src); /* Chapter 10.5.2.1b.3 */ @@ -1645,6 +1646,7 @@ extern const struct value_string gsm48_cc_msgtype_names[]; const char *gsm48_pdisc_msgtype_name(uint8_t pdisc, uint8_t msg_type); char *gsm48_pdisc_msgtype_name_buf(char *buf, size_t buf_len, uint8_t pdisc, uint8_t msg_type); +char *gsm48_pdisc_msgtype_name_c(const void *ctx, uint8_t pdisc, uint8_t msg_type); /* FIXME: Table 10.4 / 10.4a (GPRS) */ diff --git a/include/osmocom/gsm/rsl.h b/include/osmocom/gsm/rsl.h index 4a1da3a..285dbc2 100644 --- a/include/osmocom/gsm/rsl.h +++ b/include/osmocom/gsm/rsl.h @@ -32,6 +32,7 @@ /* Turns channel number into a string */ char *rsl_chan_nr_str_buf(char *buf, size_t buf_len, uint8_t chan_nr); const char *rsl_chan_nr_str(uint8_t chan_nr); +char *rsl_chan_nr_str_c(const void *ctx, uint8_t chan_nr); const char *rsl_err_name(uint8_t err); diff --git a/include/osmocom/sim/sim.h b/include/osmocom/sim/sim.h index 0490dcd..2bc4715 100644 --- a/include/osmocom/sim/sim.h +++ b/include/osmocom/sim/sim.h @@ -298,6 +298,7 @@ struct osim_card_hdl; char *osim_print_sw_buf(char *buf, size_t buf_len, const struct osim_card_hdl *ch, uint16_t sw_in); char *osim_print_sw(const struct osim_card_hdl *ch, uint16_t sw_in); +char *osim_print_sw_c(const void *ctx, const struct osim_card_hdl *ch, uint16_t sw_in); extern const struct tlv_definition ts102221_fcp_tlv_def; extern const struct value_string ts102221_fcp_vals[14]; diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index fc120ce..d72003e 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -1552,6 +1552,14 @@ return gprs_ns_ll_str_buf(buf, sizeof(buf), nsvc); } +char *gprs_ns_ll_str_c(const void *ctx, const struct gprs_nsvc *nsvc) +{ + char *buf = talloc_size(ctx, INET6_ADDRSTRLEN+10); + if (!buf) + return buf; + return gprs_ns_ll_str_buf(buf, INET6_ADDRSTRLEN+10, nsvc); +} + void gprs_ns_ll_copy(struct gprs_nsvc *nsvc, struct gprs_nsvc *other) { nsvc->ll = other->ll; diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map index 21929da..5e675a6 100644 --- a/src/gb/libosmogb.map +++ b/src/gb/libosmogb.map @@ -65,6 +65,7 @@ gprs_ns_vty_init; gprs_ns_ll_str; gprs_ns_ll_str_buf; +gprs_ns_ll_str_c; gprs_ns_ll_copy; gprs_ns_ll_clear; gprs_ns_msgb_alloc; diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c index e25fdd0..a4c0e41 100644 --- a/src/gsm/abis_nm.c +++ b/src/gsm/abis_nm.c @@ -943,6 +943,15 @@ return abis_nm_dump_foh_buf(foh_buf, sizeof(foh_buf), foh); } +char *abis_nm_dump_foh_c(void *ctx, const struct abis_om_fom_hdr *foh) +{ + size_t len = 15 /* format */ + 22 /* obj_class_name */+ 4*3 /* uint8 */ + 1 /*nul*/; + char *buf = talloc_size(ctx, len); + if (!buf) + return NULL; + return abis_nm_dump_foh_buf(buf, len, foh); +} + /* this is just for compatibility reasons, it is now a macro */ #undef abis_nm_debugp_foh OSMO_DEPRECATED("Use abis_nm_debugp_foh macro instead") diff --git a/src/gsm/apn.c b/src/gsm/apn.c index 4ab370c..88b45a4 100644 --- a/src/gsm/apn.c +++ b/src/gsm/apn.c @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -45,6 +46,13 @@ return osmo_apn_qualify_buf(apn_strbuf, sizeof(apn_strbuf), mcc, mnc, ni); } +char *osmo_apn_qualify_c(const void *ctx, unsigned int mcc, unsigned int mnc, const char *ni) +{ + char *buf = talloc_size(ctx, APN_MAXLEN); + if (!buf) + return NULL; + return osmo_apn_qualify_buf(buf, APN_MAXLEN, mcc, mnc, ni); +} char *osmo_apn_qualify_from_imsi_buf(char *buf, size_t buf_len, const char *imsi, const char *ni, int have_3dig_mnc) @@ -70,6 +78,14 @@ return osmo_apn_qualify_from_imsi_buf(apn_strbuf, sizeof(apn_strbuf), imsi, ni, have_3dig_mnc); } +char *osmo_apn_qualify_from_imsi_c(const void *ctx, const char *imsi, const char *ni, int have_3dig_mnc) +{ + char *buf = talloc_size(ctx, APN_MAXLEN); + if (!buf) + return NULL; + return osmo_apn_qualify_from_imsi_buf(buf, APN_MAXLEN, imsi, ni, have_3dig_mnc); +} + /** * Convert an encoded APN into a dot-separated string. * diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index 52e4674..99cf188 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -622,6 +622,14 @@ return osmo_lcls_dump_buf(dbuf, sizeof(dbuf), lcls); } +char *osmo_lcls_dump_c(void *ctx, const struct osmo_lcls *lcls) +{ + char *buf = talloc_size(ctx, 256); + if (!buf) + return NULL; + return osmo_lcls_dump_buf(buf, 256, lcls); +} + /*! Dump GCR struct into string for printing. * \param[out] buf caller-allocated output string buffer * \param[in] buf_len size of buf in bytes @@ -1775,8 +1783,7 @@ #define APPEND_STR(fmt, args...) APPEND_THING(snprintf, fmt, ##args) #define APPEND_CELL_ID_U(DISCR, U) APPEND_THING(gsm0808_cell_id_u_name, DISCR, U) -static const char *gsm0808_cell_id_name_buf(const struct gsm0808_cell_id *cid, - char *buf, size_t buflen) +char *gsm0808_cell_id_name_buf(char *buf, size_t buflen, const struct gsm0808_cell_id *cid) { char *pos = buf; int total_len = 0; @@ -1793,7 +1800,7 @@ const char *gsm0808_cell_id_name(const struct gsm0808_cell_id *cid) { static char buf[64]; - return gsm0808_cell_id_name_buf(cid, buf, sizeof(buf)); + return gsm0808_cell_id_name_buf(buf, sizeof(buf), cid); } /*! Like gsm0808_cell_id_name() but uses a different static buffer. @@ -1803,7 +1810,15 @@ const char *gsm0808_cell_id_name2(const struct gsm0808_cell_id *cid) { static char buf[64]; - return gsm0808_cell_id_name_buf(cid, buf, sizeof(buf)); + return gsm0808_cell_id_name_buf(buf, sizeof(buf), cid); +} + +char *gsm0808_cell_id_name_c(const void *ctx, const struct gsm0808_cell_id *cid) +{ + char *buf = talloc_size(ctx, 64); + if (!buf) + return NULL; + return gsm0808_cell_id_name_buf(buf, 64, cid); } /*! Return a human readable representation of the Cell Identifier List, like @@ -1856,6 +1871,15 @@ return buf; } +char *gsm0808_cell_id_list_name_c(const void *ctx, const struct gsm0808_cell_id_list2 *cil) +{ + char *buf = talloc_size(ctx, 1024); + if (!buf) + return NULL; + gsm0808_cell_id_list_name_buf(buf, 1024, cil); + return buf; +} + #undef APPEND_STR #undef APPEND_CELL_ID_U @@ -1873,4 +1897,12 @@ return gsm0808_channel_type_name_buf(buf, sizeof(buf), ct); } +char *gsm0808_channel_type_name_c(const void *ctx, const struct gsm0808_channel_type *ct) +{ + char *buf = talloc_size(ctx, 128); + if (!buf) + return NULL; + return gsm0808_channel_type_name_buf(buf, 128, ct); +} + /*! @} */ diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c index bbfe236..2252f70 100644 --- a/src/gsm/gsm23003.c +++ b/src/gsm/gsm23003.c @@ -111,6 +111,19 @@ return osmo_mcc_name_buf(buf, sizeof(buf), mcc); } +/*! Return MCC string as standardized 3-digit with leading zeros, into a talloc-allocated buffer. + * \param[in] ctx talloc context from which to allocate output buffer + * \param[in] mcc MCC value. + * \returns string in dynamically allocated buffer. + */ +const char *osmo_mcc_name_c(const void *ctx, uint16_t mcc) +{ + char *buf = talloc_size(ctx, 8); + if (!buf) + return NULL; + return osmo_mcc_name_buf(buf, 8, mcc); +} + /*! Return MNC string as standardized 2- or 3-digit with leading zeros. * \param[out] buf caller-allocated output buffer * \param[in] buf_len size of buf in bytes @@ -124,6 +137,20 @@ return buf; } +/*! Return MNC string as standardized 2- or 3-digit with leading zeros, into a talloc-allocated buffer. + * \param[in] ctx talloc context from which to allocate output buffer + * \param[in] mnc MNC value. + * \param[in] mnc_3_digits True if an MNC should fill three digits, only has an effect if MNC < 100. + * \returns string in dynamically allocated buffer. + */ +char *osmo_mnc_name_c(const void *ctx, uint16_t mnc, bool mnc_3_digits) +{ + char *buf = talloc_size(ctx, 8); + if (!buf) + return buf; + return osmo_mnc_name_buf(buf, 8, mnc, mnc_3_digits); +} + /*! Return MNC string as standardized 2- or 3-digit with leading zeros. * \param[in] mnc MNC value. * \param[in] mnc_3_digits True if an MNC should fill three digits, only has an effect if MNC < 100. @@ -170,6 +197,20 @@ return osmo_plmn_name_buf(buf, sizeof(buf), plmn); } +/*! Return MCC-MNC string as standardized 3-digit-dash-2/3-digit with leading zeros, into + * a dynamically-allocated output buffer. + * \param[in] ctx talloc context from which to allocate output buffer + * \param[in] plmn MCC-MNC value. + * \returns string in dynamically allocated buffer. + */ +char *osmo_plmn_name_c(const void *ctx, const struct osmo_plmn_id *plmn) +{ + char *buf = talloc_size(ctx, 16); + if (!buf) + return NULL; + return osmo_plmn_name_buf(buf, 16, plmn); +} + /*! Return MCC-MNC-LAC as string, in caller-provided output buffer. * \param[out] buf caller-allocated output buffer * \param[in] buf_len size of buf in bytes @@ -193,6 +234,19 @@ return osmo_lai_name_buf(buf, sizeof(buf), lai); } +/*! Return MCC-MNC-LAC as string, in a talloc-allocated output buffer. + * \param[in] ctx talloc context from which to allocate output buffer + * \param[in] lai LAI to encode, the rac member is ignored. + * \returns string representation of lai in dynamically allocated buffer. + */ +char *osmo_lai_name_c(const void *ctx, const struct osmo_location_area_id *lai) +{ + char *buf = talloc_size(ctx, 32); + if (!buf) + return NULL; + return osmo_lai_name_buf(buf, 32, lai); +} + /*! Return MCC-MNC-LAC-CI as string, in caller-provided output buffer. * \param[out] buf caller-allocated output buffer * \param[in] buf_len size of buf in bytes @@ -226,6 +280,17 @@ return osmo_cgi_name_buf(buf, sizeof(buf), cgi); } +/*! Return MCC-MNC-LAC-CI as string, in a talloc-allocated output buffer. + * \param[in] ctx talloc context from which to allocate output buffer + * \param[in] cgi CGI to encode. + * \returns string representation of CGI in dynamically-allocated buffer. + */ +char *osmo_cgi_name_c(const void *ctx, const struct osmo_cell_global_id *cgi) +{ + char *buf = talloc_size(ctx, 32); + return osmo_cgi_name_buf(buf, 32, cgi); +} + static void to_bcd(uint8_t *bcd, uint16_t val) { bcd[2] = val % 10; @@ -259,6 +324,19 @@ return osmo_gummei_name_buf(buf, sizeof(buf), gummei); } +/*! Return string representation of GUMMEI in static output buffer. + * \param[out] buf pointer to caller-provided output buffer + * \param[in] buf_len size of buf in bytes + * \param[in] gummei GUMMEI to be stringified + * \returns pointer to static output buffer + */ +char *osmo_gummei_name_c(const void *ctx, const struct osmo_gummei *gummei) +{ + char *buf = talloc_size(ctx, 32); + if (!buf) + return NULL; + return osmo_gummei_name_buf(buf, 32, gummei); +} /* Convert MCC + MNC to BCD representation * \param[out] bcd_dst caller-allocated memory for output diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index a45d67b..c2c19cf 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -206,6 +207,19 @@ return osmo_rai_name_buf(buf, sizeof(buf), rai); } +/*! Return MCC-MNC-LAC-RAC as string, in dynamically-allocated output buffer. + * \param[in] ctx talloc context from which to allocate output buffer + * \param[in] rai RAI to encode. + * \returns string representation in dynamically-allocated output buffer. + */ +char *osmo_rai_name_c(const void *ctx, const struct gprs_ra_id *rai) +{ + char *buf = talloc_size(ctx, 32); + if (!buf) + return NULL; + return osmo_rai_name_buf(buf, 32, rai); +} + /* FIXME: convert to value_string */ static const char *cc_state_names[32] = { "NULL", @@ -492,6 +506,22 @@ return osmo_mi_name_buf(mi_name, sizeof(mi_name), mi, mi_len); } +/*! Return a human readable representation of a Mobile Identity in dynamically-allocated buffer. + * \param[in] ctx talloc context from which to allocate output buffer + * \param[in] mi Mobile Identity buffer containing 3GPP TS 04.08 style MI type and data. + * \param[in] mi_len Length of mi. + * \return A string like "IMSI-1234567", "TMSI-0x1234ABCD" or "unknown", "TMSI-invalid" in a + * dynamically-allocated output buffer. + */ +char *osmo_mi_name_c(const void *ctx, const uint8_t *mi, uint8_t mi_len) +{ + size_t buf_len = 10 + GSM48_MI_SIZE + 1; + char *mi_name = talloc_size(ctx, buf_len); + if (!mi_name) + return NULL; + return osmo_mi_name_buf(mi_name, buf_len, mi, mi_len); +} + /*! Checks is particular message is cipherable in A/Gb mode according to * 3GPP TS 24.008 ? 4.7.1.2 * \param[in] hdr Message header @@ -1124,6 +1154,22 @@ return gsm48_pdisc_msgtype_name_buf(namebuf, sizeof(namebuf), pdisc, msg_type); } +/*! Compose a string naming the message type for given protocol, in a dynamically-allocated buffer. + * If the message type string is known, return the message type name, otherwise + * return ":". + * \param[in] ctx talloc context from which to allocate output buffer + * \param[in] pdisc protocol discriminator like GSM48_PDISC_MM + * \param[in] msg_type message type like GSM48_MT_MM_LOC_UPD_REQUEST + * \returns string representation in dynamically allocated output buffer. + */ +char *gsm48_pdisc_msgtype_name_c(const void *ctx, uint8_t pdisc, uint8_t msg_type) +{ + char *namebuf = talloc_size(ctx, 64); + if (!namebuf) + return NULL; + return gsm48_pdisc_msgtype_name_buf(namebuf, 64, pdisc, msg_type); +} + const struct value_string gsm48_reject_value_names[] = { { GSM48_REJECT_IMSI_UNKNOWN_IN_HLR, "IMSI_UNKNOWN_IN_HLR" }, { GSM48_REJECT_ILLEGAL_MS, "ILLEGAL_MS" }, @@ -1261,6 +1307,19 @@ return osmo_gsm48_classmark_a5_name_buf(buf, sizeof(buf), cm); } +/*! Return a string representation of A5 cipher algorithms indicated by Classmark 1, 2 and 3. + * \param[in] ctx talloc context from which to allocate output buffer + * \param[in] cm Classmarks. + * \returns string like "cm1{a5/1=supported} cm2{0x23= A5/2 A5/3} no-cm3" in dynamically-allocated + * output buffer. + */ +char *osmo_gsm48_classmark_a5_name_c(const void *ctx, const struct osmo_gsm48_classmark *cm) +{ + char *buf = talloc_size(ctx, 128); + if (!buf) + return NULL; + return osmo_gsm48_classmark_a5_name_buf(buf, 128, cm); +} /*! Overwrite dst with the Classmark information present in src. * Add an new Classmark and overwrite in dst what src has to offer, but where src has no Classmark information, leave diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index f2bf57b..1450ed0 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -900,6 +900,13 @@ return osmo_dump_gsmtime_buf(buf, sizeof(buf), tm); } +char *osmo_dump_gsmtime_c(const void *ctx, const struct gsm_time *tm) +{ + char *buf = talloc_size(ctx, 64); + if (!buf) + return NULL; + return osmo_dump_gsmtime_buf(buf, 64, tm); +} /*! append range1024 encoded data to bit vector * \param[out] bv Caller-provided output bit-vector diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index a69fb60..56481fd 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -10,6 +10,7 @@ abis_nm_debugp_foh; abis_nm_dump_foh; abis_nm_dump_foh_buf; +abis_nm_dump_foh_c; abis_nm_event_type_name; abis_nm_nack_cause_name; abis_nm_nack_name; @@ -212,8 +213,11 @@ gsm0808_dec_cell_id; gsm0808_cell_id_name; gsm0808_cell_id_name2; +gsm0808_cell_id_name_buf; +gsm0808_cell_id_name_c; gsm0808_cell_id_list_name; gsm0808_cell_id_list_name_buf; +gsm0808_cell_id_list_name_c; gsm0808_cell_id_discr_names; gsm0808_cell_id_u_name; gsm0808_cell_ids_match; @@ -227,6 +231,7 @@ gsm0808_chosen_enc_alg_names; gsm0808_channel_type_name; gsm0808_channel_type_name_buf; +gsm0808_channel_type_name_c; gsm0808_lcls_config_names; gsm0808_lcls_control_names; gsm0808_lcls_status_names; @@ -255,6 +260,7 @@ osmo_gcr_dump_buf; osmo_lcls_dump; osmo_lcls_dump_buf; +osmo_lcls_dump_c; gsm0858_rsl_ul_meas_enc; @@ -350,6 +356,7 @@ gsm48_mi_type_name; osmo_mi_name; osmo_mi_name_buf; +osmo_mi_name_c; gsm48_mcc_mnc_to_bcd; gsm48_mcc_mnc_from_bcd; gsm48_generate_lai2; @@ -360,20 +367,27 @@ osmo_plmn_from_bcd; osmo_mcc_name; osmo_mcc_name_buf; +osmo_mcc_name_c; osmo_mnc_name; osmo_mnc_name_buf; +osmo_mnc_name_c; osmo_plmn_name; osmo_plmn_name_buf; +osmo_plmn_name_c; osmo_plmn_name2; osmo_lai_name; osmo_lai_name_buf; +osmo_lai_name_c; osmo_rai_name; osmo_rai_name_buf; +osmo_rai_name_c; osmo_cgi_name; osmo_cgi_name_buf; +osmo_cgi_name_c; osmo_cgi_name2; osmo_gummei_name; osmo_gummei_name_buf; +osmo_gummei_name_c; osmo_mnc_from_str; osmo_mnc_cmp; osmo_plmn_cmp; @@ -391,6 +405,7 @@ gsm48_cc_cause_names; gsm48_pdisc_msgtype_name; gsm48_pdisc_msgtype_name_buf; +gsm48_pdisc_msgtype_name_c; gsm48_reject_value_names; gsm_7bit_decode; @@ -417,6 +432,7 @@ gsm_gsmtime2fn; osmo_dump_gsmtime; osmo_dump_gsmtime_buf; +osmo_dump_gsmtime_c; gsm_milenage; gsm_septet_encode; @@ -487,6 +503,7 @@ rsl_ccch_conf_to_bs_ccch_sdcch_comb; rsl_chan_nr_str; rsl_chan_nr_str_buf; +rsl_chan_nr_str_c; rsl_dec_chan_nr; rsl_enc_chan_nr; rsl_err_name; @@ -549,8 +566,10 @@ osmo_apn_qualify; osmo_apn_qualify_buf; +osmo_apn_qualify_c; osmo_apn_qualify_from_imsi; osmo_apn_qualify_from_imsi_buf; +osmo_apn_qualify_from_imsi_c; osmo_apn_to_str; osmo_apn_from_str; @@ -610,6 +629,7 @@ osmo_gsm48_classmark_supports_a5; osmo_gsm48_classmark_a5_name; osmo_gsm48_classmark_a5_name_buf; +osmo_gsm48_classmark_a5_name_c; osmo_gsm48_classmark_update; local: *; diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index 7bc6002..1777479 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -258,6 +258,19 @@ return rsl_chan_nr_str_buf(str, sizeof(str), chan_nr); } +/*! Get human-readable string for RSL channel number, in dynamically-allocated buffer. + * \param[in] ctx talloc context from which to allocate output buffer + * \param[in] chan_nr channel number to be stringified + * \returns dynamically-allocated buffer with string representation + */ +char *rsl_chan_nr_str_c(const void *ctx, uint8_t chan_nr) +{ + char *str = talloc_size(ctx, 20); + if (!str) + return NULL; + return rsl_chan_nr_str_buf(str, 20, chan_nr); +} + static const struct value_string rsl_err_vals[] = { { RSL_ERR_RADIO_IF_FAIL, "Radio Interface Failure" }, { RSL_ERR_RADIO_LINK_FAIL, "Radio Link Failure" }, diff --git a/src/msgb.c b/src/msgb.c index 47b413b..5a154e5 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -64,9 +64,8 @@ #include #include -void *tall_msgb_ctx = NULL; - -/*! Allocate a new message buffer +/*! Allocate a new message buffer from given talloc cotext + * \param[in] ctx talloc context from which to allocate * \param[in] size Length in octets, including headroom * \param[in] name Human-readable name to be associated with msgb * \returns dynamically-allocated \ref msgb @@ -75,11 +74,11 @@ * memory buffer for the actual message data (size specified by \a size) * using the talloc memory context previously set by \ref msgb_set_talloc_ctx */ -struct msgb *msgb_alloc(uint16_t size, const char *name) +struct msgb *msgb_alloc_c(const void *ctx, uint16_t size, const char *name) { struct msgb *msg; - msg = talloc_named_const(tall_msgb_ctx, sizeof(*msg) + size, name); + msg = talloc_named_const(ctx, sizeof(*msg) + size, name); if (!msg) { LOGP(DLGLOBAL, LOGL_FATAL, "Unable to allocate a msgb: " "name='%s', size=%u\n", name, size); @@ -98,6 +97,24 @@ return msg; } +/* default msgb allocation context for msgb_alloc() */ +void *tall_msgb_ctx = NULL; + +/*! Allocate a new message buffer from tall_msgb_ctx + * \param[in] size Length in octets, including headroom + * \param[in] name Human-readable name to be associated with msgb + * \returns dynamically-allocated \ref msgb + * + * This function allocates a 'struct msgb' as well as the underlying + * memory buffer for the actual message data (size specified by \a size) + * using the talloc memory context previously set by \ref msgb_set_talloc_ctx + */ +struct msgb *msgb_alloc(uint16_t size, const char *name) +{ + return msgb_alloc_c(tall_msgb_ctx, size, name); +} + + /*! Release given message buffer * \param[in] m Message buffer to be freed */ @@ -309,11 +326,11 @@ * \param[in] msg The old msgb object * \param[in] name Human-readable name to be associated with msgb */ -struct msgb *msgb_copy(const struct msgb *msg, const char *name) +struct msgb *msgb_copy_c(const void *ctx, const struct msgb *msg, const char *name) { struct msgb *new_msg; - new_msg = msgb_alloc(msg->data_len, name); + new_msg = msgb_alloc_c(ctx, msg->data_len, name); if (!new_msg) return NULL; @@ -338,6 +355,19 @@ return new_msg; } +/*! Copy an msgb. + * + * This function allocates a new msgb, copies the data buffer of msg, + * and adjusts the pointers (incl l1h-l4h) accordingly. The cb part + * is not copied. + * \param[in] msg The old msgb object + * \param[in] name Human-readable name to be associated with msgb + */ +struct msgb *msgb_copy(const struct msgb *msg, const char *name) +{ + return msgb_copy_c(tall_msgb_ctx, msg, name); +} + /*! Resize an area within an msgb * * This resizes a sub area of the msgb data and adjusts the pointers (incl @@ -485,6 +515,19 @@ return msgb_hexdump_buf(buf, sizeof(buf), msg); } +/*! Return a dynamically allocated buffer containing a hexdump of the msg + * \param[in] ctx talloc context from where to allocate the output string + * \param[in] msg message buffer + * \returns a pointer to a static char array + */ +char *msgb_hexdump_c(const void *ctx, const struct msgb *msg) +{ + char *buf = talloc_size(ctx, msgb_length(msg)*3 + 100); + if (!buf) + return NULL; + return msgb_hexdump_buf(buf, sizeof(buf), msg); +} + /*! Print a string to the end of message buffer. * \param[in] msgb message buffer. * \param[in] format format string. diff --git a/src/sim/core.c b/src/sim/core.c index 998e836..63b3000 100644 --- a/src/sim/core.c +++ b/src/sim/core.c @@ -305,6 +305,14 @@ return osim_print_sw_buf(sw_print_buf, sizeof(sw_print_buf), ch, sw_in); } +char *osim_print_sw_c(const void *ctx, const struct osim_card_hdl *ch, uint16_t sw_in) +{ + char *buf = talloc_size(ctx, 256); + if (!buf) + return NULL; + return osim_print_sw_buf(buf, 256, ch, sw_in); +} + const struct osim_card_sw *osim_find_sw(const struct osim_card_profile *cp, uint16_t sw_in) { diff --git a/src/socket.c b/src/socket.c index 3a46ad0..c817e72 100644 --- a/src/socket.c +++ b/src/socket.c @@ -827,6 +827,20 @@ return str; } +/*! Get address/port information on socket in static string, like "r=1.2.3.4:5<->l=6.7.8.9:10". + * This does not include braces like osmo_sock_get_name(). + * \param[in] fd File descriptor of socket. + * \return Static string buffer containing the result. + */ +char *osmo_sock_get_name2_c(const void *ctx, int fd) +{ + char *str = talloc_size(ctx, OSMO_SOCK_NAME_MAXLEN); + if (!str) + return NULL; + osmo_sock_get_name_buf(str, sizeof(str), fd); + return str; +} + static int sock_get_domain(int fd) { int domain; diff --git a/src/utils.c b/src/utils.c index 4796365..b8b4ef5 100644 --- a/src/utils.c +++ b/src/utils.c @@ -338,6 +338,27 @@ } /*! Convert binary sequence to hexadecimal ASCII string + * \param[in] ctx talloc context from where to allocate the output string + * \param[in] buf pointer to sequence of bytes + * \param[in] len length of buf in number of bytes + * \returns pointer to zero-terminated string + * + * This function will print a sequence of bytes as hexadecimal numbers, + * adding one space character between each byte (e.g. "1a ef d9") + * + * The maximum size of the output buffer is 4096 bytes, i.e. the maximum + * number of input bytes that can be printed in one call is 1365! + */ +char *osmo_hexdump_c(const void *ctx, const unsigned char *buf, int len) +{ + char *hexd_buff = talloc_size(ctx, len*3 + 1); + if (!hexd_buff) + return NULL; + osmo_hexdump_buf(hexd_buff, sizeof(hexd_buff), buf, len, " ", true); + return hexd_buff; +} + +/*! Convert binary sequence to hexadecimal ASCII string * \param[in] buf pointer to sequence of bytes * \param[in] len length of buf in number of bytes * \returns pointer to zero-terminated string @@ -354,6 +375,28 @@ return hexd_buff; } +/*! Convert binary sequence to hexadecimal ASCII string + * \param[in] ctx talloc context from where to allocate the output string + * \param[in] buf pointer to sequence of bytes + * \param[in] len length of buf in number of bytes + * \returns pointer to zero-terminated string + * + * This function will print a sequence of bytes as hexadecimal numbers, + * without any space character between each byte (e.g. "1aefd9") + * + * The maximum size of the output buffer is 4096 bytes, i.e. the maximum + * number of input bytes that can be printed in one call is 2048! + */ +char *osmo_hexdump_nospc_c(const void *ctx, const unsigned char *buf, int len) +{ + char *hexd_buff = talloc_size(ctx, len*2 + 1); + if (!hexd_buff) + return NULL; + osmo_hexdump_buf(hexd_buff, sizeof(hexd_buff), buf, len, "", true); + return hexd_buff; +} + + /* Compat with previous typo to preserve abi */ char *osmo_osmo_hexdump_nospc(const unsigned char *buf, int len) #if defined(__MACH__) && defined(__APPLE__) @@ -639,6 +682,19 @@ return osmo_escape_str_buf(str, in_len, namebuf, sizeof(namebuf)); } +/*! Return the string with all non-printable characters escaped, in dynamically-allocated buffer. + * \param[in] str A string that may contain any characters. + * \param[in] len Pass -1 to print until nul char, or >= 0 to force a length. + * \returns dynamically-allocated output buffer, containing an escaped representation + */ +char *osmo_escape_str_c(const void *ctx, const char *str, int in_len) +{ + char *buf = talloc_size(ctx, in_len+1); + if (!buf) + return NULL; + return osmo_escape_str_buf(str, in_len, buf, in_len+1); +} + /*! Like osmo_escape_str(), but returns double-quotes around a string, or "NULL" for a NULL string. * This allows passing any char* value and get its C representation as string. * \param[in] str A string that may contain any characters. @@ -671,6 +727,20 @@ return osmo_quote_str_buf(str, in_len, namebuf, sizeof(namebuf)); } +/*! Like osmo_quote_str_buf() but returns the result in a dynamically-allocated buffer. + * The static buffer is shared with get_value_string() and osmo_escape_str(). + * \param[in] str A string that may contain any characters. + * \param[in] in_len Pass -1 to print until nul char, or >= 0 to force a length. + * \returns dynamically-allocated buffer containing a quoted and escaped representation. + */ +char *osmo_quote_str_c(const void *ctx, const char *str, int in_len) +{ + char *buf = talloc_size(ctx, OSMO_MAX(in_len+2, 32)); + if (!buf) + return NULL; + return osmo_quote_str_buf(str, in_len, buf, 32); +} + /*! perform an integer square root operation on unsigned 32bit integer. * This implementation is taken from "Hacker's Delight" Figure 11-1 "Integer square root, Newton's * method", which can also be found at http://www.hackersdelight.org/hdcodetxt/isqrt.c.txt */ @@ -754,6 +824,21 @@ return buf; } +/*! Convert a string to lowercase, dynamically allocating the output from given talloc context + * See also osmo_str_tolower_buf(). + * \param[in] ctx talloc context from where to allocate the output string + * \param[in] src String to convert to lowercase. + * \returns Resulting lowercase string in a dynamically allocated buffer, always nul terminated. + */ +char *osmo_str_tolower_c(const void *ctx, const char *src) +{ + char *buf = talloc_size(ctx, strlen(src)+1); + if (!buf) + return NULL; + osmo_str_tolower_buf(buf, sizeof(buf), src); + return buf; +} + /*! Convert a string to uppercase, while checking buffer size boundaries. * The result written to \a dest is guaranteed to be nul terminated if \a dest_len > 0. * If dest == src, the string is converted in-place, if necessary truncated at dest_len - 1 characters @@ -797,6 +882,21 @@ return buf; } +/*! Convert a string to uppercase, dynamically allocating the output from given talloc context + * See also osmo_str_tolower_buf(). + * \param[in] ctx talloc context from where to allocate the output string + * \param[in] src String to convert to uppercase. + * \returns Resulting uppercase string in a dynamically allocated buffer, always nul terminated. + */ +char *osmo_str_toupper_c(const void *ctx, const char *src) +{ + char *buf = talloc_size(ctx, strlen(src)+1); + if (!buf) + return NULL; + osmo_str_toupper_buf(buf, sizeof(buf), src); + return buf; +} + /*! Calculate the Luhn checksum (as used for IMEIs). * \param[in] in Input digits in ASCII string representation. * \param[in] in_len Count of digits to use for the input (14 for IMEI). -- To view, visit https://gerrit.osmocom.org/13311 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8481c19b68ff67cfa22abb93c405ebcfcb0ab19b Gerrit-Change-Number: 13311 Gerrit-PatchSet: 10 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:44:27 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:44:27 +0000 Subject: Change in libosmocore[master]: add identifier sanitation for setting FSM instance ids In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13574 ) Change subject: add identifier sanitation for setting FSM instance ids ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13574 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia40a6f3b2243c95fe428a080b938e11d8ab771a7 Gerrit-Change-Number: 13574 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 10 Apr 2019 22:44:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:44:37 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:44:37 +0000 Subject: Change in libosmocore[master]: add OSMO_IMSI_SIZE In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13575 ) Change subject: add OSMO_IMSI_SIZE ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 Gerrit-Change-Number: 13575 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 10 Apr 2019 22:44:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:47:40 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:47:40 +0000 Subject: Change in libosmocore[master]: GSUP: add Kind IE In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13576 ) Change subject: GSUP: add Kind IE ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13576/1/include/osmocom/gsm/gsup.h File include/osmocom/gsm/gsup.h: https://gerrit.osmocom.org/#/c/13576/1/include/osmocom/gsm/gsup.h at 234 PS1, Line 234: OSMO_GSUP_KIND_UNSET I would prefer "message class" over "message kind". There's already several 3GPP protocols we deal with (among those, Abis OML) where there's a message class and a message type, and hence the class already has some pre-existing notion/definition. Alternatively, one could also call it subsystem or the like, but I think class is quite ok? -- To view, visit https://gerrit.osmocom.org/13576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef Gerrit-Change-Number: 13576 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 10 Apr 2019 22:47:40 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:48:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:48:21 +0000 Subject: Change in libosmocore[master]: BSSMAP: tweaks In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13577 ) Change subject: BSSMAP: tweaks ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13577 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6387836bab76e1fa42daa0f42ab94fc14b70b112 Gerrit-Change-Number: 13577 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 10 Apr 2019 22:48:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:50:28 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:50:28 +0000 Subject: Change in libosmocore[master]: BSSMAP: add messages for inter-BSC and inter-MSC Handover In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13578 ) Change subject: BSSMAP: add messages for inter-BSC and inter-MSC Handover ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13578 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9dac375331f6bea744769e973725d58e35f87226 Gerrit-Change-Number: 13578 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 10 Apr 2019 22:50:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:50:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:50:51 +0000 Subject: Change in libosmocore[master]: add gsm48_decode_bcd_number2() from osmo-msc In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13579 ) Change subject: add gsm48_decode_bcd_number2() from osmo-msc ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13579 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idb6ae6e2f3bea11ad420dae14d021ac36d99e921 Gerrit-Change-Number: 13579 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 10 Apr 2019 22:50:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:52:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:52:08 +0000 Subject: Change in libosmocore[master]: add osmo_bssap_tlv_parse2() for multiple identical T In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13580 ) Change subject: add osmo_bssap_tlv_parse2() for multiple identical T ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13580 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib9a2095f7498dc2cda2a57154b2dbe4621df72f8 Gerrit-Change-Number: 13580 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 10 Apr 2019 22:52:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 22:53:46 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 10 Apr 2019 22:53:46 +0000 Subject: Change in libosmocore[master]: add vty_is_active() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13581 ) Change subject: add vty_is_active() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13581 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I42cf2af47283dd42c101faae0fac293c3a68d599 Gerrit-Change-Number: 13581 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 10 Apr 2019 22:53:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 23:18:14 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 23:18:14 +0000 Subject: Change in libosmocore[master]: add osmo_str_startswith() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13394 ) Change subject: add osmo_str_startswith() ...................................................................... Patch Set 2: I agree that we should fix the vty keyword problem. Even though that's the reason why I wanted this function in the first place, it's still a useful function in general... maybe I should strip the commit log a bit. -- To view, visit https://gerrit.osmocom.org/13394 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib2ffb0e9a870dd52e081c7e66d8818057d159513 Gerrit-Change-Number: 13394 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 10 Apr 2019 23:18:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 10 23:23:44 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 10 Apr 2019 23:23:44 +0000 Subject: Change in libosmocore[master]: add osmo_{escape, quote}_str_buf2() for OSMO_STRBUF_APPEND() use In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13573 ) Change subject: add osmo_{escape,quote}_str_buf2() for OSMO_STRBUF_APPEND() use ...................................................................... Patch Set 1: > I see some overlap here with my _buf changes I noticed the overlap with commit "osmo_escape_str_buf: Always copy, don't return input string pointer" -- this patch existed before you merged that, and this patch had the exact same changes to osmo_escape_str_buf() in it. After that I stripped this commit log msg. Now noticing the commit "Add _buf() functions to bypass static string buffers" is also merged. I should have another close look... -- To view, visit https://gerrit.osmocom.org/13573 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae Gerrit-Change-Number: 13573 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 10 Apr 2019 23:23:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 00:24:56 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 00:24:56 +0000 Subject: Change in libosmocore[master]: vty/talloc_ctx_vty.c: allocate walk_cb_params on stack, not heap In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13534 ) Change subject: vty/talloc_ctx_vty.c: allocate walk_cb_params on stack, not heap ...................................................................... vty/talloc_ctx_vty.c: allocate walk_cb_params on stack, not heap There is no need to allocate struct 'walk_cb_params' dynamically. Change-Id: I96f25f1ddb36b19b12055deaeeb6f58e59180e72 --- M src/vty/talloc_ctx_vty.c 1 file changed, 15 insertions(+), 43 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/vty/talloc_ctx_vty.c b/src/vty/talloc_ctx_vty.c index e7fe675..c4d5a88 100644 --- a/src/vty/talloc_ctx_vty.c +++ b/src/vty/talloc_ctx_vty.c @@ -180,22 +180,13 @@ 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; + struct walk_cb_params params = { 0 }; /* Set up callback parameters */ - params->filter = WALK_FILTER_NONE; - params->vty = vty; + params.filter = WALK_FILTER_NONE; + params.vty = vty; - talloc_ctx_walk(argv[0], argv[1], params); - - /* Free memory */ - talloc_free(params); - + talloc_ctx_walk(argv[0], argv[1], ¶ms); return CMD_SUCCESS; } @@ -204,31 +195,22 @@ "Filter chunks using regular expression\n" "Regular expression\n") { - struct walk_cb_params *params; + struct walk_cb_params params = { 0 }; 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); + 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; + params.filter = WALK_FILTER_REGEXP; + params.vty = vty; - talloc_ctx_walk(argv[0], argv[1], params); - - /* Free memory */ - regfree(¶ms->regexp); - talloc_free(params); + talloc_ctx_walk(argv[0], argv[1], ¶ms); + regfree(¶ms.regexp); return CMD_SUCCESS; } @@ -238,31 +220,21 @@ "Display only a specific memory chunk\n" "Chunk address (e.g. 0xdeadbeef)\n") { - struct walk_cb_params *params; + struct walk_cb_params params = { 0 }; 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); + 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; + params.filter = WALK_FILTER_TREE; + params.vty = vty; - talloc_ctx_walk(argv[0], argv[1], params); - - /* Free memory */ - talloc_free(params); - + talloc_ctx_walk(argv[0], argv[1], ¶ms); return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/13534 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I96f25f1ddb36b19b12055deaeeb6f58e59180e72 Gerrit-Change-Number: 13534 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 00:24:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 00:24:57 +0000 Subject: Change in libosmocore[master]: vty/talloc_ctx_vty.c: use REG_NOSUB flag of regcomp() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13536 ) Change subject: vty/talloc_ctx_vty.c: use REG_NOSUB flag of regcomp() ...................................................................... vty/talloc_ctx_vty.c: use REG_NOSUB flag of regcomp() We don't need to know position of matches: just yes or no. This change would save some computation power. Change-Id: Id55ffe64cc1a35dd83f61dbb0f9828aa676696f9 --- M src/vty/talloc_ctx_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/talloc_ctx_vty.c b/src/vty/talloc_ctx_vty.c index c4d5a88..16cb763 100644 --- a/src/vty/talloc_ctx_vty.c +++ b/src/vty/talloc_ctx_vty.c @@ -199,7 +199,7 @@ int rc; /* Attempt to compile a regular expression */ - rc = regcomp(¶ms.regexp, argv[2], 0); + rc = regcomp(¶ms.regexp, argv[2], REG_NOSUB); if (rc) { vty_out(vty, "Invalid expression%s", VTY_NEWLINE); return CMD_WARNING; -- To view, visit https://gerrit.osmocom.org/13536 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id55ffe64cc1a35dd83f61dbb0f9828aa676696f9 Gerrit-Change-Number: 13536 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 00:24:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 00:24:57 +0000 Subject: Change in libosmocore[master]: gsm_utils.c: fix Doxygen description for gsm_get_octet_len() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13552 ) Change subject: gsm_utils.c: fix Doxygen description for gsm_get_octet_len() ...................................................................... gsm_utils.c: fix Doxygen description for gsm_get_octet_len() Change-Id: Id6fd2cd33be1cb7cd7ff6a43bfcfb1f368304522 --- M src/gsm/gsm_utils.c 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 1450ed0..94c6ca5 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -185,10 +185,10 @@ return -1; } -/*! \brife Compute number of octets from number of septets, - * for instance: 47 septets needs 41,125 = 42 octets - * \param[in sept_len Number of Septets - * \returns Number of octets required */ +/*! Compute number of octets from number of septets. + * For instance: 47 septets need 41,125 = 42 octets. + * \param[in] sept_len Number of septets + * \returns Number of octets required */ uint8_t gsm_get_octet_len(const uint8_t sept_len){ int octet_len = (sept_len * 7) / 8; if ((sept_len * 7) % 8 != 0) -- To view, visit https://gerrit.osmocom.org/13552 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id6fd2cd33be1cb7cd7ff6a43bfcfb1f368304522 Gerrit-Change-Number: 13552 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 00:25:32 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 00:25:32 +0000 Subject: Change in osmo-bts[master]: oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13275 ) Change subject: oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging() ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13275 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iebc80cd1f77f10a879d4536d788377f522dd853f Gerrit-Change-Number: 13275 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 00:25:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 00:26:07 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 00:26:07 +0000 Subject: Change in libosmo-abis[master]: ipa_keepalive_fsm: Fix OSMO_IPA_KA_E_STOP allstate event In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13540 ) Change subject: ipa_keepalive_fsm: Fix OSMO_IPA_KA_E_STOP allstate event ...................................................................... ipa_keepalive_fsm: Fix OSMO_IPA_KA_E_STOP allstate event We had the allstate_action function registered, and that function implemented handling of OSMO_IPA_KA_E_STOP. However, the allstate_event_mask was not set, rendering this functionality inaccessible. Change-Id: I83fd991bdacb7bab794878e47c7797fecf8b9286 --- M src/input/ipa_keepalive.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved diff --git a/src/input/ipa_keepalive.c b/src/input/ipa_keepalive.c index 1aae096..6467720 100644 --- a/src/input/ipa_keepalive.c +++ b/src/input/ipa_keepalive.c @@ -189,6 +189,7 @@ .states = ipa_keepalive_states, .num_states = ARRAY_SIZE(ipa_keepalive_states), .log_subsys = DLINP, + .allstate_event_mask = S(OSMO_IPA_KA_E_STOP), .allstate_action = ipa_ka_allstate_action, .event_names = ipa_keepalive_event_names, .timer_cb = ipa_ka_fsm_timer_cb, -- To view, visit https://gerrit.osmocom.org/13540 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I83fd991bdacb7bab794878e47c7797fecf8b9286 Gerrit-Change-Number: 13540 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 00:26:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 00:26:08 +0000 Subject: Change in libosmo-abis[master]: ipa_keepalive_fsm: Suppress error messages for INIT -> INIT transition In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13541 ) Change subject: ipa_keepalive_fsm: Suppress error messages for INIT -> INIT transition ...................................................................... ipa_keepalive_fsm: Suppress error messages for INIT -> INIT transition If we receive an OSMO_IPA_KA_E_STOP in INIT state, we are trying to re-enter INIT, which is not permitted as per the FSM definition. Adding this permission avoids the below error message from hitting the logs every time this happens: <0003> input/ipa_keepalive.c:158 IPA-KEEPALIVE(server)[0x612000000520]{INIT}: transition to state INIT not permitted! Change-Id: I8db2f2e708fc4fbb81f5019973098a80e8f540d2 --- M src/input/ipa_keepalive.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved diff --git a/src/input/ipa_keepalive.c b/src/input/ipa_keepalive.c index 6467720..81b5a26 100644 --- a/src/input/ipa_keepalive.c +++ b/src/input/ipa_keepalive.c @@ -167,7 +167,7 @@ [OSMO_IPA_KA_S_INIT] = { .name = "INIT", .in_event_mask = S(OSMO_IPA_KA_E_START), - .out_state_mask = S(OSMO_IPA_KA_S_WAIT_RESP), + .out_state_mask = S(OSMO_IPA_KA_S_WAIT_RESP) | S(OSMO_IPA_KA_S_INIT), .action = ipa_ka_init, }, [OSMO_IPA_KA_S_IDLE] = { -- To view, visit https://gerrit.osmocom.org/13541 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8db2f2e708fc4fbb81f5019973098a80e8f540d2 Gerrit-Change-Number: 13541 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 01:24:58 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 01:24:58 +0000 Subject: Change in libosmocore[master]: add osmo_{escape, quote}_str_buf2() for OSMO_STRBUF_APPEND() use In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13573 ) Change subject: add osmo_{escape,quote}_str_buf2() for OSMO_STRBUF_APPEND() use ...................................................................... Patch Set 1: > _buf changes We've recently added the OSMO_STRBUF_APPEND() macro, which works well with function signatures like snprintf(), i.e. first arguments are buf and len, and it returns an *int* len of characters that would have been written. The _buf functions generally return a char* to be useful for printf formats. They can't be used with OSMO_STRBUF_APPEND() directly because that requires the int return val. However, they *can* be used with OSMO_STRBUF_PRINTF(): OSMO_STRBUF_PRINTF(sb, "%s", osmo_gsm48_classmark_a5_name_buf(...)); So, this patch should probably not bother to introduce _buf functions that adhere to the snprintf() signature. It is fine to return a char* and use those with OSMO_STRBUF_PRINTF(). -- To view, visit https://gerrit.osmocom.org/13573 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae Gerrit-Change-Number: 13573 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Thu, 11 Apr 2019 01:24:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 03:20:37 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 03:20:37 +0000 Subject: Change in osmo-bts[master]: oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging() In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13275 ) Change subject: oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging() ...................................................................... Patch Set 4: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13275/4/src/osmo-bts-oc2g/misc/oc2gbts_mgr.c File src/osmo-bts-oc2g/misc/oc2gbts_mgr.c: https://gerrit.osmocom.org/#/c/13275/4/src/osmo-bts-oc2g/misc/oc2gbts_mgr.c at 264 PS4, Line 264: mgr_log_init BTW: what are the benefit(s) of having this function? It basically calls osmo_init_logging2(), so why not to call it directly from main()? Not related to this change, can be done separately... -- To view, visit https://gerrit.osmocom.org/13275 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iebc80cd1f77f10a879d4536d788377f522dd853f Gerrit-Change-Number: 13275 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 03:20:37 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 03:47:00 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 03:47:00 +0000 Subject: Change in libosmocore[master]: make all library-internal static buffers thread-local In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13436 ) Change subject: make all library-internal static buffers thread-local ...................................................................... Patch Set 5: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13436 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I50eb2436a7c1261d79a9d2955584dce92780ca07 Gerrit-Change-Number: 13436 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 03:47:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 04:07:28 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 04:07:28 +0000 Subject: Change in libosmocore[master]: add osmo_{escape, quote}_str_buf2() for OSMO_STRBUF_APPEND() use In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13573 ) Change subject: add osmo_{escape,quote}_str_buf2() for OSMO_STRBUF_APPEND() use ...................................................................... Patch Set 1: > So, this patch should probably not bother to introduce _buf functions that adhere to the snprintf() signature. It is fine to return a char* and use those with OSMO_STRBUF_PRINTF(). I remember now why i wanted a function that is directly usable for OSMO_STRBUF_APPEND(): it allows using the target buffer directly. If I use OSMO_STRBUF_PRINTF(sb, "%s", osmo_escape_str_buf(buf2, ...)), then I need to define a *second* buffer, and even if the final target buffer is large enough, if the intermediate buffer is too small, that part of the string will be truncated. If instead I can use OSMO_STRBUF_APPEND(sb, osmo_escape_str_buf2, str, in_len); then there is only one buffer involved, and that is the final target buffer that was probably passed in by the user. So, having a signature returning char* is useful as direct printf() arg, but also having a signature that returns int is useful for using the same buffer with OSMO_STRBUF_APPEND(). options that come to mind: - add another signature kind that behaves like snprintf(), not *_buf but something named like snprintf(), which works with OSMO_STRBUF_APPEND() directly. maybe osmo_foo_name_snf() - add another OSMO_STRBUF_xxx() macro that feeds the same sb buffer to *_buf() like signatures. That would have to do a strlen() to figure out how much of the buffer is left afterwards, but it would save the need for a lot of yet more str writing functions. Going for the latter. -- To view, visit https://gerrit.osmocom.org/13573 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae Gerrit-Change-Number: 13573 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Thu, 11 Apr 2019 04:07:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 04:13:22 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 04:13:22 +0000 Subject: Change in osmo-bts[master]: pcu_sock: use %zu conversion specifier for printing sizeof() result In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13267 ) Change subject: pcu_sock: use %zu conversion specifier for printing sizeof() result ...................................................................... Patch Set 4: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13267/4/src/common/pcu_sock.c File src/common/pcu_sock.c: https://gerrit.osmocom.org/#/c/13267/4/src/common/pcu_sock.c at 801 PS4, Line 801: return 0; BTW: it looks like we have a memleak here: msg is allocated, but not freed... -- To view, visit https://gerrit.osmocom.org/13267 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709 Gerrit-Change-Number: 13267 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 11 Apr 2019 04:13:22 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 04:13:41 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 04:13:41 +0000 Subject: Change in libosmocore[master]: add osmo_{escape, quote}_str_buf2() for OSMO_STRBUF_APPEND() use In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13573 ) Change subject: add osmo_{escape,quote}_str_buf2() for OSMO_STRBUF_APPEND() use ...................................................................... Patch Set 1: really annoying: osmo_quote_str_buf() has the buf arg in the end, unlike the other _buf functions :P -- To view, visit https://gerrit.osmocom.org/13573 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae Gerrit-Change-Number: 13573 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Thu, 11 Apr 2019 04:13:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 04:33:36 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 04:33:36 +0000 Subject: Change in libsmpp34[master]: Allow application to override default heap allocator In-Reply-To: References: Message-ID: Vadim Yanitskiy has uploaded a new patch set (#6) to the change originally created by Harald Welte. ( https://gerrit.osmocom.org/13561 ) Change subject: Allow application to override default heap allocator ...................................................................... Allow application to override default heap allocator Let's introduce a mechanism by which libsmpp34-using applications can override the memory allocator functions. This allows us e.g. in the Osmocom context to use talloc which aids us in debugging memory leaks. Closes: OS#3913 Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 --- M TODO-RELEASE M src/Makefile.am A src/smpp34_heap.c A src/smpp34_heap.h M src/smpp34_params.c M src/smpp34_unpack.c 6 files changed, 108 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/61/13561/6 -- To view, visit https://gerrit.osmocom.org/13561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Gerrit-Change-Number: 13561 Gerrit-PatchSet: 6 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-CC: fixeria -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 04:37:33 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 04:37:33 +0000 Subject: Change in osmo-msc[master]: smpp: Make libsmpp34 use talloc for its allocations In-Reply-To: References: Message-ID: Vadim Yanitskiy has uploaded a new patch set (#3) to the change originally created by Harald Welte. ( https://gerrit.osmocom.org/13562 ) Change subject: smpp: Make libsmpp34 use talloc for its allocations ...................................................................... smpp: Make libsmpp34 use talloc for its allocations We are just introducing smpp34_set_memory_functions() in libsmpp34 to allow applications like OsmoMSC to provide their own heap allocator callback functions. Let's used this to integrate with talloc and hence allow talloc tracking/debugging for libsmpp34 internal allocations. Depends: libsmpp34 Change-Id I3656117115e89638c093bfbcbc4369ce302f7a94 Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Related: OS#3913 --- M src/libmsc/smpp_openbsc.c 1 file changed, 27 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/62/13562/3 -- To view, visit https://gerrit.osmocom.org/13562 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Gerrit-Change-Number: 13562 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 04:38:55 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 04:38:55 +0000 Subject: Change in osmo-msc[master]: smpp: Make libsmpp34 use talloc for its allocations In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13562 ) Change subject: smpp: Make libsmpp34 use talloc for its allocations ...................................................................... Patch Set 3: > @vadim: please revert. Done. My apologies... -- To view, visit https://gerrit.osmocom.org/13562 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Gerrit-Change-Number: 13562 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 04:38:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 04:51:46 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 04:51:46 +0000 Subject: Change in osmo-msc[master]: libmsc/ran_conn.c: send S_SUBSCR_ATTACHED after RAN_CONN_S_ACCEPTED In-Reply-To: References: Message-ID: Vadim Yanitskiy has abandoned this change. ( https://gerrit.osmocom.org/13571 ) Change subject: libmsc/ran_conn.c: send S_SUBSCR_ATTACHED after RAN_CONN_S_ACCEPTED ...................................................................... Abandoned This change was only needed to demonstrate the problem and a potential solution. Not compatible with neels/ho. -- To view, visit https://gerrit.osmocom.org/13571 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Id5bc2d1d488a0ab92fd72e9cef6250e6794807a9 Gerrit-Change-Number: 13571 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:36:02 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 05:36:02 +0000 Subject: Change in libosmocore[master]: add osmo_{escape, quote}_str_buf2() for standard args ordering In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13573 to look at the new patch set (#2). Change subject: add osmo_{escape,quote}_str_buf2() for standard args ordering ...................................................................... add osmo_{escape,quote}_str_buf2() for standard args ordering To be able to append an escaped or quoted string using OSMO_STRBUF_APPEND_NOLEN(), the function signature must have the buf and len as first args, like most other *_buf() functions. Add osmo_escape_str_buf2() and osmo_quote_str_buf2() to match this signature. A recent patch [1] has changed the return value of osmo_escape_str_buf() and osmo_quote_str_buf() to char*, removing the const. However, the functions may return const strings, hence re-add the const. The new signatures are guaranteed to return the non-const buffer. To avoid code duplication, implement osmo_quote_str_buf() and osmo_escape_str_buf() by calling the new functions. I decided to allow slight changes to the behavior for current osmo_escape_str() and osmo_escape_str_buf(), because impact on callers is minimal: (1) The new implementation uses OSMO_STRBUF_*, and in consequence osmo_quote_str() no longer prints an ending double quote after truncated strings; Before, a truncated output was, sic: "this string is trunca" and now this becomes, sic: "this string is truncat I decided to not keep the old behavior because it is questionable to begin with. It looks like the string actually ended at the truncation boundary instead of the reason being not enough space in the output buffer. (2) The new osmo_escape_str_buf2() function obviously cannot pass-thru an unchanged char* if no escaping was needed. Sacrifice this tiny optimization feature to avoid code duplication: - it is an unnoticeable optimization, - the caller anyway always passes a string buffer, - the feature caused handling strings and buffers differently depending on their content (i.e. code that usually writes out strings in full length "suddenly" truncates because a non-printable character is contained, etc.) I considered adding a skip_if_unescaped flag to the osmo_quote_str_buf2() function signature, but in the end decided that the API clutter is not worth having for all the above reasons. Adjust tests to accomodate above changes. [1] 4a62eda225ab7f3c9556990c81a6fc5e19b5eec8 Ibf85f79e93244f53b2684ff6f1095c5b41203e05 Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae --- M TODO-RELEASE M include/osmocom/core/utils.h M src/utils.c M tests/utils/utils_test.c M tests/utils/utils_test.ok 5 files changed, 115 insertions(+), 47 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/13573/2 -- To view, visit https://gerrit.osmocom.org/13573 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae Gerrit-Change-Number: 13573 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:36:02 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 05:36:02 +0000 Subject: Change in libosmocore[master]: add identifier sanitation for setting FSM instance ids 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/13574 to look at the new patch set (#2). Change subject: add identifier sanitation for setting FSM instance ids ...................................................................... add identifier sanitation for setting FSM instance ids We often compose FSM instance IDs from context information, for example placing an MSISDN string or IP:port information in the FSM instance id, using osmo_fsm_inst_update_id_f(). This fails if any characters are contained that don't pass osmo_identifier_valid(). Hence it is the task of the caller to make sure only characters allowed in an FSM id are applied. Provide API to trivially allow this by replacing illegal chars: - osmo_identifier_sanitize_buf(), with access to the same set of illegal characters defined in utils.c, - osmo_fsm_inst_update_id_f_sanitize() implicitly replaces non-identifier chars. This makes it easy to add strings like '192.168.0.1:2342' or '+4987654321' to an FSM instance id, without adding string mangling to each place that sets an id; e.g. replacing with '-' to yield '192-168-0-1:2342' or '-4987654321'. Change-Id: Ia40a6f3b2243c95fe428a080b938e11d8ab771a7 --- M include/osmocom/core/fsm.h M include/osmocom/core/utils.h M src/fsm.c M src/utils.c 4 files changed, 53 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/13574/2 -- To view, visit https://gerrit.osmocom.org/13574 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia40a6f3b2243c95fe428a080b938e11d8ab771a7 Gerrit-Change-Number: 13574 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:36:02 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 05:36:02 +0000 Subject: Change in libosmocore[master]: add OSMO_IMSI_SIZE In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13575 to look at the new patch set (#2). Change subject: add OSMO_IMSI_SIZE ...................................................................... add OSMO_IMSI_SIZE Various places in our code base figure out how many chars they need to safely store an IMSI. An IMSI can have a checksum digit, which is not reflected by GSM23003_IMSI_MAX_DIGITS. And we usually need a terminating \0. Instead of having a magic +2 repeated every so often, rather define OSMO_IMSI_SIZE to contain both checksum digit and nul char, and have the explanatory comment with it here in libosmocore. Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 --- M include/osmocom/gsm/protocol/gsm_23_003.h 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/13575/2 -- To view, visit https://gerrit.osmocom.org/13575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 Gerrit-Change-Number: 13575 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:36:02 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 05:36:02 +0000 Subject: Change in libosmocore[master]: GSUP: add Class IE 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/13576 to look at the new patch set (#2). Change subject: GSUP: add Class IE ...................................................................... GSUP: add Class IE osmo-msc and osmo-hlr have distinct subsystems handling incoming GSUP messages. So far we decide entirely by message type which code path should handle a GSUP message. Thus no GSUP message type may be re-used across subsystems. If we add a GSUP message to indicate a routing error, it would have to be a distinct message type for subscriber management, another one for SMS, another one for USSD... To allow introducing common message types, introduce a GSUP Class IE. In the presence of this IE, GSUP handlers can trivially direct a received message to the right code path. If it is missing, handlers can fall back to the previous switch(message_type) method. Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c M src/gsm/libosmogsm.map M tests/gsup/gsup_test.c M tests/gsup/gsup_test.err 5 files changed, 47 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/13576/2 -- To view, visit https://gerrit.osmocom.org/13576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef Gerrit-Change-Number: 13576 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:36:06 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 05:36:06 +0000 Subject: Change in libosmocore[master]: tweak OSMO_STRBUF_APPEND(), add OSMO_STRBUF_APPEND_NOLEN() Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13594 Change subject: tweak OSMO_STRBUF_APPEND(), add OSMO_STRBUF_APPEND_NOLEN() ...................................................................... tweak OSMO_STRBUF_APPEND(), add OSMO_STRBUF_APPEND_NOLEN() In OSMO_STRBUF_APPEND, use local variable names that are less likely to shadow other local variables: prefix with _sb_. In OSMO_STRBUF_APPEND, add a check to add to .pos only if it is not NULL. Add OSMO_STRBUF_APPEND_NOLEN(), which works for function signatures that don't return a length. This is useful for any osmo_*_buf() string writing functions, so that these write directly to the strbuf. Change-Id: I108cadf72deb3a3bcab9a07e50572d9da1ab0359 --- M include/osmocom/core/utils.h M tests/utils/utils_test.c M tests/utils/utils_test.ok 3 files changed, 53 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/94/13594/1 diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index e19649a..0daad76 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -199,14 +199,14 @@ #define OSMO_STRBUF_APPEND(STRBUF, func, args...) do { \ if (!(STRBUF).pos) \ (STRBUF).pos = (STRBUF).buf; \ - size_t remain = (STRBUF).buf ? (STRBUF).len - ((STRBUF).pos - (STRBUF).buf) : 0; \ - int l = func((STRBUF).pos, remain, ##args); \ - if (l < 0 || l > remain) \ + size_t _sb_remain = (STRBUF).buf ? (STRBUF).len - ((STRBUF).pos - (STRBUF).buf) : 0; \ + int _sb_l = func((STRBUF).pos, _sb_remain, ##args); \ + if (_sb_l < 0 || _sb_l > _sb_remain) \ (STRBUF).pos = (STRBUF).buf + (STRBUF).len; \ - else \ - (STRBUF).pos += l; \ - if (l > 0) \ - (STRBUF).chars_needed += l; \ + else if ((STRBUF).pos) \ + (STRBUF).pos += _sb_l; \ + if (_sb_l > 0) \ + (STRBUF).chars_needed += _sb_l; \ } while(0) /*! Shortcut for OSMO_STRBUF_APPEND() invocation using snprintf(). @@ -231,6 +231,29 @@ #define OSMO_STRBUF_PRINTF(STRBUF, fmt, args...) \ OSMO_STRBUF_APPEND(STRBUF, snprintf, fmt, ##args) +/*! Like OSMO_STRBUF_APPEND(), but for function signatures that return the char* buffer instead of a length. + * When using this function, the final STRBUF.chars_needed may not reflect the actual number of characters needed, since + * that number cannot be obtained from this kind of function signature. + * \param[inout] STRBUF A struct osmo_strbuf instance. + * \param[in] func A function with a signature of char *func(char *dst, size_t dst_len [, args]) where + * the returned string is always written to dst. + * \param[in] args Arguments passed to func, if any. + */ +#define OSMO_STRBUF_APPEND_NOLEN(STRBUF, func, args...) do { \ + if (!(STRBUF).pos) \ + (STRBUF).pos = (STRBUF).buf; \ + size_t _sb_remain = (STRBUF).buf ? (STRBUF).len - ((STRBUF).pos - (STRBUF).buf) : 0; \ + if (_sb_remain) { \ + func((STRBUF).pos, _sb_remain, ##args); \ + } \ + size_t _sb_l = (STRBUF).pos ? strnlen((STRBUF).pos, _sb_remain) : 0; \ + if (_sb_l > _sb_remain) \ + (STRBUF).pos = (STRBUF).buf + (STRBUF).len; \ + else if ((STRBUF).pos) \ + (STRBUF).pos += _sb_l; \ + (STRBUF).chars_needed += _sb_l; \ + } while(0) + bool osmo_str_startswith(const char *str, const char *startswith_str); /*! @} */ diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index 211b4d1..223f67d 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -1014,6 +1014,23 @@ printf("(need %d chars, had size=63) %s\n", rc, buf); } +void strbuf_test_nolen() +{ + char buf[20]; + struct osmo_strbuf sb = { .buf = buf, .len = sizeof(buf) }; + uint8_t ubits[] = {0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0}; + printf("\n%s\n", __func__); + + OSMO_STRBUF_APPEND_NOLEN(sb, osmo_ubit_dump_buf, ubits, sizeof(ubits)); + printf("%zu: %s (need=%zu)\n", sb.len, buf, sb.chars_needed); + OSMO_STRBUF_APPEND_NOLEN(sb, osmo_ubit_dump_buf, ubits, sizeof(ubits)); + printf("more: %s (need=%zu)\n", buf, sb.chars_needed); + + sb = (struct osmo_strbuf){ .buf = buf, .len = 10 }; + OSMO_STRBUF_APPEND_NOLEN(sb, osmo_ubit_dump_buf, ubits, sizeof(ubits)); + printf("%zu: %s (need=%zu)\n", sb.len, buf, sb.chars_needed); +} + static void startswith_test_str(const char *str, const char *startswith_str, bool expect_rc) { bool rc = osmo_str_startswith(str, startswith_str); @@ -1059,6 +1076,7 @@ osmo_sockaddr_to_str_and_uint_test(); osmo_str_tolowupper_test(); strbuf_test(); + strbuf_test_nolen(); startswith_test(); return 0; } diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok index 5783eb1..587c6f0 100644 --- a/tests/utils/utils_test.ok +++ b/tests/utils/utils_test.ok @@ -341,6 +341,11 @@ T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! -- T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! -- T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! (need 134 chars, had size=63) T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! -- T minus 10 9 8 7 +strbuf_test_nolen +20: 0001011100101010 (need=16) +more: 0001011100101010000 (need=19) +10: 000101110 (need=9) + startswith_test() osmo_str_startswith(NULL, NULL) == true osmo_str_startswith("", NULL) == true -- To view, visit https://gerrit.osmocom.org/13594 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I108cadf72deb3a3bcab9a07e50572d9da1ab0359 Gerrit-Change-Number: 13594 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:36:37 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 05:36:37 +0000 Subject: Change in libosmocore[master]: add fsm_dealloc_test.c In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13391 ) Change subject: add fsm_dealloc_test.c ...................................................................... add fsm_dealloc_test.c Despite efforts to properly handle "GONE" events and entering a ST_DESTROYING only once, so far this test runs straight into a heap use-after-free. With current fsm.c, it is hard to resolve the situation with the objects named "other" also causing deallocations besides the FSM instance parent/child relations. For illustration, add an "expected" test output file fsm_dealloc_test.err, making this pass will follow in a subsequent patch. Change-Id: If801907c541bca9f524c9e5fd22ac280ca16979a --- M tests/Makefile.am A tests/fsm/fsm_dealloc_test.c A tests/fsm/fsm_dealloc_test.err 3 files changed, 606 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/Makefile.am b/tests/Makefile.am index d123ee2..09a1c18 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -51,7 +51,11 @@ endif if ENABLE_CTRL -check_PROGRAMS += ctrl/ctrl_test fsm/fsm_test +check_PROGRAMS += \ + ctrl/ctrl_test \ + fsm/fsm_test \ + fsm/fsm_dealloc_test \ + $(NULL) endif if ENABLE_STATS_TEST @@ -207,6 +211,9 @@ $(top_builddir)/src/gsm/libosmogsm.la \ $(top_builddir)/src/vty/libosmovty.la +fsm_fsm_dealloc_test_SOURCES = fsm/fsm_dealloc_test.c +fsm_fsm_dealloc_test_LDADD = $(LDADD) + write_queue_wqueue_test_SOURCES = write_queue/wqueue_test.c socket_socket_test_SOURCES = socket/socket_test.c diff --git a/tests/fsm/fsm_dealloc_test.c b/tests/fsm/fsm_dealloc_test.c new file mode 100644 index 0000000..5a493ad --- /dev/null +++ b/tests/fsm/fsm_dealloc_test.c @@ -0,0 +1,476 @@ +/* Scenarios of parent/child FSM instances cleaning up and deallocating from various triggers. */ + +#include + +#include +#include +#include +#include + +enum event { + EV_DESTROY, + EV_CHILD_GONE, + EV_OTHER_GONE, +}; + +static const struct value_string test_fsm_event_names[] = { + OSMO_VALUE_STRING(EV_DESTROY), + OSMO_VALUE_STRING(EV_CHILD_GONE), + OSMO_VALUE_STRING(EV_OTHER_GONE), + {} +}; + +enum state { + ST_ALIVE, + ST_DESTROYING, +}; + +enum objname { + root = 0, + branch0, + twig0a, + twig0b, + branch1, + twig1a, + twig1b, + + other, + scene_size +}; + +struct scene { + struct obj *o[scene_size]; + + /* The use count is actually just to help tracking what functions have not exited yet */ + struct osmo_use_count use_count; +}; + +int use_cb(struct osmo_use_count_entry *use_count_entry, int32_t old_use_count, const char *file, int line) +{ + char buf[128]; + LOGP(DLGLOBAL, LOGL_DEBUG, "%s\n", osmo_use_count_name_buf(buf, sizeof(buf), use_count_entry->use_count)); + return 0; +} + +/* References to related actual objects that are tied to FSM instances. */ +struct obj { + struct osmo_fsm_inst *fi; + struct scene *s; + struct obj *parent; + struct obj *child[2]; + struct obj *other[3]; +}; + +static void scene_forget_obj(struct scene *s, struct obj *obj) +{ + int i; + for (i = 0; i < ARRAY_SIZE(obj->s->o); i++) { + if (obj->s->o[i] != obj) + continue; + LOGPFSML(obj->fi, LOGL_DEBUG, "scene forgets %s\n", obj->fi->id); + obj->s->o[i] = NULL; + } +} + +struct scene *g_scene = NULL; + +#define GET() \ + char *token = talloc_asprintf(g_scene, "%s.%s()", obj->fi->id, __func__); \ + osmo_use_count_get_put(&g_scene->use_count, token, 1) + +#define PUT() osmo_use_count_get_put(&g_scene->use_count, token, -1) + +void alive_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + LOGPFSML(fi, LOGL_DEBUG, "%s()\n", __func__); +} + +/* Remove obj->other[*] reference, return true if found and removed, false if not. */ +bool other_gone(struct obj *obj, struct obj *other) +{ + int i; + GET(); + for (i = 0; i < ARRAY_SIZE(obj->other); i++) { + if (obj->other[i] == other) { + obj->other[i] = NULL; + LOGPFSML(obj->fi, LOGL_DEBUG, "EV_OTHER_GONE: Dropped reference %s.other[%d] = %s\n", obj->fi->id, i, + other->fi->id); + PUT(); + return true; + } + } + PUT(); + return false; +} + +/* Remove obj->child[*] reference, return true if more children remain after this, false if all are gone */ +bool child_gone(struct obj *obj, struct obj *child) +{ + int i; + bool found; + if (!child) { + LOGPFSML(obj->fi, LOGL_DEBUG, "EV_CHILD_GONE with NULL data, must be a parent_term event. Ignore.\n"); + return true; + } + GET(); + found = false; + for (i = 0; i < ARRAY_SIZE(obj->child); i++) { + if (obj->child[i] == child) { + obj->child[i] = NULL; + LOGPFSML(obj->fi, LOGL_DEBUG, "EV_CHILD_GONE: Dropped reference %s.child[%d] = %s\n", obj->fi->id, i, + child->fi->id); + found = true; + } + } + if (!found) + LOGPFSML(obj->fi, LOGL_ERROR, "EV_CHILD_GONE: cannot find child %s\n", + child && child->fi ? child->fi->id : "(null)"); + + /* Any children left? */ + for (i = 0; i < ARRAY_SIZE(obj->child); i++) { + if (obj->child[i]) { + LOGPFSML(obj->fi, LOGL_DEBUG, "still exists: child[%d]\n", i); + PUT(); + return true; + } + } + LOGPFSML(obj->fi, LOGL_DEBUG, "No more children\n"); + PUT(); + return false; +} + +void alive(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct obj *obj = fi->priv; + GET(); + LOGPFSML(fi, LOGL_DEBUG, "%s(%s)\n", __func__, osmo_fsm_event_name(fi->fsm, event)); + switch (event) { + case EV_OTHER_GONE: + if (other_gone(obj, data)) { + /* Something this object depends on is gone, trigger deallocation */ + osmo_fsm_inst_state_chg(fi, ST_DESTROYING, 0, 0); + } + break; + + case EV_CHILD_GONE: + if (!child_gone(obj, data)) { + /* All children are gone. Deallocate. */ + osmo_fsm_inst_state_chg(fi, ST_DESTROYING, 0, 0); + } + break; + + case EV_DESTROY: + osmo_fsm_inst_state_chg(fi, ST_DESTROYING, 0, 0); + break; + + default: + OSMO_ASSERT(false); + } + PUT(); +} + +void destroying_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct obj *obj = fi->priv; + GET(); + LOGPFSML(fi, LOGL_DEBUG, "%s() from %s\n", __func__, osmo_fsm_state_name(fi->fsm, prev_state)); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, 0); + PUT(); +} + +void destroying(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct obj *obj = fi->priv; + GET(); + LOGPFSML(fi, LOGL_DEBUG, "%s(%s)\n", __func__, osmo_fsm_event_name(fi->fsm, event)); + switch (event) { + case EV_OTHER_GONE: + other_gone(obj, data); + break; + + case EV_CHILD_GONE: + child_gone(obj, data); + break; + + case EV_DESTROY: + LOGPFSML(fi, LOGL_DEBUG, "already destroying\n"); + break; + + default: + OSMO_ASSERT(false); + } + PUT(); +} + +#define S(x) (1 << (x)) + +static const struct osmo_fsm_state test_fsm_states[] = { + [ST_ALIVE] = { + .name = "alive", + .in_event_mask = 0 + | S(EV_CHILD_GONE) + | S(EV_OTHER_GONE) + | S(EV_DESTROY) + , + .out_state_mask = 0 + | S(ST_ALIVE) + | S(ST_DESTROYING) + , + .onenter = alive_onenter, + .action = alive, + }, + [ST_DESTROYING] = { + .name = "destroying", + .in_event_mask = 0 + | S(EV_CHILD_GONE) + | S(EV_OTHER_GONE) + | S(EV_DESTROY) + , + .out_state_mask = 0 + | S(ST_DESTROYING) + , + .onenter = destroying_onenter, + .action = destroying, + }, +}; + +void cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) +{ + struct obj *obj = fi->priv; + int i; + GET(); + LOGPFSML(fi, LOGL_DEBUG, "%s()\n", __func__); + + /* Remove from the scene overview for this test */ + scene_forget_obj(obj->s, obj); + + /* Signal "other" objects */ + for (i = 0; i < ARRAY_SIZE(obj->other); i++) { + struct obj *other = obj->other[i]; + if (!other) + continue; + LOGPFSML(fi, LOGL_DEBUG, "removing reference %s.other[%d] -> %s\n", + obj->fi->id, i, other->fi->id); + obj->other[i] = NULL; + osmo_fsm_inst_dispatch(other->fi, EV_OTHER_GONE, obj); + } + + if (obj->parent) + osmo_fsm_inst_dispatch(obj->parent->fi, EV_CHILD_GONE, obj); + + /* children are handled by fsm.c: term event / osmo_fsm_inst_term_children() */ + LOGPFSML(fi, LOGL_DEBUG, "%s() done\n", __func__); + PUT(); +} + +int timer_cb(struct osmo_fsm_inst *fi) +{ + LOGPFSML(fi, LOGL_DEBUG, "%s()\n", __func__); + return 1; +} + +void pre_term(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) +{ + LOGPFSML(fi, LOGL_DEBUG, "%s()\n", __func__); +} + +struct osmo_fsm test_fsm = { + .name = "test", + .states = test_fsm_states, + .num_states = ARRAY_SIZE(test_fsm_states), + .cleanup = cleanup, + .timer_cb = timer_cb, + .event_names = test_fsm_event_names, + .pre_term = pre_term, + .log_subsys = DLGLOBAL, +}; + +void *ctx = NULL; + +static struct obj *obj_alloc(struct scene *s, struct obj *parent, const char *id) { + struct osmo_fsm_inst *fi; + struct obj *obj; + if (!parent) { + fi = osmo_fsm_inst_alloc(&test_fsm, s, NULL, LOGL_DEBUG, id); + OSMO_ASSERT(fi); + } else { + fi = osmo_fsm_inst_alloc_child(&test_fsm, parent->fi, EV_CHILD_GONE); + OSMO_ASSERT(fi); + osmo_fsm_inst_update_id(fi, id); + } + + obj = talloc_zero(fi, struct obj); + fi->priv = obj; + *obj = (struct obj){ + .fi = fi, + .s = s, + .parent = parent, + }; + + if (parent) { + int i; + for (i = 0; i < ARRAY_SIZE(parent->child); i++) { + if (parent->child[i]) + continue; + parent->child[i] = obj; + break; + } + } + + return obj; +}; + +void obj_add_other(struct obj *a, struct obj *b) +{ + int i; + for (i = 0; i < ARRAY_SIZE(a->other); i++) { + if (a->other[i]) + i++; + a->other[i] = b; + LOGPFSML(a->fi, LOGL_DEBUG, "%s.other[%d] = %s\n", a->fi->id, i, b->fi->id); + return; + } +} + +void obj_set_other(struct obj *a, struct obj *b) +{ + obj_add_other(a, b); + obj_add_other(b, a); +} + +static struct scene *scene_alloc() +{ + struct scene *s = talloc_zero(ctx, struct scene); + s->use_count.talloc_object = s; + s->use_count.use_cb = use_cb; + + LOGP(DLGLOBAL, LOGL_DEBUG, "%s()\n", __func__); + + /* + s->o[root] = obj_alloc(s, NULL, "root"); + */ + + s->o[branch0] = obj_alloc(s, s->o[root], "_branch0"); + + s->o[twig0a] = obj_alloc(s, s->o[branch0], "__twig0a"); + + /* + s->o[twig0b] = obj_alloc(s, s->o[branch0], "__twig0b"); + + s->o[branch1] = obj_alloc(s, s->o[root], "_branch1"); + s->o[twig1a] = obj_alloc(s, s->o[branch1], "__twig1a"); + s->o[twig1b] = obj_alloc(s, s->o[branch1], "__twig1b"); + */ + + s->o[other] = obj_alloc(s, NULL, "other"); + + obj_set_other(s->o[branch0], s->o[other]); + obj_set_other(s->o[twig0a], s->o[other]); + + return s; +} + +static int scene_dump(struct scene *s) +{ + int i; + int got = 0; + for (i = 0; i < ARRAY_SIZE(s->o); i++) { + if (!s->o[i]) + continue; + LOGP(DLGLOBAL, LOGL_DEBUG, " %s\n", s->o[i]->fi->id); + got++; + } + return got; +} + +static void scene_clean(struct scene *s) +{ + int i; + for (i = 0; i < ARRAY_SIZE(s->o); i++) { + if (!s->o[i]) + continue; + osmo_fsm_inst_term(s->o[i]->fi, OSMO_FSM_TERM_ERROR, 0); + s->o[i] = NULL; + } + talloc_free(s); +} + +void obj_destroy(struct obj *obj) +{ + osmo_fsm_inst_dispatch(obj->fi, EV_DESTROY, NULL); +} + +void obj_term(struct obj *obj) +{ + osmo_fsm_inst_term(obj->fi, OSMO_FSM_TERM_REGULAR, NULL); +} + +void test_dealloc(enum objname trigger, bool by_destroy_event) +{ + struct scene *s = scene_alloc(); + const char *label = by_destroy_event ? "destroy-event" : "term"; + int remain; + g_scene = s; + if (!s->o[trigger]) { + LOGP(DLGLOBAL, LOGL_DEBUG, "--- Test disabled: object %d was not created. Cleaning up.\n", + trigger); + scene_clean(s); + return; + } + LOGP(DLGLOBAL, LOGL_DEBUG, "------ before %s cascade, got:\n", label); + scene_dump(s); + LOGP(DLGLOBAL, LOGL_DEBUG, "---\n"); + LOGP(DLGLOBAL, LOGL_DEBUG, "--- %s at %s\n", label, s->o[trigger]->fi->id); + + if (by_destroy_event) + obj_destroy(s->o[trigger]); + else + obj_term(s->o[trigger]); + + LOGP(DLGLOBAL, LOGL_DEBUG, "--- after %s cascade:\n", label); + remain = scene_dump(s); + if (remain) { + LOGP(DLGLOBAL, LOGL_DEBUG, "--- %d objects remain. cleaning up\n", remain); + } else + LOGP(DLGLOBAL, LOGL_DEBUG, "--- all deallocated.\n"); + scene_clean(s); +} + +int main(void) +{ + enum objname trigger; + size_t ctx_blocks; + size_t ctx_size; + int by_destroy_event; + + ctx = talloc_named_const(NULL, 0, "main"); + osmo_init_logging2(ctx, NULL); + + log_set_print_filename(osmo_stderr_target, 0); + log_set_print_level(osmo_stderr_target, 1); + log_set_print_category(osmo_stderr_target, 1); + log_set_print_category_hex(osmo_stderr_target, 0); + log_set_use_color(osmo_stderr_target, 0); + osmo_fsm_log_addr(false); + + log_set_category_filter(osmo_stderr_target, DLGLOBAL, 1, LOGL_DEBUG); + + osmo_fsm_register(&test_fsm); + + ctx_blocks = talloc_total_blocks(ctx); + ctx_size = talloc_total_size(ctx); + + for (trigger = 0; trigger < scene_size; trigger++) { + for (by_destroy_event = 0; by_destroy_event < 2; by_destroy_event++) { + test_dealloc(trigger, (bool)by_destroy_event); + if (ctx_blocks != talloc_total_blocks(ctx) + || ctx_size != talloc_total_size(ctx)) { + talloc_report_full(ctx, stderr); + OSMO_ASSERT(false); + } + } + } + + talloc_free(ctx); + return 0; +} diff --git a/tests/fsm/fsm_dealloc_test.err b/tests/fsm/fsm_dealloc_test.err new file mode 100644 index 0000000..1719677 --- /dev/null +++ b/tests/fsm/fsm_dealloc_test.err @@ -0,0 +1,122 @@ +DLGLOBAL DEBUG scene_alloc() +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: is child of test(_branch0) +DLGLOBAL DEBUG test(other){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: _branch0.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[0] = _branch0 +DLGLOBAL DEBUG test(__twig0a){alive}: __twig0a.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[1] = __twig0a +DLGLOBAL DEBUG --- Test disabled: object 0 was not created. Cleaning up. +DLGLOBAL DEBUG test(_branch0){alive}: Terminating (cause = OSMO_FSM_TERM_ERROR) +DLGLOBAL DEBUG test(_branch0){alive}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DLGLOBAL DEBUG test(__twig0a){alive}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Removing from parent test(_branch0) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() +DLGLOBAL DEBUG test(__twig0a){alive}: scene forgets __twig0a +DLGLOBAL DEBUG test(__twig0a){alive}: removing reference __twig0a.other[0] -> other +DLGLOBAL DEBUG test(other){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.other_gone()) +DLGLOBAL DEBUG test(other){alive}: EV_OTHER_GONE: Dropped reference other.other[1] = __twig0a +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: state_chg to destroying +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(other){destroying}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(other){destroying}: pre_term() +DLGLOBAL DEBUG 4 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() +DLGLOBAL DEBUG test(other){destroying}: scene forgets other +DLGLOBAL DEBUG test(other){destroying}: removing reference other.other[0] -> _branch0 +DLGLOBAL DEBUG test(_branch0){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.other_gone()) +DLGLOBAL DEBUG test(_branch0){alive}: EV_OTHER_GONE: Dropped reference _branch0.other[0] = other +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: state_chg to destroying +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.destroying_onenter()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(_branch0){destroying}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(_branch0){destroying}: pre_term() +DLGLOBAL DEBUG 7 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.destroying_onenter(),_ +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() +DLGLOBAL DEBUG test(_branch0){destroying}: scene forgets _branch0 +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() done +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.destroying_onenter()) +DLGLOBAL DEBUG test(_branch0){destroying}: Freeing instance +DLGLOBAL DEBUG test(_branch0){destroying}: Deallocated +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG 4 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() done +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: Freeing instance +DLGLOBAL DEBUG test(other){destroying}: Deallocated +================================================================= +==12545==ERROR: AddressSanitizer: heap-use-after-free on address 0x6120000003a8 at pc 0x7fa96fdc9149 bp 0x7fff6045b000 sp 0x7fff6045aff8 +WRITE of size 8 at 0x6120000003a8 thread T0 + #0 0x7fa96fdc9148 in __llist_del ../../../src/libosmocore/include/osmocom/core/linuxlist.h:114 + #1 0x7fa96fdc9280 in llist_del ../../../src/libosmocore/include/osmocom/core/linuxlist.h:126 + #2 0x7fa96fdcddaa in osmo_fsm_inst_free ../../../src/libosmocore/src/fsm.c:404 + #3 0x7fa96fdd599c in _osmo_fsm_inst_term ../../../src/libosmocore/src/fsm.c:738 + #4 0x55dde97cb9e3 in destroying_onenter ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:177 + #5 0x7fa96fdd26be in state_chg ../../../src/libosmocore/src/fsm.c:521 + #6 0x7fa96fdd2770 in _osmo_fsm_inst_state_chg ../../../src/libosmocore/src/fsm.c:577 + #7 0x55dde97cb2e6 in alive ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:151 + #8 0x7fa96fdd3d2f in _osmo_fsm_inst_dispatch ../../../src/libosmocore/src/fsm.c:685 + #9 0x55dde97cd0ee in cleanup ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:255 + #10 0x7fa96fdd5192 in _osmo_fsm_inst_term ../../../src/libosmocore/src/fsm.c:733 + #11 0x7fa96fdd60b1 in _osmo_fsm_inst_term_children ../../../src/libosmocore/src/fsm.c:784 + #12 0x7fa96fdd475e in _osmo_fsm_inst_term ../../../src/libosmocore/src/fsm.c:720 + #13 0x55dde97cf5d5 in scene_clean ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:392 + #14 0x55dde97cf92f in test_dealloc ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:417 + #15 0x55dde97cfffe in main ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:465 + #16 0x7fa96eff409a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a) + #17 0x55dde97c7329 in _start (/n/s/dev/make/libosmocore/tests/fsm/fsm_dealloc_test+0x11329) + +0x6120000003a8 is located 104 bytes inside of 288-byte region [0x612000000340,0x612000000460) +freed by thread T0 here: + #0 0x7fa970061b50 in free (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe8b50) + #1 0x7fa96fcbd5d2 (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0xb5d2) + +previously allocated by thread T0 here: + #0 0x7fa970061ed0 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe8ed0) + #1 0x7fa96fcbb140 in _talloc_zero (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0x9140) + +SUMMARY: AddressSanitizer: heap-use-after-free ../../../src/libosmocore/include/osmocom/core/linuxlist.h:114 in __llist_del +Shadow bytes around the buggy address: + 0x0c247fff8020: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa + 0x0c247fff8030: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd + 0x0c247fff8040: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd + 0x0c247fff8050: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa + 0x0c247fff8060: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd +=>0x0c247fff8070: fd fd fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd + 0x0c247fff8080: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa + 0x0c247fff8090: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 + 0x0c247fff80a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x0c247fff80b0: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa + 0x0c247fff80c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa +Shadow byte legend (one shadow byte represents 8 application bytes): + Addressable: 00 + Partially addressable: 01 02 03 04 05 06 07 + Heap left redzone: fa + Freed heap region: fd + Stack left redzone: f1 + Stack mid redzone: f2 + Stack right redzone: f3 + Stack after return: f5 + Stack use after scope: f8 + Global redzone: f9 + Global init order: f6 + Poisoned by user: f7 + Container overflow: fc + Array cookie: ac + Intra object redzone: bb + ASan internal: fe + Left alloca redzone: ca + Right alloca redzone: cb +==12545==ABORTING -- To view, visit https://gerrit.osmocom.org/13391 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If801907c541bca9f524c9e5fd22ac280ca16979a Gerrit-Change-Number: 13391 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:36:38 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 05:36:38 +0000 Subject: Change in libosmocore[master]: fsm: add flag to ensure osmo_fsm_inst_term() happens only once In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13545 ) Change subject: fsm: add flag to ensure osmo_fsm_inst_term() happens only once ...................................................................... fsm: add flag to ensure osmo_fsm_inst_term() happens only once To prevent re-entering osmo_fsm_inst_term() twice for the same osmo_fsm_inst, add flag osmo_fsm_inst.proc.terminating. osmo_fsm_inst_term() sets this to true, or exits if it already is true. Update fsm_dealloc_test.err for illustration. It is not relevant for unit testing yet, just showing the difference. Change-Id: I0c02d76a86f90c49e0eae2f85db64704c96a7674 --- M TODO-RELEASE M include/osmocom/core/fsm.h M src/fsm.c M tests/fsm/fsm_dealloc_test.err 4 files changed, 349 insertions(+), 38 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/TODO-RELEASE b/TODO-RELEASE index ba603c6..5ddc57a 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -10,3 +10,4 @@ libosmogb gprs_ns_inst Adding bss_sns_fi member for IP-SNS support libosmogb gprs_nsvc Adding sig_weight and data_weight members for IP-SNS support libosmogb various new symbols Adding functions related to IP-SNS support +libosmocore osmo_fsm_inst Add flag proc.terminating (ABI change) diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index c40d7f3..07bcd12 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -114,6 +114,8 @@ struct llist_head children; /*! \ref llist_head linked to parent->proc.children */ struct llist_head child; + /*! Indicator whether osmo_fsm_inst_term() was already invoked on this instance. */ + bool terminating; } proc; }; diff --git a/src/fsm.c b/src/fsm.c index d86ff4b..d18406a 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -710,6 +710,12 @@ struct osmo_fsm_inst *parent; uint32_t parent_term_event = fi->proc.parent_term_event; + if (fi->proc.terminating) { + LOGPFSMSRC(fi, file, line, "Ignoring trigger to terminate: already terminating\n"); + return; + } + fi->proc.terminating = true; + LOGPFSMSRC(fi, file, line, "Terminating (cause = %s)\n", osmo_fsm_term_cause_name(cause)); diff --git a/tests/fsm/fsm_dealloc_test.err b/tests/fsm/fsm_dealloc_test.err index 1719677..7f41340 100644 --- a/tests/fsm/fsm_dealloc_test.err +++ b/tests/fsm/fsm_dealloc_test.err @@ -41,6 +41,310 @@ DLGLOBAL DEBUG test(_branch0){alive}: state_chg to destroying DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.destroying_onenter()) DLGLOBAL DEBUG test(_branch0){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(_branch0){destroying}: Ignoring trigger to terminate: already terminating +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG 4 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() done +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: Freeing instance +DLGLOBAL DEBUG test(other){destroying}: Deallocated +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: Received Event EV_CHILD_GONE +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying(EV_CHILD_GONE) +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),_branch0.destroying(),_branch0.child_gone()) +DLGLOBAL DEBUG test(_branch0){destroying}: EV_CHILD_GONE: Dropped reference _branch0.child[0] = __twig0a +DLGLOBAL DEBUG test(_branch0){destroying}: No more children +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() done +DLGLOBAL DEBUG 0 (-) +DLGLOBAL DEBUG test(__twig0a){alive}: Freeing instance +DLGLOBAL DEBUG test(__twig0a){alive}: Deallocated +DLGLOBAL DEBUG 1 (_branch0.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() +DLGLOBAL DEBUG test(_branch0){destroying}: scene forgets _branch0 +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() done +DLGLOBAL DEBUG 0 (-) +DLGLOBAL DEBUG test(_branch0){destroying}: Freeing instance +DLGLOBAL DEBUG test(_branch0){destroying}: Deallocated +DLGLOBAL DEBUG scene_alloc() +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: is child of test(_branch0) +DLGLOBAL DEBUG test(other){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: _branch0.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[0] = _branch0 +DLGLOBAL DEBUG test(__twig0a){alive}: __twig0a.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[1] = __twig0a +DLGLOBAL DEBUG --- Test disabled: object 0 was not created. Cleaning up. +DLGLOBAL DEBUG test(_branch0){alive}: Terminating (cause = OSMO_FSM_TERM_ERROR) +DLGLOBAL DEBUG test(_branch0){alive}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DLGLOBAL DEBUG test(__twig0a){alive}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Removing from parent test(_branch0) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() +DLGLOBAL DEBUG test(__twig0a){alive}: scene forgets __twig0a +DLGLOBAL DEBUG test(__twig0a){alive}: removing reference __twig0a.other[0] -> other +DLGLOBAL DEBUG test(other){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.other_gone()) +DLGLOBAL DEBUG test(other){alive}: EV_OTHER_GONE: Dropped reference other.other[1] = __twig0a +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: state_chg to destroying +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(other){destroying}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(other){destroying}: pre_term() +DLGLOBAL DEBUG 4 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() +DLGLOBAL DEBUG test(other){destroying}: scene forgets other +DLGLOBAL DEBUG test(other){destroying}: removing reference other.other[0] -> _branch0 +DLGLOBAL DEBUG test(_branch0){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.other_gone()) +DLGLOBAL DEBUG test(_branch0){alive}: EV_OTHER_GONE: Dropped reference _branch0.other[0] = other +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: state_chg to destroying +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.destroying_onenter()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(_branch0){destroying}: Ignoring trigger to terminate: already terminating +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG 4 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() done +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: Freeing instance +DLGLOBAL DEBUG test(other){destroying}: Deallocated +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: Received Event EV_CHILD_GONE +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying(EV_CHILD_GONE) +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),_branch0.destroying(),_branch0.child_gone()) +DLGLOBAL DEBUG test(_branch0){destroying}: EV_CHILD_GONE: Dropped reference _branch0.child[0] = __twig0a +DLGLOBAL DEBUG test(_branch0){destroying}: No more children +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() done +DLGLOBAL DEBUG 0 (-) +DLGLOBAL DEBUG test(__twig0a){alive}: Freeing instance +DLGLOBAL DEBUG test(__twig0a){alive}: Deallocated +DLGLOBAL DEBUG 1 (_branch0.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() +DLGLOBAL DEBUG test(_branch0){destroying}: scene forgets _branch0 +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() done +DLGLOBAL DEBUG 0 (-) +DLGLOBAL DEBUG test(_branch0){destroying}: Freeing instance +DLGLOBAL DEBUG test(_branch0){destroying}: Deallocated +DLGLOBAL DEBUG scene_alloc() +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: is child of test(_branch0) +DLGLOBAL DEBUG test(other){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: _branch0.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[0] = _branch0 +DLGLOBAL DEBUG test(__twig0a){alive}: __twig0a.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[1] = __twig0a +DLGLOBAL DEBUG ------ before term cascade, got: +DLGLOBAL DEBUG _branch0 +DLGLOBAL DEBUG __twig0a +DLGLOBAL DEBUG other +DLGLOBAL DEBUG --- +DLGLOBAL DEBUG --- term at _branch0 +DLGLOBAL DEBUG test(_branch0){alive}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(_branch0){alive}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DLGLOBAL DEBUG test(__twig0a){alive}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Removing from parent test(_branch0) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() +DLGLOBAL DEBUG test(__twig0a){alive}: scene forgets __twig0a +DLGLOBAL DEBUG test(__twig0a){alive}: removing reference __twig0a.other[0] -> other +DLGLOBAL DEBUG test(other){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.other_gone()) +DLGLOBAL DEBUG test(other){alive}: EV_OTHER_GONE: Dropped reference other.other[1] = __twig0a +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: state_chg to destroying +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(other){destroying}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(other){destroying}: pre_term() +DLGLOBAL DEBUG 4 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() +DLGLOBAL DEBUG test(other){destroying}: scene forgets other +DLGLOBAL DEBUG test(other){destroying}: removing reference other.other[0] -> _branch0 +DLGLOBAL DEBUG test(_branch0){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.other_gone()) +DLGLOBAL DEBUG test(_branch0){alive}: EV_OTHER_GONE: Dropped reference _branch0.other[0] = other +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: state_chg to destroying +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.destroying_onenter()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(_branch0){destroying}: Ignoring trigger to terminate: already terminating +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG 4 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() done +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: Freeing instance +DLGLOBAL DEBUG test(other){destroying}: Deallocated +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: Received Event EV_CHILD_GONE +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying(EV_CHILD_GONE) +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),_branch0.destroying(),_branch0.child_gone()) +DLGLOBAL DEBUG test(_branch0){destroying}: EV_CHILD_GONE: Dropped reference _branch0.child[0] = __twig0a +DLGLOBAL DEBUG test(_branch0){destroying}: No more children +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() done +DLGLOBAL DEBUG 0 (-) +DLGLOBAL DEBUG test(__twig0a){alive}: Freeing instance +DLGLOBAL DEBUG test(__twig0a){alive}: Deallocated +DLGLOBAL DEBUG 1 (_branch0.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() +DLGLOBAL DEBUG test(_branch0){destroying}: scene forgets _branch0 +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() done +DLGLOBAL DEBUG 0 (-) +DLGLOBAL DEBUG test(_branch0){destroying}: Freeing instance +DLGLOBAL DEBUG test(_branch0){destroying}: Deallocated +DLGLOBAL DEBUG --- after term cascade: +DLGLOBAL DEBUG --- all deallocated. +DLGLOBAL DEBUG scene_alloc() +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: is child of test(_branch0) +DLGLOBAL DEBUG test(other){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: _branch0.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[0] = _branch0 +DLGLOBAL DEBUG test(__twig0a){alive}: __twig0a.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[1] = __twig0a +DLGLOBAL DEBUG ------ before destroy-event cascade, got: +DLGLOBAL DEBUG _branch0 +DLGLOBAL DEBUG __twig0a +DLGLOBAL DEBUG other +DLGLOBAL DEBUG --- +DLGLOBAL DEBUG --- destroy-event at _branch0 +DLGLOBAL DEBUG test(_branch0){alive}: Received Event EV_DESTROY +DLGLOBAL DEBUG 1 (_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: alive(EV_DESTROY) +DLGLOBAL DEBUG test(_branch0){alive}: state_chg to destroying +DLGLOBAL DEBUG 2 (_branch0.alive(),_branch0.destroying_onenter()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(_branch0){destroying}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(_branch0){destroying}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DLGLOBAL DEBUG test(__twig0a){alive}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Removing from parent test(_branch0) +DLGLOBAL DEBUG 3 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() +DLGLOBAL DEBUG test(__twig0a){alive}: scene forgets __twig0a +DLGLOBAL DEBUG test(__twig0a){alive}: removing reference __twig0a.other[0] -> other +DLGLOBAL DEBUG test(other){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 4 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 5 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.other_gone()) +DLGLOBAL DEBUG test(other){alive}: EV_OTHER_GONE: Dropped reference other.other[1] = __twig0a +DLGLOBAL DEBUG 4 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: state_chg to destroying +DLGLOBAL DEBUG 5 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(other){destroying}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(other){destroying}: pre_term() +DLGLOBAL DEBUG 6 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() +DLGLOBAL DEBUG test(other){destroying}: scene forgets other +DLGLOBAL DEBUG test(other){destroying}: removing reference other.other[0] -> _branch0 +DLGLOBAL DEBUG test(_branch0){destroying}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 7 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_ +DLGLOBAL DEBUG test(_branch0){destroying}: destroying(EV_OTHER_GONE) +DLGLOBAL DEBUG 8 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_ +DLGLOBAL DEBUG test(_branch0){destroying}: EV_OTHER_GONE: Dropped reference _branch0.other[0] = other +DLGLOBAL DEBUG 7 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_ +DLGLOBAL DEBUG 6 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() done +DLGLOBAL DEBUG 5 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: Freeing instance +DLGLOBAL DEBUG test(other){destroying}: Deallocated +DLGLOBAL DEBUG 4 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG 3 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: Received Event EV_CHILD_GONE +DLGLOBAL DEBUG 4 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying(EV_CHILD_GONE) +DLGLOBAL DEBUG 5 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),_branch0.destroying(),_branch0.child_gone()) +DLGLOBAL DEBUG test(_branch0){destroying}: EV_CHILD_GONE: Dropped reference _branch0.child[0] = __twig0a +DLGLOBAL DEBUG test(_branch0){destroying}: No more children +DLGLOBAL DEBUG 4 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup(),_branch0.destroying()) +DLGLOBAL DEBUG 3 (_branch0.alive(),_branch0.destroying_onenter(),__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() done +DLGLOBAL DEBUG 2 (_branch0.alive(),_branch0.destroying_onenter()) +DLGLOBAL DEBUG test(__twig0a){alive}: Freeing instance +DLGLOBAL DEBUG test(__twig0a){alive}: Deallocated +DLGLOBAL DEBUG 3 (_branch0.alive(),_branch0.destroying_onenter(),_branch0.cleanup()) +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() +DLGLOBAL DEBUG test(_branch0){destroying}: scene forgets _branch0 +DLGLOBAL DEBUG test(_branch0){destroying}: cleanup() done +DLGLOBAL DEBUG 2 (_branch0.alive(),_branch0.destroying_onenter()) +DLGLOBAL DEBUG test(_branch0){destroying}: Freeing instance +DLGLOBAL DEBUG test(_branch0){destroying}: Deallocated +DLGLOBAL DEBUG 1 (_branch0.alive()) +DLGLOBAL DEBUG 0 (-) +DLGLOBAL DEBUG --- after destroy-event cascade: +DLGLOBAL DEBUG --- all deallocated. +DLGLOBAL DEBUG scene_alloc() +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: is child of test(_branch0) +DLGLOBAL DEBUG test(other){alive}: Allocated +DLGLOBAL DEBUG test(_branch0){alive}: _branch0.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[0] = _branch0 +DLGLOBAL DEBUG test(__twig0a){alive}: __twig0a.other[0] = other +DLGLOBAL DEBUG test(other){alive}: other.other[1] = __twig0a +DLGLOBAL DEBUG ------ before term cascade, got: +DLGLOBAL DEBUG _branch0 +DLGLOBAL DEBUG __twig0a +DLGLOBAL DEBUG other +DLGLOBAL DEBUG --- +DLGLOBAL DEBUG --- term at __twig0a +DLGLOBAL DEBUG test(__twig0a){alive}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(__twig0a){alive}: pre_term() +DLGLOBAL DEBUG test(__twig0a){alive}: Removing from parent test(_branch0) +DLGLOBAL DEBUG 1 (__twig0a.cleanup()) +DLGLOBAL DEBUG test(__twig0a){alive}: cleanup() +DLGLOBAL DEBUG test(__twig0a){alive}: scene forgets __twig0a +DLGLOBAL DEBUG test(__twig0a){alive}: removing reference __twig0a.other[0] -> other +DLGLOBAL DEBUG test(other){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.other_gone()) +DLGLOBAL DEBUG test(other){alive}: EV_OTHER_GONE: Dropped reference other.other[1] = __twig0a +DLGLOBAL DEBUG 2 (__twig0a.cleanup(),other.alive()) +DLGLOBAL DEBUG test(other){alive}: state_chg to destroying +DLGLOBAL DEBUG 3 (__twig0a.cleanup(),other.alive(),other.destroying_onenter()) +DLGLOBAL DEBUG test(other){destroying}: destroying_onenter() from alive +DLGLOBAL DEBUG test(other){destroying}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DLGLOBAL DEBUG test(other){destroying}: pre_term() +DLGLOBAL DEBUG 4 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup()) +DLGLOBAL DEBUG test(other){destroying}: cleanup() +DLGLOBAL DEBUG test(other){destroying}: scene forgets other +DLGLOBAL DEBUG test(other){destroying}: removing reference other.other[0] -> _branch0 +DLGLOBAL DEBUG test(_branch0){alive}: Received Event EV_OTHER_GONE +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: alive(EV_OTHER_GONE) +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.other_gone()) +DLGLOBAL DEBUG test(_branch0){alive}: EV_OTHER_GONE: Dropped reference _branch0.other[0] = other +DLGLOBAL DEBUG 5 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive()) +DLGLOBAL DEBUG test(_branch0){alive}: state_chg to destroying +DLGLOBAL DEBUG 6 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.destroying_onenter()) +DLGLOBAL DEBUG test(_branch0){destroying}: destroying_onenter() from alive DLGLOBAL DEBUG test(_branch0){destroying}: Terminating (cause = OSMO_FSM_TERM_REGULAR) DLGLOBAL DEBUG test(_branch0){destroying}: pre_term() DLGLOBAL DEBUG 7 (__twig0a.cleanup(),other.alive(),other.destroying_onenter(),other.cleanup(),_branch0.alive(),_branch0.destroying_onenter(),_ @@ -57,49 +361,47 @@ DLGLOBAL DEBUG test(other){destroying}: Freeing instance DLGLOBAL DEBUG test(other){destroying}: Deallocated ================================================================= -==12545==ERROR: AddressSanitizer: heap-use-after-free on address 0x6120000003a8 at pc 0x7fa96fdc9149 bp 0x7fff6045b000 sp 0x7fff6045aff8 -WRITE of size 8 at 0x6120000003a8 thread T0 - #0 0x7fa96fdc9148 in __llist_del ../../../src/libosmocore/include/osmocom/core/linuxlist.h:114 - #1 0x7fa96fdc9280 in llist_del ../../../src/libosmocore/include/osmocom/core/linuxlist.h:126 - #2 0x7fa96fdcddaa in osmo_fsm_inst_free ../../../src/libosmocore/src/fsm.c:404 - #3 0x7fa96fdd599c in _osmo_fsm_inst_term ../../../src/libosmocore/src/fsm.c:738 - #4 0x55dde97cb9e3 in destroying_onenter ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:177 - #5 0x7fa96fdd26be in state_chg ../../../src/libosmocore/src/fsm.c:521 - #6 0x7fa96fdd2770 in _osmo_fsm_inst_state_chg ../../../src/libosmocore/src/fsm.c:577 - #7 0x55dde97cb2e6 in alive ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:151 - #8 0x7fa96fdd3d2f in _osmo_fsm_inst_dispatch ../../../src/libosmocore/src/fsm.c:685 - #9 0x55dde97cd0ee in cleanup ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:255 - #10 0x7fa96fdd5192 in _osmo_fsm_inst_term ../../../src/libosmocore/src/fsm.c:733 - #11 0x7fa96fdd60b1 in _osmo_fsm_inst_term_children ../../../src/libosmocore/src/fsm.c:784 - #12 0x7fa96fdd475e in _osmo_fsm_inst_term ../../../src/libosmocore/src/fsm.c:720 - #13 0x55dde97cf5d5 in scene_clean ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:392 - #14 0x55dde97cf92f in test_dealloc ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:417 - #15 0x55dde97cfffe in main ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:465 - #16 0x7fa96eff409a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a) - #17 0x55dde97c7329 in _start (/n/s/dev/make/libosmocore/tests/fsm/fsm_dealloc_test+0x11329) +==12033==ERROR: AddressSanitizer: heap-use-after-free on address 0x6120000015a8 at pc 0x7f873241e1f9 bp 0x7ffe32f6c8c0 sp 0x7ffe32f6c8b8 +WRITE of size 8 at 0x6120000015a8 thread T0 + #0 0x7f873241e1f8 in __llist_del ../../../src/libosmocore/include/osmocom/core/linuxlist.h:117 + #1 0x7f873241e330 in llist_del ../../../src/libosmocore/include/osmocom/core/linuxlist.h:129 + #2 0x7f8732422e5a in osmo_fsm_inst_free ../../../src/libosmocore/src/fsm.c:404 + #3 0x7f873242b2e4 in _osmo_fsm_inst_term ../../../src/libosmocore/src/fsm.c:744 + #4 0x55c9a9fb49e3 in destroying_onenter ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:177 + #5 0x7f873242776e in state_chg ../../../src/libosmocore/src/fsm.c:521 + #6 0x7f8732427820 in _osmo_fsm_inst_state_chg ../../../src/libosmocore/src/fsm.c:577 + #7 0x55c9a9fb42e6 in alive ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:151 + #8 0x7f8732428ddf in _osmo_fsm_inst_dispatch ../../../src/libosmocore/src/fsm.c:685 + #9 0x55c9a9fb60ee in cleanup ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:255 + #10 0x7f873242aada in _osmo_fsm_inst_term ../../../src/libosmocore/src/fsm.c:739 + #11 0x55c9a9fb87d6 in obj_term ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:405 + #12 0x55c9a9fb8d00 in test_dealloc ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:428 + #13 0x55c9a9fb8ffe in main ../../../src/libosmocore/tests/fsm/fsm_dealloc_test.c:465 + #14 0x7f873164509a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a) + #15 0x55c9a9fb0329 in _start (/n/s/dev/make/libosmocore/tests/fsm/fsm_dealloc_test+0x11329) -0x6120000003a8 is located 104 bytes inside of 288-byte region [0x612000000340,0x612000000460) +0x6120000015a8 is located 104 bytes inside of 296-byte region [0x612000001540,0x612000001668) freed by thread T0 here: - #0 0x7fa970061b50 in free (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe8b50) - #1 0x7fa96fcbd5d2 (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0xb5d2) + #0 0x7f87326bcfd0 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe8fd0) + #1 0x7f873230f5d2 (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0xb5d2) previously allocated by thread T0 here: - #0 0x7fa970061ed0 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe8ed0) - #1 0x7fa96fcbb140 in _talloc_zero (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0x9140) + #0 0x7f87326bd350 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9350) + #1 0x7f873230d140 in _talloc_zero (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0x9140) -SUMMARY: AddressSanitizer: heap-use-after-free ../../../src/libosmocore/include/osmocom/core/linuxlist.h:114 in __llist_del +SUMMARY: AddressSanitizer: heap-use-after-free ../../../src/libosmocore/include/osmocom/core/linuxlist.h:117 in __llist_del Shadow bytes around the buggy address: - 0x0c247fff8020: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa - 0x0c247fff8030: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd - 0x0c247fff8040: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd - 0x0c247fff8050: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa - 0x0c247fff8060: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd -=>0x0c247fff8070: fd fd fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd - 0x0c247fff8080: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa - 0x0c247fff8090: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 - 0x0c247fff80a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x0c247fff80b0: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa - 0x0c247fff80c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x0c247fff8260: fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa + 0x0c247fff8270: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd + 0x0c247fff8280: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd + 0x0c247fff8290: fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa + 0x0c247fff82a0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd +=>0x0c247fff82b0: fd fd fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd + 0x0c247fff82c0: fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa + 0x0c247fff82d0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 + 0x0c247fff82e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x0c247fff82f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa + 0x0c247fff8300: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 @@ -119,4 +421,4 @@ ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb -==12545==ABORTING +==12033==ABORTING -- To view, visit https://gerrit.osmocom.org/13545 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0c02d76a86f90c49e0eae2f85db64704c96a7674 Gerrit-Change-Number: 13545 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:36:39 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 05:36:39 +0000 Subject: Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13392 ) Change subject: fsm: support graceful osmo_fsm_inst_term() cascades ...................................................................... fsm: support graceful osmo_fsm_inst_term() cascades Add global flag osmo_fsm_term_safely() -- if set to true, enable the following behavior: Detect osmo_fsm_inst_term() occuring within osmo_fsm_inst_term(): - collect deallocations until the outermost osmo_fsm_inst_term() is done. - call osmo_fsm_inst_free() *after* dispatching the parent event. If a struct osmo_fsm_inst enters osmo_fsm_inst_term() while another is already within osmo_fsm_inst_term(), do not directly deallocate it, but talloc-reparent it to a separate talloc context, to be deallocated with the outermost FSM inst. The effect is that all osmo_fsm_inst freed within an osmo_fsm_inst_term() cascade will stay allocated until all osmo_fsm_inst_term() are complete and all of them will be deallocated at the same time. Mark the deferred deallocation state as __thread in an attempt to make cascaded deallocation handling threadsafe. Keep the enable/disable flag separate, so that it is global and not per-thread. The feature is showcased by fsm_dealloc_test.c: with this feature, all of those wild deallocation scenarios succeed. Make fsm_dealloc_test a normal regression test in testsuite.at. Rationale: It is difficult to gracefully handle deallocations of groups of FSM instances that reference each other. As soon as one child dispatching a cleanup event causes its parent to deallocate before fsm.c was ready for it, deallocation will hit a use-after-free. Before this patch, by using parent_term events and distinct "terminating" FSM states, parent/child FSMs can be taught to wait for all children to deallocate before deallocating the parent. But as soon as a non-child / non-parent FSM instance is involved, or actually any other cleanup() action that triggers parent FSMs or parent talloc contexts to become unused, it is near impossible to think of all possible deallocation events ricocheting, and to avoid running into freeing FSM instances that were still in the middle of osmo_fsm_inst_term(), or FSM instances to enter osmo_fsm_inst_term() more than once. This patch makes deallocation of "all possible" setups of complex cross referencing FSM instances easy to handle correctly, without running into use-after-free or double free situations, and, notably, without changing calling code. Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 --- M include/osmocom/core/fsm.h M src/fsm.c M tests/Makefile.am M tests/fsm/fsm_dealloc_test.c M tests/fsm/fsm_dealloc_test.err M tests/testsuite.at 6 files changed, 3,503 insertions(+), 301 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/13392 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8eda67540a1cd444491beb7856b9fcd0a3143b18 Gerrit-Change-Number: 13392 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:36:39 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 05:36:39 +0000 Subject: Change in libosmocore[master]: fsm_dealloc_test: no need for ST_DESTROYING In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13393 ) Change subject: fsm_dealloc_test: no need for ST_DESTROYING ...................................................................... fsm_dealloc_test: no need for ST_DESTROYING A separate ST_DESTROYING state originally helped with certain deallocation scenarios. But now that fsm.c avoids re-entering osmo_fsm_inst_term() twice and gracefully handles FSM instance deallocations for termination cascades, it is actually just as safe without a separate ST_DESTROYING state. ST_DESTROYING was used to flag deallocation and prevent entering osmo_fsm_inst_term() twice, which works only in a very limited range of scenarios. Remove ST_DESTROYING from fsm_dealloc_test.c to show that all tested scenarios still clean up gracefully. Change-Id: I05354e6cad9b82ba474fa50ffd41d481b3c697b4 --- M tests/fsm/fsm_dealloc_test.c M tests/fsm/fsm_dealloc_test.err 2 files changed, 1,522 insertions(+), 1,801 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/13393 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I05354e6cad9b82ba474fa50ffd41d481b3c697b4 Gerrit-Change-Number: 13393 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:36:40 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 05:36:40 +0000 Subject: Change in libosmocore[master]: make osmo_sockaddr_str_is_set() NULL-safe In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13572 ) Change subject: make osmo_sockaddr_str_is_set() NULL-safe ...................................................................... make osmo_sockaddr_str_is_set() NULL-safe Obviously a NULL pointer should return false instead of segfaulting. Change-Id: Iac025cf4d556cbed99f3924cd9ca05a05881cd9a --- M src/sockaddr_str.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sockaddr_str.c b/src/sockaddr_str.c index c9d9a94..d683c7d 100644 --- a/src/sockaddr_str.c +++ b/src/sockaddr_str.c @@ -60,7 +60,8 @@ */ bool osmo_sockaddr_str_is_set(const struct osmo_sockaddr_str *sockaddr_str) { - return *sockaddr_str->ip + return sockaddr_str + && *sockaddr_str->ip && sockaddr_str->port && (sockaddr_str->af == AF_INET || sockaddr_str->af == AF_INET6); } -- To view, visit https://gerrit.osmocom.org/13572 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iac025cf4d556cbed99f3924cd9ca05a05881cd9a Gerrit-Change-Number: 13572 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:36:40 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 05:36:40 +0000 Subject: Change in libosmocore[master]: add osmo_str_startswith() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13394 ) Change subject: add osmo_str_startswith() ...................................................................... add osmo_str_startswith() Move from a static implementation in tdef_vty.c to utils.c, I also want to use this in osmo-msc. The point is that the telnet VTY allows unambiguous partly matches of keyword args. For example, if I have a command definition of: compare (apples|oranges) then it is perfectly legal as for the vty parser to write only compare app One could expect the VTY to then pass the unambiguous match of "apples" to the parsing function, but that is not the case. Hence a VTY function implementation is faced with parsing a keyword of "app" instead of the expected "apples". This is actually a very widespread bug in our VTY implementations, which assume that exactly one full keyword will always be found. I am now writing new commands in a way that are able to manage only the starts of keywords. Arguably, strstr(a, b) == a does the same thing, but it searches the entire string unnecessarily. Change-Id: Ib2ffb0e9a870dd52e081c7e66d8818057d159513 --- M include/osmocom/core/utils.h M src/utils.c M src/vty/tdef_vty.c M tests/utils/utils_test.c M tests/utils/utils_test.ok 5 files changed, 60 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 51e43ee..474e36c 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -237,4 +237,6 @@ #define OSMO_STRBUF_PRINTF(STRBUF, fmt, args...) \ OSMO_STRBUF_APPEND(STRBUF, snprintf, fmt, ##args) +bool osmo_str_startswith(const char *str, const char *startswith_str); + /*! @} */ diff --git a/src/utils.c b/src/utils.c index b8b4ef5..9ab990a 100644 --- a/src/utils.c +++ b/src/utils.c @@ -928,4 +928,18 @@ return (sum * 9) % 10 + '0'; } +/*! Compare start of a string. + * This is an optimisation of 'strstr(str, startswith_str) == str' because it doesn't search through the entire string. + * \param str (Longer) string to compare. + * \param startswith_str (Shorter) string to compare with the start of str. + * \return true iff the first characters of str fully match startswith_str or startswith_str is empty. */ +bool osmo_str_startswith(const char *str, const char *startswith_str) +{ + if (!startswith_str || !*startswith_str) + return true; + if (!str) + return false; + return strncmp(str, startswith_str, strlen(startswith_str)) == 0; +} + /*! @} */ diff --git a/src/vty/tdef_vty.c b/src/vty/tdef_vty.c index 28de21a..0dac2bf 100644 --- a/src/vty/tdef_vty.c +++ b/src/vty/tdef_vty.c @@ -247,16 +247,6 @@ /*! Singleton Tnnn groups definition as set by osmo_tdef_vty_groups_init(). */ static struct osmo_tdef_group *global_tdef_groups; -/*! \return true iff the first characters of str fully match startswith_str or both are empty. */ -static bool startswith(const char *str, const char *startswith_str) -{ - if (!startswith_str) - return true; - if (!str) - return false; - return strncmp(str, startswith_str, strlen(startswith_str)) == 0; -} - DEFUN(show_timer, show_timer_cmd, "DYNAMIC", "DYNAMIC") /* show timer [(alpha|beta|gamma)] [TNNNN] */ { @@ -268,7 +258,7 @@ * like "softw" or "t" (which can also be ambiguous). */ osmo_tdef_groups_for_each(g, global_tdef_groups) { - if (!group_arg || startswith(g->name, group_arg)) + if (!group_arg || osmo_str_startswith(g->name, group_arg)) osmo_tdef_vty_show_cmd(vty, g->tdefs, T_arg, "%s: ", g->name); } return CMD_SUCCESS; diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index 711d6e1..211b4d1 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -1014,6 +1014,33 @@ printf("(need %d chars, had size=63) %s\n", rc, buf); } +static void startswith_test_str(const char *str, const char *startswith_str, bool expect_rc) +{ + bool rc = osmo_str_startswith(str, startswith_str); + printf("osmo_str_startswith(%s, ", osmo_quote_str(str, -1)); + printf("%s) == %s\n", osmo_quote_str(startswith_str, -1), rc ? "true" : "false"); + if (rc != expect_rc) + printf(" ERROR: EXPECTED %s\n", expect_rc ? "true" : "false"); +} + +static void startswith_test() +{ + printf("\n%s()\n", __func__); + startswith_test_str(NULL, NULL, true); + startswith_test_str("", NULL, true); + startswith_test_str(NULL, "", true); + startswith_test_str("", "", true); + startswith_test_str("abc", NULL, true); + startswith_test_str("abc", "", true); + startswith_test_str(NULL, "abc", false); + startswith_test_str("", "abc", false); + startswith_test_str("abc", "a", true); + startswith_test_str("abc", "ab", true); + startswith_test_str("abc", "abc", true); + startswith_test_str("abc", "abcd", false); + startswith_test_str("abc", "xyz", false); +} + int main(int argc, char **argv) { static const struct log_info log_info = {}; @@ -1032,5 +1059,6 @@ osmo_sockaddr_to_str_and_uint_test(); osmo_str_tolowupper_test(); strbuf_test(); + startswith_test(); return 0; } diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok index 8fce9f1..5783eb1 100644 --- a/tests/utils/utils_test.ok +++ b/tests/utils/utils_test.ok @@ -340,3 +340,18 @@ (need 134 chars) T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! -- T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! -- T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! (need 134 chars, had size=63) T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! -- T minus 10 9 8 7 + +startswith_test() +osmo_str_startswith(NULL, NULL) == true +osmo_str_startswith("", NULL) == true +osmo_str_startswith(NULL, "") == true +osmo_str_startswith("", "") == true +osmo_str_startswith("abc", NULL) == true +osmo_str_startswith("abc", "") == true +osmo_str_startswith(NULL, "abc") == false +osmo_str_startswith("", "abc") == false +osmo_str_startswith("abc", "a") == true +osmo_str_startswith("abc", "ab") == true +osmo_str_startswith("abc", "abc") == true +osmo_str_startswith("abc", "abcd") == false +osmo_str_startswith("abc", "xyz") == false -- To view, visit https://gerrit.osmocom.org/13394 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib2ffb0e9a870dd52e081c7e66d8818057d159513 Gerrit-Change-Number: 13394 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:45:06 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 05:45:06 +0000 Subject: Change in libosmocore[master]: add osmo_{escape, quote}_str_buf2() for standard args ordering In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13573 to look at the new patch set (#3). Change subject: add osmo_{escape,quote}_str_buf2() for standard args ordering ...................................................................... add osmo_{escape,quote}_str_buf2() for standard args ordering To be able to append an escaped or quoted string using OSMO_STRBUF_APPEND_NOLEN(), the function signature must have the buf and len as first args, like most other *_buf() functions. Add osmo_escape_str_buf2() and osmo_quote_str_buf2() to match this signature. A recent patch [1] has changed the return value of osmo_escape_str_buf() to char*, removing the const. However, the functions may return const strings, hence re-add the const. The new signatures always return the non-const buffer. To avoid code duplication, implement osmo_quote_str_buf() and osmo_escape_str_buf() by calling the new functions. I decided to allow slight changes to the behavior for current osmo_escape_str() and osmo_escape_str_buf(), because impact on callers is minimal: (1) The new implementation uses OSMO_STRBUF_*, and in consequence osmo_quote_str() no longer prints an ending double quote after truncated strings; Before, a truncated output was, sic: "this string is trunca" and now this becomes, sic: "this string is truncat I decided to not keep the old behavior because it is questionable to begin with. It looks like the string actually ended at the truncation boundary instead of the reason being not enough space in the output buffer. (2) The new osmo_escape_str_buf2() function obviously cannot pass-thru an unchanged char* if no escaping was needed. Sacrifice this tiny optimization feature to avoid code duplication: - it is an unnoticeable optimization, - the caller anyway always passes a string buffer, - the feature caused handling strings and buffers differently depending on their content (i.e. code that usually writes out strings in full length "suddenly" truncates because a non-printable character is contained, etc.) I considered adding a skip_if_unescaped flag to the osmo_quote_str_buf2() function signature, but in the end decided that the API clutter is not worth having for all the above reasons. Adjust tests to accomodate above changes. [1] 4a62eda225ab7f3c9556990c81a6fc5e19b5eec8 Ibf85f79e93244f53b2684ff6f1095c5b41203e05 Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae --- M TODO-RELEASE M include/osmocom/core/utils.h M src/utils.c M tests/utils/utils_test.c M tests/utils/utils_test.ok 5 files changed, 115 insertions(+), 47 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/13573/3 -- To view, visit https://gerrit.osmocom.org/13573 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae Gerrit-Change-Number: 13573 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:51:17 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 05:51:17 +0000 Subject: Change in libosmocore[master]: add osmo_{escape, quote}_str_buf2() for standard args ordering In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13573 ) Change subject: add osmo_{escape,quote}_str_buf2() for standard args ordering ...................................................................... Patch Set 3: ...and now I noticed the _c() variant merged to master. Getting frustrated with string mangling and diverse ideas of how to do them :/ -- To view, visit https://gerrit.osmocom.org/13573 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae Gerrit-Change-Number: 13573 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Thu, 11 Apr 2019 05:51:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:57:43 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 05:57:43 +0000 Subject: Change in libosmocore[master]: tweak OSMO_STRBUF_APPEND(), add OSMO_STRBUF_APPEND_NOLEN() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13594 ) Change subject: tweak OSMO_STRBUF_APPEND(), add OSMO_STRBUF_APPEND_NOLEN() ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13594 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I108cadf72deb3a3bcab9a07e50572d9da1ab0359 Gerrit-Change-Number: 13594 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 05:57:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:58:38 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 05:58:38 +0000 Subject: Change in libosmocore[master]: add osmo_{escape, quote}_str_buf2() for standard args ordering In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13573 ) Change subject: add osmo_{escape,quote}_str_buf2() for standard args ordering ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13573 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae Gerrit-Change-Number: 13573 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 11 Apr 2019 05:58:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:59:24 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 05:59:24 +0000 Subject: Change in libosmocore[master]: add identifier sanitation for setting FSM instance ids In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13574 ) Change subject: add identifier sanitation for setting FSM instance ids ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13574 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia40a6f3b2243c95fe428a080b938e11d8ab771a7 Gerrit-Change-Number: 13574 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 05:59:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 05:59:42 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 05:59:42 +0000 Subject: Change in libosmocore[master]: add OSMO_IMSI_SIZE In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13575 ) Change subject: add OSMO_IMSI_SIZE ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 Gerrit-Change-Number: 13575 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 05:59:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 06:00:10 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 06:00:10 +0000 Subject: Change in libosmocore[master]: GSUP: add Class IE In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13576 ) Change subject: GSUP: add Class IE ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef Gerrit-Change-Number: 13576 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 06:00:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 06:08:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 06:08:08 +0000 Subject: Change in libosmocore[master]: add gsm0808_create_handover_request_ack2 to add AoIP RTP addr In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13259 ) Change subject: add gsm0808_create_handover_request_ack2 to add AoIP RTP addr ...................................................................... Patch Set 9: (1 comment) https://gerrit.osmocom.org/#/c/13259/9//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13259/9//COMMIT_MSG at 15 PS9, Line 15: the : gsm0808.c actually also gets built on embedded systems that lack arpa/inet.h : (for me indicated by the ARM build job on jenkins) we can simply not compile 08.08 related functions in the "embedded" case. we don't want to implement the A interface on bare iron in a microcontroller firmware. So you can just use a large "#if (!EMBEDDED)" blockaround those parts, or even disable the entire files from Makefile.am in a patch preceding this patch? Or was this approach attempted and didn't work for some reason? In the latter case I'm happy to investigate why you couldn't deactivate it. -- To view, visit https://gerrit.osmocom.org/13259 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia71542ea37d4fd2c9fb9b40357db7aeb111ec576 Gerrit-Change-Number: 13259 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 11 Apr 2019 06:08:08 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 06:11:43 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 06:11:43 +0000 Subject: Change in libsmpp34[master]: Allow application to override default heap allocator In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13561 ) Change subject: Allow application to override default heap allocator ...................................................................... Patch Set 6: (1 comment) https://gerrit.osmocom.org/#/c/13561/3/src/smpp34_heap.h File src/smpp34_heap.h: https://gerrit.osmocom.org/#/c/13561/3/src/smpp34_heap.h at 2 PS3, Line 2: we actually need stddef.h because of the size_t usage below. stdlib.h was wrong. http://open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf#page=266 -- To view, visit https://gerrit.osmocom.org/13561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Gerrit-Change-Number: 13561 Gerrit-PatchSet: 6 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-CC: fixeria Gerrit-Comment-Date: Thu, 11 Apr 2019 06:11:43 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 06:12:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 06:12:45 +0000 Subject: Change in libsmpp34[master]: Allow application to override default heap allocator 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/13561 to look at the new patch set (#7). Change subject: Allow application to override default heap allocator ...................................................................... Allow application to override default heap allocator Let's introduce a mechanism by which libsmpp34-using applications can override the memory allocator functions. This allows us e.g. in the Osmocom context to use talloc which aids us in debugging memory leaks. Closes: OS#3913 Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 --- M TODO-RELEASE M src/Makefile.am A src/smpp34_heap.c A src/smpp34_heap.h M src/smpp34_params.c M src/smpp34_unpack.c 6 files changed, 109 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/61/13561/7 -- To view, visit https://gerrit.osmocom.org/13561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Gerrit-Change-Number: 13561 Gerrit-PatchSet: 7 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-CC: fixeria -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 06:12:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 06:12:54 +0000 Subject: Change in libsmpp34[master]: Allow application to override default heap allocator In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13561 ) Change subject: Allow application to override default heap allocator ...................................................................... Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Gerrit-Change-Number: 13561 Gerrit-PatchSet: 7 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-CC: fixeria Gerrit-Comment-Date: Thu, 11 Apr 2019 06:12:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 06:15:49 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 06:15:49 +0000 Subject: Change in osmo-bsc[master]: lchan activation: add explicit encryption info to activation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13582 ) Change subject: lchan activation: add explicit encryption info to activation ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13582 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib3d259a5711add65ab7298bfa3977855a17a1642 Gerrit-Change-Number: 13582 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 06:15:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 06:16:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 06:16:51 +0000 Subject: Change in osmo-bsc[master]: Handover Request: also parse Chosen Algorithm IE, pass to lchan activ... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13583 ) Change subject: Handover Request: also parse Chosen Algorithm IE, pass to lchan activation ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13583 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5b269f50bd2092516bfdf87746196983d3ac49d1 Gerrit-Change-Number: 13583 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 06:16:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 06:18:14 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 06:18:14 +0000 Subject: Change in osmo-bsc[master]: fix inter-BSC-HO-incoming for AoIP (1/2) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13584 ) Change subject: fix inter-BSC-HO-incoming for AoIP (1/2) ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13584 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4a5acdb2d4a0b947cc0c62067a67be88a3d467ff Gerrit-Change-Number: 13584 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 06:18:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 06:18:44 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 06:18:44 +0000 Subject: Change in osmo-bsc[master]: fix inter-BSC-HO-incoming for AoIP (2/2) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13585 ) Change subject: fix inter-BSC-HO-incoming for AoIP (2/2) ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13585 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia05e37da125eb6e7b7be9b974b73261bd72de1f4 Gerrit-Change-Number: 13585 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 06:18:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 06:21:25 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 06:21:25 +0000 Subject: Change in osmo-hlr[master]: USSD: don't use gsm0480_msgb_alloc_name() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13548 ) Change subject: USSD: don't use gsm0480_msgb_alloc_name() ...................................................................... Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/13548/1/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13548/1/src/hlr_ussd.c at 244 PS1, Line 244: resp_msg = msgb_alloc_headroom(4000, 64, __func__); > To match what osmo_gsup_client_msgb_alloc() is doing, so the server messages have the same size as t [?] might be good to introduce a #define for it then, and use that #define (maybe a sa preceding patch, or as a cleanup patch after this one) -- To view, visit https://gerrit.osmocom.org/13548 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icdab40c6a933888eb9f51bee9c5264c8919dbf7b Gerrit-Change-Number: 13548 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Thu, 11 Apr 2019 06:21:25 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 06:22:02 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 06:22:02 +0000 Subject: Change in osmo-msc[master]: enable osmo_fsm_term_safely(), apply logging changes In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13592 ) Change subject: enable osmo_fsm_term_safely(), apply logging changes ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13592 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I195a719d9ec1f6764ee5a361244f59f0144dc253 Gerrit-Change-Number: 13592 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 06:22:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 06:24:22 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 06:24:22 +0000 Subject: Change in osmo-msc[master]: sms queue: avoid repeated Paging for a failed SMS In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13173 ) Change subject: sms queue: avoid repeated Paging for a failed SMS ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13173 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I24bf9f1c1167efe1080ae4cf47ed2ef0bd981e49 Gerrit-Change-Number: 13173 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 06:24:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 06:26:28 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 06:26:28 +0000 Subject: Change in osmo-msc[master]: vlr_subscr: use osmo_use_count In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13136 ) Change subject: vlr_subscr: use osmo_use_count ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13136 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib06d030e8464abe415ff597d462ed40eeddef475 Gerrit-Change-Number: 13136 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Max Gerrit-Comment-Date: Thu, 11 Apr 2019 06:26:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:05:44 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:05:44 +0000 Subject: Change in osmo-msc[master]: gsm_04_08_cc: improve logging for CC trans In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13593 ) Change subject: gsm_04_08_cc: improve logging for CC trans ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13593 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If79f724a2faca70023271398c618cfe490fb294e Gerrit-Change-Number: 13593 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 07:05:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:08:26 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:08:26 +0000 Subject: Change in osmo-hlr[master]: use new OSMO_IMSI_SIZE In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13589 ) Change subject: use new OSMO_IMSI_SIZE ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13589 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8e8fa221e97303df3c6cce96b25d31a53f67b939 Gerrit-Change-Number: 13589 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 07:08:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:09:07 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:09:07 +0000 Subject: Change in osmo-hlr[master]: add missing error log: invalid IMSI In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13587 ) Change subject: add missing error log: invalid IMSI ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13587 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I65e9ecac06dc6d1abb9802d621c385d3b4fab83a Gerrit-Change-Number: 13587 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 07:09:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:10:40 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:10:40 +0000 Subject: Change in osmo-hlr[master]: osmo-hlr: allow configuring db path from cfg file In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13586 ) Change subject: osmo-hlr: allow configuring db path from cfg file ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13586 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I87b8673324e1e6225afb758fb4963ff3279ea3d8 Gerrit-Change-Number: 13586 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 07:10:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:24:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:24:13 +0000 Subject: Change in libsmpp34[master]: configure.ac: enable kernel style compile messages In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13565 ) Change subject: configure.ac: enable kernel style compile messages ...................................................................... configure.ac: enable kernel style compile messages Change-Id: I96a5d808e2a199c33a1c9eef77da3a040e305689 --- M configure.ac 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved diff --git a/configure.ac b/configure.ac index 8ecbb77..2c974f8 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,9 @@ AM_INIT_AUTOMAKE([foreign]) AM_CONFIG_HEADER([aux_config/config.h]) +dnl kernel style compile messages +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + dnl include release helper RELMAKE='-include osmo-release.mk' AC_SUBST([RELMAKE]) -- To view, visit https://gerrit.osmocom.org/13565 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I96a5d808e2a199c33a1c9eef77da3a040e305689 Gerrit-Change-Number: 13565 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:24:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:24:21 +0000 Subject: Change in libsmpp34[master]: Allow application to override default heap allocator In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13561 ) Change subject: Allow application to override default heap allocator ...................................................................... Allow application to override default heap allocator Let's introduce a mechanism by which libsmpp34-using applications can override the memory allocator functions. This allows us e.g. in the Osmocom context to use talloc which aids us in debugging memory leaks. Closes: OS#3913 Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 --- M TODO-RELEASE M src/Makefile.am A src/smpp34_heap.c A src/smpp34_heap.h M src/smpp34_params.c M src/smpp34_unpack.c 6 files changed, 109 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/TODO-RELEASE b/TODO-RELEASE index d0852fc..bbc1495 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 +libsmpp34 smpp34_heap Adding new API/ABI to override memory allocator diff --git a/src/Makefile.am b/src/Makefile.am index 67550f3..55097c4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -10,6 +10,7 @@ $(LIBRARY_SOURCE_DIR)/smpp34.h \ $(LIBRARY_SOURCE_DIR)/smpp34_dumpBuf.c \ $(LIBRARY_SOURCE_DIR)/smpp34_dumpPdu.c \ + $(LIBRARY_SOURCE_DIR)/smpp34_heap.c \ $(LIBRARY_SOURCE_DIR)/smpp34_pack.c \ $(LIBRARY_SOURCE_DIR)/smpp34_unpack.c \ $(LIBRARY_SOURCE_DIR)/smpp34_structs.c \ @@ -19,6 +20,7 @@ include_HEADERS = \ $(LIBRARY_SOURCE_DIR)/smpp34.h \ + $(LIBRARY_SOURCE_DIR)/smpp34_heap.h \ $(LIBRARY_SOURCE_DIR)/smpp34_structs.h \ $(LIBRARY_SOURCE_DIR)/smpp34_params.h diff --git a/src/smpp34_heap.c b/src/smpp34_heap.c new file mode 100644 index 0000000..f93d457 --- /dev/null +++ b/src/smpp34_heap.c @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2019 Harald Welte + * File : smpp34_heap.c + * Author: Harald Welte + * + * 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 + * 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 + * 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 + * + */ + +#include +#include +#include + +#include "smpp34_heap.h" + +static void *smpp34_libc_malloc(size_t sz) +{ + return malloc(sz); +} + +static void *smpp34_libc_realloc(void *ptr, size_t sz) +{ + return realloc(ptr, sz); +} + +static void smpp34_libc_free(void *ptr) +{ + return free(ptr); +} + +static bool allocator_used = false; + +static struct smpp34_memory_functions smpp34_allocator = { + .malloc_fun = smpp34_libc_malloc, + .realloc_fun = smpp34_libc_realloc, + .free_fun = smpp34_libc_free, +}; + +void smpp34_set_memory_functions(const struct smpp34_memory_functions *mf) +{ + if (allocator_used) { + fprintf(stderr, "%s must be called before first use of smpp34_malloc\n", __func__); + return; + } + smpp34_allocator = *mf; +} + +void *smpp34_malloc(size_t sz) +{ + allocator_used = true; + return smpp34_allocator.malloc_fun(sz); +} + +void *smpp34_realloc(void *ptr, size_t sz) +{ + allocator_used = true; + return smpp34_allocator.realloc_fun(ptr, sz); +} + +void smpp34_free(void *ptr) +{ + smpp34_allocator.free_fun(ptr); +} diff --git a/src/smpp34_heap.h b/src/smpp34_heap.h new file mode 100644 index 0000000..6b9ac42 --- /dev/null +++ b/src/smpp34_heap.h @@ -0,0 +1,15 @@ +#pragma once +#include + +/* override the allocator with these methods; to be called BEFORE allocating anything */ +struct smpp34_memory_functions { + void * (*malloc_fun)(size_t sz); + void * (*realloc_fun)(void *ptr, size_t sz); + void (*free_fun)(void *ptr); +}; + +void smpp34_set_memory_functions(const struct smpp34_memory_functions *mf); + +void *smpp34_malloc(size_t sz); +void *smpp34_realloc(void *ptr, size_t sz); +void smpp34_free(void *ptr); diff --git a/src/smpp34_params.c b/src/smpp34_params.c index a91f9eb..e7eb680 100644 --- a/src/smpp34_params.c +++ b/src/smpp34_params.c @@ -27,15 +27,16 @@ #include "smpp34.h" #include "smpp34_structs.h" +#include "smpp34_heap.h" int build_udad( udad_t **dest, udad_t *source ) { /* Build new DAD-Chain ************************************************/ - udad_t *dummy = (udad_t*)malloc(sizeof( udad_t )); + udad_t *dummy = (udad_t*)smpp34_malloc(sizeof( udad_t )); if( dummy == NULL ){ - printf("Error in malloc()\n" ); + printf("Error in smpp34_malloc()\n" ); return( -1 ); }; memcpy(dummy, source, sizeof( udad_t )); @@ -54,7 +55,7 @@ /* Destroy DAD-Chain **************************************************/ while( sourceList != NULL ){ i = sourceList->next; - free((void*)sourceList); + smpp34_free((void*)sourceList); sourceList = i; }; @@ -68,9 +69,9 @@ { /* Build new DAD-Chain ************************************************/ - dad_t *dummy = (dad_t*)malloc(sizeof( dad_t )); + dad_t *dummy = (dad_t*)smpp34_malloc(sizeof( dad_t )); if( dummy == NULL ){ - printf("Error in malloc()\n" ); + printf("Error in smpp34_malloc()\n" ); return( -1 ); }; memcpy(dummy, source, sizeof( dad_t )); @@ -89,7 +90,7 @@ /* Destroy DAD-Chain **************************************************/ while( sourceList != NULL ){ i = sourceList->next; - free((void*)sourceList); + smpp34_free((void*)sourceList); sourceList = i; }; @@ -102,9 +103,9 @@ { /* Build new TLV-Chain ************************************************/ - tlv_t *dummy = (tlv_t*)malloc(sizeof( tlv_t )); + tlv_t *dummy = (tlv_t*)smpp34_malloc(sizeof( tlv_t )); if( dummy == NULL ){ - printf("Error in malloc()\n" ); + printf("Error in smpp34_malloc()\n" ); return( -1 ); }; memcpy(dummy, source, sizeof( tlv_t )); @@ -123,7 +124,7 @@ /* Destroy TLV-Chain **************************************************/ while( sourceList != NULL ){ i = sourceList->next; - free((void*)sourceList); + smpp34_free((void*)sourceList); sourceList = i; }; diff --git a/src/smpp34_unpack.c b/src/smpp34_unpack.c index 749a037..ec73d35 100644 --- a/src/smpp34_unpack.c +++ b/src/smpp34_unpack.c @@ -31,6 +31,7 @@ #include "smpp34.h" #include "smpp34_structs.h" #include "smpp34_params.h" +#include "smpp34_heap.h" /* GLOBALS ********************************************************************/ /* EXTERN *********************************************************************/ @@ -179,7 +180,7 @@ #define TLV( inst, tlv3, do_tlv ){\ tlv_t *aux_tlv = NULL;\ while( (aux - ini) < t1->command_length ){\ - aux_tlv = (tlv_t *) malloc(sizeof( tlv_t ));\ + aux_tlv = (tlv_t *) smpp34_malloc(sizeof( tlv_t ));\ memset(aux_tlv, 0, sizeof(tlv_t));\ do_tlv( aux_tlv );\ aux_tlv->next = inst tlv3;\ @@ -191,7 +192,7 @@ udad_t *aux_udad = NULL;\ int c = 0;\ while( c < t1->no_unsuccess ){\ - aux_udad = (udad_t *) malloc(sizeof( udad_t ));\ + aux_udad = (udad_t *) smpp34_malloc(sizeof( udad_t ));\ memset(aux_udad, 0, sizeof(udad_t));\ do_udad( aux_udad );\ aux_udad->next = inst udad3;\ @@ -204,7 +205,7 @@ dad_t *aux_dad = NULL;\ int c = 0;\ while( c < t1->number_of_dests ){\ - aux_dad = (dad_t *) malloc(sizeof( dad_t ));\ + aux_dad = (dad_t *) smpp34_malloc(sizeof( dad_t ));\ memset(aux_dad, 0, sizeof(dad_t));\ do_dad( aux_dad );\ aux_dad->next = inst dad3;\ -- To view, visit https://gerrit.osmocom.org/13561 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3656117115e89638c093bfbcbc4369ce302f7a94 Gerrit-Change-Number: 13561 Gerrit-PatchSet: 7 Gerrit-Owner: Harald Welte Gerrit-Assignee: fixeria Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-CC: fixeria -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:25:46 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:25:46 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: allow disabeling GSUP In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13557 ) Change subject: MSC_Tests: allow disabeling GSUP ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13557 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7c86aa0a906a0d7e8be765f9109a65b4b4387bc6 Gerrit-Change-Number: 13557 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 07:25:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:26:18 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:26:18 +0000 Subject: Change in osmo-ttcn3-hacks[master]: SGsAP_Templates: Remove invalid template. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13556 ) Change subject: SGsAP_Templates: Remove invalid template. ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13556 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ifdf6030bb42ebd99c2030d600e87127e3619d7ad Gerrit-Change-Number: 13556 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 07:26:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:28:04 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:28:04 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: Add testcase to simulate VLR/HLR failure (SGsAP) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13558 ) Change subject: MSC_Tests: Add testcase to simulate VLR/HLR failure (SGsAP) ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13558 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I830d0b936cbe9d73d1e0b1f4792c2be3d0b08cb9 Gerrit-Change-Number: 13558 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 07:28:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:28:10 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:28:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: SGsAP_Templates: Remove invalid template. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13556 ) Change subject: SGsAP_Templates: Remove invalid template. ...................................................................... SGsAP_Templates: Remove invalid template. The Template tr_SGsAP_RESET_IND is invalid since it requires vlr and mme name at once, which is not a valid constellation in the real world. Lets have two separate templates, one for MME and VLR, just like we have it already with the ts_ versions of the templates. Change-Id: Ifdf6030bb42ebd99c2030d600e87127e3619d7ad Related: OS#3859 --- M library/SGsAP_Templates.ttcn 1 file changed, 9 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, approved Harald Welte: Looks good to me, approved diff --git a/library/SGsAP_Templates.ttcn b/library/SGsAP_Templates.ttcn index 457481e..428924f 100644 --- a/library/SGsAP_Templates.ttcn +++ b/library/SGsAP_Templates.ttcn @@ -659,10 +659,18 @@ vLR_Name := ts_SGsAP_IE_VlrName(vlr_name) } } -template PDU_SGsAP tr_SGsAP_RESET_IND(template octetstring mme_name, template octetstring vlr_name) := { + +template PDU_SGsAP tr_SGsAP_RESET_IND_MME(template octetstring mme_name) := { sGsAP_RESET_INDICATION := { messageType := '00010101'B, mME_Name := tr_SGsAP_IE_MmeName(mme_name), + vLR_Name := omit + } +} +template PDU_SGsAP tr_SGsAP_RESET_IND_VLR(template octetstring vlr_name) := { + sGsAP_RESET_INDICATION := { + messageType := '00010101'B, + mME_Name := omit, vLR_Name := tr_SGsAP_IE_VlrName(vlr_name) } } -- To view, visit https://gerrit.osmocom.org/13556 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ifdf6030bb42ebd99c2030d600e87127e3619d7ad Gerrit-Change-Number: 13556 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:28:10 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:28:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: allow disabeling GSUP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13557 ) Change subject: MSC_Tests: allow disabeling GSUP ...................................................................... MSC_Tests: allow disabeling GSUP The GSUP link between testsuit and osmo-msc is currently on by default and can not be disabled. However, there may be situations where a missing GSUP connection must be simulated. Lets add add a parameter to disable GSUP if necessary. Change-Id: I7c86aa0a906a0d7e8be765f9109a65b4b4387bc6 Related: OS#3859 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 21 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index c7a4a71..8e5c5f2 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -73,7 +73,8 @@ integer ipa_ctrl_port, boolean ipa_ctrl_enable, boolean mm_info, - boolean sgsap_enable + boolean sgsap_enable, + boolean gsup_enable }; /* get a one-octet bitmaks of supported algorithms based on Classmark information */ diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index c7c61eb..1a6e8f7 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -210,11 +210,17 @@ vc_MGCP.start(MGCP_Emulation.main(ops, pars, id)); } +function ForwardUnitdataCallback(PDU_SGsAP msg) +runs on SGsAP_Emulation_CT return template PDU_SGsAP { + SGsAP_CLIENT.send(msg); + return omit; +} + function f_init_sgsap(charstring id) runs on MTC_CT { id := id & "-SGsAP"; var SGsAPOps ops := { create_cb := refers(SGsAP_Emulation.ExpectedCreateCallback), - unitdata_cb := refers(SGsAP_Emulation.DummyUnitdataCallback) + unitdata_cb := refers(ForwardUnitdataCallback) } var SGsAP_conn_parameters pars := { remote_ip := mp_msc_ip, @@ -258,7 +264,7 @@ } } -function f_init(integer num_bsc := 1, boolean sgsap := false) runs on MTC_CT { +function f_init(integer num_bsc := 1, boolean sgsap := false, boolean gsup := true) runs on MTC_CT { if (g_initialized == true) { return; @@ -281,7 +287,10 @@ f_ipa_ctrl_start(mp_msc_ip, mp_msc_ctrl_port); f_init_mncc("MSC_Test"); f_init_mgcp("MSC_Test"); - f_init_gsup("MSC_Test"); + + if (gsup == true) { + f_init_gsup("MSC_Test"); + } f_init_smpp("MSC_Test"); if (sgsap == true) { @@ -476,7 +485,7 @@ type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; /* FIXME: move into BSC_ConnectionHandler? */ -function f_init_pars(integer imsi_suffix, boolean sgsap := false) runs on MTC_CT return BSC_ConnHdlrPars { +function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup := true) runs on MTC_CT return BSC_ConnHdlrPars { var BSC_ConnHdlrNetworkPars net_pars := { kc_support := '0A'O, /* A5/1 and A5/3 enabled */ expect_tmsi := true, @@ -501,7 +510,8 @@ ipa_ctrl_port := mp_msc_ctrl_port, ipa_ctrl_enable := true, mm_info := mp_mm_info, - sgsap_enable := sgsap + sgsap_enable := sgsap, + gsup_enable := gsup }; return pars; } @@ -521,8 +531,10 @@ connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); /* GSUP part */ - connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); - connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); + if (pars.gsup_enable == true) { + connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); + connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); + } /* SMPP part */ connect(vc_conn:SMPP, vc_SMPP:SMPP_CLIENT); connect(vc_conn:SMPP_PROC, vc_SMPP:SMPP_PROC); -- To view, visit https://gerrit.osmocom.org/13557 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7c86aa0a906a0d7e8be765f9109a65b4b4387bc6 Gerrit-Change-Number: 13557 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:28:11 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:28:11 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: Add testcase to simulate VLR/HLR failure (SGsAP) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13558 ) Change subject: MSC_Tests: Add testcase to simulate VLR/HLR failure (SGsAP) ...................................................................... MSC_Tests: Add testcase to simulate VLR/HLR failure (SGsAP) Currently we do not simulate a situation where the HLR is unreachable to the MSC. Lets add a test wehere the HLR is disconnected and an LU via SGsAP is tried. The SGs interface should then carry out a reset procedure. Change-Id: I830d0b936cbe9d73d1e0b1f4792c2be3d0b08cb9 Related: OS#3859 --- M msc/MSC_Tests.ttcn M msc/expected-results.xml 2 files changed, 39 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 1a6e8f7..13d1ddb 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -4627,6 +4627,43 @@ vc_conn.done; } +/* Simulate an HLR/VLR failure */ +private function f_tc_sgsap_vlr_failure(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + var octetstring mme_name := f_enc_dns_hostname(mp_mme_name); + var octetstring vlr_name := f_enc_dns_hostname(mp_vlr_name); + + var PDU_SGsAP lur; + + f_init_handler(pars); + + /* Attempt location update (which is expected to fail) */ + lur := valueof(ts_SGsAP_LU_REQ(g_pars.imsi, mme_name, IMSI_attach, + ts_SGsAP_LAI('901'H, '70'H, 2342))); + SGsAP.send(lur); + + /* Respond to SGsAP-RESET-INDICATION from VLR */ + alt { + [] SGsAP.receive(tr_SGsAP_RESET_IND_VLR(vlr_name)); { + SGsAP.send(valueof(ts_SGsAP_RESET_ACK_MME(mme_name))); + setverdict(pass); + } + [] SGsAP.receive { + setverdict(fail, "Received unexpected message on SGs"); + } + } + + f_sleep(1.0); + setverdict(pass); +} +testcase TC_sgsap_vlr_failure() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(1, true, false); + pars := f_init_pars(11811, true, false); + vc_conn := f_start_handler_with_pars(refers(f_tc_sgsap_vlr_failure), pars); + vc_conn.done; +} + /* SGs TODO: * LU attempt for IMSI without NAM_PS in HLR * LU attempt with AUTH FAIL due to invalid RES/SRES @@ -4729,6 +4766,7 @@ execute( TC_sgsap_unsol_ud() ); execute( TC_bssap_lu_sgsap_lu_and_mt_call() ); execute( TC_sgsap_lu_and_mt_call() ); + execute( TC_sgsap_vlr_failure() ); /* Run this last: at the time of writing this test crashes the MSC */ execute( TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug() ); diff --git a/msc/expected-results.xml b/msc/expected-results.xml index 2c0083c..78b0099 100644 --- a/msc/expected-results.xml +++ b/msc/expected-results.xml @@ -90,6 +90,7 @@ + Tguard timeout -- To view, visit https://gerrit.osmocom.org/13558 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I830d0b936cbe9d73d1e0b1f4792c2be3d0b08cb9 Gerrit-Change-Number: 13558 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:29:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:29:51 +0000 Subject: Change in osmo-pcu[master]: Add test for MS mode and (M)CS settings In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13164 ) Change subject: Add test for MS mode and (M)CS settings ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13164 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibf917f4b49d927a21cbd467775806fa6ea06a6a6 Gerrit-Change-Number: 13164 Gerrit-PatchSet: 3 Gerrit-Owner: Max Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: osmith Gerrit-Comment-Date: Thu, 11 Apr 2019 07:29:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:29:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:29:54 +0000 Subject: Change in osmo-pcu[master]: Add test for MS mode and (M)CS settings In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13164 ) Change subject: Add test for MS mode and (M)CS settings ...................................................................... Add test for MS mode and (M)CS settings Right now set_mode() on GprsMs behaves in pretty counter-intuitive way: * it's possible to set current DL MCS higher than max value * EGPRS and EGPRS_GMSK have the same max DL MCS * setting EGPRS* mode drops current/max MCS values to unknown Let's capture this in a unit-test before attempting any further modifications. Change-Id: Ibf917f4b49d927a21cbd467775806fa6ea06a6a6 --- M tests/ms/MsTest.cpp M tests/ms/MsTest.err M tests/ms/MsTest.ok 3 files changed, 86 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/ms/MsTest.cpp b/tests/ms/MsTest.cpp index aa600e5..4f8f3a0 100644 --- a/tests/ms/MsTest.cpp +++ b/tests/ms/MsTest.cpp @@ -531,6 +531,75 @@ printf("=== end %s ===\n", __func__); } +static void dump_ms(const GprsMs *ms, const char *pref) +{ + printf("%s MS DL %s/%s, UL %s/%s, mode %s, <%s>\n", pref, + mcs_name(ms->current_cs_dl()), mcs_name(ms->max_cs_dl()), + mcs_name(ms->current_cs_ul()), mcs_name(ms->max_cs_ul()), + mode_name(ms->mode()), + ms->is_idle() ? "IDLE" : "ACTIVE"); +} + +static void test_ms_mcs_mode() +{ + BTS the_bts; + gprs_rlcmac_bts *bts = the_bts.bts_data(); + uint32_t tlli = 0xdeadbeef; + + gprs_rlcmac_dl_tbf *dl_tbf; + GprsMs *ms1, *ms2; + + printf("=== start %s ===\n", __func__); + + ms1 = new GprsMs(&the_bts, tlli); + dump_ms(ms1, "1: no BTS defaults "); + + bts->initial_cs_dl = 4; + bts->initial_cs_ul = 1; + bts->cs_downgrade_threshold = 0; + + ms2 = new GprsMs(&the_bts, tlli + 1); + dump_ms(ms2, "2: with BTS defaults"); + + dl_tbf = talloc_zero(tall_pcu_ctx, struct gprs_rlcmac_dl_tbf); + new (dl_tbf) gprs_rlcmac_dl_tbf(NULL); + + dl_tbf->set_ms(ms2); + dump_ms(ms2, "2: after TBF attach "); + + ms1->set_mode(EGPRS); + dump_ms(ms1, "1: after mode set "); + + ms2->set_mode(EGPRS); + dump_ms(ms2, "2: after mode set "); + + ms1->set_current_cs_dl(MCS7); + dump_ms(ms1, "1: after MCS set "); + + ms2->set_current_cs_dl(MCS8); + dump_ms(ms2, "2: after MCS set "); + + ms1->set_mode(EGPRS_GMSK); + dump_ms(ms1, "1: after mode set "); + + ms2->set_mode(EGPRS_GMSK); + dump_ms(ms2, "2: after mode set "); + + // FIXME: following code triggers ASAN failure: + // ms2->detach_tbf(dl_tbf); + // dump_ms(ms2, "2: after TBF detach "); + + ms1->set_mode(GPRS); + dump_ms(ms1, "1: after mode set "); + + ms2->set_mode(GPRS); + dump_ms(ms2, "2: after mode set "); + + talloc_free(dl_tbf); + + printf("=== end %s ===\n", __func__); +} + int main(int argc, char **argv) { struct vty_app_info pcu_vty_info = {0}; @@ -556,6 +625,7 @@ test_ms_storage(); test_ms_timeout(); test_ms_cs_selection(); + test_ms_mcs_mode(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/ms/MsTest.err b/tests/ms/MsTest.err index a2e4a0c..735c4fe 100644 --- a/tests/ms/MsTest.err +++ b/tests/ms/MsTest.err @@ -56,3 +56,6 @@ Destroying MS object, TLLI = 0xffeeddbb Creating MS object, TLLI = 0xffeeddbb Attaching TBF to MS object, TLLI = 0xffeeddbb, TBF = TBF(TFI=0 TLLI=0xffeeddbb DIR=DL STATE=NULL) +Creating MS object, TLLI = 0xdeadbeef +Creating MS object, TLLI = 0xdeadbef0 +Attaching TBF to MS object, TLLI = 0xdeadbef0, TBF = TBF(TFI=0 TLLI=0xdeadbef0 DIR=DL STATE=NULL) diff --git a/tests/ms/MsTest.ok b/tests/ms/MsTest.ok index f14cceb..9952d59 100644 --- a/tests/ms/MsTest.ok +++ b/tests/ms/MsTest.ok @@ -18,3 +18,16 @@ === end test_ms_timeout === === start test_ms_cs_selection === === end test_ms_cs_selection === +=== start test_ms_mcs_mode === +1: no BTS defaults MS DL UNKNOWN/UNKNOWN, UL UNKNOWN/UNKNOWN, mode GPRS, +2: with BTS defaults MS DL CS-4/CS-4, UL CS-1/CS-4, mode GPRS, +2: after TBF attach MS DL CS-4/CS-4, UL CS-1/CS-4, mode GPRS, +1: after mode set MS DL UNKNOWN/UNKNOWN, UL UNKNOWN/UNKNOWN, mode EGPRS, +2: after mode set MS DL UNKNOWN/UNKNOWN, UL UNKNOWN/UNKNOWN, mode EGPRS, +1: after MCS set MS DL MCS-7/MCS-4, UL UNKNOWN/UNKNOWN, mode EGPRS, +2: after MCS set MS DL MCS-8/MCS-4, UL UNKNOWN/UNKNOWN, mode EGPRS, +1: after mode set MS DL MCS-7/MCS-4, UL UNKNOWN/UNKNOWN, mode EGPRS_GMSK-only, +2: after mode set MS DL MCS-8/MCS-4, UL UNKNOWN/UNKNOWN, mode EGPRS_GMSK-only, +1: after mode set MS DL CS-4/CS-4, UL CS-1/CS-4, mode GPRS, +2: after mode set MS DL CS-4/CS-4, UL CS-1/CS-4, mode GPRS, +=== end test_ms_mcs_mode === -- To view, visit https://gerrit.osmocom.org/13164 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ibf917f4b49d927a21cbd467775806fa6ea06a6a6 Gerrit-Change-Number: 13164 Gerrit-PatchSet: 4 Gerrit-Owner: Max Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:30:22 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:30:22 +0000 Subject: Change in libosmo-sccp[master]: sccp_scoc: move sccp_find_user() up In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13507 ) Change subject: sccp_scoc: move sccp_find_user() up ...................................................................... sccp_scoc: move sccp_find_user() up Move it before sccp_scoc_rx_scrc_rout_fail(), so it can be used in the latter function to figure out the local_ref from the user (follow up commit). Related: OS#3871 Change-Id: Ieabeda3126dcc0349a06c0fc7c9e468b900d7855 --- M src/sccp_scoc.c 1 file changed, 25 insertions(+), 25 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index 726426c..82590a0 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1329,6 +1329,31 @@ return xua; } +/* Find a SCCP user for given SUA message (based on SUA_IEI_DEST_ADDR */ +static struct osmo_sccp_user *sccp_find_user(struct osmo_sccp_instance *inst, + struct xua_msg *xua) +{ + int rc; + struct osmo_sccp_addr called_addr; + + rc = sua_addr_parse(&called_addr, xua, SUA_IEI_DEST_ADDR); + if (rc < 0) { + LOGP(DLSCCP, LOGL_ERROR, "Cannot find SCCP User for XUA " + "Message %s without valid DEST_ADDR\n", + xua_hdr_dump(xua, &xua_dialect_sua)); + return NULL; + } + + if (!(called_addr.presence & OSMO_SCCP_ADDR_T_SSN)) { + LOGP(DLSCCP, LOGL_ERROR, "Cannot resolve SCCP User for " + "XUA Message %s without SSN in CalledAddr\n", + xua_hdr_dump(xua, &xua_dialect_sua)); + return NULL; + } + + return sccp_user_find(inst, called_addr.ssn, called_addr.pc); +} + /*! \brief SCOC: Receive SCRC Routing Failure * \param[in] inst SCCP Instance on which we operate * \param[in] xua SUA message that was failed to route @@ -1355,31 +1380,6 @@ } } -/* Find a SCCP user for given SUA message (based on SUA_IEI_DEST_ADDR */ -static struct osmo_sccp_user *sccp_find_user(struct osmo_sccp_instance *inst, - struct xua_msg *xua) -{ - int rc; - struct osmo_sccp_addr called_addr; - - rc = sua_addr_parse(&called_addr, xua, SUA_IEI_DEST_ADDR); - if (rc < 0) { - LOGP(DLSCCP, LOGL_ERROR, "Cannot find SCCP User for XUA " - "Message %s without valid DEST_ADDR\n", - xua_hdr_dump(xua, &xua_dialect_sua)); - return NULL; - } - - if (!(called_addr.presence & OSMO_SCCP_ADDR_T_SSN)) { - LOGP(DLSCCP, LOGL_ERROR, "Cannot resolve SCCP User for " - "XUA Message %s without SSN in CalledAddr\n", - xua_hdr_dump(xua, &xua_dialect_sua)); - return NULL; - } - - return sccp_user_find(inst, called_addr.ssn, called_addr.pc); -} - /* Generate a COERR based in input arguments */ static struct xua_msg *gen_coerr(uint32_t route_ctx, uint32_t dest_ref, uint32_t err_cause) -- To view, visit https://gerrit.osmocom.org/13507 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ieabeda3126dcc0349a06c0fc7c9e468b900d7855 Gerrit-Change-Number: 13507 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:30:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:30:51 +0000 Subject: Change in osmo-remsim[master]: README.md: add 'osmo-' prefix to remsim-{server, bankd, client} In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13510 ) Change subject: README.md: add 'osmo-' prefix to remsim-{server,bankd,client} ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13510 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I42df660d8c7f696a12118d4e4c38f7ee9e48d2e8 Gerrit-Change-Number: 13510 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 07:30:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:30:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:30:54 +0000 Subject: Change in osmo-remsim[master]: README.md: add 'osmo-' prefix to remsim-{server, bankd, client} In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13510 ) Change subject: README.md: add 'osmo-' prefix to remsim-{server,bankd,client} ...................................................................... README.md: add 'osmo-' prefix to remsim-{server,bankd,client} Change-Id: I42df660d8c7f696a12118d4e4c38f7ee9e48d2e8 --- M README.md 1 file changed, 21 insertions(+), 20 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/README.md b/README.md index 8808338..8f2657f 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,23 @@ This software suite is a work in progress. -remsim-client -------------- +osmo-remsim-client +------------------ The client interfaces with GSM phones / modems via dedicated "Card Emulation" devices such as the Osmocom SIMtrace2 or sysmocom sysmoQMOD board + firmware. This hardware implements the ISO7816-3 electrical interface and protocol handling and passes any TPDU headers received -from the phone/modem to remsim-client for further processing of the +from the phone/modem to osmo-remsim-client for further processing of the TPDUs associated to the given APDU transfer. -remsim-client connects via a RSPRO control connection to remsim-server -at startup and registers itself. It will receive configuration data -such as the remsim-bankd IP+Port and the ClientId from remsim-server. +osmo-remsim-client connects via a RSPRO control connection to +osmo-remsim-server at startup and registers itself. It will receive +configuration data such as the osmo-remsim-bankd IP+Port and the +ClientId from osmo-remsim-server. -After receiving the configuration, remsim-client will establish a RSPRO -data connection to the remsim-bankd IP:Port. +After receiving the configuration, osmo-remsim-client will establish a +RSPRO data connection to the osmo-remsim-bankd IP:Port. As the USB interface for remote SIM in simtrace2.git uses one interface per slot, we can implement the client in blocking mode, i.e. use @@ -27,22 +28,22 @@ to a more complex async implementation. -remsim-bankd ------------- +osmo-remsim-bankd +----------------- -The remsim-bankd (SIM Bank Daemon) manages one given SIM bank. The +The osmo-remsim-bankd (SIM Bank Daemon) manages one given SIM bank. The initial implementation supports a PC/SC driver to expose any PC/SC compatible card readers as SIM bank. -remsim-bankd initially connects via a RSPRO control connection to -remsim-server at startup, and will in turn receive a set of initial +osmo-remsim-bankd initially connects via a RSPRO control connection to +osmo-remsim-server at startup, and will in turn receive a set of initial [client,slot]:[bankd,slot] mappings. These mappings determine which slot on the client (corresponding to a modem) is mapped to which slot on -the SIM bank. Mappings can be updated by remsim-server at any given +the SIM bank. Mappings can be updated by osmo-remsim-server at any given point in time. -remsim-bankd implements a RSPRO server, where it listens to connections -from remsim-clients. +osmo-remsim-bankd implements a RSPRO server, where it listens to +connections from osmo-remsim-clients. As PC/SC only offers a blocking API, there is one thread per PC/SC slot. This thread will perform blocking I/O on the socket towards the client, @@ -62,10 +63,10 @@ client has identified itself. The advantage is that the entire bankd can live without any non-blocking I/O. -The main thread handles the connection to remsim-server, where it can -also use non-blocking I/O. However, re-connection would be required, to -avoid stalling all banks/cards in the event of a connection loss to the -server. +The main thread handles the connection to osmo-remsim-server, where it +can also use non-blocking I/O. However, re-connection would be +required, to avoid stalling all banks/cards in the event of a connection +loss to the server. worker threads have the following states: * INIT (just started) -- To view, visit https://gerrit.osmocom.org/13510 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I42df660d8c7f696a12118d4e4c38f7ee9e48d2e8 Gerrit-Change-Number: 13510 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:32:46 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:32:46 +0000 Subject: Change in osmo-msc[master]: sgs_iface: fix nullpointer dereference In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13513 ) Change subject: sgs_iface: fix nullpointer dereference ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13513 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6 Gerrit-Change-Number: 13513 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 11 Apr 2019 07:32:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:32:48 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:32:48 +0000 Subject: Change in osmo-msc[master]: sgs_iface: fix nullpointer dereference In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13513 ) Change subject: sgs_iface: fix nullpointer dereference ...................................................................... sgs_iface: fix nullpointer dereference The function sgs_tx() is using the sgs connection pointer as context, even though it has done a check for a nullpointer in the line before. This is very prone to lead into a segfault when the SGs connection dies. Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6 Related: OS#3859 --- M src/libmsc/sgs_iface.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Neels Hofmeyr: Looks good to me, but someone else must approve Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c index 450d552..f64b191 100644 --- a/src/libmsc/sgs_iface.c +++ b/src/libmsc/sgs_iface.c @@ -301,8 +301,8 @@ msgb_sctp_ppid(msg) = 0; if (!sgc) { - LOGSGC(sgc, LOGL_NOTICE, "Cannot transmit %s: connection dead. Discarding\n", - sgsap_msg_type_name(msg->data[0])); + LOGP(LOGL_NOTICE, DSGS, "Cannot transmit %s: connection dead. Discarding\n", + sgsap_msg_type_name(msg->data[0])); msgb_free(msg); return; } -- To view, visit https://gerrit.osmocom.org/13513 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6 Gerrit-Change-Number: 13513 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:33:39 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:33:39 +0000 Subject: Change in osmo-trx[master]: multi-ARFCN: fix maximum number of carriers limitation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13472 ) Change subject: multi-ARFCN: fix maximum number of carriers limitation ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13472 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I66a1462f368458afd313ee6f0bc0abc496dde817 Gerrit-Change-Number: 13472 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Tom Tsou Gerrit-Comment-Date: Thu, 11 Apr 2019 07:33:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:33:40 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:33:40 +0000 Subject: Change in osmo-trx[master]: multi-ARFCN: fix maximum number of carriers limitation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13472 ) Change subject: multi-ARFCN: fix maximum number of carriers limitation ...................................................................... multi-ARFCN: fix maximum number of carriers limitation Maximum number of carriers is fixed to 3 channels on a single physical RF channel in multi-ARFCN mode. For some reason, it was limited to 5. Let's fix this, and also follow this limitation in the following VTY command handlers: - cfg_multi_arfcn_cmd, - cfg_chan_cmd. Change-Id: I66a1462f368458afd313ee6f0bc0abc496dde817 --- M CommonLibs/trx_vty.c M CommonLibs/trx_vty.h M Transceiver52M/osmo-trx.cpp 3 files changed, 16 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c index 3b1b979..06e20ab 100644 --- a/CommonLibs/trx_vty.c +++ b/CommonLibs/trx_vty.c @@ -236,12 +236,16 @@ if (strcmp("disable", argv[0]) == 0) { trx->cfg.multi_arfcn = false; - } else if (strcmp("enable", argv[0]) == 0) { - trx->cfg.multi_arfcn = true; - } else { + return CMD_SUCCESS; + } + + if (trx->cfg.num_chans > TRX_MCHAN_MAX) { + vty_out(vty, "Up to %i channels are supported for multi-TRX mode%s", + TRX_MCHAN_MAX, VTY_NEWLINE); return CMD_WARNING; } + trx->cfg.multi_arfcn = true; return CMD_SUCCESS; } @@ -354,7 +358,12 @@ if (idx >= TRX_CHAN_MAX) { vty_out(vty, "Chan list full.%s", VTY_NEWLINE); return CMD_WARNING; + } else if (trx->cfg.multi_arfcn && trx->cfg.num_chans >= TRX_MCHAN_MAX) { + vty_out(vty, "Up to %i channels are supported for multi-TRX mode%s", + TRX_MCHAN_MAX, VTY_NEWLINE); + return CMD_WARNING; } + if (trx->cfg.num_chans < idx) { /* Unexisting or creating non-consecutive */ vty_out(vty, "Non-existent or non-consecutive chan %d.%s", idx, VTY_NEWLINE); diff --git a/CommonLibs/trx_vty.h b/CommonLibs/trx_vty.h index 8d251ee..8e91113 100644 --- a/CommonLibs/trx_vty.h +++ b/CommonLibs/trx_vty.h @@ -6,7 +6,10 @@ extern struct vty_app_info g_vty_info; +/* Maximum number of physical RF channels */ #define TRX_CHAN_MAX 8 +/* Maximum number of carriers in multi-ARFCN mode */ +#define TRX_MCHAN_MAX 3 /* Samples-per-symbol for downlink path * 4 - Uses precision modulator (more computation, less distortion) diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index b252d0c..7489e7c 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -411,7 +411,7 @@ int trx_validate_config(struct trx_ctx *trx) { - if (trx->cfg.multi_arfcn && trx->cfg.num_chans > 5) { + if (trx->cfg.multi_arfcn && trx->cfg.num_chans > TRX_MCHAN_MAX) { LOG(ERROR) << "Unsupported number of channels"; return -1; } -- To view, visit https://gerrit.osmocom.org/13472 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I66a1462f368458afd313ee6f0bc0abc496dde817 Gerrit-Change-Number: 13472 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Tom Tsou -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:34:02 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:34:02 +0000 Subject: Change in osmo-trx[master]: doc/configuration.adoc: fix incorrect number of physical RF channels ... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13473 ) Change subject: doc/configuration.adoc: fix incorrect number of physical RF channels for B210 ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13473 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I58e2bf5dd99e1655ebd2ad80f6ed2bb178f0e88d Gerrit-Change-Number: 13473 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 07:34:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:34:04 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 07:34:04 +0000 Subject: Change in osmo-trx[master]: doc/configuration.adoc: fix incorrect number of physical RF channels ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13473 ) Change subject: doc/configuration.adoc: fix incorrect number of physical RF channels for B210 ...................................................................... doc/configuration.adoc: fix incorrect number of physical RF channels for B210 Change-Id: I58e2bf5dd99e1655ebd2ad80f6ed2bb178f0e88d --- M doc/manuals/chapters/configuration.adoc 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/manuals/chapters/configuration.adoc b/doc/manuals/chapters/configuration.adoc index 87d7903..ad6742d 100644 --- a/doc/manuals/chapters/configuration.adoc +++ b/doc/manuals/chapters/configuration.adoc @@ -46,7 +46,7 @@ added specifically in commit `76764278169d252980853251daeb9f1ba0c246e1`. This feature is useful for instance if you want to run more than 1 TRX with an -Ettus B200 device, or 3 TRX with an Ettus B210 device, since they support only 1 +Ettus B200 device, or 2 TRX with an Ettus B210 device, since they support only 1 and 2 physical RF channels respectively. No device from other providers or even other devices than B200 and B210 from Ettus are known to support this feature. -- To view, visit https://gerrit.osmocom.org/13473 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I58e2bf5dd99e1655ebd2ad80f6ed2bb178f0e88d Gerrit-Change-Number: 13473 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:57:40 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 07:57:40 +0000 Subject: Change in osmo-hlr[master]: hlr.c: forward GSUP messages between clients In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13006 ) Change subject: hlr.c: forward GSUP messages between clients ...................................................................... Patch Set 7: (2 comments) https://gerrit.osmocom.org/#/c/13006/7/src/hlr.c File src/hlr.c: https://gerrit.osmocom.org/#/c/13006/7/src/hlr.c at 488 PS7, Line 488: and typo: and -> an (I'm quickly fixing this myself.) https://gerrit.osmocom.org/#/c/13006/7/src/hlr.c at 491 PS7, Line 491: MAY BE DEALLOCATED Just to make sure I understand this right: msg is either free'd up directly (if an error occurs), or it gets added to the (struct ipa_server_conn) conn->tx_queue, and will eventually get sent and then deallocated in the main loop. Is that accurate? -- To view, visit https://gerrit.osmocom.org/13006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 Gerrit-Change-Number: 13006 Gerrit-PatchSet: 7 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 07:57:40 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 07:57:50 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 07:57:50 +0000 Subject: Change in osmo-hlr[master]: hlr.c: forward GSUP messages between clients 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/13006 to look at the new patch set (#8). Change subject: hlr.c: forward GSUP messages between clients ...................................................................... hlr.c: forward GSUP messages between clients Allow clients to forward any GSUP message between clients. Determine the sender and receiver from the new {source,dest}_name{,_len} IEs. Reject messages with a forged source name. This will be used for the inter-MSC handover. Depends: Ic00b0601eacff6d72927cea51767801142ee75db (libosmocore.git) Related: OS#3793 Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 --- M src/hlr.c 1 file changed, 82 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/06/13006/8 -- To view, visit https://gerrit.osmocom.org/13006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 Gerrit-Change-Number: 13006 Gerrit-PatchSet: 8 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 08:08:18 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 08:08:18 +0000 Subject: Change in libosmo-sccp[master]: sccp_scoc: conn_create{, _id}() user arg, not inst In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13508 ) Change subject: sccp_scoc: conn_create{,_id}() user arg, not inst ...................................................................... sccp_scoc: conn_create{,_id}() user arg, not inst Accept the osmo_sccp_user instead of calling conn_create() and setting conn->user afterwards. Prepare for generating a local_ref inside conn_create_id() in the future. Related: OS#3871 Change-Id: I2fb47c8ba6c0ce7cd92c9ac31f15c67eb67fb66e --- M src/sccp_scoc.c 1 file changed, 11 insertions(+), 13 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index 82590a0..91a1ab7 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -459,16 +459,16 @@ #define INIT_TIMER(x, fn, priv) do { (x)->cb = fn; (x)->data = priv; } while (0) /* allocate + init a SCCP Connection with given ID */ -static struct sccp_connection *conn_create_id(struct osmo_sccp_instance *inst, - uint32_t conn_id) +static struct sccp_connection *conn_create_id(struct osmo_sccp_user *user, uint32_t conn_id) { - struct sccp_connection *conn = talloc_zero(inst, struct sccp_connection); + struct sccp_connection *conn = talloc_zero(user->inst, struct sccp_connection); char name[16]; conn->conn_id = conn_id; - conn->inst = inst; + conn->inst = user->inst; + conn->user = user; - llist_add_tail(&conn->list, &inst->connections); + llist_add_tail(&conn->list, &user->inst->connections); INIT_TIMER(&conn->t_conn, conn_tmr_cb, conn); INIT_TIMER(&conn->t_ias, tx_inact_tmr_cb, conn); @@ -494,15 +494,15 @@ } /* Search for next free connection ID and allocate conn */ -static struct sccp_connection *conn_create(struct osmo_sccp_instance *inst) +static struct sccp_connection *conn_create(struct osmo_sccp_user *user) { uint32_t conn_id; do { - conn_id = inst->next_id++; - } while (conn_find_by_id(inst, conn_id)); + conn_id = user->inst->next_id++; + } while (conn_find_by_id(user->inst, conn_id)); - return conn_create_id(inst, conn_id); + return conn_create_id(user, conn_id); } /* destroy a SCCP connection state, releasing all timers, terminating @@ -1623,8 +1623,7 @@ return; } /* Allocate new connection */ - conn = conn_create(inst); - conn->user = scu; + conn = conn_create(scu); conn->incoming = true; } else { uint32_t conn_id; @@ -1718,14 +1717,13 @@ return sccp_sclc_user_sap_down(scu, oph); case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_REQUEST): /* Allocate new connection structure */ - conn = conn_create_id(inst, prim->u.connect.conn_id); + conn = conn_create_id(scu, prim->u.connect.conn_id); if (!conn) { /* FIXME: inform SCCP user with proper reply */ LOGP(DLSCCP, LOGL_ERROR, "Cannot create conn-id for primitive %s\n", osmo_scu_prim_name(&prim->oph)); goto out; } - conn->user = scu; break; case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_RESPONSE): case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_REQUEST): -- To view, visit https://gerrit.osmocom.org/13508 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2fb47c8ba6c0ce7cd92c9ac31f15c67eb67fb66e Gerrit-Change-Number: 13508 Gerrit-PatchSet: 3 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 08:25:22 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 08:25:22 +0000 Subject: Change in osmo-hlr[master]: hlr.c: forward GSUP messages between clients In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13006 ) Change subject: hlr.c: forward GSUP messages between clients ...................................................................... Patch Set 8: (3 comments) https://gerrit.osmocom.org/#/c/13006/8/src/hlr.c File src/hlr.c: https://gerrit.osmocom.org/#/c/13006/8/src/hlr.c at 478 PS8, Line 478: Cannot forward GSUP All "GSUP message forwarding error" messages in this function look different. This one is missing IMSI. Let's unify the message format for all LOGP() calls, for example: "GSUP message (IMSI-%imsi, kind=%kind, type=%type) forwarding error: REASON" This can be done using #define LOGP_GSUP(msg, fmt, ##args ...). https://gerrit.osmocom.org/#/c/13006/8/src/hlr.c at 483 PS8, Line 483: LOGL_NOTICE Let's rather use LOGL_INFO. GSUP message forwarding is an expected event, and may happen quite often, so there is no need to distract log reader's attention. https://gerrit.osmocom.org/#/c/13006/8/src/hlr.c at 494 PS8, Line 494: gsup = NULL; The argument is defined as follows: *const* struct osmo_gsup_message *gsup, so why do we need to forget this pointer? -- To view, visit https://gerrit.osmocom.org/13006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 Gerrit-Change-Number: 13006 Gerrit-PatchSet: 8 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 08:25:22 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 08:26:40 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 08:26:40 +0000 Subject: Change in osmo-hlr[master]: fix error logging for GSUP route In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13517 ) Change subject: fix error logging for GSUP route ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13517 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie4def16008af573ed2e1367d9da50c3d2b5a71ef Gerrit-Change-Number: 13517 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Thu, 11 Apr 2019 08:26:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 08:29:18 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 08:29:18 +0000 Subject: Change in osmo-hlr[master]: USSD: don't use gsm0480_msgb_alloc_name() In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13548 ) Change subject: USSD: don't use gsm0480_msgb_alloc_name() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13548/1/src/hlr_ussd.c File src/hlr_ussd.c: https://gerrit.osmocom.org/#/c/13548/1/src/hlr_ussd.c at 244 PS1, Line 244: resp_msg = msgb_alloc_headroom(4000, 64, __func__); > might be good to introduce a #define for it then, and use that #define (maybe a sa preceding patch, [?] How about OSMO_GSUP_MSGB_HEADROOM_SIZE? And I would put it into libosmocore, since there seems to be no gsup-related header file in osmo-hlr.git, that is included by both the server and client. Does that make sense? -- To view, visit https://gerrit.osmocom.org/13548 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icdab40c6a933888eb9f51bee9c5264c8919dbf7b Gerrit-Change-Number: 13548 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Thu, 11 Apr 2019 08:29:18 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 08:29:20 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 08:29:20 +0000 Subject: Change in osmo-hlr[master]: USSD: don't use gsm0480_msgb_alloc_name() In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13548 ) Change subject: USSD: don't use gsm0480_msgb_alloc_name() ...................................................................... USSD: don't use gsm0480_msgb_alloc_name() We have nothing to do with GSM 04.80 at the HLR - it's only used to encapsulate the SS payload between MS and MSC. This is not that critical, but may be misleading. Also, gsm0480_msgb_alloc_name() allocates a smaller buffer: return msgb_alloc_headroom(1024, 128, name); than osmo_gsup_client_msgb_alloc() does: return msgb_alloc_headroom(4000, 64, __func__); Change-Id: Icdab40c6a933888eb9f51bee9c5264c8919dbf7b --- M src/hlr_ussd.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index 56a5a95..50a0167 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -277,7 +277,7 @@ resp.ss_info_len = msgb_length(ss_msg); } - resp_msg = gsm0480_msgb_alloc_name(__func__); + resp_msg = msgb_alloc_headroom(4000, 64, __func__); OSMO_ASSERT(resp_msg); osmo_gsup_encode(resp_msg, &resp); msgb_free(ss_msg); -- To view, visit https://gerrit.osmocom.org/13548 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Icdab40c6a933888eb9f51bee9c5264c8919dbf7b Gerrit-Change-Number: 13548 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 08:32:07 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 08:32:07 +0000 Subject: Change in osmo-msc[master]: smpp: Make libsmpp34 use talloc for its allocations In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13562 ) Change subject: smpp: Make libsmpp34 use talloc for its allocations ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13562 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Gerrit-Change-Number: 13562 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 08:32:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 08:41:38 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 08:41:38 +0000 Subject: Change in osmo-hlr[master]: osmo-hlr: allow configuring db path from cfg file In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13586 ) Change subject: osmo-hlr: allow configuring db path from cfg file ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13586/1/src/hlr.c File src/hlr.c: https://gerrit.osmocom.org/#/c/13586/1/src/hlr.c at 739 PS1, Line 739: osmo_talloc_replace_string Can we do this conditionally after parsing the VTY config? -- To view, visit https://gerrit.osmocom.org/13586 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I87b8673324e1e6225afb758fb4963ff3279ea3d8 Gerrit-Change-Number: 13586 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 08:41:38 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 08:44:39 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 08:44:39 +0000 Subject: Change in osmo-hlr[master]: add missing error log: invalid IMSI In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13587 ) Change subject: add missing error log: invalid IMSI ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13587/1/src/hlr.c File src/hlr.c: https://gerrit.osmocom.org/#/c/13587/1/src/hlr.c at 537 PS1, Line 537: osmo_quote_str What is the benefit of using osmo_quote_str() here? Why not to pass gsup.imsi directly? -- To view, visit https://gerrit.osmocom.org/13587 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I65e9ecac06dc6d1abb9802d621c385d3b4fab83a Gerrit-Change-Number: 13587 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 08:44:39 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 08:45:45 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 08:45:45 +0000 Subject: Change in osmo-hlr[master]: GSUP routing: use Kind IE In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13588 ) Change subject: GSUP routing: use Kind IE ...................................................................... Patch Set 1: Can we squash this one into Ia4f345abc877baaf0a8f73b8988e6514d9589bf5? -- To view, visit https://gerrit.osmocom.org/13588 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8dc3967d9372d63e9d57ca2608dd3316edb234a4 Gerrit-Change-Number: 13588 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 08:45:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 08:48:09 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 08:48:09 +0000 Subject: Change in libosmocore[master]: add OSMO_IMSI_SIZE In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13575 ) Change subject: add OSMO_IMSI_SIZE ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/13575/3/include/osmocom/gsm/protocol/gsm_23_003.h File include/osmocom/gsm/protocol/gsm_23_003.h: https://gerrit.osmocom.org/#/c/13575/3/include/osmocom/gsm/protocol/gsm_23_003.h at 10 PS3, Line 10: OSMO_IMSI_SIZE I think I already commented somewhere, that 'OMSO_IMSI_BUF_SIZE' would be more self-explaining symbol name... Cannot find where :/ -- To view, visit https://gerrit.osmocom.org/13575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 Gerrit-Change-Number: 13575 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 08:48:09 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 08:54:47 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 08:54:47 +0000 Subject: Change in libosmocore[master]: GSUP: add Class IE In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13576 ) Change subject: GSUP: add Class IE ...................................................................... Patch Set 3: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/13576/3/include/osmocom/gsm/gsup.h File include/osmocom/gsm/gsup.h: https://gerrit.osmocom.org/#/c/13576/3/include/osmocom/gsm/gsup.h at 71 PS3, Line 71: OSMO_GSUP_CLASS_IE Looking at this IE, the reader may ask: class of what? How about 'OSMO_GSUP_MSG_CLASS_IE' or 'OSMO_GSUP_MESSAGE_CLASS_IE'? https://gerrit.osmocom.org/#/c/13576/3/include/osmocom/gsm/gsup.h at 233 PS3, Line 233: osmo_gsup_class Same comment regarding the naming here. https://gerrit.osmocom.org/#/c/13576/3/include/osmocom/gsm/gsup.h at 241 PS3, Line 241: OSMO_GSUP_CLASS_ARRAYSIZE Which array? Enum osmo_gsup_iei has '_OSMO_GSUP_IEI_END_MARKER'. I think we should keep the naming style consistent. -- To view, visit https://gerrit.osmocom.org/13576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef Gerrit-Change-Number: 13576 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 08:54:47 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 08:57:01 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 08:57:01 +0000 Subject: Change in libosmocore[master]: GSUP: add Class IE In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13576 ) Change subject: GSUP: add Class IE ...................................................................... Patch Set 3: (2 comments) https://gerrit.osmocom.org/#/c/13576/3/src/gsm/gsup.c File src/gsm/gsup.c: https://gerrit.osmocom.org/#/c/13576/3/src/gsm/gsup.c at 481 PS3, Line 481: osmo_decode_big_endian It's just one byte, no need for osmo_decode_big_endian() here. https://gerrit.osmocom.org/#/c/13576/3/src/gsm/gsup.c at 739 PS3, Line 739: {} Common style: { 0, NULL } -- To view, visit https://gerrit.osmocom.org/13576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef Gerrit-Change-Number: 13576 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 08:57:01 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 09:05:02 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 09:05:02 +0000 Subject: Change in osmo-gsm-manuals[master]: build/unix-time-to-fmt.py: use default python ver Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13595 Change subject: build/unix-time-to-fmt.py: use default python ver ...................................................................... build/unix-time-to-fmt.py: use default python ver Don't explicitly depend on python 3, so we don't need to have python 2 *and* python 3 installed to build osmo-gsm-manuals. The script is short and works fine with either python version. Related: OS#3899 Change-Id: I8af9b8159f5c7e39b905f85edd1584cb4d5a33ef --- M build/unix-time-to-fmt.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/95/13595/1 diff --git a/build/unix-time-to-fmt.py b/build/unix-time-to-fmt.py index 026e55c..72ece26 100755 --- a/build/unix-time-to-fmt.py +++ b/build/unix-time-to-fmt.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """ Usage: -- To view, visit https://gerrit.osmocom.org/13595 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8af9b8159f5c7e39b905f85edd1584cb4d5a33ef Gerrit-Change-Number: 13595 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 09:05:03 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 09:05:03 +0000 Subject: Change in osmo-gsm-manuals[master]: check-depends.sh: don't depend on git binary Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13596 Change subject: check-depends.sh: don't depend on git binary ...................................................................... check-depends.sh: don't depend on git binary Remove git from depends, because it isn't needed when building the manuals from a source tarball. Avoid having git in the build dependencies of the upcoming manuals packaging for debian. Related: OS#3899 Change-Id: I46ad818a1d009c03357821f7c8100ecb5d62962e --- M check-depends.sh 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/96/13596/1 diff --git a/check-depends.sh b/check-depends.sh index 7845719..ec3f26f 100755 --- a/check-depends.sh +++ b/check-depends.sh @@ -18,7 +18,6 @@ check_dep_bin mscgen mscgen check_dep_bin xsltproc libxslt -check_dep_bin git git check_dep_bin a2x asciidoc check_dep_bin asciidoc asciidoc check_dep_bin dblatex dblatex -- To view, visit https://gerrit.osmocom.org/13596 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I46ad818a1d009c03357821f7c8100ecb5d62962e Gerrit-Change-Number: 13596 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 09:05:03 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 09:05:03 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.common.inc: add {, un}install targets Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13597 Change subject: Makefile.common.inc: add {,un}install targets ...................................................................... Makefile.common.inc: add {,un}install targets Allow installing generated pdfs with 'make install' in all Osmocom projects using osmo-gsm-manuals. This makes proper debian packaging of the manuals easier. Autotools will automatically run this file's install target, when running 'make install' in the top source dir. Do not install anything, when OSMO_GSM_MANUALS_NO_INSTALL is set, and set this variable for the tests dir, so we don't install the test pdfs. Related: OS#3899 Change-Id: I66f33172fa410681acbaef4592e9405627948705 --- M build/Makefile.common.inc M tests/Makefile.am 2 files changed, 22 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/97/13597/1 diff --git a/build/Makefile.common.inc b/build/Makefile.common.inc index aaad088..b13bda1 100644 --- a/build/Makefile.common.inc +++ b/build/Makefile.common.inc @@ -3,12 +3,16 @@ # Other makefiles like Makefile.asciidoc.inc and Makefile.vty-reference.inc add # entries to UPLOAD_FILES and CLEAN_FILES. # -# Include this file at the end to have the common targets (upload, clean etc.). +# Include this file at the end to have the common targets (upload, clean, install etc.). SSH_COMMAND = ssh -o 'UserKnownHostsFile=$(OSMO_GSM_MANUALS_DIR)/build/known_hosts' -p 48 UPLOAD_PATH ?= generic at sysmocom-downloads:documents SYMLINKS = common build CLEAN_FILES += $(SYMLINKS) +PDF_FILES = $(patsubst %.adoc,%.pdf,$(ASCIIDOC)) $(patsubst %.xml,%.pdf,$(VTY_REFERENCE)) + +# Prefix (Makefile.am sets this to configure's --prefix when including) +prefix ?= /usr/local $(SYMLINKS): ln -s $(OSMO_GSM_MANUALS_DIR)/$@ $@ @@ -25,3 +29,17 @@ mkdir -p out cp *.pdf out rsync -avz -e "$(SSH_COMMAND)" ./out/ docs at rita.osmocom.org:web-files/latest/ + +install: $(PDF_FILES) + if [ "$(OSMO_GSM_MANUALS_NO_INSTALL)" != "1" ]; then \ + for i in $(PDF_FILES); do \ + install -vDm644 "$$i" "$(DESTDIR)$(prefix)/share/doc/osmocom/$$i" || exit 1; \ + done; \ + fi + +uninstall: + if [ "$(OSMO_GSM_MANUALS_NO_INSTALL)" != "1" ]; then \ + for i in $(PDF_FILES); do \ + rm -v "$(DESTDIR)$(prefix)/share/doc/osmocom/$$i"; \ + done; \ + fi diff --git a/tests/Makefile.am b/tests/Makefile.am index 32f23b0..7dc9544 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -3,6 +3,9 @@ test-vty-reference.xml \ vty +# Do not install any of the test pdfs +OSMO_GSM_MANUALS_NO_INSTALL = 1 + # Generate adoc file that includes all chapters ASCIIDOC = test-usermanual.adoc ASCIIDOC_DEPS = -- To view, visit https://gerrit.osmocom.org/13597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I66f33172fa410681acbaef4592e9405627948705 Gerrit-Change-Number: 13597 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 09:05:03 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 09:05:03 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.am: proper noarch pkgconfig install dir Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13598 Change subject: Makefile.am: proper noarch pkgconfig install dir ...................................................................... Makefile.am: proper noarch pkgconfig install dir Don't install the noarch osmo-gsm-manuals.pc file to $prefix/lib/x86_64-linux-gnu/pkgconfig when building a debian package (dpkg-buildpackage seems to set $libdir accordingly). Always install to $prefix/lib/pkgconfig. The debian dir for creating a package from this repository will be added in a follow up patch. Related: OS#3899 Change-Id: I63bc8ab6d2845751079f40383d2aa92c709ce2fe --- M Makefile.am 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/98/13598/1 diff --git a/Makefile.am b/Makefile.am index 2a7b881..479fe8e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,8 @@ share_files = $(srcdir)/build $(srcdir)/common $(srcdir)/*.xsl share_path = "$(DESTDIR)$(prefix)/share/osmo-gsm-manuals" -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = osmo-gsm-manuals.pc +noarch_pkgconfigdir = $(prefix)/lib/pkgconfig +noarch_pkgconfig_DATA = osmo-gsm-manuals.pc BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen .version check-depends.sh $(share_files) SUBDIRS = tests -- To view, visit https://gerrit.osmocom.org/13598 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I63bc8ab6d2845751079f40383d2aa92c709ce2fe Gerrit-Change-Number: 13598 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 09:05:04 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 09:05:04 +0000 Subject: Change in osmo-gsm-manuals[master]: Add debian packaging for osmo-gsm-manuals-dev Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13599 Change subject: Add debian packaging for osmo-gsm-manuals-dev ...................................................................... Add debian packaging for osmo-gsm-manuals-dev Allow including pdf manuals in each Osmocom repositories -doc debian package, by depending on osmo-gsm-manuals-dev. Related: OS#3899 Example usage: I4c184c62804c0b805a0a2425a5bd0312e94e49ab (osmo-bts.git) Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 --- A debian/changelog A debian/compat A debian/control A debian/copyright A debian/rules A debian/source/format 6 files changed, 76 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/99/13599/1 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..975644a --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +osmo-gsm-manuals-dev (0.0.0) unstable; urgency=medium + + * Initial Release. + + -- Oliver Smith Tue, 09 Apr 2019 13:19:25 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..9dc03cb --- /dev/null +++ b/debian/control @@ -0,0 +1,36 @@ +Source: osmo-gsm-manuals-dev +Section: devel +Priority: optional +Maintainer: Oliver Smith +Build-Depends: autotools-dev, + debhelper (>= 9), + pkg-config, +# All below also need to be in Depends + asciidoc, + asciidoc-dblatex, + dblatex, + docbook5-xml, + graphviz, + mscgen, + python, + python-nwdiag, + python-pychart, + xsltproc +Standards-Version: 3.9.8 +Homepage: https://git.osmocom.org/osmo-gsm-manuals/ + +Package: osmo-gsm-manuals-dev +Architecture: all +Depends: ${misc:Depends}, + asciidoc, + asciidoc-dblatex, + dblatex, + docbook5-xml, + graphviz, + mscgen, + python, + python-nwdiag, + python-pychart, + xsltproc +Description: Osmocom manuals shared code + All Osomocom repositories require this package to build their manuals. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..bc63191 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,28 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: osmo-gsm-manuals-dev +Source: + +Files: * +Copyright: 2009-2019 Harald Welte +License: GFDL-1.3 + +Files: debian/* +Copyright: 2019 Oliver Smith +License: GPL-3.0+ + +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 package is distributed in the hope that 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". diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..272596d --- /dev/null +++ b/debian/rules @@ -0,0 +1,5 @@ +#!/usr/bin/make -f + +#export DH_VERBOSE = 1 +%: + dh $@ --with autotools_dev diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) -- To view, visit https://gerrit.osmocom.org/13599 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 Gerrit-Change-Number: 13599 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 09:05:23 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 09:05:23 +0000 Subject: Change in osmo-ci[master]: OBS: build osmo-gsm-manuals-dev Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13600 Change subject: OBS: build osmo-gsm-manuals-dev ...................................................................... OBS: build osmo-gsm-manuals-dev Enable in osmo-nightly-packages.sh, and add as coment in osmocom-nightly-packages.sh for now (needs a tagged release first). Related: OS#3899 Depends: I7edb5093e5b58eb3b0f7af2376476db4026db735 (osmo-gsm-manuals.git) Change-Id: Ideeae4f7846fa5626fe2c1f5a77e07a3c6e626fe --- M scripts/osmocom-latest-packages.sh M scripts/osmocom-nightly-packages.sh 2 files changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/00/13600/1 diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh index d647d32..28c4550 100755 --- a/scripts/osmocom-latest-packages.sh +++ b/scripts/osmocom-latest-packages.sh @@ -98,9 +98,10 @@ cd "$TOP" } -# add those two once they have tagged any versions that include the 'debian' sub-dir: +# add those once they have tagged any versions that include the 'debian' sub-dir: #rtl-sdr #osmo-fl2k +#osmo-gsm-manuals build_osmocom() { prepare diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 7e1cede..978ba2c 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -158,6 +158,7 @@ prepare checkout_limesuite + checkout osmo-gsm-manuals checkout libosmocore checkout libosmo-sccp checkout libosmo-abis @@ -190,6 +191,7 @@ create_osmo_trx_debian8_jessie build limesuite no_commit --git-upstream-tree=v18.10.0 + build osmo-gsm-manuals build libosmocore build libosmo-sccp build libosmo-abis -- To view, visit https://gerrit.osmocom.org/13600 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ideeae4f7846fa5626fe2c1f5a77e07a3c6e626fe Gerrit-Change-Number: 13600 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 09:05:39 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 09:05:39 +0000 Subject: Change in osmo-bts[master]: debian: create -doc subpackage with pdf manuals Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13601 Change subject: debian: create -doc subpackage with pdf manuals ...................................................................... debian: create -doc subpackage with pdf manuals Related: OS#3899 Depends: I7edb5093e5b58eb3b0f7af2376476db4026db735 (osmo-gsm-manuals.git) Depends: Ideeae4f7846fa5626fe2c1f5a77e07a3c6e626fe (osmo-ci.git) Change-Id: I4c184c62804c0b805a0a2425a5bd0312e94e49ab --- M debian/control A debian/osmo-bts-doc.install M debian/rules 3 files changed, 17 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/13601/1 diff --git a/debian/control b/debian/control index 0377d9f..2b66716 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,8 @@ libosmocore-dev, libosmo-abis-dev, libgps-dev, - txt2man + txt2man, + osmo-gsm-manuals-dev Standards-Version: 3.9.8 Vcs-Browser: http://git.osmocom.org/osmo-bts/ Vcs-Git: git://git.osmocom.org/osmo-bts @@ -48,3 +49,12 @@ Depends: osmo-bts-virtual (= ${binary:Version}), ${misc:Depends} Description: Debug symbols for the osmo-bts-virtual Make debugging possible + +Package: osmo-bts-doc +Architecture: all +Section: doc +Priority: optional +Depends: ${misc:Depends} +Description: ${misc:Package} PDF documentation + Various manuals: user manual, VTY reference manual and/or + protocol/interface manuals. diff --git a/debian/osmo-bts-doc.install b/debian/osmo-bts-doc.install new file mode 100644 index 0000000..477ebc4 --- /dev/null +++ b/debian/osmo-bts-doc.install @@ -0,0 +1 @@ +usr/share/doc/osmocom/*.pdf diff --git a/debian/rules b/debian/rules index 27de11b..94bed0e 100755 --- a/debian/rules +++ b/debian/rules @@ -16,7 +16,7 @@ dh_strip --package=osmo-bts-trx --dbg-package=osmo-bts-trx-dbg override_dh_auto_configure: - dh_auto_configure -- --enable-trx --with-systemdsystemunitdir=/lib/systemd/system + dh_auto_configure -- --enable-trx --with-systemdsystemunitdir=/lib/systemd/system --enable-manuals override_dh_clean: dh_clean @@ -26,3 +26,7 @@ # Print test results in case of a failure override_dh_auto_test: dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) + +# Don't create .pdf.gz files (barely saves space and they can't be opened directly by most pdf readers) +override_dh_compress: + dh_compress -X.pdf -- To view, visit https://gerrit.osmocom.org/13601 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4c184c62804c0b805a0a2425a5bd0312e94e49ab Gerrit-Change-Number: 13601 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 09:08:38 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Apr 2019 09:08:38 +0000 Subject: Change in libosmocore[master]: BSSMAP: tweaks In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13577 ) Change subject: BSSMAP: tweaks ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13577 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6387836bab76e1fa42daa0f42ab94fc14b70b112 Gerrit-Change-Number: 13577 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 09:08:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 09:16:08 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 09:16:08 +0000 Subject: Change in osmo-gsm-manuals[master]: Add debian packaging for osmo-gsm-manuals-dev In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13599 to look at the new patch set (#2). Change subject: Add debian packaging for osmo-gsm-manuals-dev ...................................................................... Add debian packaging for osmo-gsm-manuals-dev Allow including pdf manuals in each Osmocom repositories -doc debian package, by depending on osmo-gsm-manuals-dev. Related: OS#3899 Example usage: I4c184c62804c0b805a0a2425a5bd0312e94e49ab (osmo-bts.git) Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 --- A debian/changelog A debian/compat A debian/control A debian/copyright A debian/rules A debian/source/format 6 files changed, 76 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/99/13599/2 -- To view, visit https://gerrit.osmocom.org/13599 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 Gerrit-Change-Number: 13599 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 13:34:45 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 13:34:45 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Remove duplicated check Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13602 Change subject: nightly-packages: Remove duplicated check ...................................................................... nightly-packages: Remove duplicated check Change-Id: I9659e71d87b03971673da3bfb2101de9d5fe3c6a --- M scripts/osmocom-nightly-packages.sh 1 file changed, 0 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/02/13602/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 7e1cede..052eb09 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -225,11 +225,6 @@ post } -if ! which osc >/dev/null 2>/dev/null ; then - echo "osc binary is not installed" - exit 1 -fi - TMPDIR=$(mktemp -d nightly-3g_XXXXXX) cd "$TMPDIR" build_osmocom -- To view, visit https://gerrit.osmocom.org/13602 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9659e71d87b03971673da3bfb2101de9d5fe3c6a Gerrit-Change-Number: 13602 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 13:34:45 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 13:34:45 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Remove unused variable Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13603 Change subject: nightly-packages: Remove unused variable ...................................................................... nightly-packages: Remove unused variable Change-Id: Ic120dbc134cba9bd77098ab14a5dba3d5c4d71b9 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/03/13603/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 052eb09..26b8bc9 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -40,7 +40,6 @@ get_commit_version() { # return a version based on the commit local version - local date # determine git version *and generate the .tarball-version file* test -x ./git-version-gen && ./git-version-gen . > .tarball-version 2>/dev/null -- To view, visit https://gerrit.osmocom.org/13603 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic120dbc134cba9bd77098ab14a5dba3d5c4d71b9 Gerrit-Change-Number: 13603 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 13:34:45 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 13:34:45 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Move some code and rename some vars to look similar... Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13604 Change subject: nightly-packages: Move some code and rename some vars to look similar to latest-packages ...................................................................... nightly-packages: Move some code and rename some vars to look similar to latest-packages Change-Id: I177bb7fb75e293ef665e95363a38c6b4f8e49c13 --- M scripts/osmocom-latest-packages.sh M scripts/osmocom-nightly-packages.sh 2 files changed, 28 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/04/13604/1 diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh index d647d32..e70dd92 100755 --- a/scripts/osmocom-latest-packages.sh +++ b/scripts/osmocom-latest-packages.sh @@ -18,6 +18,7 @@ exit 1 fi +### OBS build prepare() { # start with a checkout of the project if [ -d $PROJ ]; then diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 26b8bc9..5f97c3d 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -1,33 +1,21 @@ #!/bin/bash + # requirements # apt install devscripts git-buildpackage osc git set -e set -x +# OBS project name +PROJ=network:osmocom:nightly + +DT=$(date +%Y%m%d) +TOP=$(pwd)/$(mktemp -d nightly-3g_XXXXXX) + if ! which osc >/dev/null 2>/dev/null ; then echo "osc binary not found" exit 1 fi -DT=$(date +%Y%m%d) -PROJ=network:osmocom:nightly - -### common -checkout() { - local name=$1 - local branch=$2 - local url="https://git.osmocom.org" - - cd "$REPO" - - if [ -n "$branch" ] ; then - git clone "$url/$name" -b "$branch" - else - git clone "$url/$name" - fi - - cd - -} ### OBS build prepare() { @@ -56,6 +44,23 @@ echo -n "$version" } +### common +checkout() { + local name=$1 + local branch=$2 + local url="https://git.osmocom.org" + + cd "$REPO" + + if [ -n "$branch" ] ; then + git clone "$url/$name" -b "$branch" + else + git clone "$url/$name" + fi + + cd - +} + build() { local name=$1 local changelog=$2 @@ -144,12 +149,11 @@ } build_osmocom() { - BASE=$PWD - DATA=$BASE/data - REPO=$BASE/repo + DATA=$TOP/data + REPO=$TOP/repo # rather than including a dangerous 'rm -rf *' here, lets delegate to the user: - if [ -n "$(ls)" ]; then + if [ -n "$TOP" ]; then echo "ERROR: I need to run in an empty directory." exit 1 fi @@ -224,6 +228,4 @@ post } -TMPDIR=$(mktemp -d nightly-3g_XXXXXX) -cd "$TMPDIR" build_osmocom -- To view, visit https://gerrit.osmocom.org/13604 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I177bb7fb75e293ef665e95363a38c6b4f8e49c13 Gerrit-Change-Number: 13604 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 13:34:46 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 13:34:46 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Build latest tag of limesuite Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13605 Change subject: nightly-packages: Build latest tag of limesuite ...................................................................... nightly-packages: Build latest tag of limesuite Like we actually do already on latest-packages. Change-Id: I5a9e97a7a93c1d2a9983926cd0f5d7255e9666bd --- M scripts/osmocom-nightly-packages.sh 1 file changed, 13 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/05/13605/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 5f97c3d..7501ff5 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -25,6 +25,17 @@ osc co "$PROJ" } +get_last_tag() { + project="$1" + if [ "$project" = "limesuite" ]; then + ver_regexp="^v[0-9]*.[0-9]*.[0-9]*$" + else + ver_regexp="^[0-9]*.[0-9]*.[0-9]*$" + fi + VER=$(git -C "${REPO}/${project}" tag -l --sort=v:refname | grep "$ver_regexp" | tail -n 1) + echo "${VER}" +} + get_commit_version() { # return a version based on the commit local version @@ -130,10 +141,9 @@ } checkout_limesuite() { - TAG="v18.10.0" - cd "$REPO" git clone https://github.com/myriadrf/LimeSuite limesuite + TAG="$(get_last_tag limesuite)" cd limesuite git checkout "$TAG" } @@ -192,7 +202,7 @@ create_osmo_trx_debian8_jessie - build limesuite no_commit --git-upstream-tree=v18.10.0 + build limesuite no_commit --git-upstream-tree="$(get_last_tag limesuite)" build libosmocore build libosmo-sccp build libosmo-abis -- To view, visit https://gerrit.osmocom.org/13605 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5a9e97a7a93c1d2a9983926cd0f5d7255e9666bd Gerrit-Change-Number: 13605 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 13:57:18 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 13:57:18 +0000 Subject: Change in osmo-hlr[master]: hlr.c: forward GSUP messages between clients 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/13006 to look at the new patch set (#9). Change subject: hlr.c: forward GSUP messages between clients ...................................................................... hlr.c: forward GSUP messages between clients Allow clients to forward any GSUP message between clients. Determine the sender and receiver from the new {source,dest}_name{,_len} IEs. Reject messages with a forged source name. This will be used for the inter-MSC handover. Depends: Ic00b0601eacff6d72927cea51767801142ee75db (libosmocore.git) Related: OS#3793 Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 --- M src/hlr.c 1 file changed, 78 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/06/13006/9 -- To view, visit https://gerrit.osmocom.org/13006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 Gerrit-Change-Number: 13006 Gerrit-PatchSet: 9 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 14:01:45 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 14:01:45 +0000 Subject: Change in osmo-hlr[master]: hlr.c: forward GSUP messages between clients In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13006 ) Change subject: hlr.c: forward GSUP messages between clients ...................................................................... Patch Set 8: (3 comments) https://gerrit.osmocom.org/#/c/13006/8/src/hlr.c File src/hlr.c: https://gerrit.osmocom.org/#/c/13006/8/src/hlr.c at 478 PS8, Line 478: Cannot forward GSUP > All "GSUP message forwarding error" messages in this function look different. [?] Done https://gerrit.osmocom.org/#/c/13006/8/src/hlr.c at 483 PS8, Line 483: LOGL_NOTICE > Let's rather use LOGL_INFO. [?] Done https://gerrit.osmocom.org/#/c/13006/8/src/hlr.c at 494 PS8, Line 494: gsup = NULL; > The argument is defined as follows: [?] I think Neels put it there more of a reminder that accessing anything in gsup, like gsup->source_name may be deallocated at this point (since msg is deallocated). So we must not access it anymore below, and use the copy gsup_err instead. -- To view, visit https://gerrit.osmocom.org/13006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 Gerrit-Change-Number: 13006 Gerrit-PatchSet: 8 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 14:01:45 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 14:02:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 14:02:45 +0000 Subject: Change in osmo-ttcn3-hacks[master]: ggsn: Verify that there are no duplicate PCO protocolIDs In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13563 to look at the new patch set (#2). Change subject: ggsn: Verify that there are no duplicate PCO protocolIDs ...................................................................... ggsn: Verify that there are no duplicate PCO protocolIDs Introduce a function to verify there's no duplicate ProtocolIDs in the PCO returned from the GGSN. Change-Id: I9d439dab1696196cd125f4d7113b426f1711a405 Related: OS#3914 --- M ggsn_tests/GGSN_Tests.ttcn 1 file changed, 38 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/63/13563/2 -- To view, visit https://gerrit.osmocom.org/13563 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9d439dab1696196cd125f4d7113b426f1711a405 Gerrit-Change-Number: 13563 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 14:03:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 14:03:12 +0000 Subject: Change in osmo-ggsn[master]: ggsn.c: Refactor PCO processing during PDP activation Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13606 Change subject: ggsn.c: Refactor PCO processing during PDP activation ...................................................................... ggsn.c: Refactor PCO processing during PDP activation The existing PCO processing is implemented in a rater convoluted way. We scan the list of PCO elements several times for different PCO protocols. Let's change to a straight-forward model where we simply do one iteration over the list of PCO elements and generate responses step by step. Change-Id: I4a7d09279b6b259e2b95f1f51159b16838b2d94c --- M ggsn/ggsn.c 1 file changed, 96 insertions(+), 85 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/06/13606/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index eac7e16..c460b98 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -470,22 +470,6 @@ uint8_t data[0]; } __attribute__((packed)); -/* determine if PCO contains given protocol */ -static const struct pco_element *pco_contains_proto(const struct ul255_t *pco, size_t offset, - uint16_t prot, size_t prot_minlen) -{ - const uint8_t *cur = pco->v + 1 /*length*/ + offset; - - /* iterate over PCO and check if protocol contained */ - while (cur + sizeof(struct pco_element) <= pco->v + pco->l) { - const struct pco_element *elem = (const struct pco_element *)cur; - if (ntohs(elem->protocol_id) == prot && elem->length >= prot_minlen) - return elem; - cur += elem->length + sizeof(struct pco_element); - } - return NULL; -} - /*! Get the peer of pdp based on IP version used. * \param[in] pdp PDP context to select the peer from. * \param[in] v4v6 IP version to select. Valid values are 4 and 6. @@ -510,103 +494,130 @@ return NULL; } -/* construct an IPCP PCO response from request*/ -static void build_ipcp_pco(const struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) +static void process_pco_element_ipcp(const struct pco_element *pco_elem, struct msgb *resp, + const struct apn_ctx *apn, struct pdp_t *pdp) { + struct ippoolm_t *peer_v4 = pdp_get_peer_ipv(pdp, false); const struct in46_addr *dns1 = &apn->v4.cfg.dns[0]; const struct in46_addr *dns2 = &apn->v4.cfg.dns[1]; - const struct pco_element *pco_ipcp; + uint8_t *start = resp->tail; const uint8_t *ipcp; uint16_t ipcp_len; uint8_t *len1, *len2; unsigned int len_appended; ptrdiff_t consumed; - size_t remain, offset = 0; + size_t remain; - /* pco_contains_proto() returns a potentially unaligned pointer into pco_req->v (see OS#3194) */ - pco_ipcp = pco_contains_proto(&pdp->pco_req, offset, PCO_P_IPCP, sizeof(struct ipcp_hdr)); - while (pco_ipcp) { - uint8_t *start = msg->tail; + if (!peer_v4) + return; - ipcp = pco_ipcp->data; - consumed = (ipcp - &pdp->pco_req.v[0]); - remain = sizeof(pdp->pco_req.v) - consumed; - ipcp_len = osmo_load16be(ipcp + 2); /* 1=code + 1=id */ - if (remain < 0 || remain < ipcp_len) - return; + ipcp = pco_elem->data; + consumed = (ipcp - &pdp->pco_req.v[0]); + remain = sizeof(pdp->pco_req.v) - consumed; + ipcp_len = osmo_load16be(ipcp + 2); /* 1=code + 1=id */ + if (remain < 0 || remain < ipcp_len) + return; - /* Three byte T16L header */ - msgb_put_u16(msg, 0x8021); /* IPCP */ - len1 = msgb_put(msg, 1); /* Length of contents: delay */ + /* Three byte T16L header */ + msgb_put_u16(resp, 0x8021); /* IPCP */ + len1 = msgb_put(resp, 1); /* Length of contents: delay */ - msgb_put_u8(msg, 0x02); /* ACK */ - msgb_put_u8(msg, ipcp[1]); /* ID: Needs to match request */ - msgb_put_u8(msg, 0x00); /* Length MSB */ - len2 = msgb_put(msg, 1); /* Length LSB: delay */ + msgb_put_u8(resp, 0x02); /* ACK */ + msgb_put_u8(resp, ipcp[1]); /* ID: Needs to match request */ + msgb_put_u8(resp, 0x00); /* Length MSB */ + len2 = msgb_put(resp, 1); /* Length LSB: delay */ - if (dns1->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_PRIMARY_DNS, 4)) { - msgb_put_u8(msg, 0x81); /* DNS1 Tag */ - msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ - msgb_put_u32(msg, ntohl(dns1->v4.s_addr)); - } - - if (dns2->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_SECONDARY_DNS, 4)) { - msgb_put_u8(msg, 0x83); /* DNS2 Tag */ - msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ - msgb_put_u32(msg, ntohl(dns2->v4.s_addr)); - } - - /* patch in length values */ - len_appended = msg->tail - start; - *len1 = len_appended - 3; - *len2 = len_appended - 3; - - offset += sizeof(pco_ipcp) + pco_ipcp->length; - pco_ipcp = pco_contains_proto(&pdp->pco_req, offset, PCO_P_IPCP, sizeof(struct ipcp_hdr)); + if (dns1->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_PRIMARY_DNS, 4)) { + msgb_put_u8(resp, 0x81); /* DNS1 Tag */ + msgb_put_u8(resp, 2 + dns1->len); /* DNS1 Length, incl. TL */ + msgb_put_u32(resp, ntohl(dns1->v4.s_addr)); } + if (dns2->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_SECONDARY_DNS, 4)) { + msgb_put_u8(resp, 0x83); /* DNS2 Tag */ + msgb_put_u8(resp, 2 + dns2->len); /* DNS2 Length, incl. TL */ + msgb_put_u32(resp, ntohl(dns2->v4.s_addr)); + } + + /* patch in length values */ + len_appended = resp->tail - start; + *len1 = len_appended - 3; + *len2 = len_appended - 3; +} + +static void process_pco_element_dns_ipv6(const struct pco_element *pco_elem, struct msgb *resp, + const struct apn_ctx *apn, struct pdp_t *pdp) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { + const struct in46_addr *i46a = &apn->v6.cfg.dns[i]; + if (i46a->len != 16) + continue; + msgb_t16lv_put(resp, PCO_P_DNS_IPv6_ADDR, i46a->len, i46a->v6.s6_addr); + } +} + +static void process_pco_element_dns_ipv4(const struct pco_element *pco_elem, struct msgb *resp, + const struct apn_ctx *apn, struct pdp_t *pdp) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { + const struct in46_addr *i46a = &apn->v4.cfg.dns[i]; + if (i46a->len != 4) + continue; + msgb_t16lv_put(resp, PCO_P_DNS_IPv4_ADDR, i46a->len, (uint8_t *)&i46a->v4); + } +} + +static void process_pco_element(const struct pco_element *pco_elem, struct msgb *resp, + const struct apn_ctx *apn, struct pdp_t *pdp) +{ + switch (ntohs(pco_elem->protocol_id)) { + case PCO_P_IPCP: + process_pco_element_ipcp(pco_elem, resp, apn, pdp); + break; + case PCO_P_DNS_IPv6_ADDR: + process_pco_element_dns_ipv6(pco_elem, resp, apn, pdp); + break; + case PCO_P_DNS_IPv4_ADDR: + process_pco_element_dns_ipv4(pco_elem, resp, apn, pdp); + break; + default: + break; + } } /* process one PCO request from a MS/UE, putting together the proper responses */ static void process_pco(const struct apn_ctx *apn, struct pdp_t *pdp) { - struct msgb *msg = msgb_alloc(256, "PCO"); - struct ippoolm_t *peer_v4 = pdp_get_peer_ipv(pdp, false); - unsigned int i; + struct msgb *resp = msgb_alloc(256, "PCO.resp"); + const struct ul255_t *pco = &pdp->pco_req; + const struct pco_element *pco_elem; + const uint8_t *cur; - OSMO_ASSERT(msg); - msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ + /* build the header of the PCO response */ + OSMO_ASSERT(resp); + msgb_put_u8(resp, 0x80); /* ext-bit + configuration protocol byte */ - if (peer_v4) - build_ipcp_pco(apn, pdp, msg); - - if (pco_contains_proto(&pdp->pco_req, 0, PCO_P_DNS_IPv6_ADDR, 0)) { - for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { - const 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); - } + /* iterate over the PCO elements in the request; call process_pco_element() for each */ + for (cur = pco->v + 1, pco_elem = (const struct pco_element *) cur; + cur + sizeof(struct pco_element) <= pco->v + pco->l; + cur += pco_elem->length + sizeof(*pco_elem), pco_elem = (const struct pco_element *) cur) { + process_pco_element(pco_elem, resp, apn, pdp); } - if (pco_contains_proto(&pdp->pco_req, 0, PCO_P_DNS_IPv4_ADDR, 0)) { - for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { - const 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) { - memcpy(pdp->pco_neg.v, msgb_data(msg), msgb_length(msg)); - pdp->pco_neg.l = msgb_length(msg); + /* copy the PCO response msgb and copy its contents over to the PDP context */ + if (msgb_length(resp) > 1) { + memcpy(pdp->pco_neg.v, msgb_data(resp), msgb_length(resp)); + pdp->pco_neg.l = msgb_length(resp); } else pdp->pco_neg.l = 0; - - msgb_free(msg); + msgb_free(resp); } + static bool apn_supports_ipv4(const struct apn_ctx *apn) { if (apn->v4.cfg.static_prefix.addr.len || apn->v4.cfg.dynamic_prefix.addr.len) -- To view, visit https://gerrit.osmocom.org/13606 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4a7d09279b6b259e2b95f1f51159b16838b2d94c Gerrit-Change-Number: 13606 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 14:03:44 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Thu, 11 Apr 2019 14:03:44 +0000 Subject: Change in osmo-hlr[master]: hlr.c: forward GSUP messages between clients 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/13006 to look at the new patch set (#10). Change subject: hlr.c: forward GSUP messages between clients ...................................................................... hlr.c: forward GSUP messages between clients Allow clients to forward any GSUP message between clients. Determine the sender and receiver from the new {source,dest}_name{,_len} IEs. Reject messages with a forged source name. This will be used for the inter-MSC handover. Depends: Ic00b0601eacff6d72927cea51767801142ee75db (libosmocore.git) Related: OS#3793 Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 --- M src/hlr.c 1 file changed, 78 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/06/13006/10 -- To view, visit https://gerrit.osmocom.org/13006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 Gerrit-Change-Number: 13006 Gerrit-PatchSet: 10 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 14:12:01 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 14:12:01 +0000 Subject: Change in osmo-ggsn[master]: process_pco() const-ify 'apn' argument In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13566 ) Change subject: process_pco() const-ify 'apn' argument ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13566 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2a96b0fbe077c7c49342553de0880bfc58318669 Gerrit-Change-Number: 13566 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 14:12:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 14:18:00 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 14:18:00 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Remove magic numbers from pco_contains_proto() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13567 ) Change subject: ggsn: Remove magic numbers from pco_contains_proto() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13567/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13567/1/ggsn/ggsn.c at 474 PS1, Line 474: uint8_t *cur = pco->v + 1 /*length*/ + offset; I think we can drop cur completely. struct pco_element *elem = (struct pco_element *) pco->v + 1 /*length*/ + offset; while (elem + sizeof(*elem) <= pco->v+ pco->l) { if (ntohs(elem->protocol_id) == prot && elem->length >= prot_minlen) return (uint8_t*) elem; elem = elem + elem->length + sizeof(*elem); } return NULL; -- To view, visit https://gerrit.osmocom.org/13567 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9871ffced677320aa82438332bfdb951ab129f04 Gerrit-Change-Number: 13567 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 14:18:00 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 14:19:22 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 14:19:22 +0000 Subject: Change in osmo-ggsn[master]: ggsn: const-ify input / read-only arguments of PCO related functions In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13568 ) Change subject: ggsn: const-ify input / read-only arguments of PCO related functions ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13568 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia0877988180ded4e3c033d7f1fb6e1c2acd60163 Gerrit-Change-Number: 13568 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 14:19:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 14:21:49 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 14:21:49 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Remove magic numbers from ipcp_contains_option() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13569 ) Change subject: ggsn: Remove magic numbers from ipcp_contains_option() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13569/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13569/1/ggsn/ggsn.c at 419 PS1, Line 419: const uint8_t *cur_opt = ipcp + sizeof(struct ipcp_hdr); Same as with previous commit: we can drop cur_opt completely. -- To view, visit https://gerrit.osmocom.org/13569 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5b1abc6f403f85986407e9e8359924dfcb58031a Gerrit-Change-Number: 13569 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 14:21:49 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 14:23:52 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 14:23:52 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Fix build_ipcp_pco() in presence of invalid IPCP content In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13570 ) Change subject: ggsn: Fix build_ipcp_pco() in presence of invalid IPCP content ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13570/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13570/1/ggsn/ggsn.c at 534 PS1, Line 534: ipcp_len = osmo_load16be(ipcp + 2); /* 1=code + 1=id */ ipcp_len can be dropped completely in favour of pco_ipcp->length. -- To view, visit https://gerrit.osmocom.org/13570 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8e9cffde092c8c5824abfaeecb742afcf949802c Gerrit-Change-Number: 13570 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 14:23:52 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 14:59:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 14:59:51 +0000 Subject: Change in osmo-ggsn[master]: process_pco() const-ify 'apn' argument In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13566 ) Change subject: process_pco() const-ify 'apn' argument ...................................................................... process_pco() const-ify 'apn' argument Change-Id: I2a96b0fbe077c7c49342553de0880bfc58318669 --- M ggsn/ggsn.c 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index dd723e9..423f0c0 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -503,7 +503,7 @@ } /* construct an IPCP PCO response from request*/ -static void build_ipcp_pco(struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) +static void build_ipcp_pco(const struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) { const struct in46_addr *dns1 = &apn->v4.cfg.dns[0]; const struct in46_addr *dns2 = &apn->v4.cfg.dns[1]; @@ -559,7 +559,7 @@ } /* process one PCO request from a MS/UE, putting together the proper responses */ -static void process_pco(struct apn_ctx *apn, struct pdp_t *pdp) +static void process_pco(const struct apn_ctx *apn, struct pdp_t *pdp) { struct msgb *msg = msgb_alloc(256, "PCO"); struct ippoolm_t *peer_v4 = pdp_get_peer_ipv(pdp, false); @@ -573,7 +573,7 @@ if (pco_contains_proto(&pdp->pco_req, 0, PCO_P_DNS_IPv6_ADDR, 0)) { for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { - struct in46_addr *i46a = &apn->v6.cfg.dns[i]; + const 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); @@ -582,7 +582,7 @@ if (pco_contains_proto(&pdp->pco_req, 0, PCO_P_DNS_IPv4_ADDR, 0)) { for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { - struct in46_addr *i46a = &apn->v4.cfg.dns[i]; + const 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); -- To view, visit https://gerrit.osmocom.org/13566 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2a96b0fbe077c7c49342553de0880bfc58318669 Gerrit-Change-Number: 13566 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 15:01:01 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 15:01:01 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Remove magic numbers from pco_contains_proto() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13567 ) Change subject: ggsn: Remove magic numbers from pco_contains_proto() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13567/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13567/1/ggsn/ggsn.c at 474 PS1, Line 474: uint8_t *cur = pco->v + 1 /*length*/ + offset; > I think we can drop cur completely. [?] I'm removing this function a few patches later, so I don't think it's worth to spend time on it anymore. -- To view, visit https://gerrit.osmocom.org/13567 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9871ffced677320aa82438332bfdb951ab129f04 Gerrit-Change-Number: 13567 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 15:01:01 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 15:06:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 15:06:54 +0000 Subject: Change in osmo-ttcn3-hacks[master]: ggsn: Verify that there are no duplicate PCO protocolIDs In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13563 to look at the new patch set (#3). Change subject: ggsn: Verify that there are no duplicate PCO protocolIDs ...................................................................... ggsn: Verify that there are no duplicate PCO protocolIDs Introduce a function to verify there's no duplicate ProtocolIDs in the PCO returned from the GGSN. Change-Id: I9d439dab1696196cd125f4d7113b426f1711a405 Related: OS#3914 --- M ggsn_tests/GGSN_Tests.ttcn 1 file changed, 37 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/63/13563/3 -- To view, visit https://gerrit.osmocom.org/13563 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9d439dab1696196cd125f4d7113b426f1711a405 Gerrit-Change-Number: 13563 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 15:52:18 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 15:52:18 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Remove magic numbers from pco_contains_proto() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13567 ) Change subject: ggsn: Remove magic numbers from pco_contains_proto() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13567 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9871ffced677320aa82438332bfdb951ab129f04 Gerrit-Change-Number: 13567 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 15:52:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 16:03:05 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 16:03:05 +0000 Subject: Change in osmo-ggsn[master]: ggsn.c: Refactor PCO processing during PDP activation In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13606 ) Change subject: ggsn.c: Refactor PCO processing during PDP activation ...................................................................... Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/13606/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13606/1//COMMIT_MSG at 9 PS1, Line 9: The existing PCO processing is implemented in a rater convoluted typo: rater https://gerrit.osmocom.org/#/c/13606/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13606/1/ggsn/ggsn.c at 606 PS1, Line 606: cur + sizeof(struct pco_element) <= pco->v + pco->l; Drop cur: for (pco_elem = (const struct pco_element *) co->v + 1; pco_elem + sizeof(*pco_elem) <= pco->v + pco->l; pco_elem = pco_elem + sizeof(*pco_elem) + pco_elem->length) { process_pco_element(pco_elem, resp, apn, pdp);} https://gerrit.osmocom.org/#/c/13606/1/ggsn/ggsn.c at 620 PS1, Line 620: Extra line, remove it. -- To view, visit https://gerrit.osmocom.org/13606 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4a7d09279b6b259e2b95f1f51159b16838b2d94c Gerrit-Change-Number: 13606 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 16:03:05 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 16:13:34 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 16:13:34 +0000 Subject: Change in osmo-ggsn[master]: ggsn.c: Refactor PCO processing during PDP activation In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13606 ) Change subject: ggsn.c: Refactor PCO processing during PDP activation ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13606/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13606/1/ggsn/ggsn.c at 606 PS1, Line 606: cur + sizeof(struct pco_element) <= pco->v + pco->l; > Drop cur: [?] You actually need to cast to uint8_t* during the sum in last line most probably -- To view, visit https://gerrit.osmocom.org/13606 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4a7d09279b6b259e2b95f1f51159b16838b2d94c Gerrit-Change-Number: 13606 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 16:13:34 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 16:46:12 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 16:46:12 +0000 Subject: Change in osmo-bts[master]: pcu_sock: use %zu conversion specifier for printing sizeof() result In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13267 ) Change subject: pcu_sock: use %zu conversion specifier for printing sizeof() result ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/13267/4/src/common/pcu_sock.c File src/common/pcu_sock.c: https://gerrit.osmocom.org/#/c/13267/4/src/common/pcu_sock.c at 794 PS4, Line 794: return 0; Here too, memleak. Please Vadim either send a patch or otherwise tell me explicitly, I can do it in that case, np. -- To view, visit https://gerrit.osmocom.org/13267 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709 Gerrit-Change-Number: 13267 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 11 Apr 2019 16:46:12 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:03:25 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 17:03:25 +0000 Subject: Change in osmo-hlr[master]: osmo-hlr: allow configuring db path from cfg file In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13586 ) Change subject: osmo-hlr: allow configuring db path from cfg file ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13586/1/src/hlr.c File src/hlr.c: https://gerrit.osmocom.org/#/c/13586/1/src/hlr.c at 739 PS1, Line 739: osmo_talloc_replace_string > Can we do this conditionally after parsing the VTY config? Makes sense, took me a while to understand what you mean. Best option is to do in line 778 (removing the if clause): osmo_talloc_replace_string(g_hlr, &g_hlr->db_file_path, cmdline_opts.db_file ? : HLR_DEFAULT_DB_FILE_PATH); -- To view, visit https://gerrit.osmocom.org/13586 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I87b8673324e1e6225afb758fb4963ff3279ea3d8 Gerrit-Change-Number: 13586 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 17:03:25 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:03:31 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 17:03:31 +0000 Subject: Change in osmo-hlr[master]: osmo-hlr: allow configuring db path from cfg file In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13586 ) Change subject: osmo-hlr: allow configuring db path from cfg file ...................................................................... Patch Set 1: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/13586 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I87b8673324e1e6225afb758fb4963ff3279ea3d8 Gerrit-Change-Number: 13586 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 17:03:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:06:32 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 17:06:32 +0000 Subject: Change in libosmocore[master]: add OSMO_IMSI_SIZE In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13575 ) Change subject: add OSMO_IMSI_SIZE ...................................................................... Patch Set 3: I had the same thought as Vadim when I saw the name first time. BTW, I recall speaking some time about this +2 being actually wrong (should be +1). Now that we are adding the symbol it may be a good time to identify whether it's correct or not (no necessary for this patch). -- To view, visit https://gerrit.osmocom.org/13575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 Gerrit-Change-Number: 13575 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 17:06:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:08:57 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 17:08:57 +0000 Subject: Change in osmo-gsm-manuals[master]: build/unix-time-to-fmt.py: use default python ver In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13595 ) Change subject: build/unix-time-to-fmt.py: use default python ver ...................................................................... Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/13595/1/build/unix-time-to-fmt.py File build/unix-time-to-fmt.py: https://gerrit.osmocom.org/#/c/13595/1/build/unix-time-to-fmt.py at 22 PS1, Line 22: print(time.strftime(fmt, time.gmtime(float(sys.argv[1])))) How this print function is supposed to work on python2? That's not compatible, print goes without paranthesis in python2. -- To view, visit https://gerrit.osmocom.org/13595 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8af9b8159f5c7e39b905f85edd1584cb4d5a33ef Gerrit-Change-Number: 13595 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 17:08:57 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:18:15 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 17:18:15 +0000 Subject: Change in osmo-gsm-manuals[master]: build/unix-time-to-fmt.py: use default python ver In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13595 ) Change subject: build/unix-time-to-fmt.py: use default python ver ...................................................................... Patch Set 1: Code-Review+2 Oh so actually print() with parenthesis works for python2, it's just parenthesis are optional, I didn't know that. -- To view, visit https://gerrit.osmocom.org/13595 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8af9b8159f5c7e39b905f85edd1584cb4d5a33ef Gerrit-Change-Number: 13595 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 17:18:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:18:44 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 17:18:44 +0000 Subject: Change in osmo-gsm-manuals[master]: check-depends.sh: don't depend on git binary In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13596 ) Change subject: check-depends.sh: don't depend on git binary ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13596 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I46ad818a1d009c03357821f7c8100ecb5d62962e Gerrit-Change-Number: 13596 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 17:18:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:26:42 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 17:26:42 +0000 Subject: Change in osmo-ttcn3-hacks[master]: ggsn: Add TC_pdp4_act_deact_ipcp_pap_broken() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13564 to look at the new patch set (#4). Change subject: ggsn: Add TC_pdp4_act_deact_ipcp_pap_broken() ...................................................................... ggsn: Add TC_pdp4_act_deact_ipcp_pap_broken() This test case reproduces a real-world PCO capture including a broken PAP AuthenticationReq. It triggers some weird behavior in OsmoGGSN 1.3.0 where it would send duplicate IPCP repsonses and no PAP response. Change-Id: Ie89d984ed9e26fbbb2e4914bdb8623446d462a4c Related: OS#3914 --- M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/gen_links.sh M library/GTP_Templates.ttcn 3 files changed, 46 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/64/13564/4 -- To view, visit https://gerrit.osmocom.org/13564 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie89d984ed9e26fbbb2e4914bdb8623446d462a4c Gerrit-Change-Number: 13564 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:26:42 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 17:26:42 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library: Add PAP_Types for PPP Authentication Protocol (RFC 1334) Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13607 Change subject: library: Add PAP_Types for PPP Authentication Protocol (RFC 1334) ...................................................................... library: Add PAP_Types for PPP Authentication Protocol (RFC 1334) Change-Id: I31cb766bb701b8107df5de978d2b0b085977045a --- A library/PAP_Types.ttcn 1 file changed, 90 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/07/13607/1 diff --git a/library/PAP_Types.ttcn b/library/PAP_Types.ttcn new file mode 100644 index 0000000..4e3f14f --- /dev/null +++ b/library/PAP_Types.ttcn @@ -0,0 +1,90 @@ +module PAP_Types { + +/* (C) 2019 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + +import from Osmocom_Types all; + +/* RFC1334 */ +type enumerated PapCode { + PAP_AuthenticateReq ('01'O), + PAP_AuthenticateAck ('02'O), + PAP_AuthenticateNak ('03'O) +} with { variant "FIELDLENGTH(8)" }; + +type record PapPacket { + PapCode code, + uint8_t identifier, + uint16_t len, + PapPayloadUnion payload +} with { + variant (len) "LENGTHTO(code,identifier,len,payload)" + variant (payload) "CROSSTAG( req, code = PAP_AuthenticateReq; + ack, code = PAP_AuthenticateAck; + nak, code = PAP_AuthenticateNak)" +}; + +type union PapPayloadUnion { + PapAuthReq req, + PapAuthResp ack, + PapAuthResp nak +}; + +type record PapAuthReq { + uint8_t peer_id_len, + octetstring peer_id, + uint8_t passwd_len, + octetstring passwd +} with { + variant (peer_id_len) "LENGTHTO(peer_id)" + variant (passwd_len) "LENGTHTO(passwd)" +}; + +type record PapAuthResp { + uint8_t msg_len, + charstring msg +} with { variant (msg_len) "LENGTHTO(msg)" }; + +external function enc_PapPacket(in PapPacket inp) return octetstring +with { extension "prototype(convert)" extension "encode(RAW)" }; + +external function dec_PapPacket(in octetstring inp) return PapPacket +with { extension "prototype(convert)" extension "decode(RAW)" }; + + +template (value) PapPacket ts_PAP(template (value) PapCode code, template (value) uint8_t identifier, + template (value) PapPayloadUnion payload) := { + code := code, + identifier := identifier, + len := 0, /* overwritten */ + payload := payload +} +template PapPacket tr_PAP(template PapCode code, template uint8_t identifier, template PapPayloadUnion payload) := { + code := code, + identifier := identifier, + len := ?, + payload := payload +} + +template (value) PapPacket ts_PAP_AuthReq(uint8_t identifier := 0, octetstring peer_id, octetstring passwd) := + ts_PAP(PAP_AuthenticateReq, identifier, + { req := { peer_id_len := 0, peer_id := peer_id, + passwd_len := 0, passwd := passwd } }); +template PapPacket tr_PAP_AuthReq(template uint8_t identifier := ?, octetstring peer_id, octetstring passwd) := + tr_PAP(PAP_AuthenticateReq, identifier, + { req := { peer_id_len := ?, peer_id := peer_id, + passwd_len := ?, passwd := passwd } }); +template (value) PapPacket ts_PAP_AuthAck(uint8_t identifier := 0, charstring msg) := + ts_PAP(PAP_AuthenticateAck, identifier, { ack := { msg_len := 0, msg := msg } }); +template PapPacket tr_PAP_AuthAck(template uint8_t identifier := ?) := + tr_PAP(PAP_AuthenticateAck, identifier, { ack := ? }); +template (value) PapPacket ts_PAP_AuthNak(uint8_t identifier := 0, charstring msg) := + ts_PAP(PAP_AuthenticateNak, identifier, { nak := { msg_len := 0, msg := msg } }); +template PapPacket tr_PAP_AuthNak(template uint8_t identifier := ?) := + tr_PAP(PAP_AuthenticateNak, identifier, { nak := ? }); + +} with { encode "RAW" ; variant "FIELDORDER(msb)" } -- To view, visit https://gerrit.osmocom.org/13607 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I31cb766bb701b8107df5de978d2b0b085977045a Gerrit-Change-Number: 13607 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:27:31 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 17:27:31 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Add minimalistic PAP support Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13608 Change subject: ggsn: Add minimalistic PAP support ...................................................................... ggsn: Add minimalistic PAP support Some modems are configured to use PAP as an additional authentication mechanism beyond the GSM authentication that's part of GMM. Let's handle such PAP authentication requests by simply acknowledging them all, without actually checking any credentials database. This is the most sane thing we can do for now, without adding external requirements / interfaces like radius servers or the like. Change-Id: I81875f30f9f1497199253497f84718510747f731 --- M ggsn/ggsn.c 1 file changed, 63 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/08/13608/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index f46436f..d079efe 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -1,7 +1,7 @@ /* * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. - * Copyright (C) 2017 by Harald Welte + * Copyright (C) 2017-2019 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 @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -494,6 +495,64 @@ return NULL; } +struct pap_element { + uint8_t code; + uint8_t id; + uint16_t len; /* length including header */ + uint8_t data[0]; +} __attribute__((packed)); + +enum pap_code { + PAP_CODE_AUTH_REQ = 1, + PAP_CODE_AUTH_ACK = 2, + PAP_CODE_AUTH_NAK = 3, +}; + +static const char *pap_welcome = "Welcome to OsmoGGSN"; + +/* Handle PAP protocol according to RFC 1334 */ +static void process_pco_element_pap(const struct pco_element *pco_in, struct msgb *resp, + const struct apn_ctx *apn, struct pdp_t *pdp) +{ + const struct pap_element *pap_in = (const struct pap_element *) pco_in->data; + unsigned int pap_welcome_len = strlen(pap_welcome); + uint8_t pap_out_size = sizeof(struct pap_element) + 1 + pap_welcome_len; + struct pap_element *pap_out = alloca(pap_out_size); + uint8_t peer_id_len; + const uint8_t *peer_id; + + if (sizeof(*pap_in) > pco_in->length) + goto ret_broken; + if (htons(pap_in->len) > pco_in->length) + goto ret_broken; + + switch (pap_in->code) { + case PAP_CODE_AUTH_REQ: + peer_id_len = pap_in->data[0]; + peer_id = &pap_in->data[1]; + LOGPPDP(LOGL_DEBUG, pdp, "PCO PAP PeerId = %s, ACKing\n", + osmo_quote_str((const char *)peer_id, peer_id_len)); + /* Password-Length + Password following here, but we don't care */ + pap_out->code = PAP_CODE_AUTH_ACK; + pap_out->id = pap_in->id; + pap_out->len = htons(pap_out_size); + pap_out->data[0] = pap_welcome_len; + memcpy(pap_out->data+1, pap_welcome, pap_welcome_len); + msgb_t16lv_put(resp, PCO_P_PAP, pap_out_size, (uint8_t *) pap_out); + break; + case PAP_CODE_AUTH_ACK: + case PAP_CODE_AUTH_NAK: + default: + LOGPPDP(LOGL_NOTICE, pdp, "Unsupported PAP PCO Code %u, ignoring\n", pap_in->code); + break; + } + return; + +ret_broken: + LOGPPDP(LOGL_NOTICE, pdp, "Invalid PAP PCO Length: %s, ignoring\n", + osmo_hexdump_nospc((const uint8_t *)pco_in, pco_in->length)); +} + static void process_pco_element_ipcp(const struct pco_element *pco_elem, struct msgb *resp, const struct apn_ctx *apn, struct pdp_t *pdp) { @@ -575,6 +634,9 @@ const struct apn_ctx *apn, struct pdp_t *pdp) { switch (ntohs(pco_elem->protocol_id)) { + case PCO_P_PAP: + process_pco_element_pap(pco_elem, resp, apn, pdp); + break; case PCO_P_IPCP: process_pco_element_ipcp(pco_elem, resp, apn, pdp); break; -- To view, visit https://gerrit.osmocom.org/13608 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I81875f30f9f1497199253497f84718510747f731 Gerrit-Change-Number: 13608 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:27:31 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 17:27:31 +0000 Subject: Change in osmo-ggsn[master]: ggsn: More logging from PCO handling (e.g. in case of malconfiguration) Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13609 Change subject: ggsn: More logging from PCO handling (e.g. in case of malconfiguration) ...................................................................... ggsn: More logging from PCO handling (e.g. in case of malconfiguration) Change-Id: I38c2c4178ff4fd795f54638adec63166b1c0838e --- M ggsn/ggsn.c 1 file changed, 18 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/09/13609/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index d079efe..45026fe 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -567,15 +567,19 @@ ptrdiff_t consumed; size_t remain; - if (!peer_v4) + if (!peer_v4) { + LOGPPDP(LOGL_ERROR, pdp, "IPCP but no IPv4 type ?!?\n"); return; + } ipcp = pco_elem->data; consumed = (ipcp - &pdp->pco_req.v[0]); remain = sizeof(pdp->pco_req.v) - consumed; ipcp_len = osmo_load16be(ipcp + 2); /* 1=code + 1=id */ - if (remain < 0 || remain < ipcp_len) + if (remain < 0 || remain < ipcp_len) { + LOGPPDP(LOGL_ERROR, pdp, "Malformed IPCP, ignoring\n"); return; + } /* Three byte T16L header */ msgb_put_u16(resp, 0x8021); /* IPCP */ @@ -608,6 +612,7 @@ const struct apn_ctx *apn, struct pdp_t *pdp) { unsigned int i; + const uint8_t *tail = resp->tail; for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { const struct in46_addr *i46a = &apn->v6.cfg.dns[i]; @@ -615,12 +620,15 @@ continue; msgb_t16lv_put(resp, PCO_P_DNS_IPv6_ADDR, i46a->len, i46a->v6.s6_addr); } + if (resp->tail == tail) + LOGPPDP(LOGL_NOTICE, pdp, "MS requested IPv6 DNS, but APN has none configured\n"); } static void process_pco_element_dns_ipv4(const struct pco_element *pco_elem, struct msgb *resp, const struct apn_ctx *apn, struct pdp_t *pdp) { unsigned int i; + const uint8_t *tail = resp->tail; for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { const struct in46_addr *i46a = &apn->v4.cfg.dns[i]; @@ -628,12 +636,17 @@ continue; msgb_t16lv_put(resp, PCO_P_DNS_IPv4_ADDR, i46a->len, (uint8_t *)&i46a->v4); } + if (resp->tail == tail) + LOGPPDP(LOGL_NOTICE, pdp, "MS requested IPv4 DNS, but APN has none configured\n"); } static void process_pco_element(const struct pco_element *pco_elem, struct msgb *resp, const struct apn_ctx *apn, struct pdp_t *pdp) { - switch (ntohs(pco_elem->protocol_id)) { + uint16_t protocol_id = ntohs(pco_elem->protocol_id); + + LOGPPDP(LOGL_DEBUG, pdp, "PCO Protocol 0x%04x\n", protocol_id); + switch (protocol_id) { case PCO_P_PAP: process_pco_element_pap(pco_elem, resp, apn, pdp); break; @@ -647,6 +660,8 @@ process_pco_element_dns_ipv4(pco_elem, resp, apn, pdp); break; default: + LOGPPDP(LOGL_INFO, pdp, "Unknown/Unimplemented PCO Protocol 0x%04x: %s\n", + protocol_id, osmo_hexdump_nospc(pco_elem->data, pco_elem->length)); break; } } -- To view, visit https://gerrit.osmocom.org/13609 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I38c2c4178ff4fd795f54638adec63166b1c0838e Gerrit-Change-Number: 13609 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:30:50 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 17:30:50 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.common.inc: add {, un}install targets In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13597 ) Change subject: Makefile.common.inc: add {,un}install targets ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/13597/1/build/Makefile.common.inc File build/Makefile.common.inc: https://gerrit.osmocom.org/#/c/13597/1/build/Makefile.common.inc at 34 PS1, Line 34: if [ "$(OSMO_GSM_MANUALS_NO_INSTALL)" != "1" ]; then \ According to configure.ac in osmo-bsc, default is not building manuals, so I think this should also be "don't install by default", that is: var must be set explicitly to 1 to have pdf installed. Otherwise please provide some reasoning why is it enabled by default. >From osmo-bsc.git/configure.ac: # Generate manuals AC_ARG_ENABLE(manuals, [AS_HELP_STRING( [--enable-manuals], [Generate manual PDFs [default=no]], )], https://gerrit.osmocom.org/#/c/13597/1/build/Makefile.common.inc at 36 PS1, Line 36: Dm6 Probably better using /share/doc/osmo-gsm-manuals/. since we use for instance /usr/share/doc/osmo-bsc/ for osmo-bsc (unless of course you know how to easily pass by "osmo-bsc" from main Makefile to this one). -- To view, visit https://gerrit.osmocom.org/13597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I66f33172fa410681acbaef4592e9405627948705 Gerrit-Change-Number: 13597 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 17:30:50 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:35:05 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 17:35:05 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Add minimalistic PAP support In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13608 ) Change subject: ggsn: Add minimalistic PAP support ...................................................................... ggsn: Add minimalistic PAP support Some modems are configured to use PAP as an additional authentication mechanism beyond the GSM authentication that's part of GMM. Let's handle such PAP authentication requests by simply acknowledging them all, without actually checking any credentials database. This is the most sane thing we can do for now, without adding external requirements / interfaces like radius servers or the like. Closes: OS#3914 Change-Id: I81875f30f9f1497199253497f84718510747f731 --- M ggsn/ggsn.c 1 file changed, 63 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/08/13608/2 -- To view, visit https://gerrit.osmocom.org/13608 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I81875f30f9f1497199253497f84718510747f731 Gerrit-Change-Number: 13608 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:35:05 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 17:35:05 +0000 Subject: Change in osmo-ggsn[master]: ggsn: More logging from PCO handling (e.g. in case of malconfiguration) In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13609 ) Change subject: ggsn: More logging from PCO handling (e.g. in case of malconfiguration) ...................................................................... ggsn: More logging from PCO handling (e.g. in case of malconfiguration) Change-Id: I38c2c4178ff4fd795f54638adec63166b1c0838e --- M ggsn/ggsn.c 1 file changed, 18 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/09/13609/2 -- To view, visit https://gerrit.osmocom.org/13609 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I38c2c4178ff4fd795f54638adec63166b1c0838e Gerrit-Change-Number: 13609 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:39:44 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 17:39:44 +0000 Subject: Change in osmo-ggsn[master]: ggsn.c: Refactor PCO processing during PDP activation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13606 ) Change subject: ggsn.c: Refactor PCO processing during PDP activation ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13606/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13606/1/ggsn/ggsn.c at 606 PS1, Line 606: cur + sizeof(struct pco_element) <= pco->v + pco->l; > You actually need to cast to uint8_t* during the sum in last line most probably I know that I can eliminate the local stack variable that way. However, I think it's more readable - and one doesn't have to have several in-line "const uint8_t *" typecasts to make the additions work. -- To view, visit https://gerrit.osmocom.org/13606 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4a7d09279b6b259e2b95f1f51159b16838b2d94c Gerrit-Change-Number: 13606 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 17:39:44 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:41:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 17:41:13 +0000 Subject: Change in osmo-ggsn[master]: ggsn.c: Refactor PCO processing during PDP activation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13606 to look at the new patch set (#3). Change subject: ggsn.c: Refactor PCO processing during PDP activation ...................................................................... ggsn.c: Refactor PCO processing during PDP activation The existing PCO processing is implemented in a rather convoluted way. We scan the list of PCO elements several times for different PCO protocols. Let's change to a straight-forward model where we simply do one iteration over the list of PCO elements and generate responses step by step. Change-Id: I4a7d09279b6b259e2b95f1f51159b16838b2d94c --- M ggsn/ggsn.c 1 file changed, 95 insertions(+), 85 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/06/13606/3 -- To view, visit https://gerrit.osmocom.org/13606 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4a7d09279b6b259e2b95f1f51159b16838b2d94c Gerrit-Change-Number: 13606 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:42:27 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 17:42:27 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Add minimalistic PAP support In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13608 ) Change subject: ggsn: Add minimalistic PAP support ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c at 511 PS3, Line 511: "Welcome to OsmoGGSN" btw, I think this will be an easy way to figure out remotely if somebody is using OsmoGGSN or not: Simply send PAP in the PDP CTX ACT REQ and the message in the response will tell you ;) -- To view, visit https://gerrit.osmocom.org/13608 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I81875f30f9f1497199253497f84718510747f731 Gerrit-Change-Number: 13608 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 11 Apr 2019 17:42:27 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:43:13 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 17:43:13 +0000 Subject: Change in osmo-gsm-manuals[master]: Add debian packaging for osmo-gsm-manuals-dev In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13599 ) Change subject: Add debian packaging for osmo-gsm-manuals-dev ...................................................................... Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/13599/2/debian/copyright File debian/copyright: https://gerrit.osmocom.org/#/c/13599/2/debian/copyright at 10 PS2, Line 10: Copyright: 2019 Oliver Smith afaik the copyright of those files is not yours, but from sysmocom. Copyright: 2019 sysmocom s.m.f.c. GmbH https://gerrit.osmocom.org/#/c/13599/2/debian/copyright at 13 PS2, Line 13: License: GPL-3.0+ Repeated line (l11)? -- To view, visit https://gerrit.osmocom.org/13599 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 Gerrit-Change-Number: 13599 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 17:43:13 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:43:25 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 17:43:25 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.am: proper noarch pkgconfig install dir In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13598 ) Change subject: Makefile.am: proper noarch pkgconfig install dir ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13598 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I63bc8ab6d2845751079f40383d2aa92c709ce2fe Gerrit-Change-Number: 13598 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 17:43:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 17:45:50 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Apr 2019 17:45:50 +0000 Subject: Change in osmo-ttcn3-hacks[master]: ggsn: Add TC_pdp4_act_deact_ipcp_pap_broken() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13564 to look at the new patch set (#5). Change subject: ggsn: Add TC_pdp4_act_deact_ipcp_pap_broken() ...................................................................... ggsn: Add TC_pdp4_act_deact_ipcp_pap_broken() This test case reproduces a real-world PCO capture including a broken PAP AuthenticationReq. It triggers some weird behavior in OsmoGGSN 1.3.0 where it would send duplicate IPCP repsonses and no PAP response. Change-Id: Ie89d984ed9e26fbbb2e4914bdb8623446d462a4c Related: OS#3914 --- M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/gen_links.sh M library/GTP_Templates.ttcn 3 files changed, 46 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/64/13564/5 -- To view, visit https://gerrit.osmocom.org/13564 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie89d984ed9e26fbbb2e4914bdb8623446d462a4c Gerrit-Change-Number: 13564 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 19:14:14 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 19:14:14 +0000 Subject: Change in osmo-ttcn3-hacks[master]: ggsn: Verify that there are no duplicate PCO protocolIDs In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13563 ) Change subject: ggsn: Verify that there are no duplicate PCO protocolIDs ...................................................................... Patch Set 3: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13563/3/ggsn_tests/GGSN_Tests.ttcn File ggsn_tests/GGSN_Tests.ttcn: https://gerrit.osmocom.org/#/c/13563/3/ggsn_tests/GGSN_Tests.ttcn at 773 PS3, Line 773: f_PCO_ensure_no_duplicates(ctx.pco_neg); What about adding this kind of check inside f_pdp_ctx_act so we don't need to put it in every test? To take into account cases like TC_pdp4_act_deact_with_separate_dns(), I'd actually modify f_PCO_ensure_no_duplicates() to count number of duplicates sent in request and making sure we answer each of them, so req.count(prot_type) == resp.count(prot_type), for each prot_type. -- To view, visit https://gerrit.osmocom.org/13563 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9d439dab1696196cd125f4d7113b426f1711a405 Gerrit-Change-Number: 13563 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 19:14:14 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 19:18:14 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 19:18:14 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library: Add PAP_Types for PPP Authentication Protocol (RFC 1334) In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13607 ) Change subject: library: Add PAP_Types for PPP Authentication Protocol (RFC 1334) ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13607 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I31cb766bb701b8107df5de978d2b0b085977045a Gerrit-Change-Number: 13607 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 19:18:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 19:26:23 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 19:26:23 +0000 Subject: Change in osmo-ttcn3-hacks[master]: ggsn: Add TC_pdp4_act_deact_ipcp_pap_broken() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13564 ) Change subject: ggsn: Add TC_pdp4_act_deact_ipcp_pap_broken() ...................................................................... Patch Set 5: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/13564/5/ggsn_tests/GGSN_Tests.ttcn File ggsn_tests/GGSN_Tests.ttcn: https://gerrit.osmocom.org/#/c/13564/5/ggsn_tests/GGSN_Tests.ttcn at 943 PS5, Line 943: setverdict(fail, "PAP isn't an AuthenticateAck: ", pap); so iiuc this means some code is needed in osmo-ggsn which answers this and basically allows everybody no matter the PAP credentials provided (as if PAP was not used, as until now). https://gerrit.osmocom.org/#/c/13564/5/library/GTP_Templates.ttcn File library/GTP_Templates.ttcn: https://gerrit.osmocom.org/#/c/13564/5/library/GTP_Templates.ttcn at 466 PS5, Line 466: protoIDContents := '0100003c0444435338323700bc1c08087c1508083e00790000150808fd06000001000000000000000000000000000000000000000000000000000000'O lol. Some description/comment here would be welcome. -- To view, visit https://gerrit.osmocom.org/13564 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie89d984ed9e26fbbb2e4914bdb8623446d462a4c Gerrit-Change-Number: 13564 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 19:26:23 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 19:29:35 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 19:29:35 +0000 Subject: Change in osmo-ggsn[master]: ggsn.c: Refactor PCO processing during PDP activation In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13606 ) Change subject: ggsn.c: Refactor PCO processing during PDP activation ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13606/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13606/1/ggsn/ggsn.c at 606 PS1, Line 606: cur + sizeof(struct pco_element) <= pco->v + pco->l; > I know that I can eliminate the local stack variable that way. [?] Ok, I actually prefer ther other way but fine :) -- To view, visit https://gerrit.osmocom.org/13606 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4a7d09279b6b259e2b95f1f51159b16838b2d94c Gerrit-Change-Number: 13606 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 19:29:35 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 19:57:42 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 19:57:42 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Add minimalistic PAP support In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13608 ) Change subject: ggsn: Add minimalistic PAP support ...................................................................... Patch Set 3: Code-Review-1 (7 comments) -1 because it should be ntohs. https://gerrit.osmocom.org/#/c/13608/3//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13608/3//COMMIT_MSG at 12 PS3, Line 12: all, without actually checking any credentials database. So the MS is expected to send inside PAP the values you configure your APN with? (the User+Password fields in the APN menu of android phones). https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c at 511 PS3, Line 511: "Welcome to OsmoGGSN" > btw, I think this will be an easy way to figure out remotely if somebody is using OsmoGGSN or not: S [?] If it was AGPL then it'd be funny answering that in osmo-sgsn with a message "go free you code!" and a copy of the license ;) https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c at 518 PS3, Line 518: unsigned int pap_welcome_len = strlen(pap_welcome); "ARRAY_SIZE(pap_welcome) -1" would make sense too :) https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c at 519 PS3, Line 519: uint8_t pap_out_size = sizeof(struct pap_element) + 1 + pap_welcome_len; Is that +1 for the NULL chat of pap_welcome? please add comment (and add +1 to the end). https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c at 520 PS3, Line 520: struct pap_element *pap_out = alloca(pap_out_size); nice, didn't know about alloca() https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c at 526 PS3, Line 526: if (htons(pap_in->len) > pco_in->length) is htons() fine alignment-access wise? And actually it should be ntohs. https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c at 531 PS3, Line 531: peer_id_len = pap_in->data[0]; I think you are not covering case sizeof(*pap_in) == ntohs(pap_in->len), that is, pap_in->data is empty. In that case you shoul avoid accessing pap_in->data and returning broken. -- To view, visit https://gerrit.osmocom.org/13608 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I81875f30f9f1497199253497f84718510747f731 Gerrit-Change-Number: 13608 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 19:57:42 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 20:01:23 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Apr 2019 20:01:23 +0000 Subject: Change in osmo-ggsn[master]: ggsn: More logging from PCO handling (e.g. in case of malconfiguration) In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13609 ) Change subject: ggsn: More logging from PCO handling (e.g. in case of malconfiguration) ...................................................................... Patch Set 3: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/13609/3/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13609/3/ggsn/ggsn.c at 570 PS3, Line 570: if (!peer_v4) { Wondering why IPCP is only used in ipv4... -- To view, visit https://gerrit.osmocom.org/13609 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I38c2c4178ff4fd795f54638adec63166b1c0838e Gerrit-Change-Number: 13609 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 11 Apr 2019 20:01:23 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 23:04:24 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 23:04:24 +0000 Subject: Change in libosmocore[master]: add OSMO_IMSI_SIZE In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13575 ) Change subject: add OSMO_IMSI_SIZE ...................................................................... Patch Set 3: interesting, I see "size" as synonymous with "buf_size". Even more generally appropriate, next guy prefers ARRAY_SIZE or ALLOC_SIZE or DUMP_SIZE or CACHE_SIZE..., all just comes down to size. I don't mind changing the name, though it does add more work to adjust other patches for a pretty moot change... -- To view, visit https://gerrit.osmocom.org/13575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 Gerrit-Change-Number: 13575 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 23:04:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 23:24:10 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 23:24:10 +0000 Subject: Change in libosmocore[master]: GSUP: add Class IE In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13576 ) Change subject: GSUP: add Class IE ...................................................................... Patch Set 3: (2 comments) I appreciate the review, but in this case... https://gerrit.osmocom.org/#/c/13576/3/include/osmocom/gsm/gsup.h File include/osmocom/gsm/gsup.h: https://gerrit.osmocom.org/#/c/13576/3/include/osmocom/gsm/gsup.h at 71 PS3, Line 71: OSMO_GSUP_CLASS_IE > Looking at this IE, the reader may ask: class of what? [?] It is actually rather absurd, in the face of HUGE GIGANTIC patches waiting for review, we are seriously nitpicking about "Kind" vs "Class" vs "Message Class". This is Bikeshed at its best, if I may say so myself ;) "Message Class" is saying exactly the same thing but with more words; what part of GSUP is not a Message? I already once edited all those patches from "KIND" to "CLASS", here, in osmo-hlr and osmo-msc, across entire branch histories; with git format-patch, sed and git am, taking great care to not accidentally modify other sentences containing the word "kind" in unrelated contexts. IMHO that's no sane way to spend my time. https://gerrit.osmocom.org/#/c/13576/3/include/osmocom/gsm/gsup.h at 241 PS3, Line 241: OSMO_GSUP_CLASS_ARRAYSIZE > Which array? [?] Please see the comment just above it. It explicitly serves as size for an array, hence it is called ARRAYSIZE. The other may be an End Marker, which it actually isn't: it never is actually used as a marker anywhere. The only place it is used is gsup_test.c for a validity check. Apologies, but I'd rather not adopt a bad name choice if you don't force me. -- To view, visit https://gerrit.osmocom.org/13576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef Gerrit-Change-Number: 13576 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 23:24:10 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 23:30:27 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 23:30:27 +0000 Subject: Change in libosmocore[master]: GSUP: add Class IE In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13576 ) Change subject: GSUP: add Class IE ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/13576/3/include/osmocom/gsm/gsup.h File include/osmocom/gsm/gsup.h: https://gerrit.osmocom.org/#/c/13576/3/include/osmocom/gsm/gsup.h at 309 PS3, Line 309: enum osmo_gsup_class class; Actually in this case I notice that the word 'class' alone is a keyword in C++, so it was in fact a poor choice for a variable / member name. So ... might have to format-patch-sed-git-am again This here would have been a saner place to argue against the name than above :P I wish I had stayed firm with just using "Kind" instead, what's the use of changing synonyms for synonyms. -- To view, visit https://gerrit.osmocom.org/13576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef Gerrit-Change-Number: 13576 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 23:30:27 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 11 23:33:52 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Apr 2019 23:33:52 +0000 Subject: Change in libosmocore[master]: GSUP: add Class IE In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13576 ) Change subject: GSUP: add Class IE ...................................................................... Patch Set 3: (2 comments) https://gerrit.osmocom.org/#/c/13576/3/src/gsm/gsup.c File src/gsm/gsup.c: https://gerrit.osmocom.org/#/c/13576/3/src/gsm/gsup.c at 481 PS3, Line 481: osmo_decode_big_endian > It's just one byte, no need for osmo_decode_big_endian() here. was just copying code I saw elsewhere; you are right though, I think I copied uint32_t code without noticing. https://gerrit.osmocom.org/#/c/13576/3/src/gsm/gsup.c at 739 PS3, Line 739: {} > Common style: { 0, NULL } I always use {}, and have been doing that all over the place. -- To view, visit https://gerrit.osmocom.org/13576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef Gerrit-Change-Number: 13576 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Apr 2019 23:33:52 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 00:08:30 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 00:08:30 +0000 Subject: Change in libosmocore[master]: add gsm0808_create_handover_request_ack2 to add AoIP RTP addr In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13259 ) Change subject: add gsm0808_create_handover_request_ack2 to add AoIP RTP addr ...................................................................... Patch Set 9: (1 comment) https://gerrit.osmocom.org/#/c/13259/9//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13259/9//COMMIT_MSG at 15 PS9, Line 15: the : gsm0808.c actually also gets built on embedded systems that lack arpa/inet.h : (for me indicated by the ARM build job on jenkins) > we can simply not compile 08.08 related functions in the "embedded" case. [?] Yes, I actually did try quite a few things, and in the end decided it's not worth it to waste my time on. Originally I wanted to use a struct sockaddr as a member in struct gsm0808_handover_*. In the meantime I have befriended the idea of passing pointers in those structs, so not that urgent. The core problem was that I cannot use struct sockaddr as a non-opaque struct in the header file. Even though on embedded, the .c file isn't built, the header file is still included! And in the .h file one obviously cannot use '#if (!EMBEDDED)', because in /usr/include there is no config.h. It's not a big deal for me anymore, but in general the include / compile semantics for gsm0808.h are unsorted/wrong. -- To view, visit https://gerrit.osmocom.org/13259 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia71542ea37d4fd2c9fb9b40357db7aeb111ec576 Gerrit-Change-Number: 13259 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 12 Apr 2019 00:08:30 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 00:08:54 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 00:08:54 +0000 Subject: Change in libosmocore[master]: add osmo_{escape, quote}_str_buf2() for standard args ordering 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/13573 to look at the new patch set (#4). Change subject: add osmo_{escape,quote}_str_buf2() for standard args ordering ...................................................................... add osmo_{escape,quote}_str_buf2() for standard args ordering To be able to append an escaped or quoted string using OSMO_STRBUF_APPEND_NOLEN(), the function signature must have the buf and len as first args, like most other *_buf() functions. Add osmo_escape_str_buf2() and osmo_quote_str_buf2() to match this signature. A recent patch [1] has changed the return value of osmo_escape_str_buf() to char*, removing the const. However, the functions may return const strings, hence re-add the const. The new signatures always return the non-const buffer. To avoid code duplication, implement osmo_quote_str_buf() and osmo_escape_str_buf() by calling the new functions. I decided to allow slight changes to the behavior for current osmo_escape_str() and osmo_escape_str_buf(), because impact on callers is minimal: (1) The new implementation uses OSMO_STRBUF_*, and in consequence osmo_quote_str() no longer prints an ending double quote after truncated strings; Before, a truncated output was, sic: "this string is trunca" and now this becomes, sic: "this string is truncat I decided to not keep the old behavior because it is questionable to begin with. It looks like the string actually ended at the truncation boundary instead of the reason being not enough space in the output buffer. (2) The new osmo_escape_str_buf2() function obviously cannot pass-thru an unchanged char* if no escaping was needed. Sacrifice this tiny optimization feature to avoid code duplication: - it is an unnoticeable optimization, - the caller anyway always passes a string buffer, - the feature caused handling strings and buffers differently depending on their content (i.e. code that usually writes out strings in full length "suddenly" truncates because a non-printable character is contained, etc.) I considered adding a skip_if_unescaped flag to the osmo_quote_str_buf2() function signature, but in the end decided that the API clutter is not worth having for all the above reasons. Adjust tests to accomodate above changes. [1] 4a62eda225ab7f3c9556990c81a6fc5e19b5eec8 Ibf85f79e93244f53b2684ff6f1095c5b41203e05 Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae --- M TODO-RELEASE M include/osmocom/core/utils.h M src/utils.c M tests/utils/utils_test.c M tests/utils/utils_test.ok 5 files changed, 117 insertions(+), 49 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/13573/4 -- To view, visit https://gerrit.osmocom.org/13573 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae Gerrit-Change-Number: 13573 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 00:08:54 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 00:08:54 +0000 Subject: Change in libosmocore[master]: add OSMO_IMSI_BUF_SIZE In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13575 to look at the new patch set (#4). Change subject: add OSMO_IMSI_BUF_SIZE ...................................................................... add OSMO_IMSI_BUF_SIZE Various places in our code base figure out how many chars they need to safely store an IMSI. An IMSI can have a checksum digit, which is not reflected by GSM23003_IMSI_MAX_DIGITS. And we usually need a terminating \0. Instead of having a magic +2 repeated every so often, rather define OSMO_IMSI_BUF_SIZE to contain both checksum digit and nul char, and have the explanatory comment with it here in libosmocore. Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 --- M include/osmocom/gsm/gsup.h M include/osmocom/gsm/protocol/gsm_23_003.h 2 files changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/13575/4 -- To view, visit https://gerrit.osmocom.org/13575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 Gerrit-Change-Number: 13575 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 00:08:54 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 00:08:54 +0000 Subject: Change in libosmocore[master]: GSUP: add Message Class IE In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13576 to look at the new patch set (#4). Change subject: GSUP: add Message Class IE ...................................................................... GSUP: add Message Class IE osmo-msc and osmo-hlr have distinct subsystems handling incoming GSUP messages. So far we decide entirely by message type which code path should handle a GSUP message. Thus no GSUP message type may be re-used across subsystems. If we add a GSUP message to indicate a routing error, it would have to be a distinct message type for subscriber management, another one for SMS, another one for USSD... To allow introducing common message types, introduce a GSUP Message Class IE. In the presence of this IE, GSUP handlers can trivially direct a received message to the right code path. If it is missing, handlers can fall back to the previous switch(message_type) method. Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c M src/gsm/libosmogsm.map M tests/gsup/gsup_test.c M tests/gsup/gsup_test.err 5 files changed, 47 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/13576/4 -- To view, visit https://gerrit.osmocom.org/13576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef Gerrit-Change-Number: 13576 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 00:08:58 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 00:08:58 +0000 Subject: Change in libosmocore[master]: contrib/voicecall-shark Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13610 Change subject: contrib/voicecall-shark ...................................................................... contrib/voicecall-shark Change-Id: Ia3cdefe16b9e929d2836ca837db6f6107f7ed9eb --- A contrib/voicecall-shark 1 file changed, 669 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/13610/1 diff --git a/contrib/voicecall-shark b/contrib/voicecall-shark new file mode 100755 index 0000000..54600d0 --- /dev/null +++ b/contrib/voicecall-shark @@ -0,0 +1,669 @@ +#!/usr/bin/env python3 + +doc = '''voicecall-shark: get grips on voice call MGCP and RTP''' + +import pyshark +import pprint + +verbose = False + +def vprint(*args): + if not verbose: + return + print(*args) + +def error(*args): + raise Exception(''.join(*args)) + +def pget(p, *field, ifnone=None): + tokens = ('.'.join(field)).split('.') + if p is None or len(tokens) < 1: + return ifnone + first = tokens[0] + if not hasattr(p, first): + return ifnone + p_field = getattr(p, first) + if p_field is None: + return ifnone + if len(tokens) > 1: + return pget(p_field, *tokens[1:]) + return p_field + + +class LogEntry: + def __init__(s, p, message, obj): + s.p = p + s.message = message + s.obj = obj + + +class HasLog: + def __init__(s, parent=None): + s.log_entries = [] + s.parents = [] + s.children = [] + if parent is not None: + s.log_parent(parent) + + def log_child(s, child): + s.children.append(child) + child.parents.append(s) + + def log_parent(s, parent): + parent.log_child(s) + + def log(s, p, message): + s.log_entries.append(LogEntry(p, message, s)) + +class Domino(HasLog): + def __init__(s, left, right, *refs): + s.left = left + s.right = right + s.refs = list(refs) + s.reversed = [ False ] * len(s.refs) + + def absorb(s, domino): + s.refs.extend(domino.refs) + s.reversed.extend(domino.reversed) + + def reverse(s): + x = s.left + s.left = s.right + s.right = x + s.reversed = list(map(lambda x: not x, s.reversed)) + + def matches(s, label): + if s.left == label: + return -1 + if s.right == label: + return 1 + return 0 + + def __str__(s): + return s.str('[','|',']') + + def __repr__(s): + return str(s) + + def str(s, left='[', mid='|', right=']', reverse=False): + if reverse: + return '%s%s%s%s%s' % (left, s.right, mid, s.left, right) + else: + return '%s%s%s%s%s' % (left, s.left, mid, s.right, right) + + def __eq__(s, other): + o = other.str() + return s.str() == o or s.str(reverse=True) == o + +class Dominoes(HasLog): + def __init__(s, *pieces): + s.pieces = list(pieces) + + def has(s, piece): + for p in s.pieces: + if p is piece: + return True + return False + + def add(s, piece): + if s.has(piece): + return + s.pieces.append(piece) + + def find_piece(s, label, in_list=None): + if in_list is None: + in_list = s.pieces + for piece in in_list: + if piece.matches(label): + return piece + return None + + def find_match(s, for_piece, in_list=None): + if in_list is None: + in_list = s.pieces + match = s.find_piece(for_piece.left, in_list) + if not match: + match = s.find_piece(for_piece.right, in_list) + return match + + def dedup(loose_pieces): + pieces = [] + loose_pieces = list(loose_pieces) + while loose_pieces: + l = loose_pieces.pop(0) + for p in pieces: + if l == p: + p.absorb(l) + l = None + break + + if l: + pieces.append(l) + return pieces + + def arrange(loose_pieces): + if not loose_pieces: + return [] + pieces_remain = list(loose_pieces) + groups = [Dominoes(pieces_remain.pop(0))] + + which_end = -1 + failed = 0 + + while pieces_remain: + which_end = 0 if which_end == -1 else -1 + found_match = 0 + p = None + for group in groups: + p = group.pieces[which_end] + match = group.find_match(p, pieces_remain) + if not match: + continue + if which_end == -1: + found_match = match.matches(p.right) + if found_match == 1: + match.reverse() + else: + found_match = match.matches(p.left) + if found_match == -1: + match.reverse() + if found_match: + break + + if found_match: + failed = 0 + pieces_remain.remove(match) + if which_end == -1: + group.pieces.append(match) + else: + group.pieces.insert(0, match) + else: + failed += 1 + if failed < 2: + continue + # chain is broken. Create another group. + groups.append(Dominoes(pieces_remain.pop(0))) + + return groups + + def str(s, piece_left_edge='[', piece_mid='|', piece_right_edge=']'): + r = [] + for p in s.pieces: + r.append(p.str(piece_left_edge, piece_mid, piece_right_edge)) + return ''.join(r) + + def __str__(s): + return s.str() + + def chain_str(s, sep=', '): + if not s.pieces: + return '' + r = [s.pieces[0].left] + for p in s.pieces: + if r[-1] != p.left: + r.append(p.left) + if r[-1] != p.right: + r.append(p.right) + return sep.join(r) + +class RtpIpPort(HasLog): + def __init__(s, ip=None, port=None): + s.ip = ip + s.port = port + + def from_sdp(p): + ip = pget(p, 'sdp.connection_info_address') + port = pget(p, 'sdp.media_port') + return RtpIpPort(ip, port) + + def from_rtp_source(p): + ip = pget(p, 'ip.src') + port = pget(p, 'udp.srcport') + return RtpIpPort(ip, port) + + def from_rtp_dest(p): + ip = pget(p, 'ip.dst') + port = pget(p, 'udp.dstport') + return RtpIpPort(ip, port) + + def __str__(s): + return '%s:%s' % (s.ip, s.port) + + def __eq__(s, other): + return str(s) == str(other) + + +class MgcpConn(HasLog): + def __init__(s, crcx_p, endpoint, conn_id=None): + s.endpoint = None + endpoint.add_conn(s) + s.conn_id = conn_id + s.crcx = crcx_p + s.crcx_ok = None + s.mdcx = [] + s.dlcx = None + s.dlcx_ok = None + + s.rtp_local = None + s.rtp_remote = None + s.payload_type = None + s.codec = None + + s.rtp_tx = 0 + s.rtp_tx_err = 0 + s.rtp_rx = 0 + s.rtp_rx_err = 0 + super().__init__(endpoint) + + def rx_verb(s, p): + v = p.mgcp.req_verb + vprint("VERB %r" % v) + if v == 'CRCX': + if hasattr(p, 'sdp'): + s.rtp_remote = RtpIpPort.from_sdp(p) + elif v == 'MDCX': + s.mdcx.append(p) + new_remote = RtpIpPort.from_sdp(p) + if s.rtp_remote != new_remote: + s.rtp_remote = RtpIpPort.from_sdp(p) + s.log(p, 'MDCX to %s' % new_remote) + else: + s.log(p, 'MDCX') + + elif v == 'DLCX': + s.log(p, 'DLCX') + s.dlcx = p + + s.get_media(p) + + def get_media(s, p): + s.codec = pget(p, 'sdp.media_proto', ifnone=s.codec) + s.payload_type = pget(p, 'sdp.media_format', ifnone=s.payload_type) + + def rx_verb_ok(s, p, verb_p): + verb = verb_p.mgcp.req_verb + vprint("VERB OK %r" % verb) + if verb == 'CRCX': + s.crcx_ok = p + if hasattr(p.mgcp, 'param_specificendpointid'): + s.endpoint.name = p.mgcp.param_specificendpointid + s.conn_id = p.mgcp.param_connectionid + s.rtp_local = RtpIpPort.from_sdp(p) + s.log(p, "CRCX OK") + elif verb == 'MDCX': + s.mdcx.append(p) + s.log(p, "MDCX OK") + elif verb == 'DLCX': + s.dlcx_ok = p + s.log(p, "DLCX OK") + + def is_open(s): + return s.dlcx is None + + def summary(s, remote_first=False): + label = '' + if not s.is_open(): + label = 'DLCXd ' + rtp1 = s.rtp_local + rtp2 = s.rtp_remote + if remote_first: + rtpx = rtp1 + rtp1 = rtp2 + rtp2 = rtpx + err_label = '' + if s.rtp_tx_err: + err_label = err_label + ' tx-ERR:%d' % s.rtp_tx_err + if s.rtp_rx_err: + err_label = err_label + ' rx-ERR:%d' % s.rtp_rx_err + return '%s%s: %s <-> %s %r %r tx:%d rx:%d' % ( + label, s.conn_id, rtp1, rtp2, s.payload_type, s.codec, s.rtp_tx, s.rtp_rx) + + +class MgcpEndpoint(HasLog): + def __init__(s, name): + s.name = name + s.conns = [] + super().__init__() + + def name_is(s, name): + return s.name == name + + def add_conn(s, mgcp_conn): + s.conns.append(mgcp_conn) + mgcp_conn.endpoint = s + + def is_open(s): + return any(c.is_open() for c in s.conns) + + def get_conn(s, p): + conn_id = pget(p, 'mgcp.param_connectionid') + if not conn_id: + return None + vprint('get conn_id %r' % conn_id) + for c in s.conns: + vprint(' conn_id %r' % c.conn_id) + if c.conn_id == conn_id: + return c + print('ERROR: unknown conn id %r' % conn_id) + return None + + def as_dominoes(s): + pieces = [] + for i in range(len(s.conns)): + c = s.conns[i] + if not c.is_open(): + continue + + left = str(c.rtp_remote) + right = str(c.rtp_local) + pieces.append(Domino(left, right, s)) + + for j in range(i+1, len(s.conns)): + c2 = s.conns[j] + if not c2.is_open(): + continue + left = str(c.rtp_local) + right = str(c2.rtp_local) + pieces.append(Domino(left, right, s)) + return pieces + + def reverse(s): + s.conns = list(reversed(s.conns)) + + def seen_rtp(s, src, dst): + handled = False + for c in s.conns: + if c.rtp_local == src: + handled = True + if c.rtp_remote == dst: + c.rtp_tx += 1 + else: + c.rtp_tx_err += 1 + if c.rtp_remote == src: + handled = True + if c.rtp_local == dst: + c.rtp_rx += 1 + else: + c.rtp_rx_err += 1 + + return handled + + def summary(s): + r = [s.name] + remote_first = True + for c in s.conns: + r.append(' | %s' % c.summary(remote_first)) + remote_first = False + return '\n'.join(r) + +class MgcpTrans: + def __init__(s, p, obj): + s.p = p + s.obj = obj + +class RtpStream(HasLog): + all_rtp_streams = [] + + def find(rtp_ip_port): + for rtps in all_rtp_streams: + if rtps.has(rtp_ip_port): + return rtps + return None + + def find_or_create(rtp_ip_ports): + rtps = None + for rtp_ip_port in rtp_ip_ports: + rtps = RtpStream.find(rtp_ip_port) + if rtps: + break + rtps.add(*rtp_ip_ports) + return rtps + + def __init__(s, rtp_ip_ports=[]): + s.call_leg = None + s.rtp_ip_ports = rtp_ip_ports + s.rtp_packets_left = 0 + s.rtp_packets_right = 0 + super().__init__() + + def has(s, rtp_ip_port): + for ipp in s.rtp_ip_ports: + if ipp == rtp_ip_port: + return True + return False + + def add(s, *rtp_ip_ports): + for rtp_ip_port in rtp_ip_ports: + if s.has(rtp_ip_port): + continue + if len(s.rtp_ip_ports) > 1: + error('RtpStream can have only two RtpIpPorts') + s.rtp_ip_ports.append(rtp_ip_port) + + def reverse(s): + s.rtp_ip_ports = list(reversed(s.rtp_ip_ports)) + + def left(s): + if len(s.rtp_ip_ports): + return s.rtp_ip_ports[0] + return None + + def right(s): + if len(s.rtp_ip_ports) > 1: + return s.rtp_ip_ports[1] + return None + + +class CallLeg(HasLog): + def tie(rtp_ip_port_a, rtp_ip_port_b): + rtps_a = RtpStream.find(rtp_ip_port_a) + rtps_b = RtpStream.find(rtp_ip_port_b) + + + def __init__(s): + self.rtp_streams = [] + super().__init__() + + def add_rtp_stream(s, tie_to_rtp_ip_port, rtp_stream): + self.rtp_streams.append(rtp_stream) + s.log_child(edge) + + +class Results: + def __init__(s, call_legs = []): + s.call_legs = call_legs + s.mgw_endpoints = [] + s.mgcp_transactions = [] + s.stray_rtp = 0 + + def mgcp_trans_new(s, p, obj): + s.mgcp_transactions.append(MgcpTrans(p, obj)) + + def mgcp_trans_res(s, p): + for t in s.mgcp_transactions: + if t.p.mgcp.transid == p.mgcp.transid: + o = t.obj + s.mgcp_transactions.remove(t) + return t + + def new_endpoint(s, p): + ep = MgcpEndpoint(p.mgcp.req_endpoint) + s.mgw_endpoints.append(ep) + return ep + + def find_endpoint(s, endpoint, still_open=False): + for ep in s.mgw_endpoints: + if not ep.name_is(endpoint): + continue + if still_open and not ep.is_open(): + continue + return ep + + def process_mgcp(s, p): + m = p.mgcp + if verbose: + print('----') + print(p.pretty_print()) + print('MGCP:') + pprint.pprint(p.mgcp.field_names) + if hasattr(p, 'sdp'): + print('SDP:') + pprint.pprint(p.sdp.field_names) + + ep = None + label = None + + if 'req_verb' in m.field_names: + v = m.req_verb + label = v + ci = None + + ep = s.find_endpoint(m.req_endpoint, True) + if ep is None: + ep = s.new_endpoint(p) + vprint('VERB ep %r' % ep.name) + if ci is None: + ci = ep.get_conn(p) + if ci is None: + ci = MgcpConn(p, ep) + ci.rx_verb(p) + + s.mgcp_trans_new(p, ci) + + elif 'rsp' in m.field_names: + t = s.mgcp_trans_res(p) + ci = t.obj + ci.rx_verb_ok(p, t.p) + label = '%s OK' % t.p.mgcp.req_verb + ep = ci.endpoint + + if ep is not None: + print('----- %s' % label) + print(ep.summary()) + + def process_rtp(s, p): + src = RtpIpPort.from_rtp_source(p) + dst = RtpIpPort.from_rtp_dest(p) + + handled = False + for ep in s.mgw_endpoints: + if ep.seen_rtp(src, dst): + handled = True + + if not handled: + s.stray_rtp += 1 + print("Stray RTP: %s -> %s" % (src, dst)) + + + def process_cap(s, cap): + last_time = None + refresh = False + last_stray_rtp = 0 + for p in cap: + if hasattr(p, 'mgcp'): + s.process_mgcp(p) + refresh = True + + if hasattr(p, 'rtp'): + s.process_rtp(p) + + if hasattr(p, 'udp'): + time = float(pget(p, 'udp.time_relative', ifnone='0')) + if last_time is None or time > last_time + 1: + last_time = time + refresh = True + + if refresh: + refresh = False + s.correlate_endpoints() + if last_stray_rtp != s.stray_rtp: + print('stray_rtp: %d' % (s.stray_rtp - last_stray_rtp)) + last_stray_rtp = s.stray_rtp + print(time) + + + + + def correlate_endpoints(s): + pieces = [] + for ep in s.mgw_endpoints: + pieces.extend(ep.as_dominoes()) + groups = Dominoes.arrange(Dominoes.dedup(pieces)) + + i = 0 + for g in groups: + i += 1 + print('\n--- Call chain %d' % i) + print(g.chain_str('<->')) + + endp_chain = [] + for piece in g.pieces: + for i in range(len(piece.refs)): + ref = piece.refs[i] + reversd = piece.reversed[i] + if type(ref) is not MgcpEndpoint: + continue + if ref in endp_chain: + continue + endp_chain.append(ref) + + prev_rtp = g.pieces[0].left + for ep in endp_chain: + if not len(ep.conns): + continue + if str(ep.conns[0].rtp_remote) != prev_rtp: + ep.reverse() + print(ep.summary()) + prev_rtp = str(ep.conns[-1].rtp_local) + + print('\n') + + def process_file(s, path): + vprint(repr(path)) + cap = pyshark.FileCapture(path) + s.process_cap(cap) + + def summary(s): + r = [] + still_open = 0 + + for ep in s.mgw_endpoints: + if not ep.is_open(): + continue + r.append(ep.summary()) + still_open += 1 + r.append('open mgcp endpoints: %d' % still_open) + return '\n'.join(r) + + +def parse_args(): + import argparse + parser = argparse.ArgumentParser(description=doc) + parser.add_argument('--pcap-file', '-f') + return parser.parse_args() + +def dominoes_test(): + + d = [ + Domino('hat', 'hut'), + Domino('ape', 'dog'), + Domino('moo', 'foo'), + Domino('cat', 'dog'), + Domino('ape', 'cow'), + Domino('axe', 'hop'), + Domino('hat', 'cat'), + Domino('moo', 'foo'), + Domino('axe', 'bin'), + Domino('axe', 'dog'), + ] + groups = Dominoes.arrange(d) + + for g in groups: + print(str(g)) + +if __name__ == '__main__': + opts = parse_args() + + r = Results() + r.process_file(opts.pcap_file) + print(r.summary()) -- To view, visit https://gerrit.osmocom.org/13610 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia3cdefe16b9e929d2836ca837db6f6107f7ed9eb Gerrit-Change-Number: 13610 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 00:08:59 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 00:08:59 +0000 Subject: Change in libosmocore[master]: add gsm0808_create_common_id() Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13611 Change subject: add gsm0808_create_common_id() ...................................................................... add gsm0808_create_common_id() Change-Id: Id055df109cf67754854641ce6486523027f4d801 --- M include/osmocom/gsm/gsm0808.h M src/gsm/gsm0808.c 2 files changed, 28 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/11/13611/1 diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h index a4e63a9..5f3a628 100644 --- a/include/osmocom/gsm/gsm0808.h +++ b/include/osmocom/gsm/gsm0808.h @@ -301,6 +301,8 @@ struct msgb *gsm0808_create_dtap(struct msgb *msg, uint8_t link_id); void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id); +struct msgb *gsm0808_create_common_id(const char *imsi); + const struct tlv_definition *gsm0808_att_tlvdef(void); /*! Parse BSSAP TLV structure using \ref tlv_parse */ diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index 3c77c77..ad320da 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -1258,6 +1258,32 @@ return msg; } +/*! Crate BSSMAP Common ID message. + * \param[in] imsi Subscriber's IMSI to send in the Common ID message. + * \return allocated msgb with BSSMAP Common ID message. + */ +struct msgb *gsm0808_create_common_id(const char *imsi) +{ + uint8_t mid_buf[GSM48_MI_SIZE + 2]; + int mid_len; + struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, "CommonID"); + if (!msg) + return NULL; + OSMO_ASSERT(strlen(imsi) <= GSM48_MI_SIZE); + + /* Message Type, 3.2.2.1 */ + msgb_v_put(msg, BSS_MAP_MSG_COMMON_ID); + + /* mandatory IMSI 3.2.2.6 */ + mid_len = gsm48_generate_mid_from_imsi(mid_buf, imsi); + msgb_tlv_put(msg, GSM0808_IE_IMSI, mid_len - 2, mid_buf + 2); + + /* prepend header with final length */ + msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg)); + + return msg; +} + /* As per 3GPP TS 48.008 version 11.7.0 Release 11 */ static const struct tlv_definition bss_att_tlvdef = { .def = { -- To view, visit https://gerrit.osmocom.org/13611 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id055df109cf67754854641ce6486523027f4d801 Gerrit-Change-Number: 13611 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 00:09:25 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 00:09:25 +0000 Subject: Change in libosmocore[master]: contrib/voicecall-shark In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. ( https://gerrit.osmocom.org/13610 ) Change subject: contrib/voicecall-shark ...................................................................... Abandoned accidental push -- To view, visit https://gerrit.osmocom.org/13610 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Ia3cdefe16b9e929d2836ca837db6f6107f7ed9eb Gerrit-Change-Number: 13610 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 00:09:32 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 00:09:32 +0000 Subject: Change in libosmocore[master]: add gsm0808_create_common_id() In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. ( https://gerrit.osmocom.org/13611 ) Change subject: add gsm0808_create_common_id() ...................................................................... Abandoned accidental push -- To view, visit https://gerrit.osmocom.org/13611 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Id055df109cf67754854641ce6486523027f4d801 Gerrit-Change-Number: 13611 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 02:27:12 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 02:27:12 +0000 Subject: Change in osmo-msc[master]: rename bscconfig.h to config.h, cleanup In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13138 ) Change subject: rename bscconfig.h to config.h, cleanup ...................................................................... Patch Set 4: This change is ready for review. -- To view, visit https://gerrit.osmocom.org/13138 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id4f683be1f36f0630c83da54e02868aae847aeec Gerrit-Change-Number: 13138 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Max Gerrit-Comment-Date: Fri, 12 Apr 2019 02:27:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 02:27:17 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 02:27:17 +0000 Subject: Change in osmo-msc[master]: large refactoring: support inter-BSC and inter-MSC Handover In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13137 ) Change subject: large refactoring: support inter-BSC and inter-MSC Handover ...................................................................... Patch Set 4: This change is ready for review. -- To view, visit https://gerrit.osmocom.org/13137 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I27e4988e0371808b512c757d2b52ada1615067bd Gerrit-Change-Number: 13137 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 12 Apr 2019 02:27:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 02:27:29 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 02:27:29 +0000 Subject: Change in osmo-msc[master]: sms queue: avoid repeated Paging for a failed SMS In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Keith Whyte, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13173 to look at the new patch set (#5). Change subject: sms queue: avoid repeated Paging for a failed SMS ...................................................................... sms queue: avoid repeated Paging for a failed SMS So far, sms_pending_failed() starts a new sms_queue_trigger() run. The intention behind that might have been to fill up the queue when sending SMS has failed, but the practical effect is actually bad: As current ttcn3-msc-test runs show, a failed MT SMS gets triggered multiple times in short succession, i.e. osmo-msc repeatedly sends Paging Requests for the same subscriber. This special case happens actually only when there are few SMS still in the DB to be delivered. In the TTCN3 test, there is exactly one MT SMS for one subscriber, and retriggering the queue brings up the same SMS every time. See f_tc_lu_and_mt_sms_paging_and_nothing() and f_tc_sgsap_mt_sms_and_nothing() which say: "/* Expect the MSC to page exactly 10 times before giving up */" This is bad because an MSC should send a Paging Request exactly once. Retrying failed Paging is clearly the task of the BSC, not the MSC. The remaining code around Paging correctly follows this paradigm, but this retrigger doesn't. Do not immediately trigger the SMS queue on a failed MT SMS. Instead, leave it up to the periodical SMS queue trigger to decide. This patch will cause the MT SMS tests in ttcn3-msc-tests to fail, because the test expectations are bogus. The patch fixing the test run is listed 'Related' below. Related: I7dce12942a65eaaf97f78ca69401c7f93faacb9e (osmo-ttcn3-hacks) Change-Id: I24bf9f1c1167efe1080ae4cf47ed2ef0bd981e49 --- M src/libmsc/sms_queue.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/73/13173/5 -- To view, visit https://gerrit.osmocom.org/13173 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I24bf9f1c1167efe1080ae4cf47ed2ef0bd981e49 Gerrit-Change-Number: 13173 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 02:27:29 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 02:27:29 +0000 Subject: Change in osmo-msc[master]: large refactoring: support inter-BSC and inter-MSC Handover In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13137 to look at the new patch set (#5). Change subject: large refactoring: support inter-BSC and inter-MSC Handover ...................................................................... large refactoring: support inter-BSC and inter-MSC Handover 3GPP TS 49.008 '4.3 Roles of MSC-A, MSC-I and MSC-T' defines distinct roles: - MSC-A is responsible for managing subscribers, - MSC-I is the gateway to the RAN. - MSC-T is a second transitory gateway to another RAN during Handover. After inter-MSC Handover, the MSC-I is handled by a remote MSC instance, while the original MSC-A retains the responsibility of subscriber management. MSC-T exists in this patch but is not yet used, since Handover is only prepared for, not yet implemented. Facilitate Inter-MSC and inter-BSC Handover by the same internal split of MSC roles. Compared to inter-MSC Handover, mere inter-BSC has the obvious simplifications: - all of MSC-A, MSC-I and MSC-T roles will be served by the same osmo-msc instance, - messages between MSC-A and MSC-{I,T} don't need to be routed via E-interface (GSUP), - no call routing between MSC-A and -I via MNCC necessary. This is the largest code bomb I have submitted, ever. Out of principle, I apologize to everyone trying to read this as a whole. Unfortunately, I see no sense in trying to split this patch into smaller bits. It would be a huge amount of work to introduce these changes in separate chunks, especially if each should in turn be useful and pass all test suites. So, unfortunately, we are stuck with this code bomb. The following are some details and rationale for this rather huge refactoring: * separate MSC subscriber management from ran_conn struct ran_conn is reduced from the pivotal subscriber management entity it has been so far to a mere storage for an SCCP connection ID and an MSC subscriber reference. The new pivotal subscriber management entity is struct msc_a -- struct msub lists the msc_a, msc_i, msc_t roles, the vast majority of code paths however use msc_a, since MSC-A is where all the interesting stuff happens. Before handover, msc_i is an FSM implementation that encodes to the local ran_conn. After inter-MSC Handover, msc_i is a compatible but different FSM implementation that instead forwards via/from GSUP. Same goes for the msc_a struct: if osmo-msc is the MSC-I "RAN proxy" for a remote MSC-A role, the msc_a->fi is an FSM implementation that merely forwards via/from GSUP. * New SCCP implementation for RAN access To be able to forward BSSAP and RANAP messages via the GSUP interface, the individual message layers need to be cleanly separated. The IuCS implementation used until now (iu_client from libosmo-ranap) did not provide this level of separation, and needed a complete rewrite. It was trivial to implement this in such a way that both BSSAP and RANAP can be handled by the same SCCP code, hence the new SCCP-RAN layer also replaces BSSAP handling. sccp_ran.h: struct sccp_ran_inst provides an abstract handler for incoming RAN connections. A set of callback functions provides implementation specific details. * RAN Abstraction (BSSAP vs. RANAP) The common SCCP implementation did set the theme for the remaining refactoring: make all other MSC code paths entirely RAN-implementation-agnostic. ran_infra.c provides data structures that list RAN implementation specifics, from logging to NAS de-/encoding to SCCP callbacks and timers. A ran_infra pointer hence allows complete abstraction of RAN implementations: - managing connected RAN peers (BSC, RNC) in ran_peer.c, - classifying and de-/encoding NAS PDUs, - recording connected LACs and cell IDs and sending out Paging requests to matching RAN peers. * RAN RESET now also for RANAP ran_peer.c absorbs the reset_fsm from a_reset.c; in consequence, RANAP also supports proper RESET semantics now. Hence osmo-hnbgw now also needs to provide proper RESET handling, which it so far duly ignores. (TODO) * NAS de-/encoding abstraction The NAS abstraction mentioned above serves not only to separate RANAP and BSSAP implementations transparently, but also to be able to optionally handle NAS on distinct levels. Before Handover, all NAS is handled by the MSC-A role. However, after an inter-MSC Handover, a standalone MSC-I will need to decode NAS PDUs, at least in order to manage Assignment of RTP streams between BSS/RNC and MNCC call forwarding. nas.h provides a common API with abstraction for: - receiving NAS events from RAN, i.e. passing NAS decode from the BSC/RNC and MS/UE: struct nas_dec_msg represents NAS messages decoded from either BSSMAP or RANAP; - sending NAS events: nas_enc_msg is the counterpart to compose NAS messages that should be encoded to either BSSMAP or RANAP and passed down to the BSC/RNC and MS/UE. The RAN-specific implementations are completely contained by nas_a.c and nas_iu.c. In particular, Assignment and Ciphering have so far been distinct code paths for BSSAP and RANAP, with switch(via_ran){...} statements all over the place. Using NAS_DEC_* and NAS_ENC_* abstractions, these are now completely unified. Note that SGs does not qualify for NAS abstraction: the SGs interface always remains with the MSC-A role, and SGs messages follow quite distinct semantics from the fairly similar GERAN and UTRAN. * MGW and RTP stream management So far, managing MGW endpoints via MGCP was tightly glued in-between GSM-04.08-CC on the one and MNCC on the other side. Prepare for switching RTP streams between different RAN peers by moving to object-oriented implementations: implement struct call_leg and struct rtp_stream with distinct FSMs each. For MGW communication, use the osmo_mgcpc_ep API that has originated from osmo-bsc and recently moved to libosmo-mgcp-client for this purpose. Instead of implementing a sequence of events with code duplication for the RAN and CN sides, the idea is to manage each RTP stream separately by firing and receiving events as soon as codecs and RTP ports are negotiated, and letting the individual FSMs take care of the MGW management "asynchronously". The caller provides event IDs and an FSM instance that should be notified of RTP stream setup progress. Hence it becomes possible to reconnect RTP streams from one GSM-04.08-CC to another (inter-BSC Handover) or between CC and MNCC RTP peers (inter-MSC Handover) without duplicating the MGCP code for each transition. The number of FSM implementations used for MGCP handling may seem a bit of an overkill. But in fact, the number of perspectives on RTP forwarding are far from trivial: - an MGW endpoint is an entity with N connections, and MGCP "sessions" for configuring them by talking to the MGW; - an RTP stream is a remote peer connected to one of the endpoint's connections, which is asynchronously notified of codec and RTP port choices; - a call leg is the higher level view on either an MT or MO side of a voice call, a combination of two RTP streams to forward between two remote peers. BSC MGW PBX CI CI [MGW-endpoint] [--rtp_stream--] [--rtp_stream--] [----------------call_leg----------------] * Use counts Introduce using the new osmo_use_count API added to libosmocore for this purpose. Each use token has a distinct name in the logging, which can be a globally constant name or ad-hoc, like the local __func__ string constant. Use in the new struct msc_a, as well as change vlr_subscr to the new osmo_use_count API. * FSM Timeouts Introduce using the new osmo_tdef API, which provides a common VTY implementation for all timer numbers, and FSM state transitions with the correct timeout. Originated in osmo-bsc, recently moved to libosmocore. Depends: Ife31e6798b4e728a23913179e346552a7dd338c0 (libosmocore) Ib9af67b100c4583342a2103669732dab2e577b04 (libosmocore) Id617265337f09dfb6ddfe111ef5e578cd3dc9f63 (libosmocore) Ie9e2add7bbfae651c04e230d62e37cebeb91b0f5 (libosmo-sccp) I26be5c4b06a680f25f19797407ab56a5a4880ddc (osmo-mgw) Ida0e59f9a1f2dd18efea0a51680a67b69f141efa (osmo-mgw) I9a3effd38e72841529df6c135c077116981dea36 (osmo-mgw) Change-Id: I27e4988e0371808b512c757d2b52ada1615067bd --- M configure.ac A doc/sequence_charts/Makefile.am A doc/sequence_charts/inter_bsc_ho.msc A doc/sequence_charts/inter_msc_ho.msc M include/osmocom/msc/Makefile.am D include/osmocom/msc/a_iface.h D include/osmocom/msc/a_iface_bssap.h D include/osmocom/msc/a_reset.h A include/osmocom/msc/call_leg.h A include/osmocom/msc/cell_id_list.h A include/osmocom/msc/e_link.h M include/osmocom/msc/gsm_04_08.h M include/osmocom/msc/gsm_04_11.h M include/osmocom/msc/gsm_04_11_gsup.h M include/osmocom/msc/gsm_04_14.h M include/osmocom/msc/gsm_04_80.h M include/osmocom/msc/gsm_09_11.h M include/osmocom/msc/gsm_data.h M include/osmocom/msc/gsm_data_shared.h M include/osmocom/msc/gsm_subscriber.h A include/osmocom/msc/gsup_client_mux.h D include/osmocom/msc/iu_dummy.h D include/osmocom/msc/iucs.h D include/osmocom/msc/iucs_ranap.h M include/osmocom/msc/mncc.h A include/osmocom/msc/mncc_fsm.h A include/osmocom/msc/msc_a.h A include/osmocom/msc/msc_a_remote.h M include/osmocom/msc/msc_common.h A include/osmocom/msc/msc_ho.h A include/osmocom/msc/msc_i.h A include/osmocom/msc/msc_i_remote.h D include/osmocom/msc/msc_ifaces.h D include/osmocom/msc/msc_mgcp.h A include/osmocom/msc/msc_roles.h A include/osmocom/msc/msc_t.h A include/osmocom/msc/msc_t_remote.h A include/osmocom/msc/msub.h A include/osmocom/msc/nas.h A include/osmocom/msc/nas_a.h A include/osmocom/msc/nas_iu.h A include/osmocom/msc/neighbor_ident.h A include/osmocom/msc/paging.h M include/osmocom/msc/ran_conn.h A include/osmocom/msc/ran_infra.h A include/osmocom/msc/ran_peer.h A include/osmocom/msc/rtp_stream.h A include/osmocom/msc/sccp_ran.h M include/osmocom/msc/sgs_iface.h M include/osmocom/msc/signal.h M include/osmocom/msc/silent_call.h M include/osmocom/msc/sms_queue.h M include/osmocom/msc/transaction.h M include/osmocom/msc/vlr.h M include/osmocom/msc/vlr_sgs.h M src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/a_iface_bssap.c D src/libmsc/a_reset.c A src/libmsc/call_leg.c A src/libmsc/cell_id_list.c A src/libmsc/e_link.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_08_cc.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_11_gsup.c M src/libmsc/gsm_04_14.c M src/libmsc/gsm_04_80.c M src/libmsc/gsm_09_11.c D src/libmsc/gsm_subscriber.c A src/libmsc/gsup_client_mux.c D src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c M src/libmsc/mncc.c M src/libmsc/mncc_builtin.c A src/libmsc/mncc_fsm.c M src/libmsc/mncc_sock.c A src/libmsc/msc_a.c A src/libmsc/msc_a_remote.c A src/libmsc/msc_ho.c A src/libmsc/msc_i.c A src/libmsc/msc_i_remote.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_mgcp.c A src/libmsc/msc_net_init.c A src/libmsc/msc_t.c A src/libmsc/msc_t_remote.c M src/libmsc/msc_vty.c A src/libmsc/msub.c A src/libmsc/nas.c A src/libmsc/nas_a.c A src/libmsc/nas_iu.c A src/libmsc/neighbor_ident.c A src/libmsc/neighbor_ident_vty.c D src/libmsc/osmo_msc.c A src/libmsc/paging.c M src/libmsc/ran_conn.c A src/libmsc/ran_infra.c A src/libmsc/ran_peer.c A src/libmsc/ran_up_l2.c M src/libmsc/rrlp.c A src/libmsc/rtp_stream.c A src/libmsc/sccp_ran.c M src/libmsc/sgs_iface.c M src/libmsc/sgs_server.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.h M src/libmsc/sms_queue.c M src/libmsc/transaction.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M src/libvlr/vlr_sgs.c M src/libvlr/vlr_sgs_fsm.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/Makefile.am M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_test_authen_reuse.c M tests/msc_vlr/msc_vlr_test_authen_reuse.err M tests/msc_vlr/msc_vlr_test_call.c M tests/msc_vlr/msc_vlr_test_call.err M tests/msc_vlr/msc_vlr_test_gsm_authen.c M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.c M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.c M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.c M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.c M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.c M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_ss.c M tests/msc_vlr/msc_vlr_test_ss.err M tests/msc_vlr/msc_vlr_test_umts_authen.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h M tests/sms_queue/Makefile.am M tests/sms_queue/sms_queue_test.c A tests/test_neighbor_ident.vty M tests/test_nodes.vty 150 files changed, 35,584 insertions(+), 22,989 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/37/13137/5 -- To view, visit https://gerrit.osmocom.org/13137 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I27e4988e0371808b512c757d2b52ada1615067bd Gerrit-Change-Number: 13137 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Fri Apr 12 02:51:19 2019 From: admin at opensuse.org (OBS Notification) Date: Fri, 12 Apr 2019 02:51:19 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-netif in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <5caffd4079664_142310225f024417c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/libosmo-netif failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-netif Last lines of build log: [ 115s] +non-reconnecting test step 0 [client OK, server OK], FD reg 1 [ 115s] --- expout 2019-04-12 02:50:55.776000000 +0000 [ 115s] +++ /usr/src/packages/BUILD/tests/testsuite.dir/at-groups/1/stdout 2019-04-12 02:51:04.796000000 +0000 [ 115s] @@ -44,8 +44,6 @@ [ 115s] [OK|OK] Server's read_cb_srv(): received 29(29) bytes: 44 6f 68 2c 20 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 73 65 72 76 65 72 20 3a 2d 44 [ 115s] [OK|OK] Server's read_cb_srv(): sent 11 bytes message: 72 65 61 64 5f 63 62 5f 73 72 76 [ 115s] [OK|OK] Server's read_cb_srv(): force client disconnect on subsequent call [ 115s] -[OK] Client's read_cb_cli(): callback triggered [ 115s] -[OK] Client's read_cb_cli(): 0-byte read, auto-reconnect will be triggered if enabled [ 115s] non-reconnecting test complete. [ 115s] [ 115s] Stream tests completed [ 115s] 1. testsuite.at:4: 1. stream_test (testsuite.at:4): FAILED (testsuite.at:8) [ 115s] debian/rules:27: recipe for target 'override_dh_auto_test' failed [ 115s] make[1]: *** [override_dh_auto_test] Error 1 [ 115s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 115s] debian/rules:13: recipe for target 'build' failed [ 115s] make: *** [build] Error 2 [ 115s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 115s] [ 115s] lamb01 failed "build libosmo-netif_0.4.0.25.e380.dsc" at Fri Apr 12 02:51:06 UTC 2019. [ 115s] [ 115s] ### VM INTERACTION START ### [ 118s] [ 107.016730] sysrq: SysRq : Power Off [ 118s] [ 107.023688] reboot: Power down [ 118s] ### VM INTERACTION END ### [ 118s] [ 118s] lamb01 failed "build libosmo-netif_0.4.0.25.e380.dsc" at Fri Apr 12 02:51:09 UTC 2019. [ 118s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Apr 12 02:52:44 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 02:52:44 +0000 Subject: Change in osmo-msc[master]: GSUP: include terminating nul in inter-MSC source/destination name Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13612 Change subject: GSUP: include terminating nul in inter-MSC source/destination name ...................................................................... GSUP: include terminating nul in inter-MSC source/destination name Before, I was testing with osmo-hlr patch I01a45900e14d41bcd338f50ad85d9fabf2c61405 applied, but that patch is currently in an abandoned state. This is the counterpart implemented in osmo-msc: always include the terminating nul char in the "blob" that is the MSC IPA name. The dualities in the formats of routing between MSCs is whether to handle it as a char*, or as a uint8_t* with explicit len (a blob). In the VTY config to indicate target MSCs for inter-MSC handover, we have strings. We currently even completely lack a way of configuring any blob-like data as a VTY config item. In osmo-hlr, the IPA names used for routing are currently received as a char* which *includes* the terminating nul char. So in osmo-msc, if we also always include the nul char, it works. Instead, we could just send the char* part without the nul char, and apply above mentioned osmo-hlr patch. That patch would magically match a name that lacks a nul with a name that includes one. I think it is better to agree on one format on the GSUP wire now, instead of making assumptions in osmo-hlr on the format of the source/target names for routing. This format, from the way GSUP so far transmits the IPA SERNO tag when a client attaches to osmo-hlr, happens to include the terminating nul char. Change-Id: I9ca8c9eef104519ed1ea46e2fef46dcdc0d554eb --- M src/libmsc/e_link.c 1 file changed, 14 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/12/13612/1 diff --git a/src/libmsc/e_link.c b/src/libmsc/e_link.c index c0ebbf6..1ec3647 100644 --- a/src/libmsc/e_link.c +++ b/src/libmsc/e_link.c @@ -69,6 +69,7 @@ { struct e_link *e; struct msc_role_common *c = msc_role->priv; + size_t use_len; /* use msub as talloc parent, so we can move an e_link from msc_t to msc_i when it is established. */ e = talloc_zero(c->msub, struct e_link); @@ -79,12 +80,18 @@ .gcm = gcm, }; - /* Expecting all code paths to print the remote name according to remote_name_len. To be paranoid, place a nul - * character after the end. */ - e->remote_name = talloc_size(e, remote_name_len + 1); + /* FIXME: this is a braindamaged duality of char* and blob, which we can't seem to get rid of easily. + * See also osmo-hlr change I01a45900e14d41bcd338f50ad85d9fabf2c61405 which resolved this on the + * osmo-hlr side, but was abandoned. Not sure which way is the right solution. */ + /* To be able to include a terminating NUL character when sending the IPA name, append one if there is none yet. + * Current osmo-hlr needs the terminating NUL to be included. */ + use_len = remote_name_len; + if (remote_name[use_len-1] != '\0') + use_len++; + e->remote_name = talloc_size(e, use_len); memcpy(e->remote_name, remote_name, remote_name_len); - e->remote_name[remote_name_len] = '\0'; - e->remote_name_len = remote_name_len; + e->remote_name[use_len-1] = '\0'; + e->remote_name_len = use_len; e_link_assign(e, msc_role); return e; @@ -125,9 +132,9 @@ *gsup_msg = (struct osmo_gsup_message){ .message_class = OSMO_GSUP_MESSAGE_CLASS_INTER_MSC, .source_name = (const uint8_t*)local_msc_name, - .source_name_len = strlen(local_msc_name), + .source_name_len = strlen(local_msc_name)+1, /* include terminating nul */ .destination_name = (const uint8_t*)e->remote_name, - .destination_name_len = e->remote_name_len, + .destination_name_len = e->remote_name_len, /* the nul here is also included, from e_link_alloc() */ }; if (vsub) -- To view, visit https://gerrit.osmocom.org/13612 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9ca8c9eef104519ed1ea46e2fef46dcdc0d554eb Gerrit-Change-Number: 13612 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:48:09 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:48:09 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: expect only one Paging on failed MT SMS 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/13192 to look at the new patch set (#3). Change subject: msc: expect only one Paging on failed MT SMS ...................................................................... msc: expect only one Paging on failed MT SMS An MSC might decide to repeatedly retry Paging if it failed the first time, but osmo-msc currently has no such mechanism. Instead, it so far had a bug that retriggered a failed Paging from a start in a situation where there are SMS pending for only one subscriber, and sending the SMS fails. osmo-msc patch I24bf9f1c1167efe1080ae4cf47ed2ef0bd981e49 changes this behavior to accept a Paging failure and not launch the same SMS again numerous times. Adjust the tests to this new behavior. Depends: I24bf9f1c1167efe1080ae4cf47ed2ef0bd981e49 (osmo-msc) Change-Id: I7dce12942a65eaaf97f78ca69401c7f93faacb9e --- M msc/MSC_Tests.ttcn 1 file changed, 4 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/92/13192/3 -- To view, visit https://gerrit.osmocom.org/13192 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7dce12942a65eaaf97f78ca69401c7f93faacb9e Gerrit-Change-Number: 13192 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:48:10 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:48:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: clear the failed SMS when a test is done Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13613 Change subject: msc: clear the failed SMS when a test is done ...................................................................... msc: clear the failed SMS when a test is done If an MT SMS is triggered and not handled in the test, it is so far left behind when the test ends. That causes Paging to retrigger for that SMS at any later point during subsequent test runs, causing stray bogus test failures. Actually remove the SMS from the SMS database and the queue with a new VTY command: The vty command to clear failed SMS from the db is added in osmo-msc I637cbd7adc075a192f49752b38779391472ff06d Depends: I637cbd7adc075a192f49752b38779391472ff06d (osmo-msc) Change-Id: I4ff05187131e93f5bc58dc7ea44546f770e5b4c1 --- M msc/MSC_Tests.ttcn 1 file changed, 13 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/13/13613/1 diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 13d1ddb..8aa6199 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -1994,6 +1994,13 @@ f_vty_transceive(MSCVTY, "subscriber imsi "&imsi&" sms sender msisdn "&msisdn&" send "&text); } +/* Remove still pending SMS */ +private function f_vty_sms_clear(charstring imsi) +runs on BSC_ConnHdlr { + f_vty_transceive(MSCVTY, "subscriber imsi " & imsi & " sms delete-all"); + f_vty_transceive(MSCVTY, "sms-queue clear"); +} + /* LU followed by MT SMS */ private function f_tc_lu_and_mt_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { var SmsParameters spars := valueof(t_SmsPars); @@ -2088,6 +2095,8 @@ } } + f_vty_sms_clear(hex2str(g_pars.imsi)); + setverdict(pass); } testcase TC_lu_and_mt_sms_paging_and_nothing() runs on MTC_CT { @@ -4456,8 +4465,8 @@ * MSC/VLR would re-try to deliver the test SMS trigered above and * so the screening would fail. */ - /* Expire the subscriber now to avoid that the MSC will try the SMS - * delivery at some later point. */ + f_vty_sms_clear(hex2str(g_pars.imsi)); + f_vty_transceive(MSCVTY, "subscriber imsi " & hex2str(g_pars.imsi) & " expire"); setverdict(pass); @@ -4514,16 +4523,14 @@ } } + f_vty_sms_clear(hex2str(g_pars.imsi)); + /* A rejected paging with IMSI_unknown (see above) should always send * the SGs association to NULL. */ f_ctrl_get_exp(IPA_CTRL, "fsm.SGs-UE.id.imsi:" & hex2str(g_pars.imsi) & ".state", "SGs-NULL"); f_sgsap_bssmap_screening(); - /* Expire the subscriber now to avoid that the MSC will try the SMS - * delivery at some later point. */ - f_vty_transceive(MSCVTY, "subscriber imsi " & hex2str(g_pars.imsi) & " expire"); - setverdict(pass); } testcase TC_sgsap_mt_sms_and_reject() runs on MTC_CT { -- To view, visit https://gerrit.osmocom.org/13613 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4ff05187131e93f5bc58dc7ea44546f770e5b4c1 Gerrit-Change-Number: 13613 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:48:10 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:48:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: f_tc_sgsap_mt_sms_and_reject: expect SMPP messages (REALLY?) Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13614 Change subject: msc: f_tc_sgsap_mt_sms_and_reject: expect SMPP messages (REALLY?) ...................................................................... msc: f_tc_sgsap_mt_sms_and_reject: expect SMPP messages (REALLY?) Change-Id: I894ca2bba2743e7102e0e60a12a407c99a224769 --- M msc/MSC_Tests.ttcn 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/14/13614/1 diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index df088bc..d91e8b1 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -4469,6 +4469,8 @@ var template LocationAreaId exp_lai := ts_SGsAP_IE_Lai(valueof(ts_SGsAP_LAI('901'H, '70'H, 2342))); exp_pag_req.sGsAP_PAGING_REQUEST.locationAreaId := exp_lai; + f_create_smpp_expect(hex2str(spars.tp.da.tP_DA_NoPad.tP_DAValue)); + /* Trigger SMS via VTY */ f_vty_sms_send_conn_hdlr(hex2str(pars.imsi), "2342", "Hello SMS"); -- To view, visit https://gerrit.osmocom.org/13614 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I894ca2bba2743e7102e0e60a12a407c99a224769 Gerrit-Change-Number: 13614 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:48:11 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:48:11 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: f_tc_sgsap_mt_sms_and_reject: shorter delay Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13615 Change subject: msc: f_tc_sgsap_mt_sms_and_reject: shorter delay ...................................................................... msc: f_tc_sgsap_mt_sms_and_reject: shorter delay Change-Id: I4b2a588bcd20a4c04162997b9fe357dbe37178e9 --- M msc/MSC_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/15/13615/1 diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index d91e8b1..24428f1 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -4481,7 +4481,7 @@ /* The MSC/VLR should no longer try to page once the paging has been * rejected. Wait some time and check if there are no unexpected * messages on the SGs interface. */ - timer T := 20.0; + timer T := 3.0; T.start alt { [] SGsAP.receive(exp_pag_req) -- To view, visit https://gerrit.osmocom.org/13615 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4b2a588bcd20a4c04162997b9fe357dbe37178e9 Gerrit-Change-Number: 13615 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:48:11 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:48:11 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: mo and mt voice call tests: add lots of missing parts Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13616 Change subject: msc: mo and mt voice call tests: add lots of missing parts ...................................................................... msc: mo and mt voice call tests: add lots of missing parts Both f_mo_call_establish() and f_mt_call_establish() were testing barely half a voice call setup. For example, f_mo_call_establish() used to be satisfied with just two CRCX, but no actual RTP connections being made. Add numerous MNCC and MGCP messages more closely resembling an actual call. The main reason is to achieve a state that passes both current osmo-msc master as well as the upcoming inter-MSC Handover refactoring. Add log markers to f_*_call_*(): often when a test halts, it is not at all clear why. With these log markers it is saner to figure out what has happened and what hasn't. Change-Id: I162985045bb5e129977a3a797b656e30220990df --- M library/MGCP_Templates.ttcn M library/MNCC_Types.ttcn M msc/BSC_ConnectionHandler.ttcn 3 files changed, 185 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/16/13616/1 diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index f720553..506100f 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -286,6 +286,22 @@ } } + function f_mgcp_contains_par(MgcpMessage msg, MgcpInfoCode code) return boolean { + var MgcpParameterList pars; + if (ischosen(msg.command)) { + pars := msg.command.params; + } else { + pars := msg.response.params; + } + for (var integer i := 0; i < lengthof(pars); i := i + 1) { + var MgcpParameter par := pars[i]; + if (par.code == code) { + return true; + } + } + return false; + } + function f_mgcp_extract_par(MgcpMessage msg, MgcpInfoCode code) return charstring { var MgcpParameterList pars; if (ischosen(msg.command)) { @@ -317,6 +333,13 @@ return f_mgcp_extract_par(msg, code); } + function f_MgcpCmd_contains_par(MgcpCommand cmd, MgcpInfoCode code) return boolean { + var MgcpMessage msg := { + command := cmd + } + return f_mgcp_contains_par(msg, code); + } + function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId { return str2hex(f_MgcpResp_extract_par(resp, "I")); } diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index a3714b1..f5028d2 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -1874,14 +1874,17 @@ template MNCC_PDU ts_MNCC_RTP_CREATE(uint32_t call_id) := ts_MNCC_SIMPLE_RTP(MNCC_RTP_CREATE, call_id); /* MSC -> MNCC: RTP_CREATE.rsp; acknowledge creation of RTP (stating MSC side IP/Port) */ -template MNCC_PDU tr_MNCC_RTP_CREATE(template uint32_t call_id := ?) := { +template MNCC_PDU tr_MNCC_RTP_CREATE(template uint32_t call_id := ?, + template uint32_t ip := ?, + template uint32_t rtp_port := ?, + template uint32_t payload_type := ?) := { msg_type := MNCC_RTP_CREATE, u := { rtp := { callref := call_id, - ip := ?, - rtp_port := ?, - payload_type := ?, + ip := ip, + rtp_port := rtp_port, + payload_type := payload_type, payload_msg_type := ? } } diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 8e5c5f2..833c31f 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -479,12 +479,15 @@ f_establish_fully(EST_TYPE_PAG_RESP); + log("f_mt_call_complete 1"); + /* MS <- MSC: Expect CC SETUP */ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_SETUP(cpars.transaction_id, *, cpars.called_party))); /* MS -> MSC: ALERTING */ BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_ALERTING(cpars.transaction_id))); MNCC.receive(tr_MNCC_ALERT_ind(cpars.mncc_callref)); + log("f_mt_call_complete 2"); /* Create MGCP expect */ f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); @@ -493,6 +496,7 @@ /* First MGCP CRCX (for BSS/RAN side) */ MGCP.receive(tr_CRCX) -> value mgcp_cmd { + log("f_mt_call_complete 3"); cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); /* When the endpoint contains a wildcard we keep the endpoint @@ -521,6 +525,7 @@ interleave { /* Second MGCP CRCX (this time for MSS/CN side) */ [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { + log("f_mt_call_complete 4"); var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, hex2str(cpars.mgcp_call_id), "42", cpars.mgw_rtp_port_mss, @@ -529,25 +534,64 @@ cpars.rtp_sdp_format)), valueof(ts_SDP_ptime(20)) })); MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); - /* MSC acknowledges the MNCC_CREATE to the MNCC handler */ - MNCC.receive(tr_MNCC_RTP_CREATE(cpars.mncc_callref)); + } + + /* MSC acknowledges the MNCC_CREATE to the MNCC handler */ + [] MNCC.receive(tr_MNCC_RTP_CREATE(cpars.mncc_callref)) { + log("f_mt_call_complete 5"); } /* expect the MSC to trigger a BSSMAP ASSIGNMENT */ [] BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass)) { var BSSMAP_IE_AoIP_TransportLayerAddress tla; var BSSMAP_IE_SpeechCodec codec; + log("f_mt_call_complete 6"); tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); codec := valueof(ts_BSSMAP_IE_SpeechCodec({ts_CodecFR})); BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla, codec)); + + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_CONNECT(cpars.transaction_id))); } + + [] MNCC.receive(tr_MNCC_SETUP_cnf(cpars.mncc_callref)) { + log("f_mt_call_complete 7"); + MNCC.send(ts_MNCC_RTP_CONNECT(cpars.mncc_callref, + /* ip 42.23.11.5 */ hex2int('42231105'H), + /* port 423 */ 423, + /* payload type 3 = GSM FR */ 3)); + } + + /* MDCX setting up the RAN side remote RTP address received from Assignment Complete */ + [] MGCP.receive(tr_MDCX) -> value mgcp_cmd { + log("f_mt_call_complete 8"); + var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, + hex2str(cpars.mgcp_call_id), "42", + cpars.mgw_rtp_port_mss, + { int2str(cpars.rtp_payload_type) }, + { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, + cpars.rtp_sdp_format)), + valueof(ts_SDP_ptime(20)) })); + MGCP.send(ts_MDCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + } + + /* MDCX setting up the CN side remote RTP address received from MNCC CONNECT */ + [] MGCP.receive(tr_MDCX) -> value mgcp_cmd { + log("f_mt_call_complete 9"); + var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, + hex2str(cpars.mgcp_call_id), "42", + cpars.mgw_rtp_port_mss, + { int2str(cpars.rtp_payload_type) }, + { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, + cpars.rtp_sdp_format)), + valueof(ts_SDP_ptime(20)) })); + MGCP.send(ts_MDCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + } + } - /* MS -> MSC: ALERTING */ - BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_CONNECT(cpars.transaction_id))); - MNCC.receive(tr_MNCC_SETUP_cnf(cpars.mncc_callref)); + log("f_mt_call_complete DONE"); } function f_mt_call_establish(inout CallParameters cpars) @@ -588,15 +632,20 @@ } else { BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); } + + var BSSMAP_IE_AoIP_TransportLayerAddress tla_ass := + valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.mgw_rtp_ip_bss),cpars.mgw_rtp_port_bss)); + interleave { [] MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(cpars.called_party)))) -> value mncc { + log("f_mo_call_establish 1: rx MNCC SETUP ind"); cpars.mncc_callref := mncc.u.signal.callref; - /* Call Proceeding */ - MNCC.send(ts_MNCC_CALL_PROC_req(cpars.mncc_callref, cpars.mncc_bearer_cap)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); - }; + MNCC.send(ts_MNCC_RTP_CREATE(cpars.mncc_callref)); + } + /* First MGCP CRCX (for BSS/RAN side) */ [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { + log("f_mo_call_establish 2: rx 1st CRCX"); cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); /* When the endpoint contains a wildcard we keep the endpoint @@ -619,13 +668,43 @@ f_mgcp_par_append(mgcp_resp.params, ts_MgcpParSpecEP(cpars.mgcp_ep)); MGCP.send(mgcp_resp); } - } - var BSSMAP_IE_AoIP_TransportLayerAddress tla_ass := - valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.mgw_rtp_ip_bss),cpars.mgw_rtp_port_bss)); - interleave { + [] MNCC.receive(tr_MNCC_RTP_CREATE(cpars.mncc_callref)) { + log("f_mo_call_establish 3: rx RTP CREATE"); + /* Call Proceeding */ + MNCC.send(ts_MNCC_CALL_PROC_req(cpars.mncc_callref, cpars.mncc_bearer_cap)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); + + /* Alerting */ + MNCC.send(ts_MNCC_ALERT_req(cpars.mncc_callref)); + }; + + /* expect AoIP IP/Port to match what we returned in CRCX_ACK above */ + [] BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass)) { + log("f_mo_call_establish 4: rx Assignment Request"); + var BSSMAP_IE_AoIP_TransportLayerAddress tla; + var BSSMAP_IE_SpeechCodec codec; + tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); + codec := valueof(ts_BSSMAP_IE_SpeechCodec({ts_CodecFR})); + BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla, codec)); + } + + /* MDCX setting up the RAN side remote RTP address received from Assignment Complete */ + [] MGCP.receive(tr_MDCX) -> value mgcp_cmd { + log("f_mo_call_establish 5: rx MDCX for the RAN side"); + var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, + hex2str(cpars.mgcp_call_id), "42", + cpars.mgw_rtp_port_mss, + { int2str(cpars.rtp_payload_type) }, + { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, + cpars.rtp_sdp_format)), + valueof(ts_SDP_ptime(20)) })); + MGCP.send(ts_MDCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + } + /* Second MGCP CRCX (this time for MSS/CN side) */ [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { + log("f_mo_call_establish 6: rx 2nd CRCX, for CN side"); var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, hex2str(cpars.mgcp_call_id), "42", cpars.mgw_rtp_port_mss, @@ -634,31 +713,50 @@ cpars.rtp_sdp_format)), valueof(ts_SDP_ptime(20)) })); MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); - - /* Alerting */ - MNCC.send(ts_MNCC_ALERT_req(cpars.mncc_callref)); } [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(cpars.transaction_id))) { + log("f_mo_call_establish 7: rx CC Alerting"); + cpars.mncc_callref := mncc.u.signal.callref; + /* Call Proceeding */ + MNCC.send(ts_MNCC_RTP_CONNECT(cpars.mncc_callref, + /* ip 42.23.11.5 */ hex2int('42231105'H), + /* port 423 */ 423, + /* payload type 3 = GSM FR */ 3)); + MNCC.send(ts_MNCC_SETUP_rsp(cpars.mncc_callref)); } - /* expect AoIP IP/Port to match what we returned in CRCX_ACK above */ - [] BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass)) { - var BSSMAP_IE_AoIP_TransportLayerAddress tla; - var BSSMAP_IE_SpeechCodec codec; - tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); - codec := valueof(ts_BSSMAP_IE_SpeechCodec({ts_CodecFR})); - BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla, codec)); + + [] MNCC.receive(tr_MNCC_SETUP_COMPL_ind(?)) -> value mncc { + log("f_mo_call_establish 8: rx MNCC SETUP COMPLETE ind"); + } + + /* second MDCX setting up the CN side remote RTP address and codec received from MNCC RTP CONNECT */ + [] MGCP.receive(tr_MDCX) -> value mgcp_cmd { + log("f_mo_call_establish 9: rx MDCX for CN side"); + var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, + hex2str(cpars.mgcp_call_id), "42", + cpars.mgw_rtp_port_mss, + { int2str(cpars.rtp_payload_type) }, + { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, + cpars.rtp_sdp_format)), + valueof(ts_SDP_ptime(20)) })); + MGCP.send(ts_MDCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + } + + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CONNECT(cpars.transaction_id))) { + log("f_mo_call_establish 10: rx CC CONNECT"); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_CONNECT_ACK(cpars.transaction_id))); } } - /* Answer. MNCC_SETUP_RSP -> CONNECT to MS; CONNECT_ACK from MS */ - MNCC.send(ts_MNCC_SETUP_rsp(cpars.mncc_callref)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CONNECT(cpars.transaction_id))); - BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_CONNECT_ACK(cpars.transaction_id))); - + log("f_mo_call_establish DONE"); setverdict(pass); } +private altstep as_optional_mgcp_mdcx() runs on BSC_ConnHdlr { + [] MGCP.receive(tr_MDCX) {}; +} + function f_call_hangup(inout CallParameters cpars, boolean release_by_ms, boolean is_csfb := false) runs on BSC_ConnHdlr { @@ -666,6 +764,7 @@ var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; var boolean respond_to_dlcx; + var boolean dlcx_contained_ci := false; var template PDU_BSSAP t_clear := tr_BSSMAP_ClearCommand; if (is_csfb) { @@ -676,11 +775,13 @@ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(cpars.transaction_id))); if (release_by_ms) { + log("f_call_hangup 1a"); /* B-side (MS) Release of call */ BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_RELEASE(cpars.transaction_id, '1'B, '0000000'B))); MNCC.receive(tr_MNCC_REL_ind(cpars.mncc_callref)); BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_REL_COMPL(cpars.transaction_id))); } else { + log("f_call_hangup 1b"); /* A-side (PLMN) Release of call */ MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, valueof(ts_MNCC_cause(42)))); BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); @@ -689,21 +790,42 @@ respond_to_dlcx := not (isbound(cpars.mgw_drop_dlcx) and valueof(cpars.mgw_drop_dlcx)); + var default mdcx := activate(as_optional_mgcp_mdcx()); + /* clearing of radio channel */ interleave { [] BSSAP.receive(t_clear) { + log("f_call_hangup 2"); BSSAP.send(ts_BSSMAP_ClearComplete); BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + log("f_call_hangup 3"); } [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { - if (respond_to_dlcx) { - /* TODO: For one or all connections on EP? */ - MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); - f_create_mgcp_delete_ep(cpars.mgcp_ep); - } + log("f_call_hangup 4"); + if (respond_to_dlcx) { + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); + } + dlcx_contained_ci := f_MgcpCmd_contains_par(mgcp_cmd, "I"); } } + /* Two DLCXes expected, one for RAN and one for CN side. + * Unless the first DLCX did not contain a CI, in which case it was a wildcard DLCX for both. */ + if (dlcx_contained_ci) { + MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { + log("f_call_hangup 5"); + if (respond_to_dlcx) { + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); + } + } + } + } + + f_create_mgcp_delete_ep(cpars.mgcp_ep); + + deactivate(mdcx); + log("f_call_hangup DONE"); + setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/13616 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I162985045bb5e129977a3a797b656e30220990df Gerrit-Change-Number: 13616 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:51:21 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:51:21 +0000 Subject: Change in osmo-bsc[master]: Handover Request: also parse Chosen Algorithm IE, pass to lchan activ... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13583 ) Change subject: Handover Request: also parse Chosen Algorithm IE, pass to lchan activation ...................................................................... Handover Request: also parse Chosen Algorithm IE, pass to lchan activation During inter-BSC-incoming, the MSC sends the chosen encryption algorithm in the Handover Request message. Actually parse this Chosen Encryption Algorithm IE. Place the chosen algorithm and the CK into lchan_activate_info->encr so that the new lchan will use the same ciphering on this new BSS as it did on the old BSS. Change-Id: I5b269f50bd2092516bfdf87746196983d3ac49d1 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/handover_fsm.c 2 files changed, 33 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index ba28a6b..131a53e 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -179,6 +179,10 @@ struct gsm0808_speech_codec_list scl; struct gsm0808_encrypt_info ei; struct gsm_classmark classmark; + /* chosen_encr_alg reflects the encoded value as in RSL_ENC_ALG_A5(a5_numer): + * chosen_encr_alg == 1 means A5/0 i.e. no encryption, chosen_encr_alg == 4 means A5/3. + * chosen_encr_alg == 0 means no such IE was present. */ + uint8_t chosen_encr_alg; struct gsm0808_cell_id cell_id_serving; char cell_id_serving_name[64]; struct gsm0808_cell_id cell_id_target; diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 9c86b70..421c32e 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -432,6 +432,17 @@ "Missing mandatory IE: 3GPP mandates either Classmark Information 1 or 2" " in BSSMAP Handover Request, but neither are present. Will continue without.\n"); + if ((e = TLVP_GET(tp, GSM0808_IE_CHOSEN_ENCR_ALG))) { + req->chosen_encr_alg = e->val[0]; + if (req->chosen_encr_alg < 1 || req->chosen_encr_alg > 8) + LOG_HO(conn, LOGL_ERROR, "Chosen Encryption Algorithm (Serving) is invalid: %u\n", + req->chosen_encr_alg); + } + + LOG_HO(conn, LOGL_DEBUG, "Handover Request encryption info: chosen=A5/%u key=%s\n", + (req->chosen_encr_alg ? : 1) - 1, req->ei.key_len? + osmo_hexdump_nospc(req->ei.key, req->ei.key_len) : "none"); + if (TLVP_PRESENT(tp, GSM0808_IE_AOIP_TRASP_ADDR)) { int rc; unsigned int u; @@ -611,6 +622,24 @@ .msc_assigned_cic = req->msc_assigned_cic, }; + if (req->chosen_encr_alg) { + info.encr.alg_id = req->chosen_encr_alg; + if (info.encr.alg_id > 1 && !req->ei.key_len) { + ho_fail(HO_RESULT_ERROR, "Chosen Encryption Algorithm (Serving) reflects A5/%u" + " but there is no key (Encryption Information)", info.encr.alg_id - 1); + return; + } + } + + if (req->ei.key_len) { + if (req->ei.key_len > sizeof(info.encr.key)) { + ho_fail(HO_RESULT_ERROR, "Encryption Information IE key length is too large: %u\n", + req->ei.key_len); + } + memcpy(info.encr.key, req->ei.key, req->ei.key_len); + info.encr.key_len = req->ei.key_len; + } + lchan_activate(ho->new_lchan, &info); } -- To view, visit https://gerrit.osmocom.org/13583 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5b269f50bd2092516bfdf87746196983d3ac49d1 Gerrit-Change-Number: 13583 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:51:23 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:51:23 +0000 Subject: Change in osmo-bsc[master]: fix inter-BSC-HO-incoming for AoIP (1/2) In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13584 ) Change subject: fix inter-BSC-HO-incoming for AoIP (1/2) ...................................................................... fix inter-BSC-HO-incoming for AoIP (1/2) Move the HO_ST_WAIT_MGW_ENDPOINT_TO_MSC state up to right after the lchan is done establishing. For AoIP, the local RTP address towards the MSC already needs to be known before the Handover Request Acknowledge is sent, so the AoIP Transport Layer Address IE can be included. This patch only modifies the handover FSM, a subsequent patch adds the IE. Change-Id: I4a5acdb2d4a0b947cc0c62067a67be88a3d467ff --- M include/osmocom/bsc/handover_fsm.h M src/osmo-bsc/handover_fsm.c 2 files changed, 106 insertions(+), 85 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/handover_fsm.h b/include/osmocom/bsc/handover_fsm.h index 4db0890..7c2145e 100644 --- a/include/osmocom/bsc/handover_fsm.h +++ b/include/osmocom/bsc/handover_fsm.h @@ -28,10 +28,10 @@ HO_ST_NOT_STARTED, HO_ST_WAIT_LCHAN_ACTIVE, + HO_ST_WAIT_MGW_ENDPOINT_TO_MSC, HO_ST_WAIT_RR_HO_DETECT, HO_ST_WAIT_RR_HO_COMPLETE, HO_ST_WAIT_LCHAN_ESTABLISHED, - HO_ST_WAIT_MGW_ENDPOINT_TO_MSC, /* The inter-BSC Outgoing Handover FSM has completely separate states, but since it makes sense for it * to also live in conn->ho.fi, it should share the same event enum. From there it is merely @@ -46,11 +46,11 @@ HO_EV_LCHAN_ACTIVE, HO_EV_LCHAN_ESTABLISHED, HO_EV_LCHAN_ERROR, + HO_EV_MSC_MGW_OK, + HO_EV_MSC_MGW_FAIL, HO_EV_RR_HO_DETECT, HO_EV_RR_HO_COMPLETE, HO_EV_RR_HO_FAIL, - HO_EV_MSC_MGW_OK, - HO_EV_MSC_MGW_FAIL, HO_EV_CONN_RELEASING, HO_OUT_EV_BSSMAP_HO_COMMAND, diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 421c32e..3b5a660 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -161,10 +161,10 @@ static const struct state_timeout ho_fsm_timeouts[32] = { [HO_ST_WAIT_LCHAN_ACTIVE] = { .T = 23042 }, + [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { .T = 23042 }, [HO_ST_WAIT_RR_HO_DETECT] = { .T = 23042 }, [HO_ST_WAIT_RR_HO_COMPLETE] = { .T = 23042 }, [HO_ST_WAIT_LCHAN_ESTABLISHED] = { .T = 23042 }, - [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { .T = 23042 }, [HO_OUT_ST_WAIT_HO_COMMAND] = { .T = 7 }, [HO_OUT_ST_WAIT_CLEAR] = { .T = 8 }, }; @@ -876,10 +876,24 @@ static void ho_fsm_wait_lchan_active(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + struct handover *ho = &conn->ho; switch (event) { case HO_EV_LCHAN_ACTIVE: - ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); + /* - If the lchan is voiceless, no need to even think about the MGW. + * - If this is an intra-BSC Handover, we already have an RTP stream towards the MSC and aren't + * touching it. + * - If we're on SCCPlite, the MSC manages the MGW endpoint, all we do is the BTS side CI, so we can + * skip the part that would CRCX towards the MSC. + * So create an MSC side endpoint CI only if a voice lchan is established for an incoming inter-BSC + * handover on AoIP. Otherwise go on to send a Handover Command and wait for the Detect. + */ + if (ho->new_lchan->activate.info.requires_voice_stream + && (ho->scope & HO_INTER_BSC_IN) + && gscon_is_aoip(conn)) + ho_fsm_state_chg(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC); + else + ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); return; case HO_EV_LCHAN_ERROR: @@ -892,6 +906,76 @@ } } +/* Only for voice, only for inter-BSC Handover into this BSC, and only for AoIP: + * + * Establish the MGW endpoint CI that points towards the MSC. This needs to happen after the lchan (lchan_rtp_fsm) has + * created an MGW endpoint with the first CRCX, so that an endpoint is available, and before sending the Handover + * Request Acknowledge, so that the RTP address and port established towards the MSC can be included in the Handover + * Request Acknowledge message. + * (For SCCPlite, the MSC manages the CN side endpoint CI itself, and we don't need to send any RTP address in the + * Handover Request Acknowledge.) + * + * Actually, it should be possible to kick this off even above in handover_start_inter_bsc_in(), to do the CRCX towards + * the MSC at the same time as establishing the lchan. The gscon_ensure_mgw_endpoint() doesn't care which one of + * lchan_rtp_fsm or handover_start_inter_bsc_in() calls it first. The benefit would be that we'd send out the Handover + * Command ever so slightly sooner -- which isn't critical really, because a) how long does a CRCX take, milliseconds? + * and b) the time critical part is *after* the Handover Command was kicked off to keep the transition between cells as + * short as possible. The drawback of doing this earlier is code complexity: receiving the HO_EV_MSC_MGW_OK / + * HO_EV_MSC_MGW_FAIL events would need to be juggled in between the HO_EV_LCHAN_ACTIVE / HO_EV_LCHAN_ERROR. So the + * decision for now is to leave it here. + */ +static void ho_fsm_wait_mgw_endpoint_to_msc_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + struct handover *ho = &conn->ho; + + if (!gscon_connect_mgw_to_msc(conn, + ho->new_lchan, + ho->inter_bsc_in.msc_assigned_rtp_addr, + ho->inter_bsc_in.msc_assigned_rtp_port, + fi, + HO_EV_MSC_MGW_OK, + HO_EV_MSC_MGW_FAIL, + NULL, + &ho->created_ci_for_msc)) { + ho_fail(HO_RESULT_ERROR, + "Unable to connect MGW endpoint to the MSC side"); + } +} + +static void ho_fsm_wait_mgw_endpoint_to_msc(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + const struct mgcp_conn_peer *mgw_info; + + switch (event) { + + case HO_EV_MSC_MGW_OK: + /* Ensure the endpoint is really there, and log it. This state is only entered for AoIP connections, see + * ho_fsm_wait_lchan_active() above. */ + mgw_info = mgwep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); + if (!mgw_info) { + ho_fail(HO_RESULT_ERROR, + "Unable to retrieve RTP port info allocated by MGW for" + " the MSC side."); + return; + } + LOG_HO(conn, LOGL_DEBUG, "MGW's MSC side CI: %s:%u\n", + mgw_info->addr, mgw_info->port); + ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); + return; + + case HO_EV_MSC_MGW_FAIL: + ho_fail(HO_RESULT_ERROR, + "Unable to connect MGW endpoint to the MSC side"); + return; + + default: + OSMO_ASSERT(false); + } +} + + static void ho_fsm_wait_rr_ho_detect_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { int rc; @@ -1009,24 +1093,24 @@ } } -static void ho_fsm_post_lchan_established(struct osmo_fsm_inst *fi); - static void ho_fsm_wait_lchan_established_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { struct gsm_subscriber_connection *conn = ho_fi_conn(fi); if (conn->ho.fi && lchan_state_is(conn->ho.new_lchan, LCHAN_ST_ESTABLISHED)) { LOG_HO(conn, LOGL_DEBUG, "lchan already established earlier\n"); - ho_fsm_post_lchan_established(fi); + ho_success(); } } static void ho_fsm_wait_lchan_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + switch (event) { case HO_EV_LCHAN_ESTABLISHED: - ho_fsm_post_lchan_established(fi); + ho_success(); break; default: @@ -1034,69 +1118,6 @@ } } -static void ho_fsm_post_lchan_established(struct osmo_fsm_inst *fi) -{ - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - struct handover *ho = &conn->ho; - - if (ho->new_lchan->activate.info.requires_voice_stream - && (ho->scope & HO_INTER_BSC_IN)) - ho_fsm_state_chg(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC); - else - ho_success(); -} - -static void ho_fsm_wait_mgw_endpoint_to_msc_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - struct handover *ho = &conn->ho; - - if (!gscon_connect_mgw_to_msc(conn, - ho->new_lchan, - ho->inter_bsc_in.msc_assigned_rtp_addr, - ho->inter_bsc_in.msc_assigned_rtp_port, - fi, - HO_EV_MSC_MGW_OK, - HO_EV_MSC_MGW_FAIL, - NULL, - &ho->created_ci_for_msc)) { - ho_fail(HO_RESULT_ERROR, - "Unable to connect MGW endpoint to the MSC side"); - } -} - -static void ho_fsm_wait_mgw_endpoint_to_msc(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - switch (event) { - - case HO_EV_MSC_MGW_OK: - /* For AoIP, we created the MGW endpoint. Ensure it is really there, and log it. */ - if (gscon_is_aoip(conn)) { - const struct mgcp_conn_peer *mgw_info; - mgw_info = mgwep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); - if (!mgw_info) { - ho_fail(HO_RESULT_ERROR, - "Unable to retrieve RTP port info allocated by MGW for" - " the MSC side."); - return; - } - LOG_HO(conn, LOGL_DEBUG, "MGW's MSC side CI: %s:%u\n", - mgw_info->addr, mgw_info->port); - } - ho_success(); - return; - - case HO_EV_MSC_MGW_FAIL: - ho_fail(HO_RESULT_ERROR, - "Unable to connect MGW endpoint to the MSC side"); - return; - - default: - OSMO_ASSERT(false); - } -} - /* Inter-BSC OUT */ static void handover_start_inter_bsc_out(struct gsm_subscriber_connection *conn, @@ -1185,6 +1206,19 @@ , .out_state_mask = 0 | S(HO_ST_WAIT_LCHAN_ACTIVE) + | S(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC) + | S(HO_ST_WAIT_RR_HO_DETECT) + , + }, + [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { + .name = "WAIT_MGW_ENDPOINT_TO_MSC", + .onenter = ho_fsm_wait_mgw_endpoint_to_msc_onenter, + .action = ho_fsm_wait_mgw_endpoint_to_msc, + .in_event_mask = 0 + | S(HO_EV_MSC_MGW_OK) + | S(HO_EV_MSC_MGW_FAIL) + , + .out_state_mask = 0 | S(HO_ST_WAIT_RR_HO_DETECT) , }, @@ -1222,20 +1256,7 @@ .in_event_mask = 0 | S(HO_EV_LCHAN_ESTABLISHED) , - .out_state_mask = 0 - | S(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC) - , }, - [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { - .name = "WAIT_MGW_ENDPOINT_TO_MSC", - .onenter = ho_fsm_wait_mgw_endpoint_to_msc_onenter, - .action = ho_fsm_wait_mgw_endpoint_to_msc, - .in_event_mask = 0 - | S(HO_EV_MSC_MGW_OK) - | S(HO_EV_MSC_MGW_FAIL) - , - }, - [HO_OUT_ST_WAIT_HO_COMMAND] = { .name = "inter-BSC-OUT:WAIT_HO_COMMAND", .action = ho_out_fsm_wait_ho_command, -- To view, visit https://gerrit.osmocom.org/13584 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4a5acdb2d4a0b947cc0c62067a67be88a3d467ff Gerrit-Change-Number: 13584 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:51:18 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:51:18 +0000 Subject: Change in osmo-bsc[master]: lchan activation: add explicit encryption info to activation In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13582 ) Change subject: lchan activation: add explicit encryption info to activation ...................................................................... lchan activation: add explicit encryption info to activation For intra-BSC handover, the previous encryption is copied from the old lchan, which of course is not available during inter-BSC handover. Hence the lchan activation info needs to include an explicit encryption information, and we must not rely on the presence of the previous lchan to copy encryption information from. Add struct lchan_activate_info.encr to allow passing encryption info through lchan_activate() without requiring a previous struct gsm_lchan to be present. Instead of copying from the old lchan, always copy encryption info to lchan_activate_info, and during activation, just before sending the Channel Activation, copy the lchan_activate_info.encr to the new lchan. This prepares for upcoming I5b269f50bd2092516bfdf87746196983d3ac49d1 which obtains the encryption information from an intra-BSC-incoming Handover Request message. Related: OS#3842 Related: I5b269f50bd2092516bfdf87746196983d3ac49d1 Change-Id: Ib3d259a5711add65ab7298bfa3977855a17a1642 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c 4 files changed, 10 insertions(+), 10 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 47ca5e8..ba28a6b 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -528,6 +528,7 @@ /* This always is for a specific lchan, so its lchan->type indicates full or half rate. * When a dyn TS was selected, the lchan->type has been set to the desired rate. */ enum gsm48_chan_mode chan_mode; + struct gsm_encr encr; /* AMR config */ uint16_t s15_s0; bool requires_voice_stream; diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index c17b555..9c0c400 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -484,6 +484,7 @@ .activ_for = FOR_ASSIGNMENT, .for_conn = conn, .chan_mode = conn->lchan->ch_mode_rate.chan_mode, + .encr = conn->lchan->encr, .s15_s0 = conn->lchan->ch_mode_rate.s15_s0, .requires_voice_stream = conn->assignment.requires_voice_stream, .msc_assigned_cic = req->msc_assigned_cic, diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index a3d25d6..9c86b70 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -358,6 +358,7 @@ .activ_for = FOR_HANDOVER, .for_conn = conn, .chan_mode = conn->lchan->tch_mode, + .encr = conn->lchan->encr, .requires_voice_stream = conn->lchan->mgw_endpoint_ci_bts ? true : false, .msc_assigned_cic = conn->ho.inter_bsc_in.msc_assigned_cic, .re_use_mgw_endpoint_from_lchan = conn->lchan, diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 2b7dc97..7af2ea0 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -518,14 +518,6 @@ lchan->conn = info->for_conn; - if (old_lchan) - lchan->encr = old_lchan->encr; - else { - lchan->encr = (struct gsm_encr){ - .alg_id = RSL_ENC_ALG_A5(0), /* no encryption */ - }; - } - /* If there is a previous lchan, and the new lchan is on the same cell as previous one, * take over power and TA values. Otherwise, use max power and zero TA. */ if (old_lchan && old_lchan->ts->trx->bts == bts) { @@ -585,14 +577,17 @@ use_mgwep_ci = lchan_use_mgw_endpoint_ci_bts(lchan); LOG_LCHAN(lchan, LOGL_INFO, - "Activation requested: %s voice=%s MGW-ci=%s type=%s tch-mode=%s\n", + "Activation requested: %s voice=%s MGW-ci=%s type=%s tch-mode=%s encr-alg=A5/%u ck=%s\n", lchan_activate_mode_name(lchan->activate.info.activ_for), lchan->activate.info.requires_voice_stream ? "yes" : "no", lchan->activate.info.requires_voice_stream ? (use_mgwep_ci ? mgwep_ci_name(use_mgwep_ci) : "new") : "none", gsm_lchant_name(lchan->type), - gsm48_chan_mode_name(lchan->tch_mode)); + gsm48_chan_mode_name(lchan->tch_mode), + (lchan->activate.info.encr.alg_id ? : 1)-1, + lchan->activate.info.encr.key_len ? osmo_hexdump_nospc(lchan->activate.info.encr.key, + lchan->activate.info.encr.key_len) : "none"); /* Ask for the timeslot to make ready for this lchan->type. * We'll receive LCHAN_EV_TS_READY or LCHAN_EV_TS_ERROR in response. */ @@ -657,6 +652,8 @@ break; } + lchan->encr = lchan->activate.info.encr; + rc = rsl_tx_chan_activ(lchan, act_type, ho_ref); if (rc) lchan_fail_to(LCHAN_ST_UNUSED, "Tx Chan Activ failed: %s (%d)", strerror(-rc), rc); -- To view, visit https://gerrit.osmocom.org/13582 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib3d259a5711add65ab7298bfa3977855a17a1642 Gerrit-Change-Number: 13582 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:51:59 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:51:59 +0000 Subject: Change in osmo-msc[master]: add LOG_TRANS, proper context for all transactions In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13139 ) Change subject: add LOG_TRANS, proper context for all transactions ...................................................................... Patch Set 5: This change is ready for review. -- To view, visit https://gerrit.osmocom.org/13139 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2e60964d7a3c06d051debd1c707051a0eb3101ba Gerrit-Change-Number: 13139 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 12 Apr 2019 03:51:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:52:30 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:52:30 +0000 Subject: Change in osmo-msc[master]: sms queue: avoid repeated Paging for a failed SMS In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13173 ) Change subject: sms queue: avoid repeated Paging for a failed SMS ...................................................................... Patch Set 5: Code-Review+2 applying +1+1 == +2 -- To view, visit https://gerrit.osmocom.org/13173 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I24bf9f1c1167efe1080ae4cf47ed2ef0bd981e49 Gerrit-Change-Number: 13173 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 12 Apr 2019 03:52:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:52:36 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:52:36 +0000 Subject: Change in osmo-msc[master]: enable osmo_fsm_term_safely(), apply logging changes In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13592 ) Change subject: enable osmo_fsm_term_safely(), apply logging changes ...................................................................... enable osmo_fsm_term_safely(), apply logging changes Start using osmo_fsm_term_safely(true), the recently added feature of libosmocore's fsm.c. Deallocates in slightly changed order and with slightly modified logging. Adjust test expectations. Depends: I8eda67540a1cd444491beb7856b9fcd0a3143b18 (libosmocore) Change-Id: I195a719d9ec1f6764ee5a361244f59f0144dc253 --- M src/osmo-msc/msc_main.c M tests/msc_vlr/msc_vlr_test_authen_reuse.err M tests/msc_vlr/msc_vlr_test_call.err M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_ss.err M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c 14 files changed, 627 insertions(+), 1,140 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved -- To view, visit https://gerrit.osmocom.org/13592 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I195a719d9ec1f6764ee5a361244f59f0144dc253 Gerrit-Change-Number: 13592 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:52:37 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:52:37 +0000 Subject: Change in osmo-msc[master]: sms queue: avoid repeated Paging for a failed SMS In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13173 ) Change subject: sms queue: avoid repeated Paging for a failed SMS ...................................................................... sms queue: avoid repeated Paging for a failed SMS So far, sms_pending_failed() starts a new sms_queue_trigger() run. The intention behind that might have been to fill up the queue when sending SMS has failed, but the practical effect is actually bad: As current ttcn3-msc-test runs show, a failed MT SMS gets triggered multiple times in short succession, i.e. osmo-msc repeatedly sends Paging Requests for the same subscriber. This special case happens actually only when there are few SMS still in the DB to be delivered. In the TTCN3 test, there is exactly one MT SMS for one subscriber, and retriggering the queue brings up the same SMS every time. See f_tc_lu_and_mt_sms_paging_and_nothing() and f_tc_sgsap_mt_sms_and_nothing() which say: "/* Expect the MSC to page exactly 10 times before giving up */" This is bad because an MSC should send a Paging Request exactly once. Retrying failed Paging is clearly the task of the BSC, not the MSC. The remaining code around Paging correctly follows this paradigm, but this retrigger doesn't. Do not immediately trigger the SMS queue on a failed MT SMS. Instead, leave it up to the periodical SMS queue trigger to decide. This patch will cause the MT SMS tests in ttcn3-msc-tests to fail, because the test expectations are bogus. The patch fixing the test run is listed 'Related' below. Related: I7dce12942a65eaaf97f78ca69401c7f93faacb9e (osmo-ttcn3-hacks) Change-Id: I24bf9f1c1167efe1080ae4cf47ed2ef0bd981e49 --- M src/libmsc/sms_queue.c 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Neels Hofmeyr: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Keith Whyte: Looks good to me, but someone else must approve diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index afd878f..4de30ad 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -161,7 +161,6 @@ sms_pending_free(pending); smsq->pending -= 1; - sms_queue_trigger(smsq); } /* -- To view, visit https://gerrit.osmocom.org/13173 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I24bf9f1c1167efe1080ae4cf47ed2ef0bd981e49 Gerrit-Change-Number: 13173 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:52:37 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:52:37 +0000 Subject: Change in osmo-msc[master]: vlr_subscr: use osmo_use_count In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13136 ) Change subject: vlr_subscr: use osmo_use_count ...................................................................... vlr_subscr: use osmo_use_count Depends: Ife31e6798b4e728a23913179e346552a7dd338c0 (libosmocore) Change-Id: Ib06d030e8464abe415ff597d462ed40eeddef475 --- M include/osmocom/msc/db.h M include/osmocom/msc/ran_conn.h M include/osmocom/msc/sms_queue.h M include/osmocom/msc/vlr.h M include/osmocom/msc/vlr_sgs.h M src/libmsc/ctrl_commands.c M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_08_cc.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/msc_vty.c M src/libmsc/ran_conn.c M src/libmsc/sgs_iface.c M src/libmsc/smpp_openbsc.c M src/libmsc/sms_queue.c M src/libmsc/transaction.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M src/libvlr/vlr_sgs.c M tests/msc_vlr/msc_vlr_test_authen_reuse.c M tests/msc_vlr/msc_vlr_test_authen_reuse.err M tests/msc_vlr/msc_vlr_test_call.c M tests/msc_vlr/msc_vlr_test_call.err M tests/msc_vlr/msc_vlr_test_gsm_authen.c M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.c M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.c M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.c M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.c M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_ss.c M tests/msc_vlr/msc_vlr_test_ss.err M tests/msc_vlr/msc_vlr_test_umts_authen.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/sms_queue/sms_queue_test.c 45 files changed, 2,350 insertions(+), 2,287 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved -- To view, visit https://gerrit.osmocom.org/13136 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib06d030e8464abe415ff597d462ed40eeddef475 Gerrit-Change-Number: 13136 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Max -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:52:39 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:52:39 +0000 Subject: Change in osmo-msc[master]: add LOG_TRANS, proper context for all transactions In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13139 ) Change subject: add LOG_TRANS, proper context for all transactions ...................................................................... add LOG_TRANS, proper context for all transactions Change-Id: I2e60964d7a3c06d051debd1c707051a0eb3101ba --- M include/osmocom/msc/transaction.h M src/libmsc/gsm_04_08_cc.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_11_gsup.c M src/libmsc/gsm_09_11.c M src/libmsc/transaction.c M tests/msc_vlr/msc_vlr_test_call.err M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_ss.err M tests/msc_vlr/msc_vlr_test_umts_authen.err 14 files changed, 620 insertions(+), 628 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/msc/transaction.h b/include/osmocom/msc/transaction.h index 830328b..7ffcf3b 100644 --- a/include/osmocom/msc/transaction.h +++ b/include/osmocom/msc/transaction.h @@ -3,14 +3,29 @@ #include #include #include +#include #include #include +#include #include #include /* Used for late TID assignment */ #define TRANS_ID_UNASSIGNED 0xff +#define LOG_TRANS_CAT(trans, subsys, level, fmt, args...) \ + LOGP(subsys, level, \ + "trans(%s %s callref-0x%x tid-%u%s) " fmt, \ + (trans) ? gsm48_pdisc_name((trans)->protocol) : "NULL", \ + (trans) ? ((trans)->conn ? (trans)->conn->fi->id : vlr_subscr_name((trans)->vsub)) : "NULL", \ + (trans) ? (trans)->callref : 0, \ + (trans) ? (trans)->transaction_id : 0, \ + (trans) && (trans)->paging_request ? ",PAGING" : "", \ + ##args) + +#define LOG_TRANS(trans, level, fmt, args...) \ + LOG_TRANS_CAT(trans, trans_log_subsys(trans), level, fmt, ##args) + enum bridge_state { BRIDGE_STATE_NONE, BRIDGE_STATE_LOOPBACK_PENDING, @@ -118,3 +133,18 @@ uint8_t protocol); struct gsm_trans *trans_has_conn(const struct ran_conn *conn); void trans_conn_closed(const struct ran_conn *conn); + +static inline int trans_log_subsys(const struct gsm_trans *trans) +{ + if (!trans) + return DMSC; + switch (trans->protocol) { + case GSM48_PDISC_CC: + return DCC; + case GSM48_PDISC_SMS: + return DLSMS; + default: + break; + } + return DMSC; +} diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c index 532472e..4475d05 100644 --- a/src/libmsc/gsm_04_08_cc.c +++ b/src/libmsc/gsm_04_08_cc.c @@ -75,8 +75,7 @@ static void gsm48_cc_guard_timeout(void *arg) { struct gsm_trans *trans = arg; - DEBUGP(DCC, "(sub %s) guard timeout expired\n", - vlr_subscr_msisdn_or_name(trans->vsub)); + LOG_TRANS(trans, LOGL_DEBUG, "guard timeout expired\n"); trans_free(trans); return; } @@ -84,8 +83,7 @@ static void gsm48_stop_guard_timer(struct gsm_trans *trans) { if (osmo_timer_pending(&trans->cc.timer_guard)) { - DEBUGP(DCC, "(sub %s) stopping pending guard timer\n", - vlr_subscr_msisdn_or_name(trans->vsub)); + LOG_TRANS(trans, LOGL_DEBUG, "stopping pending guard timer\n"); osmo_timer_del(&trans->cc.timer_guard); } } @@ -102,9 +100,7 @@ * timer will time out and hard-clear the connection. */ if (osmo_timer_pending(&trans->cc.timer_guard)) gsm48_stop_guard_timer(trans); - DEBUGP(DCC, "(sub %s) starting guard timer with %d seconds\n", - vlr_subscr_msisdn_or_name(trans->vsub), - trans->net->mncc_guard_timeout); + LOG_TRANS(trans, LOGL_DEBUG, "starting guard timer with %d seconds\n", trans->net->mncc_guard_timeout); osmo_timer_setup(&trans->cc.timer_guard, gsm48_cc_guard_timeout, trans); osmo_timer_schedule(&trans->cc.timer_guard, trans->net->mncc_guard_timeout, 0); @@ -177,11 +173,9 @@ if (state > 31 || state < 0) return; - DEBUGP(DCC, "(ti %02x sub %s) new state %s -> %s\n", - trans->transaction_id, - vlr_subscr_name(trans->vsub), - gsm48_cc_state_name(trans->cc.state), - gsm48_cc_state_name(state)); + LOG_TRANS(trans, LOGL_DEBUG, "new state %s -> %s\n", + gsm48_cc_state_name(trans->cc.state), + gsm48_cc_state_name(state)); count_statistics(trans, state); trans->cc.state = state; @@ -213,7 +207,7 @@ static void gsm48_stop_cc_timer(struct gsm_trans *trans) { if (osmo_timer_pending(&trans->cc.timer)) { - DEBUGP(DCC, "stopping pending timer T%x\n", trans->cc.Tcurrent); + LOG_TRANS(trans, LOGL_DEBUG, "stopping pending timer T%x\n", trans->cc.Tcurrent); osmo_timer_del(&trans->cc.timer); trans->cc.Tcurrent = 0; } @@ -225,31 +219,7 @@ struct msgb *msg; unsigned char *data; - DEBUGP(DMNCC, "transmit message %s\n", get_mncc_name(msg_type)); - -#if BEFORE_MSCSPLIT - /* Re-enable this log output once we can obtain this information via - * A-interface, see OS#2391. */ - if (trans) - if (trans->conn && trans->conn->lchan) - DEBUGP(DCC, "(bts %d trx %d ts %d ti %x sub %s) " - "Sending '%s' to MNCC.\n", - trans->conn->lchan->ts->trx->bts->nr, - trans->conn->lchan->ts->trx->nr, - trans->conn->lchan->ts->nr, trans->transaction_id, - vlr_subscr_msisdn_or_name(trans->vsub), - get_mncc_name(msg_type)); - else - DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " - "Sending '%s' to MNCC.\n", - vlr_subscr_msisdn_or_name(trans->vsub), - get_mncc_name(msg_type)); - else - DEBUGP(DCC, "(bts - trx - ts - ti -- sub -) " - "Sending '%s' to MNCC.\n", get_mncc_name(msg_type)); -#else - DEBUGP(DCC, "Sending '%s' to MNCC.\n", get_mncc_name(msg_type)); -#endif + LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "tx %s\n", get_mncc_name(msg_type)); mncc->msg_type = msg_type; @@ -317,8 +287,7 @@ switch (paging_event) { case GSM_PAGING_SUCCEEDED: - DEBUGP(DCC, "Paging subscr %s succeeded!\n", - vlr_subscr_msisdn_or_name(transt->vsub)); + LOG_TRANS(transt, LOGL_DEBUG, "Paging succeeded\n"); OSMO_ASSERT(conn); /* Assign conn */ transt->conn = ran_conn_get(conn, RAN_CONN_USE_TRANS_CC); @@ -328,9 +297,7 @@ break; case GSM_PAGING_EXPIRED: case GSM_PAGING_BUSY: - DEBUGP(DCC, "Paging subscr %s %s!\n", - vlr_subscr_msisdn_or_name(transt->vsub), - paging_event == GSM_PAGING_EXPIRED ? "expired" : "busy"); + LOG_TRANS(transt, LOGL_DEBUG, "Paging expired\n"); /* Temporarily out of order */ mncc_release_ind(transt->net, transt, transt->callref, @@ -352,11 +319,19 @@ struct gsm_trans *trans2 = trans_find_by_callref(net, bridge->callref[1]); int rc; - if (!trans1 || !trans2) + if (!trans1 || !trans2) { + LOG_TRANS(trans1 ? : trans2, LOGL_ERROR, "Cannot MNCC_BRIDGE, one or both call legs are unset\n"); return -EIO; + } - if (!trans1->conn || !trans2->conn) + if (!trans1->conn || !trans2->conn) { + LOG_TRANS(trans1, LOGL_ERROR, "Cannot MNCC_BRIDGE, one or both call legs lack an active connection\n"); + LOG_TRANS(trans2, LOGL_ERROR, "Cannot MNCC_BRIDGE, one or both call legs lack an active connection\n"); return -EIO; + } + + LOG_TRANS(trans1, LOGL_DEBUG, "MNCC_BRIDGE: Local bridge to callref 0x%x\n", trans2->callref); + LOG_TRANS(trans2, LOGL_DEBUG, "MNCC_BRIDGE: Local bridge to callref 0x%x\n", trans1->callref); /* Which subscriber do we want to track trans1 or trans2? */ log_set_context(LOG_CTX_VLR_SUBSCR, trans1->vsub); @@ -386,7 +361,7 @@ static int gsm48_cc_rx_status_enq(struct gsm_trans *trans, struct msgb *msg) { - DEBUGP(DCC, "-> STATUS ENQ\n"); + LOG_TRANS(trans, LOGL_DEBUG, "-> STATUS ENQ\n"); return gsm48_cc_tx_status(trans, msg); } @@ -485,7 +460,9 @@ if (!trans0 || !trans1) return; - DEBUGP(DCC, "Failed to bridge TCH for calls %x <-> %x :: %s \n", + LOG_TRANS(trans0, LOGL_ERROR, "Failed to bridge TCH for calls %x <-> %x :: %s \n", + trans0->callref, trans1->callref, strerror(err)); + LOG_TRANS(trans1, LOGL_ERROR, "Failed to bridge TCH for calls %x <-> %x :: %s \n", trans0->callref, trans1->callref, strerror(err)); memset(&mx_rel, 0, sizeof(struct gsm_mncc)); @@ -502,7 +479,7 @@ static void gsm48_start_cc_timer(struct gsm_trans *trans, int current, int sec, int micro) { - DEBUGP(DCC, "starting timer T%x with %d seconds\n", current, sec); + LOG_TRANS(trans, LOGL_DEBUG, "starting timer T%x with %d seconds\n", current, sec); osmo_timer_setup(&trans->cc.timer, gsm48_cc_timeout, trans); osmo_timer_schedule(&trans->cc.timer, sec, micro); trans->cc.Tcurrent = current; @@ -592,9 +569,8 @@ new_cc_state(trans, GSM_CSTATE_INITIATED); - LOGP(DCC, setup.emergency ? LOGL_NOTICE : LOGL_INFO, "Subscriber %s (%s) sends %sSETUP to %s\n", - vlr_subscr_name(trans->vsub), trans->vsub->msisdn, setup.emergency ? "EMERGENCY_" : "", - setup.called.number); + LOG_TRANS(trans, setup.emergency ? LOGL_NOTICE : LOGL_INFO, "%sSETUP to %s\n", + setup.emergency ? "EMERGENCY_" : "", setup.called.number); rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MO_SETUP]); @@ -618,7 +594,7 @@ /* transaction id must not be assigned */ if (trans->transaction_id != TRANS_ID_UNASSIGNED) { - DEBUGP(DCC, "TX Setup with assigned transaction. " + LOG_TRANS(trans, LOGL_DEBUG, "TX Setup with assigned transaction. " "This is not allowed!\n"); /* Temporarily out of order */ rc = mncc_release_ind(trans->net, trans, trans->callref, @@ -1695,13 +1671,13 @@ /* Find callref */ trans = trans_find_by_callref(net, callref); if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); + LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); return -EIO; } log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); if (!trans->conn) { - LOGP(DMNCC, LOGL_NOTICE, "RTP create for trans without conn\n"); + LOG_TRANS_CAT(trans, DMNCC, LOGL_NOTICE, "RTP create for trans without conn\n"); mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); return 0; } @@ -1756,13 +1732,13 @@ /* Find callref */ trans = trans_find_by_callref(net, rtp->callref); if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "RTP connect for non-existing trans\n"); + LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR, "RTP connect for non-existing trans\n"); mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); return -EIO; } log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); if (!trans->conn) { - LOGP(DMNCC, LOGL_ERROR, "RTP connect for trans without conn\n"); + LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR, "RTP connect for trans without conn\n"); mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); return 0; } @@ -1837,8 +1813,6 @@ struct ran_conn *conn = NULL; struct gsm_mncc *data = arg, rel; - DEBUGP(DMNCC, "receive message %s\n", get_mncc_name(msg_type)); - /* handle special messages */ switch(msg_type) { case MNCC_BRIDGE: @@ -1860,7 +1834,7 @@ case GSM_TCHF_FRAME_EFR: case GSM_TCHH_FRAME: case GSM_TCH_FRAME_AMR: - LOGP(DMNCC, LOGL_ERROR, "RTP streams must be handled externally; %s not supported.\n", + LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR, "RTP streams must be handled externally; %s not supported.\n", get_mncc_name(msg_type)); return -ENOTSUP; } @@ -1876,51 +1850,43 @@ struct vlr_subscr *vsub; if (msg_type != MNCC_SETUP_REQ) { - DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " - "Received '%s' from MNCC with " - "unknown callref %d\n", data->called.number, - get_mncc_name(msg_type), data->callref); + LOG_TRANS_CAT(trans, DCC, LOGL_ERROR, "Unknown call reference for %s\n", + get_mncc_name(msg_type)); /* Invalid call reference */ return mncc_release_ind(net, NULL, data->callref, GSM48_CAUSE_LOC_PRN_S_LU, GSM48_CC_CAUSE_INVAL_TRANS_ID); } if (!data->called.number[0] && !data->imsi[0]) { - DEBUGP(DCC, "(bts - trx - ts - ti) " - "Received '%s' from MNCC with " - "no number or IMSI\n", get_mncc_name(msg_type)); + LOG_TRANS_CAT(trans, DCC, LOGL_ERROR, "Neither number nor IMSI in %s\n", + get_mncc_name(msg_type)); /* Invalid number */ return mncc_release_ind(net, NULL, data->callref, GSM48_CAUSE_LOC_PRN_S_LU, GSM48_CC_CAUSE_INV_NR_FORMAT); } /* New transaction due to setup, find subscriber */ - if (data->called.number[0]) - vsub = vlr_subscr_find_by_msisdn(net->vlr, - data->called.number, __func__); - else + if (data->called.number[0]) { + vsub = vlr_subscr_find_by_msisdn(net->vlr, data->called.number, __func__); + if (!vsub) + LOG_TRANS_CAT(trans, DCC, LOGL_ERROR, "rx %s for unknown subscriber number '%s'\n", + get_mncc_name(msg_type), data->called.number); + } else { vsub = vlr_subscr_find_by_imsi(net->vlr, data->imsi, __func__); - + if (!vsub) + LOG_TRANS_CAT(trans, DCC, LOGL_ERROR, "rx %s for unknown subscriber IMSI '%s'\n", + get_mncc_name(msg_type), data->imsi); + } + if (!vsub) + return mncc_release_ind(net, NULL, data->callref, GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_UNASSIGNED_NR); /* update the subscriber we deal with */ log_set_context(LOG_CTX_VLR_SUBSCR, vsub); - /* If subscriber is not found */ - if (!vsub) { - DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " - "Received '%s' from MNCC with " - "unknown subscriber %s\n", data->called.number, - get_mncc_name(msg_type), data->called.number); - /* Unknown subscriber */ - return mncc_release_ind(net, NULL, data->callref, - GSM48_CAUSE_LOC_PRN_S_LU, - GSM48_CC_CAUSE_UNASSIGNED_NR); - } /* If subscriber is not "attached" */ - if (!vsub->cgi.lai.lac) { - DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " - "Received '%s' from MNCC with " - "detached subscriber %s\n", data->called.number, - get_mncc_name(msg_type), vlr_subscr_name(vsub)); + if (!vsub->lu_complete) { + LOG_TRANS_CAT(trans, DCC, LOGL_ERROR, "rx %s for subscriber that is not attached: %s\n", + get_mncc_name(msg_type), vlr_subscr_name(vsub)); vlr_subscr_put(vsub, __func__); /* Temporarily out of order */ return mncc_release_ind(net, NULL, data->callref, @@ -1931,7 +1897,7 @@ trans = trans_alloc(net, vsub, GSM48_PDISC_CC, TRANS_ID_UNASSIGNED, data->callref); if (!trans) { - LOGP(DCC, LOGL_ERROR, "No memory for trans.\n"); + LOG_TRANS(trans, LOGL_ERROR, "No memory for trans.\n"); vlr_subscr_put(vsub, __func__); /* Ressource unavailable */ mncc_release_ind(net, NULL, data->callref, @@ -1951,16 +1917,14 @@ if (transt == trans || transt->vsub != vsub) continue; - DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " - "Received '%s' from MNCC with " - "unallocated channel, paging already " - "started for lac %d.\n", - data->called.number, - get_mncc_name(msg_type), vsub->cgi.lai.lac); + LOG_TRANS(trans, LOGL_DEBUG, + "rx %s, subscriber not yet connected, paging already started\n", + get_mncc_name(msg_type)); vlr_subscr_put(vsub, __func__); trans_free(trans); return 0; } + /* store setup information until paging succeeds */ memcpy(&trans->cc.msg, data, sizeof(struct gsm_mncc)); @@ -1972,7 +1936,7 @@ "MNCC: establish call", SGSAP_SERV_IND_CS_CALL); if (!trans->paging_request) { - LOGP(DCC, LOGL_ERROR, "Failed to allocate paging token.\n"); + LOG_TRANS(trans, LOGL_ERROR, "Failed to allocate paging token.\n"); vlr_subscr_put(vsub, __func__); trans_free(trans); return 0; @@ -1990,6 +1954,8 @@ log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); } + LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "rx %s\n", get_mncc_name(msg_type)); + gsm48_start_guard_timer(trans); if (trans->conn) @@ -1997,10 +1963,7 @@ /* if paging did not respond yet */ if (!conn) { - DEBUGP(DCC, "(sub %s) " - "Received '%s' from MNCC in paging state\n", - vlr_subscr_msisdn_or_name(trans->vsub), - get_mncc_name(msg_type)); + LOG_TRANS(trans, LOGL_DEBUG, "rx %s in paging state\n", get_mncc_name(msg_type)); mncc_set_cause(&rel, GSM48_CAUSE_LOC_PRN_S_LU, GSM48_CC_CAUSE_NORM_CALL_CLEAR); if (msg_type == MNCC_REL_REQ) @@ -2011,12 +1974,8 @@ trans_free(trans); return rc; } else { - DEBUGP(DCC, "(ti %02x sub %s) " - "Received '%s' from MNCC in state %d (%s)\n", - trans->transaction_id, - vlr_subscr_msisdn_or_name(trans->conn->vsub), - get_mncc_name(msg_type), trans->cc.state, - gsm48_cc_state_name(trans->cc.state)); + LOG_TRANS(trans, LOGL_DEBUG, "rx %s in state %s\n", + get_mncc_name(msg_type), gsm48_cc_state_name(trans->cc.state)); } /* Find function for current state and message */ @@ -2025,7 +1984,8 @@ && ((1 << trans->cc.state) & downstatelist[i].states)) break; if (i == DOWNSLLEN) { - DEBUGP(DCC, "Message '%s' unhandled at state '%s'\n", get_mncc_name(msg_type), gsm48_cc_state_name(trans->cc.state)); + LOG_TRANS(trans, LOGL_DEBUG, "Message '%s' unhandled at state '%s'\n", + get_mncc_name(msg_type), gsm48_cc_state_name(trans->cc.state)); return 0; } @@ -2098,29 +2058,18 @@ int i, rc = 0; if (msg_type & 0x80) { - DEBUGP(DCC, "MSG 0x%2x not defined for PD error\n", msg_type); + LOG_TRANS(trans, LOGL_DEBUG, "MSG 0x%2x not defined for PD error\n", msg_type); return -EINVAL; } if (!conn->vsub) { - LOGP(DCC, LOGL_ERROR, "Invalid conn: no subscriber\n"); + LOG_TRANS(trans, LOGL_ERROR, "Invalid conn: no subscriber\n"); return -EINVAL; } /* Find transaction */ trans = trans_find_by_id(conn, GSM48_PDISC_CC, transaction_id); -#if BEFORE_MSCSPLIT - /* Re-enable this log output once we can obtain this information via - * A-interface, see OS#2391. */ - DEBUGP(DCC, "(bts %d trx %d ts %d ti %x sub %s) " - "Received '%s' from MS in state %d (%s)\n", - conn->bts->nr, conn->lchan->ts->trx->nr, conn->lchan->ts->nr, - transaction_id, vlr_subscr_msisdn_or_name(conn->vsub), - gsm48_cc_msg_name(msg_type), trans?(trans->cc.state):0, - gsm48_cc_state_name(trans?(trans->cc.state):0)); -#endif - /* Create transaction */ if (!trans) { DEBUGP(DCC, "Unknown transaction ID %x, " @@ -2130,7 +2079,7 @@ GSM48_PDISC_CC, transaction_id, new_callref++); if (!trans) { - LOGP(DCC, LOGL_ERROR, "No memory for trans.\n"); + LOG_TRANS(trans, LOGL_ERROR, "No memory for trans.\n"); rc = gsm48_tx_simple(conn, GSM48_PDISC_CC | (transaction_id << 4), GSM48_MT_CC_RELEASE_COMPL); @@ -2142,13 +2091,16 @@ cm_service_request_concludes(conn, msg); } + LOG_TRANS(trans, LOGL_DEBUG, "rx %s in state %s\n", gsm48_cc_msg_name(msg_type), + gsm48_cc_state_name(trans->cc.state)); + /* find function for current state and message */ for (i = 0; i < DATASLLEN; i++) if ((msg_type == datastatelist[i].type) && ((1 << trans->cc.state) & datastatelist[i].states)) break; if (i == DATASLLEN) { - DEBUGP(DCC, "Message unhandled at this state.\n"); + LOG_TRANS(trans, LOGL_ERROR, "Message unhandled at this state.\n"); return 0; } diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 37d0333..434f878 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -120,11 +120,11 @@ osmo_signal_dispatch(SS_SMS, sig_no, &sig); } -static int gsm411_sendmsg(struct ran_conn *conn, struct msgb *msg) +static int gsm411_sendmsg(struct gsm_trans *trans, struct msgb *msg) { - DEBUGP(DLSMS, "GSM4.11 TX %s\n", msgb_hexdump(msg)); + LOG_TRANS(trans, LOGL_DEBUG, "GSM4.11 TX %s\n", msgb_hexdump(msg)); msg->l3h = msg->data; - return msc_tx_dtap(conn, msg); + return msc_tx_dtap(trans->conn, msg); } /* Paging callback for MT SMS (Paging is triggered by SMC) */ @@ -136,7 +136,7 @@ struct gsm_sms *sms = trans->sms.sms; int rc = 0; - DEBUGP(DLSMS, "paging_cb_mmsms_est_req(hooknum=%u, event=%u)\n", hooknum, event); + LOG_TRANS(trans, LOGL_DEBUG, "%s(%s)\n", __func__, event == GSM_PAGING_SUCCEEDED ? "success" : "expired"); if (hooknum != GSM_HOOK_RR_PAGING) return -EINVAL; @@ -184,22 +184,19 @@ /* Check if connection is already established */ if (trans->conn != NULL) { - LOGP(DLSMS, LOGL_DEBUG, "Using an existing connection " - "for %s\n", vlr_subscr_name(trans->vsub)); + LOG_TRANS(trans, LOGL_DEBUG, "Using an existing connection\n"); return gsm411_smc_recv(&trans->sms.smc_inst, GSM411_MMSMS_EST_CNF, NULL, 0); } /* Initiate Paging procedure */ - LOGP(DLSMS, LOGL_DEBUG, "Initiating Paging procedure " - "for %s due to MMSMS_EST_REQ\n", vlr_subscr_name(trans->vsub)); + LOG_TRANS(trans, LOGL_DEBUG, "Initiating Paging due to MMSMS_EST_REQ\n"); trans->paging_request = subscr_request_conn(trans->vsub, paging_cb_mmsms_est_req, trans, "MT SMS", SGSAP_SERV_IND_SMS); if (!trans->paging_request) { - LOGP(DLSMS, LOGL_ERROR, "Failed to initiate Paging " - "procedure for %s\n", vlr_subscr_name(trans->vsub)); + LOG_TRANS(trans, LOGL_ERROR, "Failed to initiate Paging\n"); /* Inform SMC about channel establishment failure */ gsm411_smc_recv(&trans->sms.smc_inst, GSM411_MMSMS_REL_IND, NULL, 0); @@ -222,9 +219,9 @@ gh->msg_type = msg_type; OMSC_LINKID_CB(msg) = trans->dlci; - DEBUGP(DLSMS, "sending CP message (trans=%x)\n", trans->transaction_id); + LOG_TRANS(trans, LOGL_DEBUG, "sending CP message (trans=%x)\n", trans->transaction_id); - return gsm411_sendmsg(trans->conn, msg); + return gsm411_sendmsg(trans, msg); } /* mm_send: receive MMCCSMS sap message from SMC */ @@ -244,12 +241,12 @@ rc = gsm411_cp_sendmsg(msg, trans, cp_msg_type); break; case GSM411_MMSMS_REL_REQ: - DEBUGP(DLSMS, "Got MMSMS_REL_REQ, destroying transaction.\n"); + LOG_TRANS(trans, LOGL_DEBUG, "Got MMSMS_REL_REQ, destroying transaction.\n"); msgb_free(msg); trans_free(trans); break; default: - LOGP(DLSMS, LOGL_NOTICE, "Unhandled MMCCSMS msg 0x%x\n", msg_type); + LOG_TRANS(trans, LOGL_NOTICE, "Unhandled MMCCSMS msg 0x%x\n", msg_type); msgb_free(msg); rc = -EINVAL; } @@ -268,10 +265,10 @@ return gsm411_smc_send(&trans->sms.smc_inst, msg_type, msg); } -static int gsm340_rx_sms_submit(struct gsm_sms *gsms) +static int gsm340_rx_sms_submit(struct gsm_trans *trans, struct gsm_sms *gsms) { if (db_sms_store(gsms) != 0) { - LOGP(DLSMS, LOGL_ERROR, "Failed to store SMS in Database\n"); + LOG_TRANS(trans, LOGL_ERROR, "Failed to store SMS in Database\n"); return GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; } /* dispatch a signal to tell higher level about it */ @@ -290,7 +287,7 @@ /* generate a msgb containing an 03.40 9.2.2.1 SMS-DELIVER TPDU derived from * struct gsm_sms, returns total size of TPDU */ -static int gsm340_gen_sms_deliver_tpdu(struct msgb *msg, struct gsm_sms *sms) +static int gsm340_gen_sms_deliver_tpdu(struct gsm_trans *trans, struct msgb *msg, struct gsm_sms *sms) { uint8_t *smsp; uint8_t oa[12]; /* max len per 03.40 */ @@ -353,8 +350,8 @@ memcpy(smsp, sms->user_data, sms->user_data_len); break; default: - LOGP(DLSMS, LOGL_NOTICE, "Unhandled Data Coding Scheme: 0x%02X\n", - sms->data_coding_scheme); + LOG_TRANS(trans, LOGL_NOTICE, "Unhandled Data Coding Scheme: 0x%02X\n", + sms->data_coding_scheme); break; } @@ -362,7 +359,7 @@ } /* As defined by GSM 03.40, Section 9.2.2.3. */ -static int gsm340_gen_sms_status_report_tpdu(struct msgb *msg, +static int gsm340_gen_sms_status_report_tpdu(struct gsm_trans *trans, struct msgb *msg, struct gsm_sms *sms) { unsigned int old_msg_len = msg->len; @@ -402,16 +399,16 @@ /* From GSM 03.40, Section 9.2.3.15, 0x00 means OK. */ *smsp = 0x00; - LOGP(DLSMS, LOGL_INFO, "sending status report for SMS reference %x\n", - sms->msg_ref); + LOG_TRANS(trans, LOGL_INFO, "sending status report for SMS reference %x\n", + sms->msg_ref); return msg->len - old_msg_len; } -static int sms_route_mt_sms(struct ran_conn *conn, - struct gsm_sms *gsms) +static int sms_route_mt_sms(struct gsm_trans *trans, struct gsm_sms *gsms) { int rc; + struct ran_conn *conn = trans->conn; #ifdef BUILD_SMPP int smpp_first = smpp_route_smpp_first(gsms, conn); @@ -428,8 +425,7 @@ /* unknown subscriber, try local */ goto try_local; if (rc < 0) { - LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", - vlr_subscr_name(conn->vsub), rc); + LOG_TRANS(trans, LOGL_ERROR, "SMS delivery error: %d.", rc); rc = GSM411_RP_CAUSE_MO_TEMP_FAIL; /* rc will be logged by gsm411_send_rp_error() */ rate_ctr_inc(&conn->network->msc_ctrs->ctr[ @@ -455,8 +451,7 @@ 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.", - vlr_subscr_name(conn->vsub), rc); + LOG_TRANS(trans, LOGL_ERROR, "SMS delivery error: %d.", rc); rc = GSM411_RP_CAUSE_MO_TEMP_FAIL; /* rc will be logged by gsm411_send_rp_error() */ rate_ctr_inc(&conn->network->msc_ctrs->ctr[ @@ -515,11 +510,11 @@ /* length in bytes of the destination address */ da_len_bytes = 2 + *smsp/2 + *smsp%2; if (da_len_bytes > 12) { - LOGP(DLSMS, LOGL_ERROR, "Destination Address > 12 bytes ?!?\n"); + LOG_TRANS(trans, LOGL_ERROR, "Destination Address > 12 bytes ?!?\n"); rc = GSM411_RP_CAUSE_SEMANT_INC_MSG; goto out; } else if (da_len_bytes < 4) { - LOGP(DLSMS, LOGL_ERROR, "Destination Address < 4 bytes ?!?\n"); + LOG_TRANS(trans, LOGL_ERROR, "Destination Address < 4 bytes ?!?\n"); rc = GSM411_RP_CAUSE_SEMANT_INC_MSG; goto out; } @@ -560,8 +555,7 @@ sms_vp = 0; break; default: - LOGP(DLSMS, LOGL_NOTICE, - "SMS Validity period not implemented: 0x%02x\n", sms_vpf); + LOG_TRANS(trans, LOGL_NOTICE, "SMS Validity period not implemented: 0x%02x\n", sms_vpf); rc = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; goto out; } @@ -583,21 +577,22 @@ OSMO_STRLCPY_ARRAY(gsms->src.addr, conn->vsub->msisdn); - LOGP(DLSMS, LOGL_INFO, "RX SMS: Sender: %s, MTI: 0x%02x, VPF: 0x%02x, " - "MR: 0x%02x PID: 0x%02x, DCS: 0x%02x, DA: %s, " - "UserDataLength: 0x%02x, UserData: \"%s\"\n", - vlr_subscr_name(conn->vsub), sms_mti, sms_vpf, gsms->msg_ref, - gsms->protocol_id, gsms->data_coding_scheme, gsms->dst.addr, - gsms->user_data_len, - sms_alphabet == DCS_7BIT_DEFAULT ? gsms->text : - osmo_hexdump(gsms->user_data, gsms->user_data_len)); + LOG_TRANS(trans, LOGL_INFO, + "MO SMS -- MTI: 0x%02x, VPF: 0x%02x, " + "MR: 0x%02x PID: 0x%02x, DCS: 0x%02x, DA: %s, " + "UserDataLength: 0x%02x, UserData: \"%s\"\n", + sms_mti, sms_vpf, gsms->msg_ref, + gsms->protocol_id, gsms->data_coding_scheme, gsms->dst.addr, + gsms->user_data_len, + sms_alphabet == DCS_7BIT_DEFAULT ? gsms->text : + osmo_hexdump(gsms->user_data, gsms->user_data_len)); gsms->validity_minutes = gsm340_validity_period(sms_vpf, sms_vp); /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, gsms); + rc = sms_route_mt_sms(trans, gsms); /* * This SMS got routed through SMPP or no receiver exists. @@ -607,15 +602,15 @@ switch (sms_mti) { case GSM340_SMS_SUBMIT_MS2SC: /* MS is submitting a SMS */ - rc = gsm340_rx_sms_submit(gsms); + rc = gsm340_rx_sms_submit(trans, gsms); break; case GSM340_SMS_COMMAND_MS2SC: case GSM340_SMS_DELIVER_REP_MS2SC: - LOGP(DLSMS, LOGL_NOTICE, "Unimplemented MTI 0x%02x\n", sms_mti); + LOG_TRANS(trans, LOGL_NOTICE, "Unimplemented MTI 0x%02x\n", sms_mti); rc = GSM411_RP_CAUSE_IE_NOTEXIST; break; default: - LOGP(DLSMS, LOGL_NOTICE, "Undefined MTI 0x%02x\n", sms_mti); + LOG_TRANS(trans, LOGL_NOTICE, "Undefined MTI 0x%02x\n", sms_mti); rc = GSM411_RP_CAUSE_IE_NOTEXIST; break; } @@ -646,7 +641,7 @@ { struct msgb *msg = gsm411_msgb_alloc(); - DEBUGP(DLSMS, "TX: SMS RP ACK\n"); + LOG_TRANS(trans, LOGL_DEBUG, "TX: SMS RP ACK\n"); return gsm411_rp_sendmsg(&trans->sms.smr_inst, msg, GSM411_MT_RP_ACK_MT, msg_ref, GSM411_SM_RL_REPORT_REQ); @@ -659,7 +654,7 @@ msgb_tv_put(msg, 1, cause); - LOGP(DLSMS, LOGL_NOTICE, "TX: SMS RP ERROR, cause %d (%s)\n", cause, + LOG_TRANS(trans, LOGL_NOTICE, "TX: SMS RP ERROR, cause %d (%s)\n", cause, get_value_string(gsm411_rp_cause_strs, cause)); return gsm411_rp_sendmsg(&trans->sms.smr_inst, msg, @@ -711,14 +706,14 @@ if (rpud_len) rp_ud = &rph->data[1+src_len+1+dst_len+1]; - DEBUGP(DLSMS, "RX_RP-DATA: src_len=%u, dst_len=%u ud_len=%u\n", + LOG_TRANS(trans, LOGL_DEBUG, "RX_RP-DATA: src_len=%u, dst_len=%u ud_len=%u\n", src_len, dst_len, rpud_len); if (src_len && src) - LOGP(DLSMS, LOGL_ERROR, "RP-DATA (MO) with SRC ?!?\n"); + LOG_TRANS(trans, LOGL_ERROR, "RP-DATA (MO) with SRC ?!?\n"); if (!dst_len || !dst || !rpud_len || !rp_ud) { - LOGP(DLSMS, LOGL_ERROR, + LOG_TRANS(trans, LOGL_ERROR, "RP-DATA (MO) without DST or TPDU ?!?\n"); gsm411_send_rp_error(trans, rph->msg_ref, GSM411_RP_CAUSE_INV_MAND_INF); @@ -727,12 +722,12 @@ msg->l4h = rp_ud; - DEBUGP(DLSMS, "DST(%u,%s)\n", dst_len, osmo_hexdump(dst, dst_len)); + LOG_TRANS(trans, LOGL_DEBUG, "DST(%u,%s)\n", dst_len, osmo_hexdump(dst, dst_len)); return gsm411_rx_rp_ud(msg, trans, rph, dst, dst_len); } -static struct gsm_sms *sms_report_alloc(struct gsm_sms *sms) +static struct gsm_sms *sms_report_alloc(struct gsm_sms *sms, struct gsm_trans *trans) { struct gsm_sms *sms_report; int len; @@ -757,7 +752,7 @@ "id:%.08llu sub:000 dlvrd:000 submit date:YYMMDDhhmm done date:YYMMDDhhmm stat:DELIVRD err:000 text:%.20s", sms->id, sms->text); sms_report->user_data_len = len; - LOGP(DLSMS, LOGL_NOTICE, "%s\n", sms_report->user_data); + LOG_TRANS(trans, LOGL_NOTICE, "%s\n", sms_report->user_data); /* This represents a sms report. */ sms_report->is_report = true; @@ -765,25 +760,24 @@ return sms_report; } -static void sms_status_report(struct gsm_sms *gsms, - struct ran_conn *conn) +static void sms_status_report(struct gsm_sms *gsms, struct gsm_trans *trans) { struct gsm_sms *sms_report; int rc; - sms_report = sms_report_alloc(gsms); + sms_report = sms_report_alloc(gsms, trans); - rc = sms_route_mt_sms(conn, sms_report); + rc = sms_route_mt_sms(trans, sms_report); if (rc < 0) { - LOGP(DLSMS, LOGL_ERROR, - "Failed to send status report! err=%d\n", rc); + LOG_TRANS(trans, LOGL_ERROR, "Failed to send status report! err=%d\n", rc); + return; } /* No route via SMPP, send the GSM 03.40 status-report now. */ if (sms_report->receiver) - gsm340_rx_sms_submit(sms_report); + gsm340_rx_sms_submit(trans, sms_report); - LOGP(DLSMS, LOGL_NOTICE, "Status report has been sent\n"); + LOG_TRANS(trans, LOGL_NOTICE, "Status report has been sent\n"); sms_free(sms_report); } @@ -804,7 +798,7 @@ } if (!sms) { - LOGP(DLSMS, LOGL_ERROR, "RX RP-ACK but no sms in transaction?!?\n"); + LOG_TRANS(trans, LOGL_ERROR, "RX RP-ACK but no sms in transaction?!?\n"); return gsm411_send_rp_error(trans, rph->msg_ref, GSM411_RP_CAUSE_PROTOCOL_ERR); } @@ -815,7 +809,7 @@ send_signal(S_SMS_DELIVERED, trans, sms, 0); if (sms->status_rep_req) - sms_status_report(sms, trans->conn); + sms_status_report(sms, trans); sms_free(sms); trans->sms.sms = NULL; @@ -835,9 +829,8 @@ * successfully receive the SMS. We need to investigate * the cause and take action depending on it */ - LOGP(DLSMS, LOGL_NOTICE, "%s: RX SMS RP-ERROR, cause %d:%d (%s)\n", - vlr_subscr_name(trans->conn->vsub), cause_len, cause, - get_value_string(gsm411_rp_cause_strs, cause)); + LOG_TRANS(trans, LOGL_NOTICE, "RX SMS RP-ERROR, cause %d:%d (%s)\n", + cause_len, cause, get_value_string(gsm411_rp_cause_strs, cause)); if (trans->net->sms_over_gsup) { /* Forward towards SMSC via GSUP */ @@ -845,8 +838,7 @@ } if (!sms) { - LOGP(DLSMS, LOGL_ERROR, - "RX RP-ERR, but no sms in transaction?!?\n"); + LOG_TRANS(trans, LOGL_ERROR, "RX RP-ERR, but no sms in transaction?!?\n"); return -EINVAL; #if 0 return gsm411_send_rp_error(trans, rph->msg_ref, @@ -905,15 +897,15 @@ switch (msg_type) { case GSM411_MT_RP_DATA_MO: - DEBUGP(DLSMS, "RX SMS RP-DATA (MO)\n"); + LOG_TRANS(trans, LOGL_DEBUG, "RX SMS RP-DATA (MO)\n"); rc = gsm411_rx_rp_data(msg, trans, rp_data); break; case GSM411_MT_RP_SMMA_MO: - DEBUGP(DLSMS, "RX SMS RP-SMMA\n"); + LOG_TRANS(trans, LOGL_DEBUG, "RX SMS RP-SMMA\n"); rc = gsm411_rx_rp_smma(msg, trans, rp_data); break; default: - LOGP(DLSMS, LOGL_NOTICE, "Invalid RP type 0x%02x\n", msg_type); + LOG_TRANS(trans, LOGL_NOTICE, "Invalid RP type 0x%02x\n", msg_type); rc = -EINVAL; break; } @@ -931,15 +923,15 @@ switch (msg_type) { case GSM411_MT_RP_ACK_MO: - DEBUGP(DLSMS, "RX SMS RP-ACK (MO)\n"); + LOG_TRANS(trans, LOGL_DEBUG, "RX SMS RP-ACK (MO)\n"); rc = gsm411_rx_rp_ack(trans, rp_data); break; case GSM411_MT_RP_ERROR_MO: - DEBUGP(DLSMS, "RX SMS RP-ERROR (MO)\n"); + LOG_TRANS(trans, LOGL_DEBUG, "RX SMS RP-ERROR (MO)\n"); rc = gsm411_rx_rp_error(trans, rp_data); break; default: - LOGP(DLSMS, LOGL_NOTICE, "Invalid RP type 0x%02x\n", msg_type); + LOG_TRANS(trans, LOGL_NOTICE, "Invalid RP type 0x%02x\n", msg_type); rc = -EINVAL; break; } @@ -967,7 +959,7 @@ rc = gsm411_rx_rl_report(msg, gh, trans); break; default: - LOGP(DLSMS, LOGL_NOTICE, "Unhandled SM-RL message 0x%x\n", msg_type); + LOG_TRANS(trans, LOGL_NOTICE, "Unhandled SM-RL message 0x%x\n", msg_type); rc = -EINVAL; } @@ -988,21 +980,21 @@ switch (msg_type) { case GSM411_MNSMS_EST_IND: case GSM411_MNSMS_DATA_IND: - DEBUGP(DLSMS, "MNSMS-DATA/EST-IND\n"); + LOG_TRANS(trans, LOGL_DEBUG, "MNSMS-DATA/EST-IND\n"); rc = gsm411_smr_recv(&trans->sms.smr_inst, msg_type, msg); break; case GSM411_MNSMS_ERROR_IND: if (gh) - DEBUGP(DLSMS, "MNSMS-ERROR-IND, cause %d (%s)\n", + LOG_TRANS(trans, LOGL_DEBUG, "MNSMS-ERROR-IND, cause %d (%s)\n", gh->data[0], get_value_string(gsm411_cp_cause_strs, gh->data[0])); else - DEBUGP(DLSMS, "MNSMS-ERROR-IND, no cause\n"); + LOG_TRANS(trans, LOGL_DEBUG, "MNSMS-ERROR-IND, no cause\n"); rc = gsm411_smr_recv(&trans->sms.smr_inst, msg_type, msg); break; default: - LOGP(DLSMS, LOGL_NOTICE, "Unhandled MNCCSMS msg 0x%x\n", msg_type); + LOG_TRANS(trans, LOGL_NOTICE, "Unhandled MNCCSMS msg 0x%x\n", msg_type); rc = -EINVAL; } @@ -1015,7 +1007,7 @@ /* Allocate a new transaction */ struct gsm_trans *trans = trans_alloc(net, vsub, GSM48_PDISC_SMS, tid, new_callref++); if (!trans) { - LOGP(DLSMS, LOGL_ERROR, "No memory for transaction\n"); + LOG_TRANS(trans, LOGL_ERROR, "No memory for transaction\n"); return NULL; } @@ -1058,15 +1050,13 @@ struct vlr_subscr *vsub) { struct ran_conn *conn; - struct gsm_trans *trans; + struct gsm_trans *trans = NULL; int tid; - LOGP(DLSMS, LOGL_INFO, "Going to send a MT SMS\n"); - /* Generate a new transaction ID */ tid = trans_assign_trans_id(net, vsub, GSM48_PDISC_SMS); if (tid == -1) { - LOGP(DLSMS, LOGL_ERROR, "No available transaction IDs\n"); + LOG_TRANS(trans, LOGL_ERROR, "No available transaction IDs\n"); return NULL; } @@ -1078,9 +1068,11 @@ if (!trans) return NULL; + LOG_TRANS(trans, LOGL_INFO, "Going to send a MT SMS\n"); + /* Assign a unique SM-RP Message Reference */ if (gsm411_assign_sm_rp_mr(trans) != 0) { - LOGP(DLSMS, LOGL_ERROR, "Failed to assign SM-RP-MR\n"); + LOG_TRANS(trans, LOGL_ERROR, "Failed to assign SM-RP-MR\n"); trans_free(trans); return NULL; } @@ -1138,10 +1130,10 @@ if (sms->is_report) { /* generate the 03.40 SMS-STATUS-REPORT TPDU */ - rc = gsm340_gen_sms_status_report_tpdu(msg, sms); + rc = gsm340_gen_sms_status_report_tpdu(trans, msg, sms); } else { /* generate the 03.40 SMS-DELIVER TPDU */ - rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + rc = gsm340_gen_sms_deliver_tpdu(trans, msg, sms); } if (rc < 0) { send_signal(S_SMS_UNKNOWN_ERROR, trans, sms, 0); @@ -1216,16 +1208,13 @@ return -EIO; /* FIXME: send some error message */ - DEBUGP(DLSMS, "receiving data (trans_id=%x, msg_type=%s)\n", transaction_id, - gsm48_pdisc_msgtype_name(gsm48_hdr_pdisc(gh), gsm48_hdr_msg_type(gh))); - trans = trans_find_by_id(conn, GSM48_PDISC_SMS, transaction_id); /* * A transaction we created but don't know about? */ if (!trans && (transaction_id & 0x8) == 0) { - LOGP(DLSMS, LOGL_ERROR, "trans_id=%x allocated by us but known " + LOG_TRANS(trans, LOGL_ERROR, "trans_id=%x allocated by us but known " "to us anymore. We are ignoring it, maybe a CP-ERROR " "from a MS?\n", transaction_id); @@ -1246,6 +1235,9 @@ cm_service_request_concludes(conn, msg); } + LOG_TRANS(trans, LOGL_DEBUG, "receiving SMS message %s\n", + gsm48_pdisc_msgtype_name(gsm48_hdr_pdisc(gh), gsm48_hdr_msg_type(gh))); + /* 5.4: For MO, if a CP-DATA is received for a new * transaction, equals reception of an implicit * last CP-ACK for previous transaction */ @@ -1263,7 +1255,7 @@ if (!ptrans) continue; - DEBUGP(DLSMS, "Implicit CP-ACK for trans_id=%x\n", i); + LOG_TRANS(ptrans, LOGL_DEBUG, "Implicit CP-ACK for trans_id=%x\n", i); /* Finish it for good */ trans_free(ptrans); @@ -1291,7 +1283,7 @@ trans->sms.smc_inst.mm_send = NULL; if (trans->sms.sms) { - LOGP(DLSMS, LOGL_ERROR, "Transaction contains SMS.\n"); + LOG_TRANS(trans, LOGL_ERROR, "Freeing transaction that still contains an SMS -- discarding\n"); send_signal(S_SMS_UNKNOWN_ERROR, trans, trans->sms.sms, 0); sms_free(trans->sms.sms); trans->sms.sms = NULL; @@ -1316,7 +1308,7 @@ sms = trans->sms.sms; if (!sms) { - LOGP(DLSMS, LOGL_ERROR, "SAPI Reject but no SMS.\n"); + LOG_TRANS(trans, LOGL_ERROR, "SAPI Reject but no SMS.\n"); continue; } diff --git a/src/libmsc/gsm_04_11_gsup.c b/src/libmsc/gsm_04_11_gsup.c index eb092ae..cd83b41 100644 --- a/src/libmsc/gsm_04_11_gsup.c +++ b/src/libmsc/gsm_04_11_gsup.c @@ -58,7 +58,7 @@ /* Associate logging messages with this subscriber */ log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - LOGP(DLSMS, LOGL_DEBUG, "TX GSUP MO-forwardSM-Req\n"); + LOG_TRANS(trans, LOGL_DEBUG, "TX GSUP MO-forwardSM-Req\n"); /* Assign SM-RP-MR to transaction state */ trans->sms.sm_rp_mr = sm_rp_mr; @@ -67,7 +67,7 @@ bcd_len = gsm48_encode_bcd_number(bcd_buf, sizeof(bcd_buf), 0, trans->vsub->msisdn); if (bcd_len <= 0 || bcd_len > sizeof(bcd_buf)) { - LOGP(DLSMS, LOGL_ERROR, "Failed to encode subscriber's MSISDN\n"); + LOG_TRANS(trans, LOGL_ERROR, "Failed to encode subscriber's MSISDN\n"); return -EINVAL; } @@ -99,7 +99,7 @@ /* Associate logging messages with this subscriber */ log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - LOGP(DLSMS, LOGL_DEBUG, "TX GSUP READY-FOR-SM Req\n"); + LOG_TRANS(trans, LOGL_DEBUG, "TX GSUP READY-FOR-SM Req\n"); /* Assign SM-RP-MR to transaction state */ trans->sms.sm_rp_mr = sm_rp_mr; @@ -147,9 +147,6 @@ OSMO_ASSERT(0); } - LOGP(DLSMS, LOGL_DEBUG, "RX %s-%s\n", msg_name, - msg_is_err ? "Err" : "Res"); - /* Make sure that 'SMS over GSUP' is expected */ if (!net->sms_over_gsup) { /* TODO: notify sender about that? */ @@ -173,6 +170,8 @@ return -EIO; /* TODO: notify sender about that? */ } + LOG_TRANS(trans, LOGL_DEBUG, "RX %s-%s\n", msg_name, msg_is_err ? "Err" : "Res"); + /* Send either RP-ERROR, or RP-ACK */ if (msg_is_err) { /* TODO: handle optional SM-RP-UI payload (requires API change) */ @@ -198,7 +197,7 @@ /* Associate logging messages with this subscriber */ log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - LOGP(DLSMS, LOGL_DEBUG, "TX MT-forwardSM-Res\n"); + LOG_TRANS(trans, LOGL_DEBUG, "TX MT-forwardSM-Res\n"); /* Initialize a new GSUP message */ gsup_sm_msg_init(&gsup_msg, OSMO_GSUP_MSGT_MT_FORWARD_SM_RESULT, @@ -215,7 +214,7 @@ /* Associate logging messages with this subscriber */ log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - LOGP(DLSMS, LOGL_DEBUG, "TX MT-forwardSM-Err\n"); + LOG_TRANS(trans, LOGL_DEBUG, "TX MT-forwardSM-Err\n"); /* Initialize a new GSUP message */ gsup_sm_msg_init(&gsup_msg, OSMO_GSUP_MSGT_MT_FORWARD_SM_ERROR, diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c index c133656..25fe4aa 100644 --- a/src/libmsc/gsm_09_11.c +++ b/src/libmsc/gsm_09_11.c @@ -60,8 +60,7 @@ if (trans->net->ncss_guard_timeout == 0) return; - LOGP(DMM, LOGL_NOTICE, "SS/USSD session timeout, releasing " - "transaction (trans=%p, callref=%x)\n", trans, trans->callref); + LOG_TRANS(trans, LOGL_NOTICE, "SS/USSD session timeout, releasing\n"); /* Indicate connection release to subscriber (if active) */ if (trans->conn != NULL) { @@ -103,9 +102,6 @@ /* Associate logging messages with this subscriber */ log_set_context(LOG_CTX_VLR_SUBSCR, conn->vsub); - DEBUGP(DMM, "Received SS/USSD data (trans_id=%x, msg_type=%s)\n", - tid, gsm48_pdisc_msgtype_name(GSM48_PDISC_NC_SS, msg_type)); - /* Reuse existing transaction, or create a new one */ trans = trans_find_by_id(conn, GSM48_PDISC_NC_SS, tid); if (!trans) { @@ -121,20 +117,18 @@ * a supplementary service. */ if (msg_type != GSM0480_MTYPE_REGISTER) { - LOGP(DMM, LOGL_ERROR, "Unexpected message (msg_type=%s), " - "transaction is not allocated yet\n", - gsm48_pdisc_msgtype_name(GSM48_PDISC_NC_SS, msg_type)); + LOG_TRANS(trans, LOGL_ERROR, "Rx wrong SS/USSD message type for new transaction: %s\n", + gsm48_pdisc_msgtype_name(GSM48_PDISC_NC_SS, msg_type)); gsm48_tx_simple(conn, GSM48_PDISC_NC_SS | (tid << 4), GSM0480_MTYPE_RELEASE_COMPLETE); return -EINVAL; } - DEBUGP(DMM, " -> (new transaction)\n"); trans = trans_alloc(conn->network, conn->vsub, GSM48_PDISC_NC_SS, tid, new_callref++); if (!trans) { - LOGP(DMM, LOGL_ERROR, " -> No memory for trans\n"); + LOG_TRANS(trans, LOGL_ERROR, " -> No memory for trans\n"); gsm48_tx_simple(conn, GSM48_PDISC_NC_SS | (tid << 4), GSM0480_MTYPE_RELEASE_COMPLETE); @@ -153,6 +147,9 @@ cm_service_request_concludes(conn, msg); } + LOG_TRANS(trans, LOGL_DEBUG, "Received SS/USSD msg %s\n", + gsm48_pdisc_msgtype_name(GSM48_PDISC_NC_SS, msg_type)); + /* (Re)schedule the inactivity timer */ if (conn->network->ncss_guard_timeout > 0) { osmo_timer_schedule(&trans->ss.timer_guard, @@ -163,16 +160,15 @@ rc = gsm0480_extract_ie_by_tag(gh, msgb_l3len(msg), &facility_ie, &facility_ie_len, GSM0480_IE_FACILITY); if (rc) { - LOGP(DMM, LOGL_ERROR, "GSM 04.80 message parsing error, " - "couldn't extract Facility IE\n"); + LOG_TRANS(trans, LOGL_ERROR, "GSM 04.80 message parsing error, couldn't extract Facility IE\n"); goto error; } /* Facility IE is optional for RELEASE COMPLETE */ if (msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) { if (!facility_ie || facility_ie_len < 2) { - LOGP(DMM, LOGL_ERROR, "GSM 04.80 message parsing error, " - "missing mandatory Facility IE\n"); + LOG_TRANS(trans, LOGL_ERROR, "GSM 04.80 message parsing error," + " missing mandatory Facility IE\n"); rc = -EINVAL; goto error; } @@ -211,7 +207,7 @@ /* Allocate GSUP message buffer */ gsup_msgb = osmo_gsup_client_msgb_alloc(); if (!gsup_msgb) { - LOGP(DMM, LOGL_ERROR, "Couldn't allocate GSUP message\n"); + LOG_TRANS(trans, LOGL_ERROR, "Couldn't allocate GSUP message\n"); rc = -ENOMEM; goto error; } @@ -219,14 +215,14 @@ /* Encode GSUP message */ rc = osmo_gsup_encode(gsup_msgb, &gsup_msg); if (rc) { - LOGP(DMM, LOGL_ERROR, "Couldn't encode GSUP message\n"); + LOG_TRANS(trans, LOGL_ERROR, "Couldn't encode GSUP message\n"); goto error; } /* Finally send */ rc = osmo_gsup_client_send(conn->network->vlr->gsup_client, gsup_msgb); if (rc) { - LOGP(DMM, LOGL_ERROR, "Couldn't send GSUP message\n"); + LOG_TRANS(trans, LOGL_ERROR, "Couldn't send GSUP message\n"); goto error; } @@ -323,33 +319,37 @@ struct gsm_trans *trans, *transt; int tid; + /* Allocate transaction first, for log context */ + trans = trans_alloc(net, vsub, GSM48_PDISC_NC_SS, + TRANS_ID_UNASSIGNED, gsup_msg->session_id); + + if (!trans) { + LOG_TRANS(trans, LOGL_ERROR, " -> No memory for trans\n"); + return NULL; + } + if (gsup_msg->session_state != OSMO_GSUP_SESSION_STATE_BEGIN) { - LOGP(DMM, LOGL_ERROR, "Received non-BEGIN message " + LOG_TRANS(trans, LOGL_ERROR, "Received non-BEGIN message " "for non-existing transaction\n"); + trans_free(trans); return NULL; } if (!gsup_msg->ss_info || gsup_msg->ss_info_len < 2) { - LOGP(DMM, LOGL_ERROR, "Missing mandatory Facility IE\n"); + LOG_TRANS(trans, LOGL_ERROR, "Missing mandatory Facility IE\n"); + trans_free(trans); return NULL; } /* If subscriber is not "attached" */ if (!vsub->cgi.lai.lac) { - LOGP(DMM, LOGL_ERROR, "Network-originated session " + LOG_TRANS(trans, LOGL_ERROR, "Network-originated session " "rejected - subscriber is not attached\n"); + trans_free(trans); return NULL; } - DEBUGP(DMM, "Establishing network-originated session\n"); - - /* Allocate a new transaction */ - trans = trans_alloc(net, vsub, GSM48_PDISC_NC_SS, - TRANS_ID_UNASSIGNED, gsup_msg->session_id); - if (!trans) { - LOGP(DMM, LOGL_ERROR, " -> No memory for trans\n"); - return NULL; - } + LOG_TRANS(trans, LOGL_DEBUG, "Establishing network-originated session\n"); /* Count active NC SS/USSD sessions */ osmo_counter_inc(net->active_nc_ss); @@ -357,7 +357,7 @@ /* Assign transaction ID */ tid = trans_assign_trans_id(trans->net, trans->vsub, GSM48_PDISC_NC_SS); if (tid < 0) { - LOGP(DMM, LOGL_ERROR, "No free transaction ID\n"); + LOG_TRANS(trans, LOGL_ERROR, "No free transaction ID\n"); /* TODO: inform HLR about this */ /* TODO: release connection with subscriber */ trans->callref = 0; @@ -379,7 +379,7 @@ return trans; } - DEBUGP(DMM, "Triggering Paging Request\n"); + LOG_TRANS(trans, LOGL_DEBUG, "Triggering Paging Request\n"); /* Find transaction with this subscriber already paging */ llist_for_each_entry(transt, &net->trans_list, entry) { @@ -387,7 +387,7 @@ if (transt == trans || transt->vsub != vsub) continue; - LOGP(DMM, LOGL_ERROR, "Paging already started, " + LOG_TRANS(trans, LOGL_ERROR, "Paging already started, " "rejecting message...\n"); trans_free(trans); return NULL; @@ -398,7 +398,7 @@ &handle_paging_event, trans, "GSM 09.11 SS/USSD", SGSAP_SERV_IND_CS_CALL); if (!trans->paging_request) { - LOGP(DMM, LOGL_ERROR, "Failed to allocate paging token\n"); + LOG_TRANS(trans, LOGL_ERROR, "Failed to allocate paging token\n"); trans_free(trans); return NULL; } @@ -510,7 +510,7 @@ /* Missing or incorrect session state */ case OSMO_GSUP_SESSION_STATE_NONE: default: - LOGP(DMM, LOGL_ERROR, "Unexpected session state %d\n", + LOG_TRANS(trans, LOGL_ERROR, "Unexpected session state %d\n", gsup_msg->session_state); /* FIXME: send ERROR back to the HLR */ msgb_free(ss_msg); @@ -520,7 +520,7 @@ /* Facility IE is optional only for RELEASE COMPLETE */ if (gh->msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) { if (!gsup_msg->ss_info || gsup_msg->ss_info_len < 2) { - LOGP(DMM, LOGL_ERROR, "Missing mandatory Facility IE " + LOG_TRANS(trans, LOGL_ERROR, "Missing mandatory Facility IE " "for mapped 0x%02x message\n", gh->msg_type); /* FIXME: send ERROR back to the HLR */ msgb_free(ss_msg); diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c index b38c152..665ad46 100644 --- a/src/libmsc/transaction.c +++ b/src/libmsc/transaction.c @@ -110,18 +110,14 @@ uint8_t protocol, uint8_t trans_id, uint32_t callref) { - struct gsm_trans *trans; + struct gsm_trans *trans = NULL; /* (NULL for LOG_TRANS() before allocation) */ /* a valid subscriber is indispensable */ if (vsub == NULL) { - LOGP(DVLR, LOGL_ERROR, - "unable to alloc transaction, invalid subscriber (NULL)\n"); + LOG_TRANS(trans, LOGL_ERROR, "unable to alloc transaction, invalid subscriber (NULL)\n"); return NULL; } - DEBUGP(DCC, "(ti %02x sub %s callref %x) New transaction\n", - trans_id, vlr_subscr_name(vsub), callref); - trans = talloc_zero(tall_trans_ctx, struct gsm_trans); if (!trans) return NULL; @@ -135,6 +131,7 @@ trans->net = net; llist_add_tail(&trans->entry, &net->trans_list); + LOG_TRANS(trans, LOGL_DEBUG, "New transaction\n"); return trans; } @@ -146,6 +143,8 @@ enum ran_conn_use conn_usage_token; struct ran_conn *conn; + LOG_TRANS(trans, LOGL_DEBUG, "Freeing transaction\n"); + switch (trans->protocol) { case GSM48_PDISC_CC: _gsm48_cc_trans_free(trans); diff --git a/tests/msc_vlr/msc_vlr_test_call.err b/tests/msc_vlr/msc_vlr_test_call.err index 4f0f4b5..e364162 100644 --- a/tests/msc_vlr/msc_vlr_test_call.err +++ b/tests/msc_vlr/msc_vlr_test_call.err @@ -265,46 +265,46 @@ DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0xa: dtap,cm_service) DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) DCC Unknown transaction ID 8, creating new trans. -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref 80000001) New transaction DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 + CC: now used by 3 (attached,conn,CC) +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x80000001 tid-8) New transaction DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + trans_cc == 3 (0x1a: dtap,cm_service,trans_cc) DMM IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: rx msg GSM48_MT_CC_SETUP: received_cm_service_request changes to false DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - cm_service == 2 (0x12: dtap,trans_cc) -DCC (sub 42342) starting guard timer with 180 seconds -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state NULL -> INITIATED -DCC Subscriber IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (42342) sends SETUP to 123 -DMNCC transmit message MNCC_SETUP_IND -DCC Sending 'MNCC_SETUP_IND' to MNCC. +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) rx SETUP in state NULL +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) starting guard timer with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) new state NULL -> INITIATED +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) SETUP to 123 +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) tx MNCC_SETUP_IND MSC --> MNCC: callref 0x80000001: MNCC_SETUP_IND DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x10: trans_cc) - MNCC says that's fine -DMNCC receive message MNCC_CALL_PROC_REQ -DCC (sub 42342) stopping pending guard timer -DCC (sub 42342) starting guard timer with 180 seconds -DCC (ti 08 sub 42342) Received 'MNCC_CALL_PROC_REQ' from MNCC in state 1 (INITIATED) -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state INITIATED -> MO_CALL_PROC +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) rx MNCC_CALL_PROC_REQ +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) stopping pending guard timer +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) starting guard timer with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) rx MNCC_CALL_PROC_REQ in state INITIATED +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) new state INITIATED -> MO_CALL_PROC DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_CALL_PROC: 8302 - DTAP matches expected message MS <--Call Assignment-- MSC: subscr=IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref=0x80000001 - Total time passed: 1.000023 s - The other call leg got established (not shown here), MNCC tells us so -DMNCC receive message MNCC_ALERT_REQ -DCC (sub 42342) stopping pending guard timer -DCC (sub 42342) starting guard timer with 180 seconds -DCC (ti 08 sub 42342) Received 'MNCC_ALERT_REQ' from MNCC in state 3 (MO_CALL_PROC) -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state MO_CALL_PROC -> CALL_DELIVERED +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) rx MNCC_ALERT_REQ +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) stopping pending guard timer +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) starting guard timer with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) rx MNCC_ALERT_REQ in state MO_CALL_PROC +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) new state MO_CALL_PROC -> CALL_DELIVERED DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_ALERTING: 8301 - DTAP matches expected message -DMNCC receive message MNCC_SETUP_RSP -DCC (sub 42342) stopping pending guard timer -DCC (sub 42342) starting guard timer with 180 seconds -DCC (ti 08 sub 42342) Received 'MNCC_SETUP_RSP' from MNCC in state 4 (CALL_DELIVERED) -DCC starting timer T313 with 30 seconds -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state CALL_DELIVERED -> CONNECT_IND +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) rx MNCC_SETUP_RSP +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) stopping pending guard timer +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) starting guard timer with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) rx MNCC_SETUP_RSP in state CALL_DELIVERED +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) starting timer T313 with 30 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) new state CALL_DELIVERED -> CONNECT_IND DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_CONNECT: 8307 - DTAP matches expected message @@ -312,11 +312,11 @@ MSC <--UTRAN-Iu-- MS: GSM48_MT_CC_CONNECT_ACK DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x12: dtap,trans_cc) DRLL Dispatching 04.08 message GSM48_MT_CC_CONNECT_ACK (0x3:0xf) -DCC stopping pending timer T313 -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state CONNECT_IND -> ACTIVE -DCC (sub 42342) stopping pending guard timer -DMNCC transmit message MNCC_SETUP_COMPL_IND -DCC Sending 'MNCC_SETUP_COMPL_IND' to MNCC. +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) rx CONNECT_ACK in state CONNECT_IND +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) stopping pending timer T313 +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) new state CONNECT_IND -> ACTIVE +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) stopping pending guard timer +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) tx MNCC_SETUP_COMPL_IND MSC --> MNCC: callref 0x80000001: MNCC_SETUP_COMPL_IND DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x10: trans_cc) @@ -328,30 +328,31 @@ MSC <--UTRAN-Iu-- MS: GSM48_MT_CC_DISCONNECT DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x12: dtap,trans_cc) DRLL Dispatching 04.08 message GSM48_MT_CC_DISCONNECT (0x3:0x25) -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state ACTIVE -> DISCONNECT_IND -DMNCC transmit message MNCC_DISC_IND -DCC Sending 'MNCC_DISC_IND' to MNCC. +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) rx DISCONNECT in state ACTIVE +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) new state ACTIVE -> DISCONNECT_IND +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) tx MNCC_DISC_IND MSC --> MNCC: callref 0x80000001: MNCC_DISC_IND DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x10: trans_cc) -DMNCC receive message MNCC_REL_REQ -DCC (sub 42342) starting guard timer with 180 seconds -DCC (ti 08 sub 42342) Received 'MNCC_REL_REQ' from MNCC in state 12 (DISCONNECT_IND) -DCC starting timer T308 with 10 seconds -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state DISCONNECT_IND -> RELEASE_REQ +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) rx MNCC_REL_REQ +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) starting guard timer with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) rx MNCC_REL_REQ in state DISCONNECT_IND +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) starting timer T308 with 10 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) new state DISCONNECT_IND -> RELEASE_REQ DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_RELEASE: 832d - DTAP matches expected message MSC <--UTRAN-Iu-- MS: GSM48_MT_CC_RELEASE_COMPL DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x12: dtap,trans_cc) DRLL Dispatching 04.08 message GSM48_MT_CC_RELEASE_COMPL (0x3:0x2a) -DCC stopping pending timer T308 -DMNCC transmit message MNCC_REL_CNF -DCC Sending 'MNCC_REL_CNF' to MNCC. +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) rx RELEASE_COMPL in state RELEASE_REQ +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) stopping pending timer T308 +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000001 tid-8) tx MNCC_REL_CNF MSC --> MNCC: callref 0x80000001: MNCC_REL_CNF +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x0 tid-8) Freeing transaction MS <--Call Release-- MSC: subscr=IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref=0x0 -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state RELEASE_REQ -> NULL -DCC (sub 42342) stopping pending guard timer +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x0 tid-8) new state RELEASE_REQ -> NULL +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x0 tid-8) stopping pending guard timer DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - CC: now used by 2 (attached,conn) DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - trans_cc == 1 (0x2: dtap) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING @@ -559,10 +560,9 @@ DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - standard_lu: now used by 1 (attached) --- - after a while, MNCC asks us to setup a call, causing Paging -DMNCC receive message MNCC_SETUP_REQ DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 + mncc_tx_to_cc: now used by 2 (attached,mncc_tx_to_cc) -DCC (ti ff sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref 423) New transaction DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 + CC: now used by 3 (attached,mncc_tx_to_cc,CC) +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x423 tid-255) New transaction DMM Subscriber IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 not paged yet, start paging. UTRAN-Iu sends out paging request to IMSI 901700000010650, TMSI 0x03020100, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -643,10 +643,10 @@ DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (event=0) DPAG Calling paging cbfn. -DCC Paging subscr 42342 succeeded! +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x423 tid-255,PAGING) Paging succeeded DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + trans_cc == 1 (0x10: trans_cc) -DCC starting timer T303 with 30 seconds -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state NULL -> CALL_PRESENT +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) starting timer T303 with 30 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) new state NULL -> CALL_PRESENT DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_SETUP: 0305 - DTAP matches expected message @@ -657,12 +657,12 @@ MSC <--UTRAN-Iu-- MS: GSM48_MT_CC_CALL_CONF DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x12: dtap,trans_cc) DRLL Dispatching 04.08 message GSM48_MT_CC_CALL_CONF (0x3:0x8) -DCC stopping pending timer T303 -DCC starting timer T310 with 30 seconds -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state CALL_PRESENT -> MO_TERM_CALL_CONF +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) rx CALL_CONF in state CALL_PRESENT +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) stopping pending timer T303 +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) starting timer T310 with 30 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) new state CALL_PRESENT -> MO_TERM_CALL_CONF MS <--Call Assignment-- MSC: subscr=IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref=0x423 -DMNCC transmit message MNCC_CALL_CONF_IND -DCC Sending 'MNCC_CALL_CONF_IND' to MNCC. +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) tx MNCC_CALL_CONF_IND MSC --> MNCC: callref 0x423: MNCC_CALL_CONF_IND DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING @@ -671,11 +671,11 @@ MSC <--UTRAN-Iu-- MS: GSM48_MT_CC_ALERTING DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x12: dtap,trans_cc) DRLL Dispatching 04.08 message GSM48_MT_CC_ALERTING (0x3:0x1) -DCC stopping pending timer T310 -DCC starting timer T301 with 180 seconds -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state MO_TERM_CALL_CONF -> CALL_RECEIVED -DMNCC transmit message MNCC_ALERT_IND -DCC Sending 'MNCC_ALERT_IND' to MNCC. +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) rx ALERTING in state MO_TERM_CALL_CONF +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) stopping pending timer T310 +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) starting timer T301 with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) new state MO_TERM_CALL_CONF -> CALL_RECEIVED +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) tx MNCC_ALERT_IND MSC --> MNCC: callref 0x423: MNCC_ALERT_IND DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x10: trans_cc) @@ -683,18 +683,18 @@ MSC <--UTRAN-Iu-- MS: GSM48_MT_CC_CONNECT DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x12: dtap,trans_cc) DRLL Dispatching 04.08 message GSM48_MT_CC_CONNECT (0x3:0x7) -DCC stopping pending timer T301 -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state CALL_RECEIVED -> CONNECT_REQUEST -DMNCC transmit message MNCC_SETUP_CNF -DCC Sending 'MNCC_SETUP_CNF' to MNCC. +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) rx CONNECT in state CALL_RECEIVED +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) stopping pending timer T301 +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) new state CALL_RECEIVED -> CONNECT_REQUEST +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) tx MNCC_SETUP_CNF MSC --> MNCC: callref 0x423: MNCC_SETUP_CNF DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x10: trans_cc) -DMNCC receive message MNCC_SETUP_COMPL_REQ -DCC (sub 42342) starting guard timer with 180 seconds -DCC (ti 00 sub 42342) Received 'MNCC_SETUP_COMPL_REQ' from MNCC in state 8 (CONNECT_REQUEST) -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state CONNECT_REQUEST -> ACTIVE -DCC (sub 42342) stopping pending guard timer +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) rx MNCC_SETUP_COMPL_REQ +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) starting guard timer with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) rx MNCC_SETUP_COMPL_REQ in state CONNECT_REQUEST +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) new state CONNECT_REQUEST -> ACTIVE +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) stopping pending guard timer DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_CONNECT_ACK: 030f - DTAP matches expected message @@ -706,30 +706,31 @@ MSC <--UTRAN-Iu-- MS: GSM48_MT_CC_DISCONNECT DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x12: dtap,trans_cc) DRLL Dispatching 04.08 message GSM48_MT_CC_DISCONNECT (0x3:0x25) -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state ACTIVE -> DISCONNECT_IND -DMNCC transmit message MNCC_DISC_IND -DCC Sending 'MNCC_DISC_IND' to MNCC. +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) rx DISCONNECT in state ACTIVE +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) new state ACTIVE -> DISCONNECT_IND +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) tx MNCC_DISC_IND MSC --> MNCC: callref 0x423: MNCC_DISC_IND DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x10: trans_cc) -DMNCC receive message MNCC_REL_REQ -DCC (sub 42342) starting guard timer with 180 seconds -DCC (ti 00 sub 42342) Received 'MNCC_REL_REQ' from MNCC in state 12 (DISCONNECT_IND) -DCC starting timer T308 with 10 seconds -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state DISCONNECT_IND -> RELEASE_REQ +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) rx MNCC_REL_REQ +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) starting guard timer with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) rx MNCC_REL_REQ in state DISCONNECT_IND +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) starting timer T308 with 10 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) new state DISCONNECT_IND -> RELEASE_REQ DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_RELEASE: 032d - DTAP matches expected message MSC <--UTRAN-Iu-- MS: GSM48_MT_CC_RELEASE_COMPL DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x12: dtap,trans_cc) DRLL Dispatching 04.08 message GSM48_MT_CC_RELEASE_COMPL (0x3:0x2a) -DCC stopping pending timer T308 -DMNCC transmit message MNCC_REL_CNF -DCC Sending 'MNCC_REL_CNF' to MNCC. +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) rx RELEASE_COMPL in state RELEASE_REQ +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) stopping pending timer T308 +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) tx MNCC_REL_CNF MSC --> MNCC: callref 0x423: MNCC_REL_CNF +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x0 tid-0) Freeing transaction MS <--Call Release-- MSC: subscr=IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref=0x0 -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state RELEASE_REQ -> NULL -DCC (sub 42342) stopping pending guard timer +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x0 tid-0) new state RELEASE_REQ -> NULL +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x0 tid-0) stopping pending guard timer DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - CC: now used by 2 (attached,conn) DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - trans_cc == 1 (0x2: dtap) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING @@ -937,10 +938,9 @@ DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - standard_lu: now used by 1 (attached) --- - after a while, MNCC asks us to setup a call, causing Paging -DMNCC receive message MNCC_SETUP_REQ DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 + mncc_tx_to_cc: now used by 2 (attached,mncc_tx_to_cc) -DCC (ti ff sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref 423) New transaction DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 + CC: now used by 3 (attached,mncc_tx_to_cc,CC) +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x423 tid-255) New transaction DMM Subscriber IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 not paged yet, start paging. UTRAN-Iu sends out paging request to IMSI 901700000010650, TMSI 0x03020100, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -1021,10 +1021,10 @@ DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (event=0) DPAG Calling paging cbfn. -DCC Paging subscr 42342 succeeded! +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x423 tid-255,PAGING) Paging succeeded DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + trans_cc == 1 (0x10: trans_cc) -DCC starting timer T303 with 30 seconds -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state NULL -> CALL_PRESENT +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) starting timer T303 with 30 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) new state NULL -> CALL_PRESENT DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_SETUP: 0305 - DTAP matches expected message @@ -1035,12 +1035,12 @@ MSC <--UTRAN-Iu-- MS: GSM48_MT_CC_CALL_CONF DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x12: dtap,trans_cc) DRLL Dispatching 04.08 message GSM48_MT_CC_CALL_CONF (0x3:0x8) -DCC stopping pending timer T303 -DCC starting timer T310 with 30 seconds -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state CALL_PRESENT -> MO_TERM_CALL_CONF +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) rx CALL_CONF in state CALL_PRESENT +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) stopping pending timer T303 +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) starting timer T310 with 30 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) new state CALL_PRESENT -> MO_TERM_CALL_CONF MS <--Call Assignment-- MSC: subscr=IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref=0x423 -DMNCC transmit message MNCC_CALL_CONF_IND -DCC Sending 'MNCC_CALL_CONF_IND' to MNCC. +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) tx MNCC_CALL_CONF_IND MSC --> MNCC: callref 0x423: MNCC_CALL_CONF_IND DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING @@ -1049,11 +1049,11 @@ MSC <--UTRAN-Iu-- MS: GSM48_MT_CC_ALERTING DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x12: dtap,trans_cc) DRLL Dispatching 04.08 message GSM48_MT_CC_ALERTING (0x3:0x1) -DCC stopping pending timer T310 -DCC starting timer T301 with 180 seconds -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state MO_TERM_CALL_CONF -> CALL_RECEIVED -DMNCC transmit message MNCC_ALERT_IND -DCC Sending 'MNCC_ALERT_IND' to MNCC. +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) rx ALERTING in state MO_TERM_CALL_CONF +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) stopping pending timer T310 +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) starting timer T301 with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) new state MO_TERM_CALL_CONF -> CALL_RECEIVED +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) tx MNCC_ALERT_IND MSC --> MNCC: callref 0x423: MNCC_ALERT_IND DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x10: trans_cc) @@ -1064,22 +1064,22 @@ DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + release == 2 (0x110: trans_cc,release) DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 + vlr_subscr_cancel_attach_fsm: now used by 4 (attached,CC,conn,vlr_subscr_cancel_attach_fsm) DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - vlr_subscr_cancel_attach_fsm: now used by 3 (attached,CC,conn) -DCC stopping pending timer T301 +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) Freeing transaction +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) stopping pending timer T301 MS <--Call Release-- MSC: subscr=IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref=0x423 -DMNCC receive message MNCC_REL_REQ -DCC (sub 42342) starting guard timer with 180 seconds -DCC (ti 00 sub 42342) Received 'MNCC_REL_REQ' from MNCC in state 7 (CALL_RECEIVED) -DCC starting timer T308 with 10 seconds -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state CALL_RECEIVED -> RELEASE_REQ +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) rx MNCC_REL_REQ +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) starting guard timer with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) rx MNCC_REL_REQ in state CALL_RECEIVED +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) starting timer T308 with 10 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) new state CALL_RECEIVED -> RELEASE_REQ DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_RELEASE: 032d - DTAP matches expected message -DMNCC transmit message MNCC_REL_CNF -DCC Sending 'MNCC_REL_CNF' to MNCC. +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) tx MNCC_REL_CNF MSC --> MNCC: callref 0x423: MNCC_REL_CNF -DCC stopping pending timer T308 -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state RELEASE_REQ -> NULL -DCC (sub 42342) stopping pending guard timer +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) stopping pending timer T308 +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) new state RELEASE_REQ -> NULL +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x423 tid-0) stopping pending guard timer DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - CC: now used by 2 (attached,conn) DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - trans_cc == 1 (0x100: release) - Iu Release --UTRAN-Iu--> MS @@ -1366,55 +1366,56 @@ DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0xa: dtap,cm_service) DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) DCC Unknown transaction ID 8, creating new trans. -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref 80000002) New transaction DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 + CC: now used by 3 (attached,conn,CC) +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x80000002 tid-8) New transaction DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + trans_cc == 3 (0x1a: dtap,cm_service,trans_cc) DMM IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: rx msg GSM48_MT_CC_SETUP: received_cm_service_request changes to false DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - cm_service == 2 (0x12: dtap,trans_cc) -DCC (sub 42342) starting guard timer with 180 seconds -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state NULL -> INITIATED -DCC Subscriber IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (42342) sends SETUP to 123 -DMNCC transmit message MNCC_SETUP_IND -DCC Sending 'MNCC_SETUP_IND' to MNCC. +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) rx SETUP in state NULL +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) starting guard timer with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) new state NULL -> INITIATED +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) SETUP to 123 +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) tx MNCC_SETUP_IND MSC --> MNCC: callref 0x80000002: MNCC_SETUP_IND DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x10: trans_cc) - MNCC says that's fine -DMNCC receive message MNCC_CALL_PROC_REQ -DCC (sub 42342) stopping pending guard timer -DCC (sub 42342) starting guard timer with 180 seconds -DCC (ti 08 sub 42342) Received 'MNCC_CALL_PROC_REQ' from MNCC in state 1 (INITIATED) -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state INITIATED -> MO_CALL_PROC +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) rx MNCC_CALL_PROC_REQ +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) stopping pending guard timer +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) starting guard timer with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) rx MNCC_CALL_PROC_REQ in state INITIATED +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) new state INITIATED -> MO_CALL_PROC DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_CALL_PROC: 8302 - DTAP matches expected message MS <--Call Assignment-- MSC: subscr=IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref=0x80000002 - But the other side's MSISDN could not be resolved, MNCC tells us to cancel -DMNCC receive message MNCC_REL_REQ -DCC (sub 42342) stopping pending guard timer -DCC (sub 42342) starting guard timer with 180 seconds -DCC (ti 08 sub 42342) Received 'MNCC_REL_REQ' from MNCC in state 3 (MO_CALL_PROC) -DCC starting timer T308 with 10 seconds -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state MO_CALL_PROC -> RELEASE_REQ +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) rx MNCC_REL_REQ +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) stopping pending guard timer +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) starting guard timer with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) rx MNCC_REL_REQ in state MO_CALL_PROC +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) starting timer T308 with 10 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) new state MO_CALL_PROC -> RELEASE_REQ DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_RELEASE: 832d - DTAP matches expected message - Total time passed: 10.000023 s -DCC starting timer T308 with 10 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) starting timer T308 with 10 seconds DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_RELEASE: 832d - DTAP matches expected message MSC <--UTRAN-Iu-- MS: GSM48_MT_CC_RELEASE_COMPL DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x12: dtap,trans_cc) DRLL Dispatching 04.08 message GSM48_MT_CC_RELEASE_COMPL (0x3:0x2a) -DCC stopping pending timer T308 -DMNCC transmit message MNCC_REL_CNF -DCC Sending 'MNCC_REL_CNF' to MNCC. +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) rx RELEASE_COMPL in state RELEASE_REQ +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) stopping pending timer T308 +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000002 tid-8) tx MNCC_REL_CNF MSC --> MNCC: callref 0x80000002: MNCC_REL_CNF +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x0 tid-8) Freeing transaction MS <--Call Release-- MSC: subscr=IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref=0x0 -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state RELEASE_REQ -> NULL -DCC (sub 42342) stopping pending guard timer +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x0 tid-8) new state RELEASE_REQ -> NULL +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x0 tid-8) stopping pending guard timer DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - CC: now used by 2 (attached,conn) DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - trans_cc == 1 (0x2: dtap) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING @@ -1707,54 +1708,54 @@ DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0xa: dtap,cm_service) DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) DCC Unknown transaction ID 8, creating new trans. -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref 80000003) New transaction DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 + CC: now used by 3 (attached,conn,CC) +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x80000003 tid-8) New transaction DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + trans_cc == 3 (0x1a: dtap,cm_service,trans_cc) DMM IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: rx msg GSM48_MT_CC_SETUP: received_cm_service_request changes to false DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - cm_service == 2 (0x12: dtap,trans_cc) -DCC (sub 42342) starting guard timer with 180 seconds -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state NULL -> INITIATED -DCC Subscriber IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (42342) sends SETUP to 123 -DMNCC transmit message MNCC_SETUP_IND -DCC Sending 'MNCC_SETUP_IND' to MNCC. +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) rx SETUP in state NULL +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) starting guard timer with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) new state NULL -> INITIATED +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) SETUP to 123 +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) tx MNCC_SETUP_IND MSC --> MNCC: callref 0x80000003: MNCC_SETUP_IND DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - dtap == 1 (0x10: trans_cc) - MNCC says that's fine -DMNCC receive message MNCC_CALL_PROC_REQ -DCC (sub 42342) stopping pending guard timer -DCC (sub 42342) starting guard timer with 180 seconds -DCC (ti 08 sub 42342) Received 'MNCC_CALL_PROC_REQ' from MNCC in state 1 (INITIATED) -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state INITIATED -> MO_CALL_PROC +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) rx MNCC_CALL_PROC_REQ +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) stopping pending guard timer +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) starting guard timer with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) rx MNCC_CALL_PROC_REQ in state INITIATED +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) new state INITIATED -> MO_CALL_PROC DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_CALL_PROC: 8302 - DTAP matches expected message MS <--Call Assignment-- MSC: subscr=IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref=0x80000003 - But the other side's MSISDN could not be resolved, MNCC tells us to cancel -DMNCC receive message MNCC_REL_REQ -DCC (sub 42342) stopping pending guard timer -DCC (sub 42342) starting guard timer with 180 seconds -DCC (ti 08 sub 42342) Received 'MNCC_REL_REQ' from MNCC in state 3 (MO_CALL_PROC) -DCC starting timer T308 with 10 seconds -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state MO_CALL_PROC -> RELEASE_REQ +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) rx MNCC_REL_REQ +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) stopping pending guard timer +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) starting guard timer with 180 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) rx MNCC_REL_REQ in state MO_CALL_PROC +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) starting timer T308 with 10 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) new state MO_CALL_PROC -> RELEASE_REQ DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_RELEASE: 832d - DTAP matches expected message - Despite our repeated CC Release Requests, the MS does not respond anymore - Total time passed: 10.000023 s -DCC starting timer T308 with 10 seconds +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) starting timer T308 with 10 seconds DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: GSM48_MT_CC_RELEASE: 832d - DTAP matches expected message - The CC Release times out and we still properly clear the conn - Total time passed: 20.000046 s +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) Freeing transaction MS <--Call Release-- MSC: subscr=IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref=0x80000003 -DMNCC transmit message MNCC_REL_CNF -DCC Sending 'MNCC_REL_CNF' to MNCC. +DMNCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) tx MNCC_REL_CNF MSC --> MNCC: callref 0x80000003: MNCC_REL_CNF -DCC (ti 08 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100) new state RELEASE_REQ -> NULL -DCC (sub 42342) stopping pending guard timer +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) new state RELEASE_REQ -> NULL +DCC trans(CC IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ callref-0x80000003 tid-8) stopping pending guard timer DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - CC: now used by 2 (attached,conn) DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use - trans_cc == 0 (0x0: ) DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:CM_SERVICE_REQ){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_UNUSED diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index 166a95d..457b77f 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -262,17 +262,17 @@ DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + test_gsm_authen: now used by 2 (attached,test_gsm_authen) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS-receiver: now used by 3 (attached,test_gsm_authen,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000004620:MSISDN-46071 callref 40000001) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS: now used by 4 (attached,test_gsm_authen,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000004620:MSISDN-46071 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000004620:MSISDN-46071 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000004620, TMSI 0xffffffff, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -353,13 +353,13 @@ DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000004620:MSISDN-46071 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + trans_sms == 2 (0x22: dtap,trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000004620:MSISDN-46071 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -380,7 +380,7 @@ MSC <--GERAN-A-- MS: SMS:0x04 DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -392,25 +392,26 @@ MSC <--GERAN-A-- MS: SMS:0x01 DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000004620:MSISDN-46071 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS: now used by 2 (attached,conn) @@ -772,17 +773,17 @@ DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 + test_gsm_authen_tmsi: now used by 2 (attached,test_gsm_authen_tmsi) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 + SMS-receiver: now used by 3 (attached,test_gsm_authen_tmsi,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref 40000002) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 + SMS: now used by 4 (attached,test_gsm_authen_tmsi,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref-0x40000002 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref-0x40000002 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref-0x40000002 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000004620, TMSI 0x03020100, LAC 23 paging_expecting_tmsi == 0x03020100 @@ -863,13 +864,13 @@ DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref-0x40000002 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + trans_sms == 2 (0x22: dtap,trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -890,7 +891,7 @@ MSC <--GERAN-A-- MS: SMS:0x04 DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -902,25 +903,26 @@ MSC <--GERAN-A-- MS: SMS:0x01 DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 - SMS: now used by 2 (attached,conn) @@ -2354,17 +2356,17 @@ DREF VLR subscr IMSI-901700000010650:MSISDN-42342 + test_gsm_milenage_authen: now used by 2 (attached,test_gsm_milenage_authen) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000010650:MSISDN-42342 + SMS-receiver: now used by 3 (attached,test_gsm_milenage_authen,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342 callref 40000003) New transaction DREF VLR subscr IMSI-901700000010650:MSISDN-42342 + SMS: now used by 4 (attached,test_gsm_milenage_authen,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342 callref-0x40000003 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342 callref-0x40000003 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000010650:MSISDN-42342 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342 callref-0x40000003 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000010650:MSISDN-42342 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000010650, TMSI 0xffffffff, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -2445,13 +2447,13 @@ DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000010650:MSISDN-42342 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342 callref-0x40000003 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000010650:MSISDN-42342: MSC conn use + trans_sms == 2 (0x22: dtap,trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 24 43 f2 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 24 43 f2 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000010650:MSISDN-42342 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -2472,7 +2474,7 @@ MSC <--GERAN-A-- MS: SMS:0x04 DREF IMSI-901700000010650:MSISDN-42342: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -2484,25 +2486,26 @@ MSC <--GERAN-A-- MS: SMS:0x01 DREF IMSI-901700000010650:MSISDN-42342: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000010650:MSISDN-42342 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000010650:MSISDN-42342 - SMS: now used by 2 (attached,conn) diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index b65cccd..9ca5b8c 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -290,17 +290,17 @@ DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + test_ciph: now used by 2 (attached,test_ciph) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS-receiver: now used by 3 (attached,test_ciph,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000004620:MSISDN-46071 callref 40000001) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS: now used by 4 (attached,test_ciph,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000004620:MSISDN-46071 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000004620:MSISDN-46071 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000004620, TMSI 0xffffffff, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -407,13 +407,13 @@ DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000004620:MSISDN-46071 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + trans_sms == 1 (0x20: trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000004620:MSISDN-46071 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -432,7 +432,7 @@ MSC <--GERAN-A-- MS: SMS:0x04 DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -444,25 +444,26 @@ MSC <--GERAN-A-- MS: SMS:0x01 DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000004620:MSISDN-46071 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS: now used by 2 (attached,conn) @@ -853,17 +854,17 @@ DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 + test_ciph_tmsi: now used by 2 (attached,test_ciph_tmsi) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 + SMS-receiver: now used by 3 (attached,test_ciph_tmsi,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref 40000002) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 + SMS: now used by 4 (attached,test_ciph_tmsi,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref-0x40000002 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref-0x40000002 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref-0x40000002 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000004620, TMSI 0x03020100, LAC 23 paging_expecting_tmsi == 0x03020100 @@ -970,13 +971,13 @@ DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref-0x40000002 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + trans_sms == 1 (0x20: trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -995,7 +996,7 @@ MSC <--GERAN-A-- MS: SMS:0x04 DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -1007,25 +1008,26 @@ MSC <--GERAN-A-- MS: SMS:0x01 DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 - SMS: now used by 2 (attached,conn) @@ -2106,17 +2108,17 @@ DREF VLR subscr IMSI-901700000010650:MSISDN-42342 + test_gsm_ciph_in_umts_env: now used by 2 (attached,test_gsm_ciph_in_umts_env) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000010650:MSISDN-42342 + SMS-receiver: now used by 3 (attached,test_gsm_ciph_in_umts_env,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342 callref 40000003) New transaction DREF VLR subscr IMSI-901700000010650:MSISDN-42342 + SMS: now used by 4 (attached,test_gsm_ciph_in_umts_env,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342 callref-0x40000003 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342 callref-0x40000003 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000010650:MSISDN-42342 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342 callref-0x40000003 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000010650:MSISDN-42342 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000010650, TMSI 0xffffffff, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -2213,13 +2215,13 @@ DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000010650:MSISDN-42342 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342 callref-0x40000003 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000010650:MSISDN-42342: MSC conn use + trans_sms == 1 (0x20: trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 24 43 f2 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 24 43 f2 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000010650:MSISDN-42342 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -2238,7 +2240,7 @@ MSC <--GERAN-A-- MS: SMS:0x04 DREF IMSI-901700000010650:MSISDN-42342: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -2250,25 +2252,26 @@ MSC <--GERAN-A-- MS: SMS:0x01 DREF IMSI-901700000010650:MSISDN-42342: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000010650:MSISDN-42342 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000010650:MSISDN-42342 - SMS: now used by 2 (attached,conn) @@ -2620,17 +2623,17 @@ DREF VLR subscr IMSI-901700000004620:MSISDN-42342 + test_a5_3_supported: now used by 2 (attached,test_a5_3_supported) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000004620:MSISDN-42342 + SMS-receiver: now used by 3 (attached,test_a5_3_supported,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000004620:MSISDN-42342 callref 40000004) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-42342 + SMS: now used by 4 (attached,test_a5_3_supported,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342 callref-0x40000004 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342 callref-0x40000004 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000004620:MSISDN-42342 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342 callref-0x40000004 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000004620:MSISDN-42342 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000004620, TMSI 0xffffffff, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -2737,13 +2740,13 @@ DMM RAN_conn(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000004620:MSISDN-42342 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342 callref-0x40000004 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000004620:MSISDN-42342: MSC conn use + trans_sms == 1 (0x20: trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 24 43 f2 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000004 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000004 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 24 43 f2 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000004620:MSISDN-42342 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -2762,7 +2765,7 @@ MSC <--GERAN-A-- MS: SMS:0x04 DREF IMSI-901700000004620:MSISDN-42342: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000004 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -2774,25 +2777,26 @@ MSC <--GERAN-A-- MS: SMS:0x01 DREF IMSI-901700000004620:MSISDN-42342: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000004 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000004 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000004 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000004620:MSISDN-42342 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000004 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000004 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000004620:MSISDN-42342 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000004 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000004 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000004620:MSISDN-42342 - SMS: now used by 2 (attached,conn) @@ -3144,17 +3148,17 @@ DREF VLR subscr IMSI-901700000004620:MSISDN-42342 + test_cm_service_needs_classmark_update: now used by 2 (attached,test_cm_service_needs_classmark_update) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000004620:MSISDN-42342 + SMS-receiver: now used by 3 (attached,test_cm_service_needs_classmark_update,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000004620:MSISDN-42342 callref 40000005) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-42342 + SMS: now used by 4 (attached,test_cm_service_needs_classmark_update,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342 callref-0x40000005 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342 callref-0x40000005 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000004620:MSISDN-42342 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342 callref-0x40000005 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000004620:MSISDN-42342 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000004620, TMSI 0xffffffff, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -3257,13 +3261,13 @@ DMM RAN_conn(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000004620:MSISDN-42342 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342 callref-0x40000005 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000004620:MSISDN-42342: MSC conn use + trans_sms == 1 (0x20: trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 24 43 f2 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000005 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000005 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 24 43 f2 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000004620:MSISDN-42342 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -3282,7 +3286,7 @@ MSC <--GERAN-A-- MS: SMS:0x04 DREF IMSI-901700000004620:MSISDN-42342: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000005 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -3294,25 +3298,26 @@ MSC <--GERAN-A-- MS: SMS:0x01 DREF IMSI-901700000004620:MSISDN-42342: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000005 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000005 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000005 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000004620:MSISDN-42342 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000005 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000005 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000004620:MSISDN-42342 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000005 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-42342:GERAN-A-0:PAGING_RESP callref-0x40000005 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000004620:MSISDN-42342 - SMS: now used by 2 (attached,conn) diff --git a/tests/msc_vlr/msc_vlr_test_ms_timeout.err b/tests/msc_vlr/msc_vlr_test_ms_timeout.err index 7fd4978..8ff251a 100644 --- a/tests/msc_vlr/msc_vlr_test_ms_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_ms_timeout.err @@ -446,17 +446,17 @@ DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + test_ms_timeout_paging: now used by 2 (attached,test_ms_timeout_paging) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS-receiver: now used by 3 (attached,test_ms_timeout_paging,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000004620:MSISDN-46071 callref 40000001) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS: now used by 4 (attached,test_ms_timeout_paging,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000004620:MSISDN-46071 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000004620:MSISDN-46071 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000004620, TMSI 0xffffffff, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -473,17 +473,17 @@ vsub->cs.is_paging == 1 - another request is added to the list but does not cause another paging DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS-receiver: now used by 6 (attached,2*SMS-receiver,SMS,Paging,test_ms_timeout_paging) -DLSMS Going to send a MT SMS -DCC (ti 01 sub IMSI-901700000004620:MSISDN-46071 callref 40000002) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS: now used by 7 (attached,2*SMS-receiver,2*SMS,Paging,test_ms_timeout_paging) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000002 tid-1) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000002 tid-1) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000004620:MSISDN-46071 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000002 tid-1) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000004620:MSISDN-46071 already paged. llist_count(&vsub->cs.requests) == 2 DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - test_ms_timeout_paging: now used by 6 (attached,2*SMS-receiver,2*SMS,Paging) @@ -492,32 +492,34 @@ - Total time passed: 11.000000 s DPAG Paging failure for IMSI-901700000004620:MSISDN-46071 (event=1) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=1) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0,PAGING) paging_cb_mmsms_est_req(expired) DLSMS SMC(0) message MMSMS-REL-IND received in state MM_CONN_PENDING DLSMS SMC(0) MM layer is released DLSMS SMC(0) new CP state MM_CONN_PENDING -> IDLE -DLSMS MNSMS-ERROR-IND, no cause +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) MNSMS-ERROR-IND, no cause DLSMS SMR(0) message MNSMS-ERROR-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) TX SMS MNSMS-ERROR-IND DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state IDLE DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS-receiver: now used by 5 (attached,SMS-receiver,2*SMS,Paging) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS: now used by 4 (attached,SMS-receiver,SMS,Paging) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=1) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000002 tid-1,PAGING) paging_cb_mmsms_est_req(expired) DLSMS SMC(0) message MMSMS-REL-IND received in state MM_CONN_PENDING DLSMS SMC(0) MM layer is released DLSMS SMC(0) new CP state MM_CONN_PENDING -> IDLE -DLSMS MNSMS-ERROR-IND, no cause +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000002 tid-1) MNSMS-ERROR-IND, no cause DLSMS SMR(0) message MNSMS-ERROR-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) TX SMS MNSMS-ERROR-IND DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state IDLE DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS-receiver: now used by 3 (attached,SMS,Paging) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000002 tid-1) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS: now used by 2 (attached,Paging) @@ -529,17 +531,17 @@ --- - Now that the timeout has expired, another Paging is sent on request DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS-receiver: now used by 3 (attached,test_ms_timeout_paging,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000004620:MSISDN-46071 callref 40000003) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS: now used by 4 (attached,test_ms_timeout_paging,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000003 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000003 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000004620:MSISDN-46071 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000003 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000004620:MSISDN-46071 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000004620, TMSI 0xffffffff, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -560,17 +562,18 @@ DMM IMSI DETACH for IMSI-901700000004620:MSISDN-46071 DPAG Paging failure for IMSI-901700000004620:MSISDN-46071 (event=1) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=1) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000003 tid-0,PAGING) paging_cb_mmsms_est_req(expired) DLSMS SMC(0) message MMSMS-REL-IND received in state MM_CONN_PENDING DLSMS SMC(0) MM layer is released DLSMS SMC(0) new CP state MM_CONN_PENDING -> IDLE -DLSMS MNSMS-ERROR-IND, no cause +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000003 tid-0) MNSMS-ERROR-IND, no cause DLSMS SMR(0) message MNSMS-ERROR-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) TX SMS MNSMS-ERROR-IND DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state IDLE DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS-receiver: now used by 4 (attached,SMS,Paging,gsm48_rx_mm_imsi_detach_ind) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000003 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS: now used by 3 (attached,Paging,gsm48_rx_mm_imsi_detach_ind) diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index b21e3fc..6f5adb6 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -176,17 +176,17 @@ DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + test_no_authen: now used by 2 (attached,test_no_authen) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS-receiver: now used by 3 (attached,test_no_authen,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000004620:MSISDN-46071 callref 40000001) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS: now used by 4 (attached,test_no_authen,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000004620:MSISDN-46071 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000004620:MSISDN-46071 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000004620, TMSI 0xffffffff, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -227,13 +227,13 @@ DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_NEW}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000004620:MSISDN-46071 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + trans_sms == 2 (0x21: compl_l3,trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000004620:MSISDN-46071 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -255,7 +255,7 @@ MSC <--GERAN-A-- MS: SMS:0x04 DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -267,25 +267,26 @@ MSC <--GERAN-A-- MS: SMS:0x01 DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000004620:MSISDN-46071 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS: now used by 2 (attached,conn) @@ -561,17 +562,17 @@ DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 + test_no_authen_tmsi: now used by 2 (attached,test_no_authen_tmsi) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 + SMS-receiver: now used by 3 (attached,test_no_authen_tmsi,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref 40000002) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 + SMS: now used by 4 (attached,test_no_authen_tmsi,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref-0x40000002 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref-0x40000002 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref-0x40000002 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000004620, TMSI 0x03020100, LAC 23 paging_expecting_tmsi == 0x03020100 @@ -612,13 +613,13 @@ DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_NEW}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 callref-0x40000002 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + trans_sms == 2 (0x21: compl_l3,trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -640,7 +641,7 @@ MSC <--GERAN-A-- MS: SMS:0x04 DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -652,25 +653,26 @@ MSC <--GERAN-A-- MS: SMS:0x01 DREF IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000004620:MSISDN-46071:TMSI-0x03020100 - SMS: now used by 2 (attached,conn) diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index 7dc039d..71bf732 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -1175,17 +1175,17 @@ DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + _page: now used by 2 (attached,_page) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS-receiver: now used by 3 (attached,_page,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000004620:MSISDN-46071 callref 40000001) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS: now used by 4 (attached,_page,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000004620:MSISDN-46071 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000004620:MSISDN-46071 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000004620, TMSI 0xffffffff, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -1222,13 +1222,13 @@ DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_NEW}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000004620:MSISDN-46071 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000001 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + trans_sms == 2 (0x21: compl_l3,trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000004620:MSISDN-46071 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -1255,7 +1255,7 @@ MSC <--GERAN-A-- MS: SMS:0x04 DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -1267,25 +1267,26 @@ MSC <--GERAN-A-- MS: SMS:0x01 DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000004620:MSISDN-46071 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS: now used by 2 (attached,conn) @@ -1426,17 +1427,17 @@ DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + _page: now used by 2 (attached,_page) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS-receiver: now used by 3 (attached,_page,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000004620:MSISDN-46071 callref 40000002) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS: now used by 4 (attached,_page,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000002 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000002 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000004620:MSISDN-46071 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000002 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000004620:MSISDN-46071 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000004620, TMSI 0xffffffff, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -1473,13 +1474,13 @@ DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_NEW}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000004620:MSISDN-46071 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000002 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + trans_sms == 2 (0x21: compl_l3,trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000002 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000004620:MSISDN-46071 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -1512,7 +1513,7 @@ MSC <--GERAN-A-- MS: SMS:0x04 DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + dtap == 3 (0x2a: dtap,cm_service,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ callref-0x40000002 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -1524,25 +1525,26 @@ MSC <--GERAN-A-- MS: SMS:0x01 DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + dtap == 3 (0x2a: dtap,cm_service,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ callref-0x40000002 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ callref-0x40000002 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ callref-0x40000002 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000004620:MSISDN-46071 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ callref-0x40000002 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ callref-0x40000002 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ callref-0x40000002 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ callref-0x40000002 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS: now used by 2 (attached,conn) @@ -1698,17 +1700,17 @@ DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + _page: now used by 2 (attached,_page) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS-receiver: now used by 3 (attached,_page,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000004620:MSISDN-46071 callref 40000003) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + SMS: now used by 4 (attached,_page,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000003 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000003 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000004620:MSISDN-46071 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000003 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000004620:MSISDN-46071 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000004620, TMSI 0xffffffff, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -1745,13 +1747,13 @@ DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_NEW}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000004620:MSISDN-46071 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071 callref-0x40000003 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + trans_sms == 2 (0x21: compl_l3,trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 64 70 f1 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000004620:MSISDN-46071 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -1776,7 +1778,7 @@ MSC <--GERAN-A-- MS: SMS:0x04 DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -1788,25 +1790,26 @@ MSC <--GERAN-A-- MS: SMS:0x01 DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000004620:MSISDN-46071 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x40000003 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - SMS: now used by 2 (attached,conn) diff --git a/tests/msc_vlr/msc_vlr_test_ss.err b/tests/msc_vlr/msc_vlr_test_ss.err index 744f25a..fa091ce 100644 --- a/tests/msc_vlr/msc_vlr_test_ss.err +++ b/tests/msc_vlr/msc_vlr_test_ss.err @@ -145,13 +145,12 @@ MSC <--GERAN-A-- MS: GSM0480_MTYPE_REGISTER DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + dtap == 2 (0xa: dtap,cm_service) DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub IMSI-901700000004620:MSISDN-46071 callref 20000001) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + NCSS: now used by 3 (attached,conn,NCSS) +DMSC trans(NCSS IMSI-901700000004620:MSISDN-46071 callref-0x20000001 tid-8) New transaction DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) DMM IMSI-901700000004620:MSISDN-46071: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false DREF IMSI-901700000004620:MSISDN-46071: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) +DMSC trans(NCSS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ callref-0x20000001 tid-8) Received SS/USSD msg GSM0480_MTYPE_REGISTER GSUP --> HLR: OSMO_GSUP_MSGT_PROC_SS_REQUEST: 20010809710000004026f03004200000013101013515a11302010102013b300b04010f0406aa510c061b01 DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING @@ -163,6 +162,7 @@ DMSC msc_tx 43 bytes to IMSI-901700000004620:MSISDN-46071 via GERAN-A - DTAP --GERAN-A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020101302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message +DMSC trans(NCSS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ callref-0x20000001 tid-8) Freeing transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - NCSS: now used by 3 (attached,conn,vlr_gsupc_read_cb) DREF IMSI-901700000004620:MSISDN-46071: MSC conn use - trans_nc_ss == 0 (0x0: ) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:CM_SERVICE_REQ){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_UNUSED @@ -307,10 +307,10 @@ DVLR GSUP rx 43: 20010809710000004026f03004200001013101013515a11302010102013b300b04010f0406aa510c061b01 DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + vlr_gsupc_read_cb: now used by 3 (attached,_test_ss_ussd_no,vlr_gsupc_read_cb) DMSC Routed to GSM 09.11 SS/USSD handler -DMM Establishing network-originated session -DCC (ti ff sub IMSI-901700000004620:MSISDN-46071 callref 20000101) New transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071 + NCSS: now used by 4 (attached,_test_ss_ussd_no,vlr_gsupc_read_cb,NCSS) -DMM Triggering Paging Request +DMSC trans(NCSS IMSI-901700000004620:MSISDN-46071 callref-0x20000101 tid-255) New transaction +DMSC trans(NCSS IMSI-901700000004620:MSISDN-46071 callref-0x20000101 tid-255) Establishing network-originated session +DMSC trans(NCSS IMSI-901700000004620:MSISDN-46071 callref-0x20000101 tid-0) Triggering Paging Request DMM Subscriber IMSI-901700000004620:MSISDN-46071 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000004620, TMSI 0xffffffff, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -370,7 +370,7 @@ MSC <--GERAN-A-- MS: GSM0480_MTYPE_FACILITY DREF IMSI-901700000004620:MSISDN-46071: MSC conn use + dtap == 2 (0x42: dtap,trans_nc_ss) DRLL Dispatching 04.08 message GSM0480_MTYPE_FACILITY (0xb:0x3a) -DMM Received SS/USSD data (trans_id=0, msg_type=GSM0480_MTYPE_FACILITY) +DMSC trans(NCSS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x20000101 tid-0) Received SS/USSD msg GSM0480_MTYPE_FACILITY GSUP --> HLR: OSMO_GSUP_MSGT_PROC_SS_REQUEST: 20010809710000004026f03004200001013101023527a225020101302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING @@ -385,6 +385,7 @@ DMSC msc_tx 2 bytes to IMSI-901700000004620:MSISDN-46071 via GERAN-A - DTAP --GERAN-A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 0b2a - DTAP matches expected message +DMSC trans(NCSS IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP callref-0x20000101 tid-0) Freeing transaction DREF VLR subscr IMSI-901700000004620:MSISDN-46071 - NCSS: now used by 3 (attached,conn,vlr_gsupc_read_cb) DREF IMSI-901700000004620:MSISDN-46071: MSC conn use - trans_nc_ss == 0 (0x0: ) DMM RAN_conn(IMSI-901700000004620:MSISDN-46071:GERAN-A-0:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_UNUSED diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index b0ed61f..298d6ad 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -279,17 +279,17 @@ DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 + _test_umts_authen: now used by 2 (attached,_test_umts_authen) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 + SMS-receiver: now used by 3 (attached,_test_umts_authen,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref 40000001) New transaction DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 + SMS: now used by 4 (attached,_test_umts_authen,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x40000001 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x40000001 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x40000001 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 not paged yet, start paging. GERAN-A sends out paging request to IMSI 901700000010650, TMSI 0x03020100, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -371,13 +371,13 @@ DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x40000001 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + trans_sms == 2 (0x22: dtap,trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 24 43 f2 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 24 43 f2 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -398,7 +398,7 @@ MSC <--GERAN-A-- MS: SMS:0x04 DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -410,25 +410,26 @@ MSC <--GERAN-A-- MS: SMS:0x01 DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via GERAN-A - DTAP --GERAN-A--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:GERAN-A-0:PAGING_RESP callref-0x40000001 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - SMS: now used by 2 (attached,conn) @@ -792,17 +793,17 @@ DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 + _test_umts_authen: now used by 2 (attached,_test_umts_authen) llist_count(&vsub->cs.requests) == 0 DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 + SMS-receiver: now used by 3 (attached,_test_umts_authen,SMS-receiver) -DLSMS Going to send a MT SMS -DCC (ti 00 sub IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref 40000002) New transaction DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 + SMS: now used by 4 (attached,_test_umts_authen,SMS-receiver,SMS) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x40000002 tid-0) New transaction DLSMS SMC(0) instance created for network DLSMS SMR(0) instance created for network. +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x40000002 tid-0) Going to send a MT SMS DLSMS SMR(0) message SM-RL-DATA_REQ received in state IDLE DLSMS SMR(0) TX SMS RP-DATA DLSMS SMR(0) new RP state IDLE -> WAIT_FOR_RP_ACK DLSMS SMC(0) message MNSMS-EST-REQ received in state IDLE DLSMS SMC(0) new CP state IDLE -> MM_CONN_PENDING -DLSMS Initiating Paging procedure for IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 due to MMSMS_EST_REQ +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x40000002 tid-0) Initiating Paging due to MMSMS_EST_REQ DMM Subscriber IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 not paged yet, start paging. UTRAN-Iu sends out paging request to IMSI 901700000010650, TMSI 0x03020100, LAC 23 strcmp(paging_expecting_imsi, imsi) == 0 @@ -900,13 +901,13 @@ DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_AUTH_CIPH}: Received Event RAN_CONN_E_ACCEPTED DPAG Paging success for IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 (event=0) DPAG Calling paging cbfn. -DLSMS paging_cb_mmsms_est_req(hooknum=1, event=0) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 callref-0x40000002 tid-0,PAGING) paging_cb_mmsms_est_req(success) DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + trans_sms == 1 (0x20: trans_sms) DLSMS SMC(0) message MMSMS-EST-CNF received in state MM_CONN_PENDING DLSMS SMC(0) send CP data DLSMS SMC(0) new CP state MM_CONN_PENDING -> WAIT_CP_ACK -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 24 43 f2 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x40000002 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x40000002 tid-0) GSM4.11 TX 09 01 58 01 00 07 91 44 77 58 10 06 50 00 4c 00 05 80 24 43 f2 00 00 07 10 10 00 00 00 00 44 50 79 da 1e 1e e7 41 69 37 48 5e 9e a7 c9 65 37 3d 1d 66 83 c2 70 38 3b 3d 0e d3 d3 6f f7 1c 94 9e 83 c2 20 72 79 9e 96 87 c5 ec 32 a8 1d 96 af cb f4 b4 fb 0c 7a c3 e9 e9 b7 db 05 DMSC msc_tx 91 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message @@ -924,7 +925,7 @@ MSC <--UTRAN-Iu-- MS: SMS:0x04 DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x04) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x40000002 tid-0) receiving SMS message SMS:0x04 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_ACCEPTED}: Received Event RAN_CONN_E_COMMUNICATING DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_ACCEPTED}: state_chg to RAN_CONN_S_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP ACK) received in state WAIT_CP_ACK @@ -936,25 +937,26 @@ MSC <--UTRAN-Iu-- MS: SMS:0x01 DREF IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100: MSC conn use + dtap == 2 (0x22: dtap,trans_sms) DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) -DLSMS receiving data (trans_id=0, msg_type=SMS:0x01) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x40000002 tid-0) receiving SMS message SMS:0x01 DMM RAN_conn(IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP){RAN_CONN_S_COMMUNICATING}: Received Event RAN_CONN_E_COMMUNICATING DLSMS SMC(0) message MMSMS-DATA-IND (CP DATA) received in state MM_ESTABLISHED DLSMS SMC(0) received CP-DATA -DLSMS sending CP message (trans=0) -DLSMS GSM4.11 TX 09 04 +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x40000002 tid-0) sending CP message (trans=0) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x40000002 tid-0) GSM4.11 TX 09 04 DMSC msc_tx 2 bytes to IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 via UTRAN-Iu - DTAP --UTRAN-Iu--> MS: SMS:0x04: 0904 - DTAP matches expected message -DLSMS MNSMS-DATA/EST-IND +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x40000002 tid-0) MNSMS-DATA/EST-IND DLSMS SMR(0) message MNSMS-DATA-IND received in state WAIT_FOR_RP_ACK DLSMS SMR(0) RX SMS RP-ACK DLSMS SMR(0) new RP state WAIT_FOR_RP_ACK -> IDLE -DLSMS RX SMS RP-ACK (MO) +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x40000002 tid-0) RX SMS RP-ACK (MO) DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - SMS-receiver: now used by 3 (attached,SMS,conn) DLSMS SMR(0) TX: MNSMS-REL-REQ DLSMS SMC(0) message MNSMS-REL-REQ received in state MM_ESTABLISHED DLSMS SMC(0) new CP state MM_ESTABLISHED -> IDLE -DLSMS Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x40000002 tid-0) Got MMSMS_REL_REQ, destroying transaction. +DLSMS trans(SMS IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100:UTRAN-Iu-42:PAGING_RESP callref-0x40000002 tid-0) Freeing transaction DLSMS SMR(0) clearing SMR instance DLSMS SMC(0) clearing instance DREF VLR subscr IMSI-901700000010650:MSISDN-42342:TMSI-0x03020100 - SMS: now used by 2 (attached,conn) -- To view, visit https://gerrit.osmocom.org/13139 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2e60964d7a3c06d051debd1c707051a0eb3101ba Gerrit-Change-Number: 13139 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:52:40 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:52:40 +0000 Subject: Change in osmo-msc[master]: gsm_04_08_cc: improve logging for CC trans In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13593 ) Change subject: gsm_04_08_cc: improve logging for CC trans ...................................................................... gsm_04_08_cc: improve logging for CC trans Pass trans around more functions as log context. Add missing "rx" logging for two cases. Change-Id: If79f724a2faca70023271398c618cfe490fb294e --- M src/libmsc/gsm_04_08_cc.c 1 file changed, 12 insertions(+), 9 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c index 4475d05..62b5d12 100644 --- a/src/libmsc/gsm_04_08_cc.c +++ b/src/libmsc/gsm_04_08_cc.c @@ -1601,7 +1601,7 @@ return mncc_recvmsg(trans->net, trans, MNCC_USERINFO_IND, &user); } -static void mncc_recv_rtp(struct gsm_network *net, uint32_t callref, +static void mncc_recv_rtp(struct gsm_network *net, struct gsm_trans *trans, uint32_t callref, int cmd, uint32_t addr, uint16_t port, uint32_t payload_type, uint32_t payload_msg_type) { @@ -1617,7 +1617,7 @@ rtp->port = port; rtp->payload_type = payload_type; rtp->payload_msg_type = payload_msg_type; - mncc_recvmsg(net, NULL, cmd, (struct gsm_mncc *)data); + mncc_recvmsg(net, trans, cmd, (struct gsm_mncc *)data); } static void mncc_recv_rtp_sock(struct gsm_network *net, struct gsm_trans *trans, int cmd) @@ -1652,16 +1652,16 @@ * lchan->abis_ip.rtp_payload */ uint32_t payload_type = 0; - return mncc_recv_rtp(net, trans->callref, cmd, + return mncc_recv_rtp(net, trans, trans->callref, cmd, addr, port, payload_type, msg_type); } -static void mncc_recv_rtp_err(struct gsm_network *net, uint32_t callref, int cmd) +static void mncc_recv_rtp_err(struct gsm_network *net, struct gsm_trans *trans, uint32_t callref, int cmd) { - return mncc_recv_rtp(net, callref, cmd, 0, 0, 0, 0); + return mncc_recv_rtp(net, trans, callref, cmd, 0, 0, 0, 0); } static int tch_rtp_create(struct gsm_network *net, uint32_t callref) @@ -1672,15 +1672,16 @@ trans = trans_find_by_callref(net, callref); if (!trans) { LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); + mncc_recv_rtp_err(net, trans, callref, MNCC_RTP_CREATE); return -EIO; } log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); if (!trans->conn) { LOG_TRANS_CAT(trans, DMNCC, LOGL_NOTICE, "RTP create for trans without conn\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); + mncc_recv_rtp_err(net, trans, callref, MNCC_RTP_CREATE); return 0; } + LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "rx %s\n", get_mncc_name(MNCC_RTP_CREATE)); /* When we call msc_mgcp_call_assignment() we will trigger, depending * on the RAN type the call assignment on the A or Iu interface. @@ -1733,16 +1734,18 @@ trans = trans_find_by_callref(net, rtp->callref); if (!trans) { LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR, "RTP connect for non-existing trans\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); + mncc_recv_rtp_err(net, trans, rtp->callref, MNCC_RTP_CONNECT); return -EIO; } log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); if (!trans->conn) { LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR, "RTP connect for trans without conn\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); + mncc_recv_rtp_err(net, trans, rtp->callref, MNCC_RTP_CONNECT); return 0; } + LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "rx %s\n", get_mncc_name(MNCC_RTP_CONNECT)); + addr.s_addr = osmo_htonl(rtp->ip); return msc_mgcp_call_complete(trans, rtp->port, inet_ntoa(addr)); } -- To view, visit https://gerrit.osmocom.org/13593 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If79f724a2faca70023271398c618cfe490fb294e Gerrit-Change-Number: 13593 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:54:51 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:54:51 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: expect only one Paging on failed MT SMS In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13192 ) Change subject: msc: expect only one Paging on failed MT SMS ...................................................................... Patch Set 3: Code-Review+2 I just merged an osmo-msc change that will probably cause puzzling ttcn3-msc-test failures. I realized this corresponding fix isn't reviewed yet -- but before I send everyone off on tagents trying to figure out what is wrong, I'll rather merge this change now. I am still open to adjusting this patch nevertheless! -- To view, visit https://gerrit.osmocom.org/13192 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7dce12942a65eaaf97f78ca69401c7f93faacb9e Gerrit-Change-Number: 13192 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 12 Apr 2019 03:54:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:55:15 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:55:15 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: clear the failed SMS when a test is done In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13613 ) Change subject: msc: clear the failed SMS when a test is done ...................................................................... Patch Set 1: I just merged an osmo-msc change that will probably cause puzzling ttcn3-msc-test failures. I realized this corresponding fix isn't reviewed yet -- but before I send everyone off on tagents trying to figure out what is wrong, I'll rather merge this change now. I am still open to adjusting this patch nevertheless! -- To view, visit https://gerrit.osmocom.org/13613 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4ff05187131e93f5bc58dc7ea44546f770e5b4c1 Gerrit-Change-Number: 13613 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 12 Apr 2019 03:55:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:55:20 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:55:20 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: clear the failed SMS when a test is done In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13613 ) Change subject: msc: clear the failed SMS when a test is done ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13613 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4ff05187131e93f5bc58dc7ea44546f770e5b4c1 Gerrit-Change-Number: 13613 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 12 Apr 2019 03:55:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:55:26 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:55:26 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: clear the failed SMS when a test is done In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13613 ) Change subject: msc: clear the failed SMS when a test is done ...................................................................... msc: clear the failed SMS when a test is done If an MT SMS is triggered and not handled in the test, it is so far left behind when the test ends. That causes Paging to retrigger for that SMS at any later point during subsequent test runs, causing stray bogus test failures. Actually remove the SMS from the SMS database and the queue with a new VTY command: The vty command to clear failed SMS from the db is added in osmo-msc I637cbd7adc075a192f49752b38779391472ff06d Depends: I637cbd7adc075a192f49752b38779391472ff06d (osmo-msc) Change-Id: I4ff05187131e93f5bc58dc7ea44546f770e5b4c1 --- M msc/MSC_Tests.ttcn 1 file changed, 13 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Neels Hofmeyr: Looks good to me, approved diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 13d1ddb..8aa6199 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -1994,6 +1994,13 @@ f_vty_transceive(MSCVTY, "subscriber imsi "&imsi&" sms sender msisdn "&msisdn&" send "&text); } +/* Remove still pending SMS */ +private function f_vty_sms_clear(charstring imsi) +runs on BSC_ConnHdlr { + f_vty_transceive(MSCVTY, "subscriber imsi " & imsi & " sms delete-all"); + f_vty_transceive(MSCVTY, "sms-queue clear"); +} + /* LU followed by MT SMS */ private function f_tc_lu_and_mt_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { var SmsParameters spars := valueof(t_SmsPars); @@ -2088,6 +2095,8 @@ } } + f_vty_sms_clear(hex2str(g_pars.imsi)); + setverdict(pass); } testcase TC_lu_and_mt_sms_paging_and_nothing() runs on MTC_CT { @@ -4456,8 +4465,8 @@ * MSC/VLR would re-try to deliver the test SMS trigered above and * so the screening would fail. */ - /* Expire the subscriber now to avoid that the MSC will try the SMS - * delivery at some later point. */ + f_vty_sms_clear(hex2str(g_pars.imsi)); + f_vty_transceive(MSCVTY, "subscriber imsi " & hex2str(g_pars.imsi) & " expire"); setverdict(pass); @@ -4514,16 +4523,14 @@ } } + f_vty_sms_clear(hex2str(g_pars.imsi)); + /* A rejected paging with IMSI_unknown (see above) should always send * the SGs association to NULL. */ f_ctrl_get_exp(IPA_CTRL, "fsm.SGs-UE.id.imsi:" & hex2str(g_pars.imsi) & ".state", "SGs-NULL"); f_sgsap_bssmap_screening(); - /* Expire the subscriber now to avoid that the MSC will try the SMS - * delivery at some later point. */ - f_vty_transceive(MSCVTY, "subscriber imsi " & hex2str(g_pars.imsi) & " expire"); - setverdict(pass); } testcase TC_sgsap_mt_sms_and_reject() runs on MTC_CT { -- To view, visit https://gerrit.osmocom.org/13613 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4ff05187131e93f5bc58dc7ea44546f770e5b4c1 Gerrit-Change-Number: 13613 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:55:27 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:55:27 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: expect only one Paging on failed MT SMS In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13192 ) Change subject: msc: expect only one Paging on failed MT SMS ...................................................................... msc: expect only one Paging on failed MT SMS An MSC might decide to repeatedly retry Paging if it failed the first time, but osmo-msc currently has no such mechanism. Instead, it so far had a bug that retriggered a failed Paging from a start in a situation where there are SMS pending for only one subscriber, and sending the SMS fails. osmo-msc patch I24bf9f1c1167efe1080ae4cf47ed2ef0bd981e49 changes this behavior to accept a Paging failure and not launch the same SMS again numerous times. Adjust the tests to this new behavior. Depends: I24bf9f1c1167efe1080ae4cf47ed2ef0bd981e49 (osmo-msc) Change-Id: I7dce12942a65eaaf97f78ca69401c7f93faacb9e --- M msc/MSC_Tests.ttcn 1 file changed, 4 insertions(+), 31 deletions(-) Approvals: Jenkins Builder: Verified Neels Hofmeyr: Looks good to me, approved diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 8aa6199..df088bc 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -2044,7 +2044,6 @@ private function f_tc_lu_and_mt_sms_paging_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { var SmsParameters spars := valueof(t_SmsPars); var OCT4 tmsi; - var integer page_count := 0; f_init_handler(pars, 150.0); /* Perform location update */ @@ -2060,21 +2059,8 @@ f_vty_sms_send(hex2str(pars.imsi), "2342", "Hello SMS"); - /* Expect the MSC to page exactly 10 times before giving up */ - alt { - [] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) - { - page_count := page_count + 1; - - if (page_count < 10) { - repeat; - } - } - [] BSSAP.receive { - setverdict(fail, "unexpected BSSAP message received"); - self.stop; - } - } + /* Expect the MSC to page exactly once */ + BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { }; /* Wait some time to make sure the MSC is not delivering any further * paging messages or anything else that could be unexpected. */ @@ -4423,21 +4409,8 @@ /* Trigger SMS via VTY */ f_vty_sms_send_conn_hdlr(hex2str(pars.imsi), "2342", "Hello SMS"); - /* Expect the MSC/VLR to page exactly 10 times before giving up */ - alt { - [] SGsAP.receive(exp_pag_req) - { - page_count := page_count + 1; - - if (page_count < 10) { - repeat; - } - } - [] SGsAP.receive { - setverdict(fail, "unexpected SGsAP message received"); - self.stop; - } - } + /* Expect the MSC/VLR to page exactly once */ + SGsAP.receive(exp_pag_req); /* Wait some time to make sure the MSC is not delivering any further * paging messages or anything else that could be unexpected. */ -- To view, visit https://gerrit.osmocom.org/13192 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7dce12942a65eaaf97f78ca69401c7f93faacb9e Gerrit-Change-Number: 13192 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:58:20 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:58:20 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: add inter-BSC and inter-MSC Handover tests Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13617 Change subject: msc: add inter-BSC and inter-MSC Handover tests ...................................................................... msc: add inter-BSC and inter-MSC Handover tests Change-Id: I7d76c982ad4e198534fa488609c41e8892b268ab --- M library/BSSMAP_Emulation.ttcn M library/BSSMAP_Templates.ttcn M library/GSUP_Types.ttcn M library/L3_Templates.ttcn M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 6 files changed, 1,024 insertions(+), 112 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/17/13617/1 diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index 55ce2fb..2be3b70 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -121,6 +121,7 @@ MgcpCommand, MgcpResponse; } with { extension "internal" }; +type uint2_t N_Sd_Array[4]; /* represents a single BSSAP connection over SCCP */ type record ConnectionData { @@ -132,7 +133,7 @@ /* CIC that has been used for voice of this channel (BSC side) */ integer cic optional, /* array of N(SD) values for MO DTAP messages, indexed by discriminator */ - uint2_t n_sd[4] + N_Sd_Array n_sd } type record ImsiMapping { @@ -432,30 +433,53 @@ template BIT4 t_ML3_DISC_CC_MM_SS := ('0011'B, '0101'B, '1011'B); -/* patch N(SD) into enc_l3, according to 24.007 11.2.3.2 */ -function f_ML3_patch_seq(inout ConnectionData cd, in PDU_ML3_MS_NW dtap, inout octetstring enc_l3) { +function f_next_n_sd(inout N_Sd_Array n_sd, in integer n_sd_idx) return uint2_t { var uint2_t seq_nr; - if (ischosen(dtap.msgs.cc) or ischosen(dtap.msgs.mm) or ischosen(dtap.msgs.ss)) { - seq_nr := cd.n_sd[0]; - cd.n_sd[0] := (cd.n_sd[0] + 1) mod 4; - } else if (ischosen(dtap.msgs.gcc)) { - seq_nr := cd.n_sd[1]; - cd.n_sd[1] := (cd.n_sd[1] + 1) mod 2; - } else if (ischosen(dtap.msgs.bcc)) { - seq_nr := cd.n_sd[2]; - cd.n_sd[2] := (cd.n_sd[2] + 1) mod 2; - } else if (ischosen(dtap.msgs.loc)) { - seq_nr := cd.n_sd[3]; - cd.n_sd[3] := (cd.n_sd[3] + 1) mod 2; + if (n_sd_idx == 0) { + seq_nr := n_sd[0]; + n_sd[0] := (n_sd[0] + 1) mod 4; + } else if (n_sd_idx >= 1 and n_sd_idx <= 3) { + seq_nr := n_sd[n_sd_idx]; + n_sd[n_sd_idx] := (n_sd[n_sd_idx] + 1) mod 2; } else { /* no sequence number to patch */ - return; + seq_nr := 0; } + return seq_nr; +} + +/* patch N(SD) into enc_l3, according to 24.007 11.2.3.2 */ +function f_ML3_patch_seq_nr(in uint2_t seq_nr, inout octetstring enc_l3) { log("patching N(SD)=", seq_nr, " into dtap ", enc_l3); enc_l3[1] := (enc_l3[1] and4b '3f'O) or4b bit2oct(int2bit(seq_nr, 8) << 6); log("patched enc_l3: ", enc_l3); } +function f_ML3_n_sd_idx(in PDU_ML3_MS_NW dtap) return integer { + var uint2_t seq_nr; + if (ischosen(dtap.msgs.cc) or ischosen(dtap.msgs.mm) or ischosen(dtap.msgs.ss)) { + return 0; + } else if (ischosen(dtap.msgs.gcc)) { + return 1; + } else if (ischosen(dtap.msgs.bcc)) { + return 2; + } else if (ischosen(dtap.msgs.loc)) { + return 3; + } + /* no sequence number to patch */ + return -1; +} + +/* patch N(SD) into enc_l3, according to 24.007 11.2.3.2 */ +function f_ML3_patch_seq(inout ConnectionData cd, in PDU_ML3_MS_NW dtap, inout octetstring enc_l3) { + var integer n_sd_idx := f_ML3_n_sd_idx(dtap); + if (n_sd_idx < 0) { + return; + } + var uint2_t seq_nr := f_next_n_sd(cd.n_sd, n_sd_idx); + f_ML3_patch_seq_nr(seq_nr, enc_l3); +} + private function f_bssap_l3_is_rr(PDU_BSSAP bssap) return boolean { var template octetstring l3 := f_bssap_extract_l3(bssap); if (not isvalue(l3)) { @@ -551,6 +575,8 @@ var octetstring l3_info; var hexstring imsi; var OCT4 tmsi; + var integer targetPointCode; + var N_Sd_Array last_n_sd; alt { /* SCCP -> Client: UNIT-DATA (connectionless SCCP) from a BSC */ @@ -663,6 +689,18 @@ BSSAP.send(ts_BSSAP_DATA_req(ConnectionTable[idx].sccp_conn_id, bssap)); } + [] PROC.getcall(BSSMAPEM_last_n_sd:{?,-}) -> param(vc_hdlr) { + var integer idx := f_idx_by_comp(vc_hdlr); + last_n_sd := ConnectionTable[idx].n_sd; + PROC.reply(BSSMAPEM_last_n_sd:{vc_hdlr, last_n_sd}) to vc_hdlr; + } + + [] PROC.getcall(BSSMAPEM_continue_after_n_sd:{?,?}) -> param(last_n_sd, vc_hdlr) { + var integer idx := f_idx_by_comp(vc_hdlr); + ConnectionTable[idx].n_sd := last_n_sd; + PROC.reply(BSSMAPEM_continue_after_n_sd:{last_n_sd, vc_hdlr}) to vc_hdlr; + } + [not g_bssmap_ops.role_ms] CLIENT.receive(PDU_DTAP_MT:?) -> value dtap_mt sender vc_conn { var integer conn_id := f_conn_id_by_comp(vc_conn); /* convert from decoded DTAP to encoded DTAP */ @@ -717,6 +755,11 @@ PROC.reply(BSSMAPEM_register:{l3_info, vc_hdlr}) to vc_hdlr; } + [] PROC.getcall(BSSMAPEM_register_handoverRequest:{?,?}) -> param(targetPointCode, vc_hdlr) { + f_create_expect(omit, vc_hdlr, targetPointCode); + PROC.reply(BSSMAPEM_register_handoverRequest:{targetPointCode, vc_hdlr}) to vc_hdlr; + } + [] PROC.getcall(BSSMAPEM_register_imsi:{?,?,?}) -> param(imsi, tmsi, vc_hdlr) { f_create_imsi(imsi, tmsi, vc_hdlr); PROC.reply(BSSMAPEM_register_imsi:{imsi, tmsi, vc_hdlr}) to vc_hdlr; @@ -741,18 +784,27 @@ type record ExpectData { /* L3 payload based on which we can match it */ octetstring l3_payload optional, + integer handoverRequestPointCode optional, /* component reference for this connection */ BSSAP_ConnHdlr vc_conn } /* procedure based port to register for incoming connections */ signature BSSMAPEM_register(in octetstring l3, in BSSAP_ConnHdlr hdlr); +signature BSSMAPEM_register_handoverRequest(in integer targetPointCode, in BSSAP_ConnHdlr hdlr); /* procedure based port to register for incoming IMSI/TMSI */ signature BSSMAPEM_register_imsi(in hexstring imsi, in OCT4 tmsi, in BSSAP_ConnHdlr hdlr); +/* If DTAP happens across other channels (e.g. GSUP), provide manual advancing of the n_sd sequence number */ +signature BSSMAPEM_last_n_sd(in BSSAP_ConnHdlr hdlr, out N_Sd_Array last_n_sd); + +/* Update conn's n_sd sequence nr after the connection was taken over from elsewhere */ +signature BSSMAPEM_continue_after_n_sd(N_Sd_Array last_n_sd, in BSSAP_ConnHdlr hdlr); + type port BSSMAPEM_PROC_PT procedure { - inout BSSMAPEM_register, BSSMAPEM_register_imsi; + inout BSSMAPEM_register, BSSMAPEM_register_handoverRequest, BSSMAPEM_register_imsi, BSSMAPEM_last_n_sd, + BSSMAPEM_continue_after_n_sd; } with { extension "internal" }; /* CreateCallback that can be used as create_cb and will use the expectation table */ @@ -760,16 +812,35 @@ runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { var BSSAP_ConnHdlr ret := null; var octetstring l3_info; + var boolean handoverRequest := false; + var integer handoverRequestPointCode; var integer i; - if (not ischosen(conn_ind.userData.pdu.bssmap.completeLayer3Information)) { - setverdict(fail, "N-CONNECT.ind with L3 != COMPLETE L3"); + if (ischosen(conn_ind.userData.pdu.bssmap.completeLayer3Information)) { + l3_info := conn_ind.userData.pdu.bssmap.completeLayer3Information.layer3Information.layer3info; + log("ExpectedCreateCallback completeLayer3Information"); + } else if (ischosen(conn_ind.userData.pdu.bssmap.handoverRequest)) { + handoverRequest := true; + handoverRequestPointCode := bit2int(conn_ind.calledAddress.signPointCode); + log("ExpectedCreateCallback handoverRequest ", handoverRequestPointCode); + } else { + setverdict(fail, "N-CONNECT.ind with L3 != COMPLETE L3 nor a Handover Request"); mtc.stop; return ret; } - l3_info := conn_ind.userData.pdu.bssmap.completeLayer3Information.layer3Information.layer3info; for (i := 0; i < sizeof(ExpectTable); i:= i+1) { + if (handoverRequest) { + log("ExpectTable[", i, "].handoverRequestPointCode = ", ExpectTable[i].handoverRequestPointCode, + " ==? ", handoverRequestPointCode); + if (ExpectTable[i].handoverRequestPointCode == handoverRequestPointCode) { + ret := ExpectTable[i].vc_conn; + log("Found Expect[", i, "] for handoverRequest handled at ", ret); + return ret; + } else { + continue; + } + } if (not ispresent(ExpectTable[i].l3_payload)) { continue; } @@ -788,14 +859,26 @@ return ret; } -private function f_create_expect(octetstring l3, BSSAP_ConnHdlr hdlr) +private function f_create_expect(template octetstring l3, BSSAP_ConnHdlr hdlr, + template integer handoverRequestPointCode := omit) runs on BSSMAP_Emulation_CT { var integer i; + log("f_create_expect(l3 := ", l3, ", handoverRequest := ", handoverRequestPointCode); for (i := 0; i < sizeof(ExpectTable); i := i+1) { - if (not ispresent(ExpectTable[i].l3_payload)) { - ExpectTable[i].l3_payload := l3; + if (not ispresent(ExpectTable[i].l3_payload) + and not ispresent(ExpectTable[i].handoverRequestPointCode)) { + if (ispresent(l3)) { + ExpectTable[i].l3_payload := valueof(l3); + } + if (ispresent(handoverRequestPointCode)) { + ExpectTable[i].handoverRequestPointCode := valueof(handoverRequestPointCode); + } ExpectTable[i].vc_conn := hdlr; - log("Created Expect[", i, "] for ", l3, " to be handled at ", hdlr); + if (ispresent(handoverRequestPointCode)) { + log("Created Expect[", i, "] for handoverRequest to be handled at ", hdlr); + } else { + log("Created Expect[", i, "] for ", l3, " to be handled at ", hdlr); + } return; } } @@ -821,6 +904,7 @@ runs on BSSMAP_Emulation_CT { for (var integer i := 0; i < sizeof(ExpectTable); i := i+1) { ExpectTable[i].l3_payload := omit; + ExpectTable[i].handoverRequestPointCode := omit; } } diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 4df39d4..b7230cd 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -307,7 +307,7 @@ } } -template BSSMAP_IE_CellIdentifierList ts_BSSMAP_IE_CidList(BSSMAP_FIELD_CellIdentificationList cid_list) := { +template BSSMAP_IE_CellIdentifierList ts_BSSMAP_IE_CidList(template BSSMAP_FIELD_CellIdentificationList cid_list) := { elementIdentifier := '1A'O, lengthIndicator := 0, /* overwritten */ cellIdentifierDiscriminator := '0000'B, /* overwritten */ @@ -315,31 +315,6 @@ cellIdentificationList := cid_list } -template PDU_BSSAP ts_BSSMAP_HandoReq(BssmapCause cause, BSSMAP_FIELD_CellIdentificationList cid_list) -modifies ts_BSSAP_BSSMAP := { - pdu := { - bssmap := { - handoverRequired := { - messageType := '11'O, - cause := ts_BSSMAP_IE_Cause(cause), - responseRequest := omit, - cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list), - circuitPoolList := omit, - currentChannelType1 := omit, - speechVersion := omit, - queueingIndicator := omit, - oldToNewBSSInfo := omit, - sourceToTargetRNCTransparentInfo := omit, - sourceToTargetRNCTransparentInfoCDMA := omit, - gERANClassmark := omit, - talkerPriority := omit, - speechCodec := omit, - cSG_Identifier := omit - } - } - } -} - const OCT1 ChRate_ANY := '00'O; const OCT1 ChRate_TCHF := '08'O; const OCT1 ChRate_TCHH := '09'O; @@ -703,6 +678,33 @@ } } +template PDU_BSSAP ts_BSSMAP_HandoverRequired(BssmapCause cause, + template BSSMAP_FIELD_CellIdentificationList cid_list) +modifies ts_BSSAP_BSSMAP := { + pdu := { + bssmap := { + handoverRequired := { + messageType := '11'O, + cause := ts_BSSMAP_IE_Cause(cause), + responseRequest := omit, + cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list), + circuitPoolList := omit, + currentChannelType1 := omit, + speechVersion := omit, + queueingIndicator := omit, + oldToNewBSSInfo := omit, + sourceToTargetRNCTransparentInfo := omit, + sourceToTargetRNCTransparentInfoCDMA := omit, + gERANClassmark := omit, + talkerPriority := omit, + speechCodec := omit, + cSG_Identifier := omit + } + } + } +} + + template PDU_BSSAP tr_BSSMAP_HandoverRequired modifies tr_BSSAP_BSSMAP := { pdu := { bssmap := { @@ -713,6 +715,38 @@ } } +template PDU_BSSAP tr_BSSMAP_HandoverRequiredReject modifies tr_BSSAP_BSSMAP := { + pdu := { + bssmap := { + handoverRequiredReject := { + messageType := '1A'O + } + } + } +} + +template PDU_BSSAP tr_BSSMAP_HandoverCommand +modifies tr_BSSAP_BSSMAP := { + pdu := { + bssmap := { + handoverCommand := { + messageType := '13'O + } + } + } +} + +template PDU_BSSAP tr_BSSMAP_HandoverSucceeded +modifies tr_BSSAP_BSSMAP := { + pdu := { + bssmap := { + handoverSucceeded := { + messageType := '15'O + } + } + } +} + template (value) PDU_BSSAP ts_BSSMAP_HandoverCommand(octetstring layer3info) modifies ts_BSSAP_BSSMAP := { pdu := { @@ -751,6 +785,16 @@ } } +template PDU_BSSAP tr_BSSMAP_HandoverRequest modifies tr_BSSAP_BSSMAP := { + pdu := { + bssmap := { + handoverRequest := { + messageType := '10'O + } + } + } +} + template PDU_BSSAP ts_BSSMAP_HandoverRequest( template BSSMAP_IE_CircuitIdentityCode cic := omit, template BSSMAP_IE_AoIP_TransportLayerAddress aoip_tla := omit, @@ -826,6 +870,41 @@ } } +template PDU_BSSAP ts_BSSMAP_HandoverRequestAcknowledge( + template octetstring layer3info, + template LIN1 layer3infoLength, + template BSSMAP_IE_AoIP_TransportLayerAddress aoIPTransportLayer := omit, + template BSSMAP_IE_SpeechCodec speechCodec := omit, + template BSSMAP_IE_ChosenChannel chosenChannel := omit, + template BSSMAP_IE_ChosenEncryptionAlgorithm chosenEncryptionAlgorithm := omit) +modifies ts_BSSAP_BSSMAP := { + pdu := { + bssmap := { + handoverRequestAck := { + messageType := '12'O, + layer3Information := { + elementIdentifier := '17'O, + lengthIndicator := layer3infoLength, + layer3info := layer3info + }, + chosenChannel := chosenChannel, + chosenEncryptionAlgorithm := chosenEncryptionAlgorithm, + circuitPool := omit, + speechVersion := omit, + circuitIdentityCode := omit, + lSAIdentifier := omit, + newBSSToOldBSSInfo := omit, + interSystemInformation := omit, + talkerPriority := omit, + aoIPTransportLayer := aoIPTransportLayer, + codecList := omit, + speechCodec := speechCodec, + lCLS_bSS_Status := omit + } + } + } +} + template PDU_BSSAP tr_BSSMAP_HandoverDetect modifies tr_BSSAP_BSSMAP := { pdu := { @@ -838,6 +917,18 @@ } } +template PDU_BSSAP ts_BSSMAP_HandoverDetect +modifies ts_BSSAP_BSSMAP := { + pdu := { + bssmap := { + handoverDetect := { + messageType := '1B'O, + talkerPriority := omit + } + } + } +} + template PDU_BSSAP tr_BSSMAP_HandoverComplete modifies tr_BSSAP_BSSMAP := { pdu := { @@ -856,6 +947,24 @@ } } +template PDU_BSSAP ts_BSSMAP_HandoverComplete +modifies ts_BSSAP_BSSMAP := { + pdu := { + bssmap := { + handoverComplete := { + messageType := '14'O, + rR_Cause := omit, + talkerPriority := omit, + speechCodec := omit, + codecList := omit, + chosenEncryptionAlgorithm := omit, + chosenChannel := omit, + lCLS_BSS_Status := omit + } + } + } +} + template PDU_BSSAP tr_BSSMAP_HandoverPerformed modifies tr_BSSAP_BSSMAP := { pdu := { @@ -975,7 +1084,7 @@ messageType := '52'O, iMSI := ts_BSSMAP_Imsi(imsi_digits), tMSI := f_tmsi_or_omit(tmsi), - cellIdentifierList := ts_BSSMAP_IE_CidList(valueof(cid_list)), + cellIdentifierList := ts_BSSMAP_IE_CidList(cid_list), channelNeeded := chneed, eMLPP_Priority := omit, pagingInformation := omit /* only VGCS/VBS flag */ diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index c024d37..3a0d4e5 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -55,7 +55,16 @@ OSMO_GSUP_SM_ALERT_RSN_IE ('46'O), OSMO_GSUP_IMEI_IE ('50'O), - OSMO_GSUP_IMEI_RESULT_IE ('51'O) + OSMO_GSUP_IMEI_RESULT_IE ('51'O), + + OSMO_GSUP_KIND_IE ('0a'O), + + OSMO_GSUP_SOURCE_NAME_IE ('60'O), + OSMO_GSUP_DESTINATION_NAME_IE ('61'O), + OSMO_GSUP_AN_APDU_IE ('62'O), + OSMO_GSUP_CAUSE_RR_IE ('63'O), + OSMO_GSUP_CAUSE_BSSAP_IE ('64'O), + OSMO_GSUP_CAUSE_SM_IE ('65'O) } with { variant "FIELDLENGTH(8)" }; type enumerated GSUP_MessageType { @@ -103,7 +112,27 @@ OSMO_GSUP_MSGT_CHECK_IMEI_REQUEST ('00110000'B), OSMO_GSUP_MSGT_CHECK_IMEI_ERROR ('00110001'B), - OSMO_GSUP_MSGT_CHECK_IMEI_RESULT ('00110010'B) + OSMO_GSUP_MSGT_CHECK_IMEI_RESULT ('00110010'B), + + OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_REQUEST ('00110100'B), + OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_ERROR ('00110101'B), + OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_RESULT ('00110110'B), + + OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_REQUEST ('00111000'B), + OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_ERROR ('00111001'B), + OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_RESULT ('00111010'B), + + OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_REQUEST ('00111100'B), + OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_ERROR ('00111101'B), + OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_RESULT ('00111110'B), + + OSMO_GSUP_MSGT_E_PROCESS_ACCESS_SIGNALLING_REQUEST ('01000000'B), + OSMO_GSUP_MSGT_E_FORWARD_ACCESS_SIGNALLING_REQUEST ('01000100'B), + + OSMO_GSUP_MSGT_E_CLOSE ('01000111'B), + OSMO_GSUP_MSGT_E_ABORT ('01001011'B), + + OSMO_GSUP_MSGT_E_ROUTING_ERROR ('01001110'B) } with { variant "FIELDLENGTH(8)" }; type enumerated GSUP_CancelType { @@ -128,6 +157,14 @@ OSMO_GSUP_SESSION_STATE_END (3) } with { variant "FIELDLENGTH(8)" }; +type enumerated GSUP_Kind { + OSMO_GSUP_KIND_UNSET (0), + OSMO_GSUP_KIND_SUBSCRIBER_MANAGEMENT (1), + OSMO_GSUP_KIND_SMS (2), + OSMO_GSUP_KIND_USSD (3), + OSMO_GSUP_KIND_INTER_MSC (4) +} with { variant "FIELDLENGTH(8)" }; + type record GSUP_MSISDN { uint8_t len, hexstring digits optional @@ -138,6 +175,16 @@ hexstring digits optional } with { variant (len) "LENGTHTO(digits)" }; +type enumerated GSUP_AN_PROTO { + OSMO_GSUP_AN_PROTO_48006 (1), + OSMO_GSUP_AN_PROTO_25413 (2) +} with { variant "FIELDLENGTH(8)" }; + +type record GSUP_AN_APDU { + GSUP_AN_PROTO proto, + octetstring pdu +}; + type record GSUP_IE { GSUP_IEI tag, uint8_t len, @@ -175,6 +222,13 @@ sm_alert_rsn, tag = OSMO_GSUP_SM_ALERT_RSN_IE; imei, tag = OSMO_GSUP_IMEI_IE; imei_result, tag = OSMO_GSUP_IMEI_RESULT_IE; + kind, tag = OSMO_GSUP_KIND_IE; + source_name, tag = OSMO_GSUP_SOURCE_NAME_IE; + destination_name, tag = OSMO_GSUP_DESTINATION_NAME_IE; + an_apdu, tag = OSMO_GSUP_AN_APDU_IE; + cause_rr, tag = OSMO_GSUP_CAUSE_RR_IE; + cause_bssap, tag = OSMO_GSUP_CAUSE_BSSAP_IE; + cause_sm, tag = OSMO_GSUP_CAUSE_SM_IE; )" }; @@ -219,7 +273,18 @@ GSUP_SM_ALERT_RSN_Type sm_alert_rsn, GSUP_IMEI imei, - GSUP_IMEIResult imei_result + GSUP_IMEIResult imei_result, + + GSUP_Kind kind, + + octetstring source_name, + octetstring destination_name, + + GSUP_AN_APDU an_apdu, + + OCT1 cause_rr, + OCT1 cause_bssap, + OCT1 cause_sm }; type record GSUP_PDU { @@ -930,6 +995,70 @@ } } +template GSUP_IE tr_GSUP_IE_Kind(template GSUP_Kind val) := { + tag := OSMO_GSUP_KIND_IE, + len := ?, + val := { + kind := val + } +} + +template (value) GSUP_IE ts_GSUP_IE_Kind(GSUP_Kind val) := { + tag := OSMO_GSUP_KIND_IE, + len := 0, /* overwritten */ + val := { + kind := val + } +} + +template GSUP_IE tr_GSUP_IE_Source_Name(template octetstring name) := { + tag := OSMO_GSUP_SOURCE_NAME_IE, + len := ?, + val := { + source_name := name + } +} + +template (value) GSUP_IE ts_GSUP_IE_Source_Name(octetstring name) := { + tag := OSMO_GSUP_SOURCE_NAME_IE, + len := 0, /* overwritten */ + val := { + source_name := name + } +} + +template GSUP_IE tr_GSUP_IE_Destination_Name(template octetstring name) := { + tag := OSMO_GSUP_DESTINATION_NAME_IE, + len := ?, + val := { + destination_name := name + } +} + +template (value) GSUP_IE ts_GSUP_IE_Destination_Name(octetstring name) := { + tag := OSMO_GSUP_DESTINATION_NAME_IE, + len := 0, /* overwritten */ + val := { + destination_name := name + } +} + +template GSUP_IE tr_GSUP_IE_AN_APDU(template GSUP_AN_APDU an_apdu) := { + tag := OSMO_GSUP_AN_APDU_IE, + len := ?, + val := { + an_apdu := an_apdu + } +} + +template (value) GSUP_IE ts_GSUP_IE_AN_APDU(GSUP_AN_APDU an_apdu) := { + tag := OSMO_GSUP_AN_APDU_IE, + len := 0, /* overwritten */ + val := { + an_apdu := an_apdu + } +} + private function f_gen_ts_ss_ies( hexstring imsi, OCT4 sid, @@ -962,14 +1091,20 @@ tr_GSUP_IE_SessionId(sid), tr_GSUP_IE_SessionState(state) }; + var integer last_idx := 3; /* Optional SS payload */ if (istemplatekind(ss, "*")) { ies[3] := *; + last_idx := last_idx + 1; } else if (not istemplatekind(ss, "omit")) { ies[3] := tr_GSUP_IE_SSInfo(ss); + last_idx := last_idx + 1; } + ies[last_idx] := tr_GSUP_IE_Kind(OSMO_GSUP_KIND_USSD); + last_idx := last_idx + 1; + return ies; } @@ -1036,7 +1171,8 @@ tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause), tr_GSUP_IE_SessionId(sid), - tr_GSUP_IE_SessionState(state) + tr_GSUP_IE_SessionState(state), + tr_GSUP_IE_Kind(OSMO_GSUP_KIND_SMS) } ); @@ -1069,7 +1205,8 @@ tr_GSUP_IE_SM_RP_MR(sm_rp_mr), tr_GSUP_IE_SM_RP_DA(sm_rp_da), tr_GSUP_IE_SM_RP_OA(sm_rp_oa), - tr_GSUP_IE_SM_RP_UI(sm_rp_ui) + tr_GSUP_IE_SM_RP_UI(sm_rp_ui), + tr_GSUP_IE_Kind(OSMO_GSUP_KIND_SMS) } ); @@ -1090,7 +1227,8 @@ OSMO_GSUP_MSGT_MO_FORWARD_SM_RESULT, { tr_GSUP_IE_IMSI(imsi), - tr_GSUP_IE_SM_RP_MR(sm_rp_mr) + tr_GSUP_IE_SM_RP_MR(sm_rp_mr), + tr_GSUP_IE_Kind(OSMO_GSUP_KIND_SMS) } ); @@ -1115,7 +1253,8 @@ { tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_SM_RP_MR(sm_rp_mr), - tr_GSUP_IE_SM_RP_CAUSE(sm_rp_cause) + tr_GSUP_IE_SM_RP_CAUSE(sm_rp_cause), + tr_GSUP_IE_Kind(OSMO_GSUP_KIND_SMS) } ); @@ -1162,7 +1301,8 @@ tr_GSUP_IE_SM_RP_DA(sm_rp_da), tr_GSUP_IE_SM_RP_OA(sm_rp_oa), tr_GSUP_IE_SM_RP_UI(sm_rp_ui), - tr_GSUP_IE_SM_RP_MMS(sm_rp_mms) + tr_GSUP_IE_SM_RP_MMS(sm_rp_mms), + tr_GSUP_IE_Kind(OSMO_GSUP_KIND_SMS) } ); @@ -1183,7 +1323,8 @@ OSMO_GSUP_MSGT_MT_FORWARD_SM_RESULT, { tr_GSUP_IE_IMSI(imsi), - tr_GSUP_IE_SM_RP_MR(sm_rp_mr) + tr_GSUP_IE_SM_RP_MR(sm_rp_mr), + tr_GSUP_IE_Kind(OSMO_GSUP_KIND_SMS) } ); @@ -1208,7 +1349,8 @@ { tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_SM_RP_MR(sm_rp_mr), - tr_GSUP_IE_SM_RP_CAUSE(sm_rp_cause) + tr_GSUP_IE_SM_RP_CAUSE(sm_rp_cause), + tr_GSUP_IE_Kind(OSMO_GSUP_KIND_SMS) } ); @@ -1233,7 +1375,8 @@ { tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_SM_RP_MR(sm_rp_mr), - tr_GSUP_IE_SM_ALERT_RSN(sm_alert_rsn) + tr_GSUP_IE_SM_ALERT_RSN(sm_alert_rsn), + tr_GSUP_IE_Kind(OSMO_GSUP_KIND_SMS) } ); @@ -1254,7 +1397,8 @@ OSMO_GSUP_MSGT_READY_FOR_SM_RESULT, { tr_GSUP_IE_IMSI(imsi), - tr_GSUP_IE_SM_RP_MR(sm_rp_mr) + tr_GSUP_IE_SM_RP_MR(sm_rp_mr), + tr_GSUP_IE_Kind(OSMO_GSUP_KIND_SMS) } ); @@ -1279,7 +1423,8 @@ { tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_SM_RP_MR(sm_rp_mr), - tr_GSUP_IE_SM_RP_CAUSE(sm_rp_cause) + tr_GSUP_IE_SM_RP_CAUSE(sm_rp_cause), + tr_GSUP_IE_Kind(OSMO_GSUP_KIND_SMS) } ); @@ -1293,5 +1438,79 @@ return false; } +template GSUP_AN_APDU t_GSUP_AN_APDU( + template GSUP_AN_PROTO an_proto := ?, + template octetstring pdu := ? +) := { + proto := an_proto, + pdu := pdu +}; + +template GSUP_PDU tr_GSUP_E_AN_APDU( + template GSUP_MessageType msgt, + template hexstring imsi := ?, + template octetstring source_name := ?, + template octetstring destination_name := ?, + template GSUP_AN_APDU an_apdu := ? +) := tr_GSUP( + msgt, + { + tr_GSUP_IE_IMSI(imsi), + tr_GSUP_IE_Kind(OSMO_GSUP_KIND_INTER_MSC), + tr_GSUP_IE_Source_Name(source_name), + tr_GSUP_IE_Destination_Name(destination_name), + tr_GSUP_IE_AN_APDU(an_apdu) + } +); + +template GSUP_PDU tr_GSUP_E_NO_PDU( + template GSUP_MessageType msgt, + template hexstring imsi := ?, + template octetstring source_name := ?, + template octetstring destination_name := ? +) := tr_GSUP( + msgt, + { + tr_GSUP_IE_IMSI(imsi), + tr_GSUP_IE_Kind(OSMO_GSUP_KIND_INTER_MSC), + tr_GSUP_IE_Source_Name(source_name), + tr_GSUP_IE_Destination_Name(destination_name) + } +); + +template (value) GSUP_PDU ts_GSUP_E_AN_APDU( + GSUP_MessageType msgt, + hexstring imsi, + octetstring source_name, + octetstring destination_name, + GSUP_AN_APDU an_apdu +) := ts_GSUP( + msgt, + { + valueof(ts_GSUP_IE_IMSI(imsi)), + valueof(ts_GSUP_IE_Kind(OSMO_GSUP_KIND_INTER_MSC)), + valueof(ts_GSUP_IE_Source_Name(source_name)), + valueof(ts_GSUP_IE_Destination_Name(destination_name)), + valueof(ts_GSUP_IE_AN_APDU(an_apdu)) + } +); + +template (value) GSUP_PDU ts_GSUP_E_PrepareHandoverResult( + hexstring imsi, + hexstring msisdn, + octetstring source_name, + octetstring destination_name, + GSUP_AN_APDU an_apdu +) := ts_GSUP( + OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_RESULT, + { + valueof(ts_GSUP_IE_IMSI(imsi)), + valueof(ts_GSUP_IE_MSISDN(msisdn)), + valueof(ts_GSUP_IE_Kind(OSMO_GSUP_KIND_INTER_MSC)), + valueof(ts_GSUP_IE_Source_Name(source_name)), + valueof(ts_GSUP_IE_Destination_Name(destination_name)), + valueof(ts_GSUP_IE_AN_APDU(an_apdu)) + } +); } with { encode "RAW"; variant "FIELDORDER(msb)" } diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 6099303..cf6d64c 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -582,6 +582,59 @@ } } +template PDU_ML3_NW_MS tr_RR_HandoverCommand := { + discriminator := '0110'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + rrm := { + handoverCommand := { + messageType := '00101011'B, + cellDescription := ?, + channelDescription2 := ?, + handoverReference := ?, + powerCommandAndAccesstype := ?, + synchronizationIndication := *, + frequencyShortListAfterTime := *, + frequencyListAfterTime := *, + cellChannelDescription := *, + multislotAllocation := *, + modeOfChannelSet1 := *, + modeOfChannelSet2 := *, + modeOfChannelSet3 := *, + modeOfChannelSet4 := *, + modeOfChannelSet5 := *, + modeOfChannelSet6 := *, + modeOfChannelSet7 := *, + modeOfChannelSet8 := *, + descrOf2ndCh_at := *, + modeOf2ndChannel := *, + frequencyChannelSequence_at := *, + mobileAllocation_at := *, + startingTime := *, + timeDifference := *, + timingAdvance := *, + frequencyShortListBeforeTime := *, + frequencyListBeforeTime := *, + descrOf1stCh_bt := *, + descrOf2ndCh_bt := *, + frequencyChannelSequence_bt := *, + mobileAllocation_bt := *, + cipherModeSetting := *, + vGCS_TargetModeIndication := *, + multiRateConfiguration := *, + dynamicARFCN_Mapping := *, + vGCS_Ciphering_Parameters := *, + dedicatedServiceInformation := *, + pLMNIndex := *, + extendedTSCSet_afterTime := *, + extendedTSCSet_beforeTime := * + } + } + } +} + function ts_CM3_TLV(template (omit) OCTN cm3) return template MobileStationClassmark3_TLV { if (not isvalue(cm3)) { return omit; @@ -1271,12 +1324,12 @@ } -template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_REL_COMPL(integer tid) := { +template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_REL_COMPL(integer tid, BIT1 tid_remote := '0'B) := { discriminator := '0011'B, tiOrSkip := { transactionId := { tio := int2bit(tid, 3), - tiFlag := '0'B, + tiFlag := tid_remote, tIExtension := omit } }, diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 833c31f..25444b2 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -411,6 +411,8 @@ /* CC related parameters */ hexstring called_party, /* whom are we calling */ integer transaction_id optional, /* which TS 04.08 CC transaction ID to use */ + boolean mo_call, /* For a MO call, the transaction_id was allocated by the MS, + important to set the TI flag properly */ BearerCapability_TLV bearer_cap, /* which bearer capabilities to claim */ boolean emergency, /* is this an emergency call? */ @@ -441,6 +443,7 @@ template (value) CallParameters t_CallParams(hexstring called, integer tid) := { called_party := called, transaction_id := tid, + mo_call := false, bearer_cap := valueof(ts_Bcap_voice), emergency := false, mncc_callref := omit, @@ -455,6 +458,7 @@ mgw_rtp_port_mss := 11000, rtp_payload_type := 98, rtp_sdp_format := "AMR/8000", + mgw_drop_dlcx := false, mgcp_call_id := omit, mgcp_ep := omit, mgcp_connection_id_bss := '0'H,// @@ -774,17 +778,24 @@ MNCC.send(ts_MNCC_DISC_req(cpars.mncc_callref, valueof(ts_MNCC_cause(23)))); BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(cpars.transaction_id))); + log("f_call_hangup 1: rx DTAP CC DISC"); + if (release_by_ms) { - log("f_call_hangup 1a"); + var BIT1 tid_remote := '1'B; + if (cpars.mo_call) { + tid_remote := '0'B; + } /* B-side (MS) Release of call */ - BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_RELEASE(cpars.transaction_id, '1'B, '0000000'B))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_RELEASE(cpars.transaction_id, tid_remote, '0000000'B))); MNCC.receive(tr_MNCC_REL_ind(cpars.mncc_callref)); + log("f_call_hangup 2: rx MNCC REL ind"); BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_REL_COMPL(cpars.transaction_id))); + log("f_call_hangup 3: rx DTAP CC REL COMPL"); } else { - log("f_call_hangup 1b"); /* A-side (PLMN) Release of call */ MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, valueof(ts_MNCC_cause(42)))); BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); + log("f_call_hangup 4: rx DTAP CC RELEASE"); BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id))); } @@ -795,13 +806,13 @@ /* clearing of radio channel */ interleave { [] BSSAP.receive(t_clear) { - log("f_call_hangup 2"); + log("f_call_hangup 5: rx BSSAP Clear Command"); BSSAP.send(ts_BSSMAP_ClearComplete); BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - log("f_call_hangup 3"); + log("f_call_hangup 6: rx SCCP DISC"); } [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { - log("f_call_hangup 4"); + log("f_call_hangup 7: rx MGCP DLCX"); if (respond_to_dlcx) { MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); } @@ -813,18 +824,17 @@ * Unless the first DLCX did not contain a CI, in which case it was a wildcard DLCX for both. */ if (dlcx_contained_ci) { MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { - log("f_call_hangup 5"); - if (respond_to_dlcx) { - MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); - } + log("f_call_hangup 8: rx MGCP DLCX"); + if (respond_to_dlcx) { + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); } } } f_create_mgcp_delete_ep(cpars.mgcp_ep); + log("f_call_hangup 9: done"); deactivate(mdcx); - log("f_call_hangup DONE"); setverdict(pass); } @@ -943,6 +953,27 @@ } } +function f_create_bssmap_exp_handoverRequest(integer targetPointCode) runs on BSC_ConnHdlr { + BSSAP_PROC.call(BSSMAPEM_register_handoverRequest:{targetPointCode, self}) { + [] BSSAP_PROC.getreply(BSSMAPEM_register_handoverRequest:{?, ?}) {}; + } +} + +function f_bssmap_last_n_sd() runs on BSC_ConnHdlr return N_Sd_Array { + var N_Sd_Array last_n_sd; + BSSAP_PROC.call(BSSMAPEM_last_n_sd:{self, -}) { + [] BSSAP_PROC.getreply(BSSMAPEM_last_n_sd:{self, ?}) -> param(last_n_sd) { + return last_n_sd; + }; + } +} + +function f_bssmap_continue_after_n_sd(N_Sd_Array last_n_sd) runs on BSC_ConnHdlr { + BSSAP_PROC.call(BSSMAPEM_continue_after_n_sd:{last_n_sd, self}) { + [] BSSAP_PROC.getreply(BSSMAPEM_continue_after_n_sd:{last_n_sd, self}); + } +} + type record SmsParametersTp { OCT1 msg_ref, TP_DA da, diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index bf3c60e..957ea67 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -154,8 +154,16 @@ } } -private altstep as_optional_cc_rel(CallParameters cpars) runs on BSC_ConnHdlr { - [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))) { repeat; }; +private altstep as_optional_cc_rel(CallParameters cpars, boolean respond := false) runs on BSC_ConnHdlr { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))) { + if (respond) { + var BIT1 tid_remote := '1'B; + if (cpars.mo_call) { + tid_remote := '0'B; + } + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id, tid_remote))); + } + } } function f_init_smpp(charstring id) runs on MTC_CT { @@ -457,31 +465,6 @@ } } -template PDU_BSSAP ts_BSSMAP_HandoReq(BssmapCause cause, BSSMAP_IE_CellIdentifierList cid_list) -modifies ts_BSSAP_BSSMAP := { - pdu := { - bssmap := { - handoverRequired := { - messageType := '11'O, - cause := ts_BSSMAP_IE_Cause(cause), - responseRequest := omit, - cellIdentifierList := cid_list, - circuitPoolList := omit, - currentChannelType1 := omit, - speechVersion := omit, - queueingIndicator := omit, - oldToNewBSSInfo := omit, - sourceToTargetRNCTransparentInfo := omit, - sourceToTargetRNCTransparentInfoCDMA := omit, - gERANClassmark := omit, - talkerPriority := omit, - speechCodec := omit, - cSG_Identifier := omit - } - } - } -} - type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; /* FIXME: move into BSC_ConnectionHandler? */ @@ -516,14 +499,14 @@ return pars; } -function f_start_handler_with_pars(void_fn fn, BSC_ConnHdlrPars pars) runs on MTC_CT return BSC_ConnHdlr { +function f_start_handler_with_pars(void_fn fn, BSC_ConnHdlrPars pars, integer bssap_idx := 0) runs on MTC_CT return BSC_ConnHdlr { var BSC_ConnHdlr vc_conn; - var charstring id := testcasename(); + var charstring id := testcasename() & int2str(bssap_idx); vc_conn := BSC_ConnHdlr.create(id); /* BSSMAP part / A interface */ - connect(vc_conn:BSSAP, g_bssap[0].vc_BSSMAP:CLIENT); - connect(vc_conn:BSSAP_PROC, g_bssap[0].vc_BSSMAP:PROC); + connect(vc_conn:BSSAP, g_bssap[bssap_idx].vc_BSSMAP:CLIENT); + connect(vc_conn:BSSAP_PROC, g_bssap[bssap_idx].vc_BSSMAP:PROC); /* MNCC part */ connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT); connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC); @@ -550,8 +533,9 @@ return vc_conn; } -function f_start_handler(void_fn fn, integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlr { - return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix)); + +function f_start_handler(void_fn fn, integer imsi_suffix, integer bssap_idx := 0) runs on MTC_CT return BSC_ConnHdlr { + return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix), bssap_idx); } private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -4655,6 +4639,434 @@ * */ +private function f_tc_ho_inter_bsc_unknown_cell(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + f_init_handler(pars); + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); + cpars.bss_rtp_port := 1110; + cpars.mgcp_connection_id_bss := '22222'H; + cpars.mgcp_connection_id_mss := '33333'H; + cpars.mgcp_ep := "rtpbridge/1 at mgw"; + cpars.mo_call := true; + + f_perform_lu(); + f_mo_call_establish(cpars); + + f_sleep(1.0); + + var myBSSMAP_Cause cause_val := GSM0808_CAUSE_BETTER_CELL; + var BssmapCause cause := enum2int(cause_val); + + var template BSSMAP_FIELD_CellIdentificationList cil; + cil := { cIl_LAI := { ts_BSSMAP_CI_LAI('023'H, '42'H, 999) } }; + + BSSAP.send(ts_BSSMAP_HandoverRequired(cause, cil)); + BSSAP.receive(tr_BSSMAP_HandoverRequiredReject); + + f_call_hangup(cpars, true); +} +testcase TC_ho_inter_bsc_unknown_cell() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_ho_inter_bsc_unknown_cell), 53); + vc_conn.done; +} + +private altstep as_mgcp_ack_all_mdcx(CallParameters cpars) runs on BSC_ConnHdlr { + var MgcpCommand mgcp_cmd; + [] MGCP.receive(tr_MDCX) -> value mgcp_cmd { + var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, + hex2str(cpars.mgcp_call_id), "42", + cpars.mgw_rtp_port_mss, + { int2str(cpars.rtp_payload_type) }, + { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, + cpars.rtp_sdp_format)), + valueof(ts_SDP_ptime(20)) })); + MGCP.send(ts_MDCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + repeat; + } +} + +private function f_tc_ho_inter_bsc0(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); + cpars.bss_rtp_port := 1110; + cpars.mgcp_connection_id_bss := '22222'H; + cpars.mgcp_connection_id_mss := '33333'H; + cpars.mgcp_ep := "rtpbridge/1 at mgw"; + cpars.mo_call := true; + + f_init_handler(pars); + + f_perform_lu(); + f_mo_call_establish(cpars); + + f_sleep(1.0); + + var default ack_mdcx := activate(as_mgcp_ack_all_mdcx(cpars)); + + var myBSSMAP_Cause cause_val := GSM0808_CAUSE_BETTER_CELL; + var BssmapCause cause := enum2int(cause_val); + + var template BSSMAP_FIELD_CellIdentificationList cil; + cil := { cIl_LAI := { ts_BSSMAP_CI_LAI('023'H, '42'H, 5) } }; + + /* old BSS sends Handover Required */ + BSSAP.send(ts_BSSMAP_HandoverRequired(cause, cil)); + + /* Now the action goes on in f_tc_ho_inter_bsc1() */ + + /* MSC forwards the RR Handover Command to old BSS */ + var PDU_BSSAP ho_command; + BSSAP.receive(tr_BSSMAP_HandoverCommand) -> value ho_command; + + log("GOT HandoverCommand", ho_command); + + BSSAP.receive(tr_BSSMAP_HandoverSucceeded); + + /* f_tc_ho_inter_bsc1() completes Handover, then expecting a Clear here. */ + f_expect_clear(); + + log("FIRST inter-BSC Handover done"); + + + /* ------------------------ */ + + /* Ok, that went well, now the other BSC is handovering back here -- + * from now on this here is the new BSS. */ + f_create_bssmap_exp_handoverRequest(193); + + var PDU_BSSAP ho_request; + BSSAP.receive(tr_BSSMAP_HandoverRequest) -> value ho_request; + + /* new BSS composes a RR Handover Command */ + var PDU_ML3_NW_MS rr_ho_cmd := valueof(ts_RR_HandoverCommand); + var octetstring rr_ho_cmd_enc := enc_PDU_ML3_NW_MS(rr_ho_cmd); + var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342)); + BSSAP.send(ts_BSSMAP_HandoverRequestAcknowledge(rr_ho_cmd_enc, lengthof(rr_ho_cmd_enc), + tla, ts_BSSMAP_IE_SpeechCodec({ts_CodecFR}))); + + /* Now f_tc_ho_inter_bsc1() expects HandoverCommand */ + + f_sleep(0.5); + + /* Notify that the MS is now over here */ + + BSSAP.send(ts_BSSMAP_HandoverDetect); + f_sleep(0.1); + BSSAP.send(ts_BSSMAP_HandoverComplete); + + f_sleep(3.0); + + deactivate(ack_mdcx); + + var default ccrel := activate(as_optional_cc_rel(cpars, true)); + f_call_hangup(cpars, true); + f_sleep(1.0); + deactivate(ccrel); + + setverdict(pass); +} +private function f_tc_ho_inter_bsc1(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + f_init_handler(pars); + f_create_bssmap_exp_handoverRequest(194); + + var PDU_BSSAP ho_request; + BSSAP.receive(tr_BSSMAP_HandoverRequest) -> value ho_request; + + /* new BSS composes a RR Handover Command */ + var PDU_ML3_NW_MS rr_ho_cmd := valueof(ts_RR_HandoverCommand); + var octetstring rr_ho_cmd_enc := enc_PDU_ML3_NW_MS(rr_ho_cmd); + var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342)); + BSSAP.send(ts_BSSMAP_HandoverRequestAcknowledge(rr_ho_cmd_enc, lengthof(rr_ho_cmd_enc), + tla, ts_BSSMAP_IE_SpeechCodec({ts_CodecFR}))); + + /* Now f_tc_ho_inter_bsc0() expects HandoverCommand */ + + f_sleep(0.5); + + /* Notify that the MS is now over here */ + + BSSAP.send(ts_BSSMAP_HandoverDetect); + f_sleep(0.1); + BSSAP.send(ts_BSSMAP_HandoverComplete); + + f_sleep(3.0); + + /* Now I'd like to f_call_hangup() but we don't know any cpars here. So + * ... handover back to the first BSC :P */ + + var myBSSMAP_Cause cause_val := GSM0808_CAUSE_BETTER_CELL; + var BssmapCause cause := enum2int(cause_val); + + var template BSSMAP_FIELD_CellIdentificationList cil; + cil := { cIl_LAI := { ts_BSSMAP_CI_LAI('262'H, '42'H, 23) } }; + + /* old BSS sends Handover Required */ + BSSAP.send(ts_BSSMAP_HandoverRequired(cause, cil)); + + /* Now the action goes on in f_tc_ho_inter_bsc0() */ + + /* MSC forwards the RR Handover Command to old BSS */ + var PDU_BSSAP ho_command; + BSSAP.receive(tr_BSSMAP_HandoverCommand) -> value ho_command; + + log("GOT HandoverCommand", ho_command); + + BSSAP.receive(tr_BSSMAP_HandoverSucceeded); + + /* f_tc_ho_inter_bsc1() completes Handover, then expecting a Clear here. */ + f_expect_clear(); + setverdict(pass); +} +testcase TC_ho_inter_bsc() runs on MTC_CT { + var BSC_ConnHdlr vc_conn0; + var BSC_ConnHdlr vc_conn1; + f_init(2); + + var BSC_ConnHdlrPars pars0 := f_init_pars(53); + var BSC_ConnHdlrPars pars1 := f_init_pars(53); + + vc_conn0 := f_start_handler_with_pars(refers(f_tc_ho_inter_bsc0), pars0, 0); + vc_conn1 := f_start_handler_with_pars(refers(f_tc_ho_inter_bsc1), pars1, 1); + vc_conn0.done; + vc_conn1.done; +} + +function f_ML3_patch_seq_nr_MS_NW(in uint2_t seq_nr, inout octetstring enc_l3) { + log("MS_NW patching N(SD)=", seq_nr, " into dtap ", enc_l3); + enc_l3[2] := (enc_l3[2] and4b '3f'O) or4b bit2oct(int2bit(seq_nr, 8) << 6); + log("MS_NW patched enc_l3: ", enc_l3); +} + +private function f_tc_ho_inter_msc_out(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); + cpars.bss_rtp_port := 1110; + cpars.mgcp_connection_id_bss := '22222'H; + cpars.mgcp_connection_id_mss := '33333'H; + cpars.mgcp_ep := "rtpbridge/1 at mgw"; + cpars.mo_call := true; + var hexstring ho_number := f_gen_msisdn(99999); + + f_init_handler(pars); + + f_create_mncc_expect(hex2str(ho_number)); + + f_perform_lu(); + f_mo_call_establish(cpars); + + f_sleep(1.0); + + var default ack_mdcx := activate(as_mgcp_ack_all_mdcx(cpars)); + + var myBSSMAP_Cause cause_val := GSM0808_CAUSE_BETTER_CELL; + var BssmapCause cause := enum2int(cause_val); + + var template BSSMAP_FIELD_CellIdentificationList cil; + cil := { cIl_LAI := { ts_BSSMAP_CI_LAI('017'H, '017'H, 1) } }; + + /* old BSS sends Handover Required */ + BSSAP.send(ts_BSSMAP_HandoverRequired(cause, cil)); + + /* The target cell 017-017 LAC 1 is configured to be a remote MSC of name "msc-017-017-1". + * This MSC tries to reach the other MSC via GSUP. */ + + var octetstring remote_msc_name := '6D73632D3031372D3031372D31'O; /* "msc-017-017-1" as octetstring */ + var GSUP_PDU prep_ho_req; + GSUP.receive(tr_GSUP_E_AN_APDU(OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_REQUEST, + pars.imsi, destination_name := remote_msc_name)) -> value prep_ho_req; + + var GSUP_IeValue source_name_ie; + f_gsup_find_ie(prep_ho_req, OSMO_GSUP_SOURCE_NAME_IE, source_name_ie); + var octetstring local_msc_name := source_name_ie.source_name; + + /* Remote MSC has figured out its BSC and signals success */ + var PDU_ML3_NW_MS rr_ho_cmd := valueof(ts_RR_HandoverCommand); + var octetstring rr_ho_cmd_enc := enc_PDU_ML3_NW_MS(rr_ho_cmd); + var PDU_BSSAP ho_req_ack := valueof(ts_BSSMAP_HandoverRequestAcknowledge(rr_ho_cmd_enc, lengthof(rr_ho_cmd_enc), + aoIPTransportLayer := omit, + speechCodec := ts_BSSMAP_IE_SpeechCodec({ts_CodecFR}))); + GSUP.send(ts_GSUP_E_PrepareHandoverResult( + pars.imsi, + ho_number, + remote_msc_name, local_msc_name, + valueof(t_GSUP_AN_APDU(OSMO_GSUP_AN_PROTO_48006, enc_PDU_BSSAP(ho_req_ack))))); + + /* MSC forwards the RR Handover Command to old BSS */ + BSSAP.receive(tr_BSSMAP_HandoverCommand); + + /* The MS shows up at remote new BSS */ + + GSUP.send(ts_GSUP_E_AN_APDU(OSMO_GSUP_MSGT_E_PROCESS_ACCESS_SIGNALLING_REQUEST, + pars.imsi, remote_msc_name, local_msc_name, + valueof(t_GSUP_AN_APDU(OSMO_GSUP_AN_PROTO_48006, + enc_PDU_BSSAP(valueof(ts_BSSMAP_HandoverDetect)))))); + BSSAP.receive(tr_BSSMAP_HandoverSucceeded); + f_sleep(0.1); + + /* Save the MS sequence counters for use on the other connection */ + var N_Sd_Array last_n_sd := f_bssmap_last_n_sd(); + + GSUP.send(ts_GSUP_E_AN_APDU(OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_REQUEST, + pars.imsi, remote_msc_name, local_msc_name, + valueof(t_GSUP_AN_APDU(OSMO_GSUP_AN_PROTO_48006, + enc_PDU_BSSAP(valueof(ts_BSSMAP_HandoverComplete)))))); + + /* The local BSS conn clears, all communication goes via remote MSC now */ + f_expect_clear(); + + /**********************************/ + /* Play through some signalling across the inter-MSC link. + * This is a copy of f_tc_lu_and_mo_ussd_single_request() translated into GSUP AN-APDUs. */ + + var template OCTN facility_req := f_USSD_FACILITY_IE_INVOKE( + invoke_id := 5, /* Phone may not start from 0 or 1 */ + op_code := SS_OP_CODE_PROCESS_USS_REQ, + ussd_string := "*#100#" + ); + + var template OCTN facility_rsp := f_USSD_FACILITY_IE_RETURN_RESULT( + invoke_id := 5, /* InvokeID shall be the same for both REQ and RSP */ + op_code := SS_OP_CODE_PROCESS_USS_REQ, + ussd_string := "Your extension is " & hex2str(g_pars.msisdn) & "\r" + ) + + /* Compose a new SS/REGISTER message with request */ + var template (value) PDU_ML3_MS_NW ussd_req := ts_ML3_MO_SS_REGISTER( + tid := 1, /* We just need a single transaction */ + ti_flag := c_TIF_ORIG, /* Sent from the side that originates the TI */ + facility := valueof(facility_req) + ); + var PDU_ML3_MS_NW ussd_req_v := valueof(ussd_req); + + /* Compose SS/RELEASE_COMPLETE template with expected response */ + var template PDU_ML3_NW_MS ussd_rsp := tr_ML3_MT_SS_RELEASE_COMPLETE( + tid := 1, /* Response should arrive within the same transaction */ + ti_flag := c_TIF_REPL, /* Sent to the side that originates the TI */ + facility := valueof(facility_rsp) + ); + + /* Compose expected MSC -> HLR message */ + var template GSUP_PDU gsup_req := tr_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + state := OSMO_GSUP_SESSION_STATE_BEGIN, + ss := valueof(facility_req) + ); + + /* To be used for sending response with correct session ID */ + var GSUP_PDU gsup_req_complete; + + /* Request own number */ + /* From remote MSC instead of BSSAP directly */ + /* Patch the correct N_SD value into the message. */ + var octetstring l3_enc := enc_PDU_ML3_MS_NW(ussd_req_v); + var BSSMAP_Emulation.ConnectionData cd; + f_ML3_patch_seq_nr_MS_NW(f_next_n_sd(last_n_sd, f_ML3_n_sd_idx(ussd_req_v)), l3_enc); + GSUP.send(ts_GSUP_E_AN_APDU(OSMO_GSUP_MSGT_E_PROCESS_ACCESS_SIGNALLING_REQUEST, + pars.imsi, remote_msc_name, local_msc_name, + valueof(t_GSUP_AN_APDU(OSMO_GSUP_AN_PROTO_48006, + enc_PDU_BSSAP(valueof(ts_BSSAP_DTAP(l3_enc))) + )) + )); + + /* Expect GSUP message containing the SS payload */ + gsup_req_complete := f_expect_gsup_msg(gsup_req); + + /* Compose the response from HLR using received session ID */ + var template GSUP_PDU gsup_rsp := ts_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + sid := gsup_req_complete.ies[1].val.session_id, + state := OSMO_GSUP_SESSION_STATE_END, + ss := valueof(facility_rsp) + ); + + /* Finally, HLR terminates the session */ + GSUP.send(gsup_rsp); + + /* The USSD response goes out to remote MSC, on GSUP E instead of BSSAP */ + var GSUP_PDU gsup_ussd_rsp; + GSUP.receive(tr_GSUP_E_AN_APDU(OSMO_GSUP_MSGT_E_FORWARD_ACCESS_SIGNALLING_REQUEST, + pars.imsi, destination_name := remote_msc_name)) -> value gsup_ussd_rsp; + + var GSUP_IeValue an_apdu; + if (not f_gsup_find_ie(gsup_ussd_rsp, OSMO_GSUP_AN_APDU_IE, an_apdu)) { + setverdict(fail, "No AN-APDU in received GSUP message. Expected USSD response in DTAP, got", gsup_ussd_rsp); + mtc.stop; + } + var PDU_BSSAP bssap_dtap_mt := dec_PDU_BSSAP(an_apdu.an_apdu.pdu); + var PDU_ML3_NW_MS dtap_mt := dec_PDU_ML3_NW_MS(bssap_dtap_mt.pdu.dtap); + log("Expecting", ussd_rsp); + log("Got", dtap_mt); + if (not match(dtap_mt, ussd_rsp)) { + setverdict(fail, "Unexpected GSUP message. Expected USSD response in DTAP, got", gsup_ussd_rsp); + mtc.stop; + } + /**********************************/ + + + /* inter-MSC handover back to the first MSC */ + f_create_bssmap_exp_handoverRequest(193); + cil := { cIl_CGI := { ts_BSSMAP_CI_CGI('262'H, '42'H, 23, 42) } }; + + /* old BSS sends Handover Required, via inter-MSC E link: like + * BSSAP.send(ts_BSSMAP_HandoverRequired(cause, cil)); + * but via GSUP */ + GSUP.send(ts_GSUP_E_AN_APDU(OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_REQUEST, + pars.imsi, remote_msc_name, local_msc_name, + valueof(t_GSUP_AN_APDU(OSMO_GSUP_AN_PROTO_48006, + enc_PDU_BSSAP(valueof(ts_BSSMAP_HandoverRequired(cause, cil))) + )) + )); + + /* MSC asks local BSS to prepare Handover to it */ + BSSAP.receive(tr_BSSMAP_HandoverRequest); + + /* Make sure the new BSSAP conn continues with the correct N_SD sequence numbers */ + f_bssmap_continue_after_n_sd(last_n_sd); + + /* new BSS composes a RR Handover Command */ + rr_ho_cmd := valueof(ts_RR_HandoverCommand); + rr_ho_cmd_enc := enc_PDU_ML3_NW_MS(rr_ho_cmd); + var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342)); + BSSAP.send(ts_BSSMAP_HandoverRequestAcknowledge(rr_ho_cmd_enc, lengthof(rr_ho_cmd_enc), + tla, ts_BSSMAP_IE_SpeechCodec({ts_CodecFR}))); + + /* HandoverCommand goes out via remote MSC-I */ + var GSUP_PDU prep_subsq_ho_res; + GSUP.receive(tr_GSUP_E_AN_APDU(OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_RESULT, + pars.imsi, destination_name := remote_msc_name)) -> value prep_subsq_ho_res; + + /* MS shows up at the local BSS */ + BSSAP.send(ts_BSSMAP_HandoverDetect); + f_sleep(0.1); + BSSAP.send(ts_BSSMAP_HandoverComplete); + + /* MS has handovered to here, Clear Command goes out via remote MSC-I -- in form of a GSUP Close. */ + GSUP.receive(tr_GSUP_E_NO_PDU(OSMO_GSUP_MSGT_E_CLOSE, + pars.imsi, destination_name := remote_msc_name)); + + /* Handover ends successfully. Call goes on for a little longer and then we hang up. */ + + f_sleep(1.0); + deactivate(ack_mdcx); + + var default ccrel := activate(as_optional_cc_rel(cpars, true)); + f_call_hangup(cpars, true); + f_sleep(1.0); + deactivate(ccrel); + + setverdict(pass); +} +testcase TC_ho_inter_msc_out() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(1); + + var BSC_ConnHdlrPars pars := f_init_pars(54); + + vc_conn := f_start_handler_with_pars(refers(f_tc_ho_inter_msc_out), pars, 0); + vc_conn.done; +} + + control { execute( TC_cr_before_reset() ); execute( TC_lu_imsi_noauth_tmsi() ); @@ -4722,7 +5134,6 @@ execute( TC_lu_and_mt_ussd_during_mt_call() ); execute( TC_lu_and_mo_ussd_mo_release() ); execute( TC_lu_and_ss_session_timeout() ); - execute( TC_cipher_complete_with_invalid_cipher() ); execute( TC_sgsap_reset() ); @@ -4748,7 +5159,12 @@ execute( TC_sgsap_lu_and_mt_call() ); execute( TC_sgsap_vlr_failure() ); - /* Run this last: at the time of writing this test crashes the MSC */ + execute( TC_ho_inter_bsc_unknown_cell() ); + execute( TC_ho_inter_bsc() ); + + execute( TC_ho_inter_msc_out() ); + + // Run this last: at the time of writing this test crashes the MSC execute( TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug() ); execute( TC_gsup_mt_multi_part_sms() ); execute( TC_mo_cc_bssmap_clear() ); -- To view, visit https://gerrit.osmocom.org/13617 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7d76c982ad4e198534fa488609c41e8892b268ab Gerrit-Change-Number: 13617 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 03:58:41 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 03:58:41 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: f_tc_sgsap_mt_sms_and_reject: expect SMPP messages (REALLY?) In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. ( https://gerrit.osmocom.org/13614 ) Change subject: msc: f_tc_sgsap_mt_sms_and_reject: expect SMPP messages (REALLY?) ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/13614 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I894ca2bba2743e7102e0e60a12a407c99a224769 Gerrit-Change-Number: 13614 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 04:14:30 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 04:14:30 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: mo and mt voice call tests: add lots of missing parts In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13616 to look at the new patch set (#3). Change subject: msc: mo and mt voice call tests: add lots of missing parts ...................................................................... msc: mo and mt voice call tests: add lots of missing parts Both f_mo_call_establish() and f_mt_call_establish() were testing barely half a voice call setup. For example, f_mo_call_establish() used to be satisfied with just two CRCX, but no actual RTP connections being made. Add numerous MNCC and MGCP messages more closely resembling an actual call. The main reason is to achieve a state that passes both current osmo-msc master as well as the upcoming inter-MSC Handover refactoring. Add log markers to f_*_call_*(): often when a test halts, it is not at all clear why. With these log markers it is saner to figure out what has happened and what hasn't. Change-Id: I162985045bb5e129977a3a797b656e30220990df --- M library/L3_Templates.ttcn M library/MGCP_Templates.ttcn M library/MNCC_Types.ttcn M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 5 files changed, 208 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/16/13616/3 -- To view, visit https://gerrit.osmocom.org/13616 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I162985045bb5e129977a3a797b656e30220990df Gerrit-Change-Number: 13616 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 04:32:59 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 04:32:59 +0000 Subject: Change in libosmo-sccp[master]: add caller-owns-msgb variant osmo_sccp_user_sap_down_nofree() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13277 to look at the new patch set (#2). Change subject: add caller-owns-msgb variant osmo_sccp_user_sap_down_nofree() ...................................................................... add caller-owns-msgb variant osmo_sccp_user_sap_down_nofree() Add osmo_sccp_user_sap_down_nofree(), which is identical to osmo_sccp_user_sap_down(), but doesn't imply a msgb_free(). To implement that, sccp_sclc_user_sap_down_nofree() with the same msgb semantics is required. Rationale: Avoiding msgb leaks is easiest if the caller retains ownership of the msgb. Take this hypothetical chain where leaks are obviously avoided: void send() { msg = msgb_alloc(); dispatch(msg); msgb_free(msg); } void dispatch(msg) { osmo_fsm_inst_dispatch(fi, msg); } void fi_on_event(fi, data) { if (socket_is_ok) socket_write((struct msgb*)data); } void socket_write(msgb) { if (!ok1) return; if (ok2) { if (!ok3) return; write(sock, msg->data); } } However, if the caller passes ownership down to the msgb consumer, things become nightmarishly complex: void send() { msg = msgb_alloc(); rc = dispatch(msg); /* dispatching event failed? */ if (rc) msgb_free(msg); } int dispatch(msg) { if (osmo_fsm_inst_dispatch(fi, msg)) return -1; if (something_else()) return -1; // <-- double free! } void fi_on_event(fi, data) { if (socket_is_ok) { socket_write((struct msgb*)data); else /* socket didn't consume? */ msgb_free(data); } int socket_write(msgb) { if (!ok1) return -1; // <-- leak! if (ok2) { if (!ok3) goto out; write(sock, msg->data); } out: msgb_free(msg); return -2; } If any link in this call chain fails to be aware of the importance to return a failed RC or to free a msgb if the chain is broken, or to not return a failed RC if the msgb is consumed, we have a hidden msgb leak or double free. This is the case with osmo_sccp_user_sap_down(). In new osmo-msc, passing data through various FSM instances, there is high potential for leak/double-free bugs. A very large brain is required to track down every msgb path. osmo_sccp_user_sap_down_nofree() makes this problem trivial to solve even for humans. Change-Id: Ic818efa78b90f727e1a94c18b60d9a306644f340 --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_internal.h M src/sccp_sclc.c M src/sccp_scoc.c 4 files changed, 38 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/77/13277/2 -- To view, visit https://gerrit.osmocom.org/13277 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic818efa78b90f727e1a94c18b60d9a306644f340 Gerrit-Change-Number: 13277 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 04:34:52 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 04:34:52 +0000 Subject: Change in osmo-msc[master]: large refactoring: support inter-BSC and inter-MSC Handover In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13137 to look at the new patch set (#6). Change subject: large refactoring: support inter-BSC and inter-MSC Handover ...................................................................... large refactoring: support inter-BSC and inter-MSC Handover 3GPP TS 49.008 '4.3 Roles of MSC-A, MSC-I and MSC-T' defines distinct roles: - MSC-A is responsible for managing subscribers, - MSC-I is the gateway to the RAN. - MSC-T is a second transitory gateway to another RAN during Handover. After inter-MSC Handover, the MSC-I is handled by a remote MSC instance, while the original MSC-A retains the responsibility of subscriber management. MSC-T exists in this patch but is not yet used, since Handover is only prepared for, not yet implemented. Facilitate Inter-MSC and inter-BSC Handover by the same internal split of MSC roles. Compared to inter-MSC Handover, mere inter-BSC has the obvious simplifications: - all of MSC-A, MSC-I and MSC-T roles will be served by the same osmo-msc instance, - messages between MSC-A and MSC-{I,T} don't need to be routed via E-interface (GSUP), - no call routing between MSC-A and -I via MNCC necessary. This is the largest code bomb I have submitted, ever. Out of principle, I apologize to everyone trying to read this as a whole. Unfortunately, I see no sense in trying to split this patch into smaller bits. It would be a huge amount of work to introduce these changes in separate chunks, especially if each should in turn be useful and pass all test suites. So, unfortunately, we are stuck with this code bomb. The following are some details and rationale for this rather huge refactoring: * separate MSC subscriber management from ran_conn struct ran_conn is reduced from the pivotal subscriber management entity it has been so far to a mere storage for an SCCP connection ID and an MSC subscriber reference. The new pivotal subscriber management entity is struct msc_a -- struct msub lists the msc_a, msc_i, msc_t roles, the vast majority of code paths however use msc_a, since MSC-A is where all the interesting stuff happens. Before handover, msc_i is an FSM implementation that encodes to the local ran_conn. After inter-MSC Handover, msc_i is a compatible but different FSM implementation that instead forwards via/from GSUP. Same goes for the msc_a struct: if osmo-msc is the MSC-I "RAN proxy" for a remote MSC-A role, the msc_a->fi is an FSM implementation that merely forwards via/from GSUP. * New SCCP implementation for RAN access To be able to forward BSSAP and RANAP messages via the GSUP interface, the individual message layers need to be cleanly separated. The IuCS implementation used until now (iu_client from libosmo-ranap) did not provide this level of separation, and needed a complete rewrite. It was trivial to implement this in such a way that both BSSAP and RANAP can be handled by the same SCCP code, hence the new SCCP-RAN layer also replaces BSSAP handling. sccp_ran.h: struct sccp_ran_inst provides an abstract handler for incoming RAN connections. A set of callback functions provides implementation specific details. * RAN Abstraction (BSSAP vs. RANAP) The common SCCP implementation did set the theme for the remaining refactoring: make all other MSC code paths entirely RAN-implementation-agnostic. ran_infra.c provides data structures that list RAN implementation specifics, from logging to NAS de-/encoding to SCCP callbacks and timers. A ran_infra pointer hence allows complete abstraction of RAN implementations: - managing connected RAN peers (BSC, RNC) in ran_peer.c, - classifying and de-/encoding NAS PDUs, - recording connected LACs and cell IDs and sending out Paging requests to matching RAN peers. * RAN RESET now also for RANAP ran_peer.c absorbs the reset_fsm from a_reset.c; in consequence, RANAP also supports proper RESET semantics now. Hence osmo-hnbgw now also needs to provide proper RESET handling, which it so far duly ignores. (TODO) * NAS de-/encoding abstraction The NAS abstraction mentioned above serves not only to separate RANAP and BSSAP implementations transparently, but also to be able to optionally handle NAS on distinct levels. Before Handover, all NAS is handled by the MSC-A role. However, after an inter-MSC Handover, a standalone MSC-I will need to decode NAS PDUs, at least in order to manage Assignment of RTP streams between BSS/RNC and MNCC call forwarding. nas.h provides a common API with abstraction for: - receiving NAS events from RAN, i.e. passing NAS decode from the BSC/RNC and MS/UE: struct nas_dec_msg represents NAS messages decoded from either BSSMAP or RANAP; - sending NAS events: nas_enc_msg is the counterpart to compose NAS messages that should be encoded to either BSSMAP or RANAP and passed down to the BSC/RNC and MS/UE. The RAN-specific implementations are completely contained by nas_a.c and nas_iu.c. In particular, Assignment and Ciphering have so far been distinct code paths for BSSAP and RANAP, with switch(via_ran){...} statements all over the place. Using NAS_DEC_* and NAS_ENC_* abstractions, these are now completely unified. Note that SGs does not qualify for NAS abstraction: the SGs interface always remains with the MSC-A role, and SGs messages follow quite distinct semantics from the fairly similar GERAN and UTRAN. * MGW and RTP stream management So far, managing MGW endpoints via MGCP was tightly glued in-between GSM-04.08-CC on the one and MNCC on the other side. Prepare for switching RTP streams between different RAN peers by moving to object-oriented implementations: implement struct call_leg and struct rtp_stream with distinct FSMs each. For MGW communication, use the osmo_mgcpc_ep API that has originated from osmo-bsc and recently moved to libosmo-mgcp-client for this purpose. Instead of implementing a sequence of events with code duplication for the RAN and CN sides, the idea is to manage each RTP stream separately by firing and receiving events as soon as codecs and RTP ports are negotiated, and letting the individual FSMs take care of the MGW management "asynchronously". The caller provides event IDs and an FSM instance that should be notified of RTP stream setup progress. Hence it becomes possible to reconnect RTP streams from one GSM-04.08-CC to another (inter-BSC Handover) or between CC and MNCC RTP peers (inter-MSC Handover) without duplicating the MGCP code for each transition. The number of FSM implementations used for MGCP handling may seem a bit of an overkill. But in fact, the number of perspectives on RTP forwarding are far from trivial: - an MGW endpoint is an entity with N connections, and MGCP "sessions" for configuring them by talking to the MGW; - an RTP stream is a remote peer connected to one of the endpoint's connections, which is asynchronously notified of codec and RTP port choices; - a call leg is the higher level view on either an MT or MO side of a voice call, a combination of two RTP streams to forward between two remote peers. BSC MGW PBX CI CI [MGW-endpoint] [--rtp_stream--] [--rtp_stream--] [----------------call_leg----------------] * Use counts Introduce using the new osmo_use_count API added to libosmocore for this purpose. Each use token has a distinct name in the logging, which can be a globally constant name or ad-hoc, like the local __func__ string constant. Use in the new struct msc_a, as well as change vlr_subscr to the new osmo_use_count API. * FSM Timeouts Introduce using the new osmo_tdef API, which provides a common VTY implementation for all timer numbers, and FSM state transitions with the correct timeout. Originated in osmo-bsc, recently moved to libosmocore. Depends: Ife31e6798b4e728a23913179e346552a7dd338c0 (libosmocore) Ib9af67b100c4583342a2103669732dab2e577b04 (libosmocore) Id617265337f09dfb6ddfe111ef5e578cd3dc9f63 (libosmocore) Ie9e2add7bbfae651c04e230d62e37cebeb91b0f5 (libosmo-sccp) I26be5c4b06a680f25f19797407ab56a5a4880ddc (osmo-mgw) Ida0e59f9a1f2dd18efea0a51680a67b69f141efa (osmo-mgw) I9a3effd38e72841529df6c135c077116981dea36 (osmo-mgw) Change-Id: I27e4988e0371808b512c757d2b52ada1615067bd --- M configure.ac A doc/sequence_charts/Makefile.am A doc/sequence_charts/inter_bsc_ho.msc A doc/sequence_charts/inter_msc_ho.msc M include/osmocom/msc/Makefile.am D include/osmocom/msc/a_iface.h D include/osmocom/msc/a_iface_bssap.h D include/osmocom/msc/a_reset.h A include/osmocom/msc/call_leg.h A include/osmocom/msc/cell_id_list.h A include/osmocom/msc/e_link.h M include/osmocom/msc/gsm_04_08.h M include/osmocom/msc/gsm_04_11.h M include/osmocom/msc/gsm_04_11_gsup.h M include/osmocom/msc/gsm_04_14.h M include/osmocom/msc/gsm_04_80.h M include/osmocom/msc/gsm_09_11.h M include/osmocom/msc/gsm_data.h M include/osmocom/msc/gsm_data_shared.h M include/osmocom/msc/gsm_subscriber.h A include/osmocom/msc/gsup_client_mux.h D include/osmocom/msc/iu_dummy.h D include/osmocom/msc/iucs.h D include/osmocom/msc/iucs_ranap.h M include/osmocom/msc/mncc.h A include/osmocom/msc/mncc_fsm.h A include/osmocom/msc/msc_a.h A include/osmocom/msc/msc_a_remote.h M include/osmocom/msc/msc_common.h A include/osmocom/msc/msc_ho.h A include/osmocom/msc/msc_i.h A include/osmocom/msc/msc_i_remote.h D include/osmocom/msc/msc_ifaces.h D include/osmocom/msc/msc_mgcp.h A include/osmocom/msc/msc_roles.h A include/osmocom/msc/msc_t.h A include/osmocom/msc/msc_t_remote.h A include/osmocom/msc/msub.h A include/osmocom/msc/nas.h A include/osmocom/msc/nas_a.h A include/osmocom/msc/nas_iu.h A include/osmocom/msc/neighbor_ident.h A include/osmocom/msc/paging.h M include/osmocom/msc/ran_conn.h A include/osmocom/msc/ran_infra.h A include/osmocom/msc/ran_peer.h A include/osmocom/msc/rtp_stream.h A include/osmocom/msc/sccp_ran.h M include/osmocom/msc/sgs_iface.h M include/osmocom/msc/signal.h M include/osmocom/msc/silent_call.h M include/osmocom/msc/sms_queue.h M include/osmocom/msc/transaction.h M include/osmocom/msc/vlr.h M include/osmocom/msc/vlr_sgs.h M src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/a_iface_bssap.c D src/libmsc/a_reset.c A src/libmsc/call_leg.c A src/libmsc/cell_id_list.c A src/libmsc/e_link.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_08_cc.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_11_gsup.c M src/libmsc/gsm_04_14.c M src/libmsc/gsm_04_80.c M src/libmsc/gsm_09_11.c D src/libmsc/gsm_subscriber.c A src/libmsc/gsup_client_mux.c D src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c M src/libmsc/mncc.c M src/libmsc/mncc_builtin.c A src/libmsc/mncc_fsm.c M src/libmsc/mncc_sock.c A src/libmsc/msc_a.c A src/libmsc/msc_a_remote.c A src/libmsc/msc_ho.c A src/libmsc/msc_i.c A src/libmsc/msc_i_remote.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_mgcp.c A src/libmsc/msc_net_init.c A src/libmsc/msc_t.c A src/libmsc/msc_t_remote.c M src/libmsc/msc_vty.c A src/libmsc/msub.c A src/libmsc/nas.c A src/libmsc/nas_a.c A src/libmsc/nas_iu.c A src/libmsc/neighbor_ident.c A src/libmsc/neighbor_ident_vty.c D src/libmsc/osmo_msc.c A src/libmsc/paging.c M src/libmsc/ran_conn.c A src/libmsc/ran_infra.c A src/libmsc/ran_peer.c A src/libmsc/ran_up_l2.c M src/libmsc/rrlp.c A src/libmsc/rtp_stream.c A src/libmsc/sccp_ran.c M src/libmsc/sgs_iface.c M src/libmsc/sgs_server.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.h M src/libmsc/sms_queue.c M src/libmsc/transaction.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M src/libvlr/vlr_sgs.c M src/libvlr/vlr_sgs_fsm.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/Makefile.am M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_test_authen_reuse.c M tests/msc_vlr/msc_vlr_test_authen_reuse.err M tests/msc_vlr/msc_vlr_test_call.c M tests/msc_vlr/msc_vlr_test_call.err M tests/msc_vlr/msc_vlr_test_gsm_authen.c M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.c M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.c M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.c M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.c M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.c M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_ss.c M tests/msc_vlr/msc_vlr_test_ss.err M tests/msc_vlr/msc_vlr_test_umts_authen.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h M tests/sms_queue/Makefile.am M tests/sms_queue/sms_queue_test.c A tests/test_neighbor_ident.vty M tests/test_nodes.vty 150 files changed, 35,584 insertions(+), 22,989 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/37/13137/6 -- To view, visit https://gerrit.osmocom.org/13137 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I27e4988e0371808b512c757d2b52ada1615067bd Gerrit-Change-Number: 13137 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 04:45:28 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 04:45:28 +0000 Subject: Change in libosmocore[master]: add osmo_{escape, quote}_str_buf2() for standard args ordering In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13573 ) Change subject: add osmo_{escape,quote}_str_buf2() for standard args ordering ...................................................................... Patch Set 4: Code-Review+2 re-apply previous +2 after trivial merge conflict fix -- To view, visit https://gerrit.osmocom.org/13573 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae Gerrit-Change-Number: 13573 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 12 Apr 2019 04:45:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 04:45:36 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 04:45:36 +0000 Subject: Change in libosmocore[master]: tweak OSMO_STRBUF_APPEND(), add OSMO_STRBUF_APPEND_NOLEN() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13594 ) Change subject: tweak OSMO_STRBUF_APPEND(), add OSMO_STRBUF_APPEND_NOLEN() ...................................................................... tweak OSMO_STRBUF_APPEND(), add OSMO_STRBUF_APPEND_NOLEN() In OSMO_STRBUF_APPEND, use local variable names that are less likely to shadow other local variables: prefix with _sb_. In OSMO_STRBUF_APPEND, add a check to add to .pos only if it is not NULL. Add OSMO_STRBUF_APPEND_NOLEN(), which works for function signatures that don't return a length. This is useful for any osmo_*_buf() string writing functions, so that these write directly to the strbuf. Change-Id: I108cadf72deb3a3bcab9a07e50572d9da1ab0359 --- M include/osmocom/core/utils.h M tests/utils/utils_test.c M tests/utils/utils_test.ok 3 files changed, 53 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 474e36c..f13c1e4 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -205,14 +205,14 @@ #define OSMO_STRBUF_APPEND(STRBUF, func, args...) do { \ if (!(STRBUF).pos) \ (STRBUF).pos = (STRBUF).buf; \ - size_t remain = (STRBUF).buf ? (STRBUF).len - ((STRBUF).pos - (STRBUF).buf) : 0; \ - int l = func((STRBUF).pos, remain, ##args); \ - if (l < 0 || l > remain) \ + size_t _sb_remain = (STRBUF).buf ? (STRBUF).len - ((STRBUF).pos - (STRBUF).buf) : 0; \ + int _sb_l = func((STRBUF).pos, _sb_remain, ##args); \ + if (_sb_l < 0 || _sb_l > _sb_remain) \ (STRBUF).pos = (STRBUF).buf + (STRBUF).len; \ - else \ - (STRBUF).pos += l; \ - if (l > 0) \ - (STRBUF).chars_needed += l; \ + else if ((STRBUF).pos) \ + (STRBUF).pos += _sb_l; \ + if (_sb_l > 0) \ + (STRBUF).chars_needed += _sb_l; \ } while(0) /*! Shortcut for OSMO_STRBUF_APPEND() invocation using snprintf(). @@ -237,6 +237,29 @@ #define OSMO_STRBUF_PRINTF(STRBUF, fmt, args...) \ OSMO_STRBUF_APPEND(STRBUF, snprintf, fmt, ##args) +/*! Like OSMO_STRBUF_APPEND(), but for function signatures that return the char* buffer instead of a length. + * When using this function, the final STRBUF.chars_needed may not reflect the actual number of characters needed, since + * that number cannot be obtained from this kind of function signature. + * \param[inout] STRBUF A struct osmo_strbuf instance. + * \param[in] func A function with a signature of char *func(char *dst, size_t dst_len [, args]) where + * the returned string is always written to dst. + * \param[in] args Arguments passed to func, if any. + */ +#define OSMO_STRBUF_APPEND_NOLEN(STRBUF, func, args...) do { \ + if (!(STRBUF).pos) \ + (STRBUF).pos = (STRBUF).buf; \ + size_t _sb_remain = (STRBUF).buf ? (STRBUF).len - ((STRBUF).pos - (STRBUF).buf) : 0; \ + if (_sb_remain) { \ + func((STRBUF).pos, _sb_remain, ##args); \ + } \ + size_t _sb_l = (STRBUF).pos ? strnlen((STRBUF).pos, _sb_remain) : 0; \ + if (_sb_l > _sb_remain) \ + (STRBUF).pos = (STRBUF).buf + (STRBUF).len; \ + else if ((STRBUF).pos) \ + (STRBUF).pos += _sb_l; \ + (STRBUF).chars_needed += _sb_l; \ + } while(0) + bool osmo_str_startswith(const char *str, const char *startswith_str); /*! @} */ diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index 211b4d1..223f67d 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -1014,6 +1014,23 @@ printf("(need %d chars, had size=63) %s\n", rc, buf); } +void strbuf_test_nolen() +{ + char buf[20]; + struct osmo_strbuf sb = { .buf = buf, .len = sizeof(buf) }; + uint8_t ubits[] = {0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0}; + printf("\n%s\n", __func__); + + OSMO_STRBUF_APPEND_NOLEN(sb, osmo_ubit_dump_buf, ubits, sizeof(ubits)); + printf("%zu: %s (need=%zu)\n", sb.len, buf, sb.chars_needed); + OSMO_STRBUF_APPEND_NOLEN(sb, osmo_ubit_dump_buf, ubits, sizeof(ubits)); + printf("more: %s (need=%zu)\n", buf, sb.chars_needed); + + sb = (struct osmo_strbuf){ .buf = buf, .len = 10 }; + OSMO_STRBUF_APPEND_NOLEN(sb, osmo_ubit_dump_buf, ubits, sizeof(ubits)); + printf("%zu: %s (need=%zu)\n", sb.len, buf, sb.chars_needed); +} + static void startswith_test_str(const char *str, const char *startswith_str, bool expect_rc) { bool rc = osmo_str_startswith(str, startswith_str); @@ -1059,6 +1076,7 @@ osmo_sockaddr_to_str_and_uint_test(); osmo_str_tolowupper_test(); strbuf_test(); + strbuf_test_nolen(); startswith_test(); return 0; } diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok index 5783eb1..587c6f0 100644 --- a/tests/utils/utils_test.ok +++ b/tests/utils/utils_test.ok @@ -341,6 +341,11 @@ T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! -- T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! -- T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! (need 134 chars, had size=63) T minus 10 9 8 7 6 5 4 3 2 1 ... Lift off! -- T minus 10 9 8 7 +strbuf_test_nolen +20: 0001011100101010 (need=16) +more: 0001011100101010000 (need=19) +10: 000101110 (need=9) + startswith_test() osmo_str_startswith(NULL, NULL) == true osmo_str_startswith("", NULL) == true -- To view, visit https://gerrit.osmocom.org/13594 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I108cadf72deb3a3bcab9a07e50572d9da1ab0359 Gerrit-Change-Number: 13594 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 04:45:37 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 04:45:37 +0000 Subject: Change in libosmocore[master]: add osmo_{escape, quote}_str_buf2() for standard args ordering In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13573 ) Change subject: add osmo_{escape,quote}_str_buf2() for standard args ordering ...................................................................... add osmo_{escape,quote}_str_buf2() for standard args ordering To be able to append an escaped or quoted string using OSMO_STRBUF_APPEND_NOLEN(), the function signature must have the buf and len as first args, like most other *_buf() functions. Add osmo_escape_str_buf2() and osmo_quote_str_buf2() to match this signature. A recent patch [1] has changed the return value of osmo_escape_str_buf() to char*, removing the const. However, the functions may return const strings, hence re-add the const. The new signatures always return the non-const buffer. To avoid code duplication, implement osmo_quote_str_buf() and osmo_escape_str_buf() by calling the new functions. I decided to allow slight changes to the behavior for current osmo_escape_str() and osmo_escape_str_buf(), because impact on callers is minimal: (1) The new implementation uses OSMO_STRBUF_*, and in consequence osmo_quote_str() no longer prints an ending double quote after truncated strings; Before, a truncated output was, sic: "this string is trunca" and now this becomes, sic: "this string is truncat I decided to not keep the old behavior because it is questionable to begin with. It looks like the string actually ended at the truncation boundary instead of the reason being not enough space in the output buffer. (2) The new osmo_escape_str_buf2() function obviously cannot pass-thru an unchanged char* if no escaping was needed. Sacrifice this tiny optimization feature to avoid code duplication: - it is an unnoticeable optimization, - the caller anyway always passes a string buffer, - the feature caused handling strings and buffers differently depending on their content (i.e. code that usually writes out strings in full length "suddenly" truncates because a non-printable character is contained, etc.) I considered adding a skip_if_unescaped flag to the osmo_quote_str_buf2() function signature, but in the end decided that the API clutter is not worth having for all the above reasons. Adjust tests to accomodate above changes. [1] 4a62eda225ab7f3c9556990c81a6fc5e19b5eec8 Ibf85f79e93244f53b2684ff6f1095c5b41203e05 Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae --- M TODO-RELEASE M include/osmocom/core/utils.h M src/utils.c M tests/utils/utils_test.c M tests/utils/utils_test.ok 5 files changed, 117 insertions(+), 49 deletions(-) Approvals: Jenkins Builder: Verified Neels Hofmeyr: Looks good to me, approved diff --git a/TODO-RELEASE b/TODO-RELEASE index 5ddc57a..7c81e32 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -11,3 +11,11 @@ libosmogb gprs_nsvc Adding sig_weight and data_weight members for IP-SNS support libosmogb various new symbols Adding functions related to IP-SNS support libosmocore osmo_fsm_inst Add flag proc.terminating (ABI change) +libosmocore osmo_escape_str(), These now always copy to the buffer instead of returning the + osmo_escape_str_buf() unchanged input string when no chars needed escaping, hence + returned strings might now also be truncated even if all chars were printable. +libosmocore osmo_escape_str_buf2() New function signature similar to snprintf(), for use with OSMO_STRBUF_APPEND(). +libosmocore osmo_quote_str(), On string truncation, these used to print a closing quote '"' after the + osmo_quote_str_buf() truncated string. This is no longer the case. e.g. a string 'truncated' in a + 9-char buffer used to print '"trunca"\0', which now becomes '"truncat\0'. +libosmocore osmo_quote_str_buf2() New function signature similar to snprintf(), for use with OSMO_STRBUF_APPEND(). diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index f13c1e4..08735fd 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -142,12 +142,16 @@ bool osmo_separated_identifiers_valid(const char *str, const char *sep_chars); const char *osmo_escape_str(const char *str, int len); -char *osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize); +char *osmo_escape_str_buf2(char *buf, size_t bufsize, const char *str, int in_len); +const char *osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize); char *osmo_escape_str_c(const void *ctx, const char *str, int in_len); const char *osmo_quote_str(const char *str, int in_len); -char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize); +char *osmo_quote_str_buf2(char *buf, size_t bufsize, const char *str, int in_len); +const char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize); char *osmo_quote_str_c(const void *ctx, const char *str, int in_len); +int osmo_print_n(char *buf, size_t bufsize, const char *str, size_t n); + uint32_t osmo_isqrt32(uint32_t x); const char osmo_luhn(const char* in, int in_len); diff --git a/src/utils.c b/src/utils.c index 9ab990a..6116d3a 100644 --- a/src/utils.c +++ b/src/utils.c @@ -594,28 +594,78 @@ return osmo_separated_identifiers_valid(str, NULL); } -/*! Return the string with all non-printable characters escapeda, in user-supplied buffer. +/*! Like osmo_escape_str_buf2, but with unusual ordering of arguments, and may sometimes return string constants instead + * of writing to buf for error cases or empty input. + * Most *_buf() functions have the buffer and size as first arguments, here the arguments are last. + * In particular, this function signature doesn't work with OSMO_STRBUF_APPEND_NOLEN(). * \param[in] str A string that may contain any characters. * \param[in] len Pass -1 to print until nul char, or >= 0 to force a length. * \param[inout] buf string buffer to write escaped characters to. * \param[in] bufsize size of \a buf. - * \returns buf containing an escaped representation, possibly truncated. + * \returns buf containing an escaped representation, possibly truncated, + * or "(null)" if str == NULL, or "(error)" in case of errors. */ -char *osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize) +const char *osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize) { - int in_pos = 0; - int next_unprintable = 0; - int out_pos = 0; - char *out = buf; - /* -1 to leave space for a final \0 */ - int out_len = bufsize-1; - if (!str) return "(null)"; + if (!buf || !bufsize) + return "(error)"; + return osmo_escape_str_buf2(buf, bufsize, str, in_len); +} + +/*! Copy N characters to a buffer with a function signature useful for OSMO_STRBUF_APPEND(). + * Similarly to snprintf(), the result is always nul terminated (except if buf is NULL or bufsize is 0). + * \param[out] buf Target buffer. + * \param[in] bufsize sizeof(buf). + * \param[in] str String to copy. + * \param[in] n Maximum number of non-nul characters to copy. + * \return Number of characters that would be written if bufsize were large enough excluding '\0' (like snprintf()). + */ +int osmo_print_n(char *buf, size_t bufsize, const char *str, size_t n) +{ + size_t write_n; + + if (!str) + str = ""; + + n = strnlen(str, n); + + if (!buf || !bufsize) + return n; + write_n = n; + if (write_n >= bufsize) + write_n = bufsize - 1; + if (write_n) + strncpy(buf, str, write_n); + buf[write_n] = '\0'; + + return n; +} + +/*! Return the string with all non-printable characters escaped. + * \param[out] buf string buffer to write escaped characters to. + * \param[in] bufsize sizeof(buf). + * \param[in] str A string that may contain any characters. + * \param[in] in_len Pass -1 to print until nul char, or >= 0 to force a length (also past nul chars). + * \return Number of characters that would be written if bufsize were large enough excluding '\0' (like snprintf()). + */ +char *osmo_escape_str_buf2(char *buf, size_t bufsize, const char *str, int in_len) +{ + struct osmo_strbuf sb = { .buf = buf, .len = bufsize }; + int in_pos = 0; + int next_unprintable = 0; + + if (!str) + in_len = 0; if (in_len < 0) in_len = strlen(str); + /* Make sure of '\0' termination */ + if (!in_len) + OSMO_STRBUF_PRINTF(sb, "%s", ""); + while (in_pos < in_len) { for (next_unprintable = in_pos; next_unprintable < in_len && isprint((int)str[next_unprintable]) @@ -623,24 +673,16 @@ && str[next_unprintable] != '\\'; next_unprintable++); - if (next_unprintable == in_len && in_pos == 0) { - osmo_strlcpy(buf, str, bufsize); - return buf; - } + OSMO_STRBUF_APPEND(sb, osmo_print_n, &str[in_pos], next_unprintable - in_pos); + in_pos = next_unprintable; - while (in_pos < next_unprintable && out_pos < out_len) - out[out_pos++] = str[in_pos++]; - - if (out_pos == out_len || in_pos == in_len) + if (in_pos == in_len) goto done; switch (str[next_unprintable]) { #define BACKSLASH_CASE(c, repr) \ case c: \ - if (out_pos > out_len-2) \ - goto done; \ - out[out_pos++] = '\\'; \ - out[out_pos++] = repr; \ + OSMO_STRBUF_PRINTF(sb, "\\%c", repr); \ break BACKSLASH_CASE('\n', 'n'); @@ -656,19 +698,14 @@ #undef BACKSLASH_CASE default: - out_pos += snprintf(&out[out_pos], out_len - out_pos, "\\%u", (unsigned char)str[in_pos]); - if (out_pos > out_len) { - out_pos = out_len; - goto done; - } + OSMO_STRBUF_PRINTF(sb, "\\%u", (unsigned char)str[in_pos]); break; } in_pos ++; } done: - out[out_pos] = '\0'; - return out; + return buf; } /*! Return the string with all non-printable characters escaped. @@ -692,27 +729,46 @@ char *buf = talloc_size(ctx, in_len+1); if (!buf) return NULL; - return osmo_escape_str_buf(str, in_len, buf, in_len+1); + return osmo_escape_str_buf2(buf, in_len+1, str, in_len); } -/*! Like osmo_escape_str(), but returns double-quotes around a string, or "NULL" for a NULL string. +/*! Like osmo_escape_str_buf2(), but returns double-quotes around a string, or "NULL" for a NULL string. * This allows passing any char* value and get its C representation as string. + * The function signature is suitable for OSMO_STRBUF_APPEND_NOLEN(). + * \param[out] buf string buffer to write escaped characters to. + * \param[in] bufsize sizeof(buf). + * \param[in] str A string that may contain any characters. + * \param[in] in_len Pass -1 to print until nul char, or >= 0 to force a length. + * \return Number of characters that would be written if bufsize were large enough excluding '\0' (like snprintf()). + */ +char *osmo_quote_str_buf2(char *buf, size_t bufsize, const char *str, int in_len) +{ + struct osmo_strbuf sb = { .buf = buf, .len = bufsize }; + if (!str) + OSMO_STRBUF_PRINTF(sb, "NULL"); + else { + OSMO_STRBUF_PRINTF(sb, "\""); + OSMO_STRBUF_APPEND_NOLEN(sb, osmo_escape_str_buf2, str, in_len); + OSMO_STRBUF_PRINTF(sb, "\""); + } + return buf; +} + +/*! Like osmo_quote_str_buf2, but with unusual ordering of arguments, and may sometimes return string constants instead + * of writing to buf for error cases or empty input. + * Most *_buf() functions have the buffer and size as first arguments, here the arguments are last. + * In particular, this function signature doesn't work with OSMO_STRBUF_APPEND_NOLEN(). * \param[in] str A string that may contain any characters. * \param[in] in_len Pass -1 to print until nul char, or >= 0 to force a length. * \returns buf containing a quoted and escaped representation, possibly truncated. */ -char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize) +const char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize) { - int l; if (!str) return "NULL"; - if (bufsize < 3) - return ""; - buf[0] = '"'; - osmo_escape_str_buf(str, in_len, buf + 1, bufsize - 2); - l = strlen(buf); - buf[l] = '"'; - buf[l+1] = '\0'; /* both osmo_escape_str_buf() and max_len above ensure room for '\0' */ + if (!buf || !bufsize) + return "(error)"; + osmo_quote_str_buf2(buf, bufsize, str, in_len); return buf; } @@ -738,7 +794,7 @@ char *buf = talloc_size(ctx, OSMO_MAX(in_len+2, 32)); if (!buf) return NULL; - return osmo_quote_str_buf(str, in_len, buf, 32); + return osmo_quote_str_buf2(buf, 32, str, in_len); } /*! perform an integer square root operation on unsigned 32bit integer. diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index 223f67d..70d017f 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -585,7 +585,7 @@ printf("- never passthru:\n"); res = osmo_quote_str(printable, -1); - if (res != printable) + if (strcmp(res, printable)) printf("NOT passed through. '%s'\n", res); else printf("passed through unchanged '%s'\n", res); @@ -596,14 +596,14 @@ printf("- truncation when too long:\n"); memset(in_buf, 'x', sizeof(in_buf)); in_buf[0] = '\a'; - in_buf[5] = 'E'; + in_buf[6] = 'E'; memset(out_buf, 0x7f, sizeof(out_buf)); printf("'%s'\n", osmo_quote_str_buf((const char *)in_buf, sizeof(in_buf), out_buf, 10)); OSMO_ASSERT(out_buf[10] == 0x7f); printf("- always truncation, even when no escaping needed:\n"); memset(in_buf, 'x', sizeof(in_buf)); - in_buf[6] = 'E'; /* dst has 10, less 2 quotes and nul, leaves 7, i.e. in[6] is last */ + in_buf[7] = 'E'; /* dst has 10, less 1 quote and nul, leaves 8, i.e. in[7] is last */ in_buf[20] = '\0'; memset(out_buf, 0x7f, sizeof(out_buf)); printf("'%s'\n", osmo_quote_str_buf((const char *)in_buf, -1, out_buf, 10)); diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok index 587c6f0..c150a8d 100644 --- a/tests/utils/utils_test.ok +++ b/tests/utils/utils_test.ok @@ -258,11 +258,11 @@ - zero length: '""' - truncation when too long: -'"\axxxxE"' +'"\axxxxxE' - always truncation, even when no escaping needed: -'"xxxxxxE"' +'"xxxxxxxE' - try to feed too little buf for quoting: -'' +'"' - NULL string becomes a "NULL" literal: 'NULL' -- To view, visit https://gerrit.osmocom.org/13573 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id748b906b0083b1f1887f2be7a53cae705a8a9ae Gerrit-Change-Number: 13573 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 04:45:38 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 04:45:38 +0000 Subject: Change in libosmocore[master]: add identifier sanitation for setting FSM instance ids In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13574 ) Change subject: add identifier sanitation for setting FSM instance ids ...................................................................... add identifier sanitation for setting FSM instance ids We often compose FSM instance IDs from context information, for example placing an MSISDN string or IP:port information in the FSM instance id, using osmo_fsm_inst_update_id_f(). This fails if any characters are contained that don't pass osmo_identifier_valid(). Hence it is the task of the caller to make sure only characters allowed in an FSM id are applied. Provide API to trivially allow this by replacing illegal chars: - osmo_identifier_sanitize_buf(), with access to the same set of illegal characters defined in utils.c, - osmo_fsm_inst_update_id_f_sanitize() implicitly replaces non-identifier chars. This makes it easy to add strings like '192.168.0.1:2342' or '+4987654321' to an FSM instance id, without adding string mangling to each place that sets an id; e.g. replacing with '-' to yield '192-168-0-1:2342' or '-4987654321'. Change-Id: Ia40a6f3b2243c95fe428a080b938e11d8ab771a7 --- M include/osmocom/core/fsm.h M include/osmocom/core/utils.h M src/fsm.c M src/utils.c 4 files changed, 53 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index c9e1e0c..41d01a5 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -220,6 +220,7 @@ int osmo_fsm_inst_update_id(struct osmo_fsm_inst *fi, const char *id); int osmo_fsm_inst_update_id_f(struct osmo_fsm_inst *fi, const char *fmt, ...); +int osmo_fsm_inst_update_id_f_sanitize(struct osmo_fsm_inst *fi, char replace_with, const char *fmt, ...); const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event); const char *osmo_fsm_inst_name(struct osmo_fsm_inst *fi); diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 08735fd..f27359c 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -140,6 +140,7 @@ bool osmo_identifier_valid(const char *str); bool osmo_separated_identifiers_valid(const char *str, const char *sep_chars); +void osmo_identifier_sanitize_buf(char *str, const char *sep_chars, char replace_with); const char *osmo_escape_str(const char *str, int len); char *osmo_escape_str_buf2(char *buf, size_t bufsize, const char *str, int in_len); diff --git a/src/fsm.c b/src/fsm.c index b6912c6..c32767b 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -364,6 +364,35 @@ return 0; } +/*! Change id of the FSM instance using a string format, and ensuring a valid id. + * Replace any characters that are not permitted as FSM identifier with replace_with. + * \param[in] fi FSM instance. + * \param[in] replace_with Character to use instead of non-permitted FSM id characters. + * Make sure to choose a legal character, e.g. '-'. + * \param[in] fmt format string to compose new ID. + * \param[in] ... variable argument list for format string. + * \returns 0 if the ID was updated, otherwise -EINVAL. + */ +int osmo_fsm_inst_update_id_f_sanitize(struct osmo_fsm_inst *fi, char replace_with, const char *fmt, ...) +{ + char *id = NULL; + va_list ap; + int rc; + + if (!fmt) + return osmo_fsm_inst_update_id(fi, NULL); + + va_start(ap, fmt); + id = talloc_vasprintf(fi, fmt, ap); + va_end(ap); + + osmo_identifier_sanitize_buf(id, NULL, replace_with); + + rc = osmo_fsm_inst_update_id(fi, id); + talloc_free(id); + return rc; +} + /*! allocate a new instance of a specified FSM * \param[in] fsm Descriptor of the FSM * \param[in] ctx talloc context from which to allocate memory diff --git a/src/utils.c b/src/utils.c index 6116d3a..896e917 100644 --- a/src/utils.c +++ b/src/utils.c @@ -553,6 +553,8 @@ return true; } +static const char osmo_identifier_illegal_chars[] = "., {}[]()<>|~\\^`'\"?=;/+*&%$#!"; + /*! Determine if a given identifier is valid, i.e. doesn't contain illegal chars * \param[in] str String to validate * \param[in] sep_chars Permitted separation characters between identifiers. @@ -561,7 +563,6 @@ bool osmo_separated_identifiers_valid(const char *str, const char *sep_chars) { /* characters that are illegal in names */ - static const char illegal_chars[] = "., {}[]()<>|~\\^`'\"?=;/+*&%$#!"; unsigned int i; size_t len; @@ -578,7 +579,7 @@ if (!isprint((int)str[i])) return false; /* check for some explicit reserved control characters */ - if (strchr(illegal_chars, str[i])) + if (strchr(osmo_identifier_illegal_chars, str[i])) return false; } @@ -594,6 +595,25 @@ return osmo_separated_identifiers_valid(str, NULL); } +/*! Replace characters in the given string buffer so that it is guaranteed to pass osmo_separated_identifiers_valid(). + * To guarantee passing osmo_separated_identifiers_valid(), replace_with must not itself be an illegal character. If in + * doubt, use '-'. + * \param[inout] str Identifier to sanitize, must be nul terminated and in a writable buffer. + * \param[in] sep_chars Additional characters that are allowed besides osmo_identifier_illegal_chars. + * \param[in] replace_with Replace any illegal characters with this character. + */ +void osmo_identifier_sanitize_buf(char *str, const char *sep_chars, char replace_with) +{ + char *pos; + if (!str) + return; + for (pos = str; *pos; pos++) { + if (strchr(osmo_identifier_illegal_chars, *pos) + || (sep_chars && strchr(sep_chars, *pos))) + *pos = replace_with; + } +} + /*! Like osmo_escape_str_buf2, but with unusual ordering of arguments, and may sometimes return string constants instead * of writing to buf for error cases or empty input. * Most *_buf() functions have the buffer and size as first arguments, here the arguments are last. -- To view, visit https://gerrit.osmocom.org/13574 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia40a6f3b2243c95fe428a080b938e11d8ab771a7 Gerrit-Change-Number: 13574 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 04:47:28 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 04:47:28 +0000 Subject: Change in libosmocore[master]: GSUP: add inter-MSC handover related msgs and IEs In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/12860 ) Change subject: GSUP: add inter-MSC handover related msgs and IEs ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/12860 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic00b0601eacff6d72927cea51767801142ee75db Gerrit-Change-Number: 12860 Gerrit-PatchSet: 9 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Fri, 12 Apr 2019 04:47:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 04:50:55 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 04:50:55 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: f_call_hangup: ignore MDCX In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13168 ) Change subject: msc: f_call_hangup: ignore MDCX ...................................................................... Patch Set 1: sorry, forgot about this one for a while. It is now absorbed in the the commit named "msc: mo and mt voice call tests: add lots of missing parts" by fixing call establishment in general. There shouldn't be stray MDCX left now. I162985045bb5e129977a3a797b656e30220990df -- To view, visit https://gerrit.osmocom.org/13168 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I768f16288617aade6a4d6548129e6f9e0b1d4d33 Gerrit-Change-Number: 13168 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 12 Apr 2019 04:50:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 05:04:26 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 05:04:26 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: mo and mt voice call tests: add lots of missing parts In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13616 to look at the new patch set (#4). Change subject: msc: mo and mt voice call tests: add lots of missing parts ...................................................................... msc: mo and mt voice call tests: add lots of missing parts Both f_mo_call_establish() and f_mt_call_establish() were testing barely half a voice call setup. For example, f_mo_call_establish() used to be satisfied with just two CRCX, but no actual RTP connections being made. Add numerous MNCC and MGCP messages more closely resembling an actual call. The main reason is to achieve a state that passes both current osmo-msc master as well as the upcoming inter-MSC Handover refactoring. Add log markers to f_*_call_*(): often when a test halts, it is not at all clear why. With these log markers it is saner to figure out what has happened and what hasn't. Change-Id: I162985045bb5e129977a3a797b656e30220990df --- M library/L3_Templates.ttcn M library/MGCP_Templates.ttcn M library/MNCC_Types.ttcn M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 5 files changed, 200 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/16/13616/4 -- To view, visit https://gerrit.osmocom.org/13616 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I162985045bb5e129977a3a797b656e30220990df Gerrit-Change-Number: 13616 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 05:04:43 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 05:04:43 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: f_call_hangup: ignore MDCX In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13168 ) Change subject: msc: f_call_hangup: ignore MDCX ...................................................................... Patch Set 1: actually it was removed completely. -- To view, visit https://gerrit.osmocom.org/13168 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I768f16288617aade6a4d6548129e6f9e0b1d4d33 Gerrit-Change-Number: 13168 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 12 Apr 2019 05:04:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 05:04:45 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 05:04:45 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: f_call_hangup: ignore MDCX In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. ( https://gerrit.osmocom.org/13168 ) Change subject: msc: f_call_hangup: ignore MDCX ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/13168 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I768f16288617aade6a4d6548129e6f9e0b1d4d33 Gerrit-Change-Number: 13168 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 05:04:59 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 05:04:59 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: f_tc_sgsap_mt_sms_and_reject: shorter delay In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. ( https://gerrit.osmocom.org/13615 ) Change subject: msc: f_tc_sgsap_mt_sms_and_reject: shorter delay ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/13615 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I4b2a588bcd20a4c04162997b9fe357dbe37178e9 Gerrit-Change-Number: 13615 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 05:09:37 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 05:09:37 +0000 Subject: Change in osmo-hlr[master]: hlr.c: forward GSUP messages between clients In-Reply-To: References: Message-ID: Neels Hofmeyr has uploaded a new patch set (#11) to the change originally created by osmith. ( https://gerrit.osmocom.org/13006 ) Change subject: hlr.c: forward GSUP messages between clients ...................................................................... hlr.c: forward GSUP messages between clients Allow clients to forward any GSUP message between clients. Determine the sender and receiver from the new {source,dest}_name{,_len} IEs. Reject messages with a forged source name. This will be used for the inter-MSC handover. Depends: Ic00b0601eacff6d72927cea51767801142ee75db (libosmocore.git) Related: OS#3793 Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 --- M src/hlr.c 1 file changed, 82 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/06/13006/11 -- To view, visit https://gerrit.osmocom.org/13006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 Gerrit-Change-Number: 13006 Gerrit-PatchSet: 11 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 05:09:37 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 05:09:37 +0000 Subject: Change in osmo-hlr[master]: GSUP routing: use Message Class IE In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13588 to look at the new patch set (#2). Change subject: GSUP routing: use Message Class IE ...................................................................... GSUP routing: use Message Class IE Include the GSUP Class from original message in routing error responses. Add the Message Class to GSUP router logging. Depends: Ic397a9f2c4a7224e47cab944c72e75ca5592efef (libosmocore) Change-Id: I8dc3967d9372d63e9d57ca2608dd3316edb234a4 --- M src/hlr.c 1 file changed, 17 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/88/13588/2 -- To view, visit https://gerrit.osmocom.org/13588 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8dc3967d9372d63e9d57ca2608dd3316edb234a4 Gerrit-Change-Number: 13588 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 05:09:37 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 05:09:37 +0000 Subject: Change in osmo-hlr[master]: use new OSMO_IMSI_BUF_SIZE In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13589 to look at the new patch set (#2). Change subject: use new OSMO_IMSI_BUF_SIZE ...................................................................... use new OSMO_IMSI_BUF_SIZE Depends: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 (libosmocore) Change-Id: I8e8fa221e97303df3c6cce96b25d31a53f67b939 --- M src/hlr_ussd.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/89/13589/2 -- To view, visit https://gerrit.osmocom.org/13589 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8e8fa221e97303df3c6cce96b25d31a53f67b939 Gerrit-Change-Number: 13589 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 05:12:08 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Apr 2019 05:12:08 +0000 Subject: Change in osmo-hlr[master]: hlr.c: forward GSUP messages between clients In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13006 ) Change subject: hlr.c: forward GSUP messages between clients ...................................................................... Patch Set 11: argh, @osmith, I think I undid some of your modifications by pushing another patch set. My apologies, but I'm infinitely way past my time, can I burden you with resurrecting the parts I destroyed, while keeping the parts I might have fixed? thanks! -- To view, visit https://gerrit.osmocom.org/13006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 Gerrit-Change-Number: 13006 Gerrit-PatchSet: 11 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 12 Apr 2019 05:12:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 08:00:08 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 12 Apr 2019 08:00:08 +0000 Subject: Change in osmo-gsm-manuals[master]: build/unix-time-to-fmt.py: use default python ver In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13595 ) Change subject: build/unix-time-to-fmt.py: use default python ver ...................................................................... build/unix-time-to-fmt.py: use default python ver Don't explicitly depend on python 3, so we don't need to have python 2 *and* python 3 installed to build osmo-gsm-manuals. The script is short and works fine with either python version. Related: OS#3899 Change-Id: I8af9b8159f5c7e39b905f85edd1584cb4d5a33ef --- M build/unix-time-to-fmt.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/build/unix-time-to-fmt.py b/build/unix-time-to-fmt.py index 026e55c..72ece26 100755 --- a/build/unix-time-to-fmt.py +++ b/build/unix-time-to-fmt.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """ Usage: -- To view, visit https://gerrit.osmocom.org/13595 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8af9b8159f5c7e39b905f85edd1584cb4d5a33ef Gerrit-Change-Number: 13595 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 08:00:30 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 12 Apr 2019 08:00:30 +0000 Subject: Change in osmo-gsm-manuals[master]: check-depends.sh: don't depend on git binary In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13596 ) Change subject: check-depends.sh: don't depend on git binary ...................................................................... check-depends.sh: don't depend on git binary Remove git from depends, because it isn't needed when building the manuals from a source tarball. Avoid having git in the build dependencies of the upcoming manuals packaging for debian. Related: OS#3899 Change-Id: I46ad818a1d009c03357821f7c8100ecb5d62962e --- M check-depends.sh 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/check-depends.sh b/check-depends.sh index 7845719..ec3f26f 100755 --- a/check-depends.sh +++ b/check-depends.sh @@ -18,7 +18,6 @@ check_dep_bin mscgen mscgen check_dep_bin xsltproc libxslt -check_dep_bin git git check_dep_bin a2x asciidoc check_dep_bin asciidoc asciidoc check_dep_bin dblatex dblatex -- To view, visit https://gerrit.osmocom.org/13596 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I46ad818a1d009c03357821f7c8100ecb5d62962e Gerrit-Change-Number: 13596 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 08:12:17 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 12 Apr 2019 08:12:17 +0000 Subject: Change in osmo-hlr[master]: hlr.c: forward GSUP messages between clients 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/13006 to look at the new patch set (#12). Change subject: hlr.c: forward GSUP messages between clients ...................................................................... hlr.c: forward GSUP messages between clients Allow clients to forward any GSUP message between clients. Determine the sender and receiver from the new {source,dest}_name{,_len} IEs. Reject messages with a forged source name. This will be used for the inter-MSC handover. Depends: Ic00b0601eacff6d72927cea51767801142ee75db (libosmocore.git) Related: OS#3793 Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 --- M src/hlr.c 1 file changed, 78 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/06/13006/12 -- To view, visit https://gerrit.osmocom.org/13006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 Gerrit-Change-Number: 13006 Gerrit-PatchSet: 12 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 08:16:30 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 12 Apr 2019 08:16:30 +0000 Subject: Change in osmo-hlr[master]: hlr.c: forward GSUP messages between clients In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13006 ) Change subject: hlr.c: forward GSUP messages between clients ...................................................................... Patch Set 12: > My apologies, but I'm infinitely way past my time, can I burden you with resurrecting the parts I destroyed, while keeping the parts I might have fixed? thanks! No problem, rebased on master and pushed patchset 10 again as patchset 12. It looks like your patchset 11 was the same as your patchset 7, except that it was rebased. (Patchset 10 was based on patchset 7 already, so all your fixes should be there.) -- To view, visit https://gerrit.osmocom.org/13006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 Gerrit-Change-Number: 13006 Gerrit-PatchSet: 12 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 12 Apr 2019 08:16:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 08:58:06 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 12 Apr 2019 08:58:06 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.common.inc: add {, un}install targets In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13597 to look at the new patch set (#2). Change subject: Makefile.common.inc: add {,un}install targets ...................................................................... Makefile.common.inc: add {,un}install targets Allow installing generated pdfs with 'make install' in all Osmocom projects using osmo-gsm-manuals. This makes proper debian packaging of the manuals easier. Autotools will automatically run this file's install target, when running 'make install' in the top source dir. Do not install anything, when OSMO_GSM_MANUALS_NO_INSTALL is set, and set this variable for the tests dir, so we don't install the test pdfs. Related: OS#3899 Change-Id: I66f33172fa410681acbaef4592e9405627948705 --- M build/Makefile.common.inc M tests/Makefile.am 2 files changed, 27 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/97/13597/2 -- To view, visit https://gerrit.osmocom.org/13597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I66f33172fa410681acbaef4592e9405627948705 Gerrit-Change-Number: 13597 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 08:58:06 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 12 Apr 2019 08:58:06 +0000 Subject: Change in osmo-gsm-manuals[master]: Add debian packaging for osmo-gsm-manuals-dev In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13599 to look at the new patch set (#3). Change subject: Add debian packaging for osmo-gsm-manuals-dev ...................................................................... Add debian packaging for osmo-gsm-manuals-dev Allow including pdf manuals in each Osmocom repositories -doc debian package, by depending on osmo-gsm-manuals-dev. Related: OS#3899 Example usage: I4c184c62804c0b805a0a2425a5bd0312e94e49ab (osmo-bts.git) Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 --- A debian/changelog A debian/compat A debian/control A debian/copyright A debian/rules A debian/source/format 6 files changed, 76 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/99/13599/3 -- To view, visit https://gerrit.osmocom.org/13599 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 Gerrit-Change-Number: 13599 Gerrit-PatchSet: 3 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 08:58:16 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 12 Apr 2019 08:58:16 +0000 Subject: Change in osmo-gsm-manuals[master]: Add debian packaging for osmo-gsm-manuals-dev In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13599 ) Change subject: Add debian packaging for osmo-gsm-manuals-dev ...................................................................... Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/13599/2/debian/copyright File debian/copyright: https://gerrit.osmocom.org/#/c/13599/2/debian/copyright at 10 PS2, Line 10: Copyright: 2019 Oliver Smith Changed to > 2019 sysmocom s.f.m.c. GmbH (I just realized, we have the s.m.f.c. (f and m switched) typo quite a few times across the source trees...) https://gerrit.osmocom.org/#/c/13599/2/debian/copyright at 13 PS2, Line 13: License: GPL-3.0+ > Repeated line (l11)? That was generated by dh_make, and it fits debian's copyright-format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/#stand-alone-license-paragraph -- To view, visit https://gerrit.osmocom.org/13599 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 Gerrit-Change-Number: 13599 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 08:58:16 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 08:58:26 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 12 Apr 2019 08:58:26 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.common.inc: add {, un}install targets In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13597 ) Change subject: Makefile.common.inc: add {,un}install targets ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/13597/1/build/Makefile.common.inc File build/Makefile.common.inc: https://gerrit.osmocom.org/#/c/13597/1/build/Makefile.common.inc at 34 PS1, Line 34: if [ "$(OSMO_GSM_MANUALS_NO_INSTALL)" != "1" ]; then \ > According to configure. [?] Good point. But we don't include the Makefile.common.inc unless --enable-manuals is set, so it won't try run the install target from here (or try to build its dependencies, $(PDF_FILES)). I've added a comment to clarify, as you have suggested. https://git.osmocom.org/osmo-bsc/tree/doc/manuals/Makefile.am if BUILD_MANUALS ... include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc endif https://gerrit.osmocom.org/#/c/13597/1/build/Makefile.common.inc at 36 PS1, Line 36: Dm6 > Probably better using /share/doc/osmo-gsm-manuals/. [?] Done -- To view, visit https://gerrit.osmocom.org/13597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I66f33172fa410681acbaef4592e9405627948705 Gerrit-Change-Number: 13597 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 08:58:26 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 10:21:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 10:21:45 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Add minimalistic PAP support In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13608 ) Change subject: ggsn: Add minimalistic PAP support ...................................................................... Patch Set 3: (5 comments) https://gerrit.osmocom.org/#/c/13608/3//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13608/3//COMMIT_MSG at 12 PS3, Line 12: all, without actually checking any credentials database. > So the MS is expected to send inside PAP the values you configure your APN with? (the User+Password [?] yes, if you add username/password, the MS/UE should send those values in PAP. https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c at 518 PS3, Line 518: unsigned int pap_welcome_len = strlen(pap_welcome); > "ARRAY_SIZE(pap_welcome) -1" would make sense too :) I think gcc is smart enough to do the strlen at compile-time these days. It's much more readable, for sure. https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c at 519 PS3, Line 519: uint8_t pap_out_size = sizeof(struct pap_element) + 1 + pap_welcome_len; > Is that +1 for the NULL chat of pap_welcome? please add comment (and add +1 to the end). the one bytes is for the *length* byte. There is no requirement for NUL termination https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c at 520 PS3, Line 520: struct pap_element *pap_out = alloca(pap_out_size); > nice, didn't know about alloca() you can also use runtime-computed size for arrays these days. So something like having the length passed in as a function argument and then putting "char foo[len_arg];" on the stack works. However, in this case we don't want to allocate an array but 'struct pcap_element' with some extra bytes at the end, and hence I went for alloca. https://gerrit.osmocom.org/#/c/13608/3/ggsn/ggsn.c at 526 PS3, Line 526: if (htons(pap_in->len) > pco_in->length) > is htons() fine alignment-access wise? [?] ACK, will update. -- To view, visit https://gerrit.osmocom.org/13608 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I81875f30f9f1497199253497f84718510747f731 Gerrit-Change-Number: 13608 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 10:21:45 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 10:23:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 10:23:57 +0000 Subject: Change in osmo-ggsn[master]: ggsn: More logging from PCO handling (e.g. in case of malconfiguration) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13609 ) Change subject: ggsn: More logging from PCO handling (e.g. in case of malconfiguration) ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/13609/3/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13609/3/ggsn/ggsn.c at 570 PS3, Line 570: if (!peer_v4) { > Wondering why IPCP is only used in ipv4... because IPCP is specified strictly for IPv4 only. There is no IP6CP (at least not for communicating DNS servers), and as a result, the IPv6 DNS adresses had to be pushed directl into PCO without any IETF format/layer. -- To view, visit https://gerrit.osmocom.org/13609 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I38c2c4178ff4fd795f54638adec63166b1c0838e Gerrit-Change-Number: 13609 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 10:23:57 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 10:24:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 10:24:12 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Add minimalistic PAP support 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/13608 to look at the new patch set (#4). Change subject: ggsn: Add minimalistic PAP support ...................................................................... ggsn: Add minimalistic PAP support Some modems are configured to use PAP as an additional authentication mechanism beyond the GSM authentication that's part of GMM. Let's handle such PAP authentication requests by simply acknowledging them all, without actually checking any credentials database. This is the most sane thing we can do for now, without adding external requirements / interfaces like radius servers or the like. Closes: OS#3914 Change-Id: I81875f30f9f1497199253497f84718510747f731 --- M ggsn/ggsn.c 1 file changed, 72 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/08/13608/4 -- To view, visit https://gerrit.osmocom.org/13608 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I81875f30f9f1497199253497f84718510747f731 Gerrit-Change-Number: 13608 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 10:28:42 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 10:28:42 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.common.inc: add {, un}install targets In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13597 ) Change subject: Makefile.common.inc: add {,un}install targets ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I66f33172fa410681acbaef4592e9405627948705 Gerrit-Change-Number: 13597 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 10:28:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 10:29:06 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 10:29:06 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.am: proper noarch pkgconfig install dir In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13598 ) Change subject: Makefile.am: proper noarch pkgconfig install dir ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13598 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I63bc8ab6d2845751079f40383d2aa92c709ce2fe Gerrit-Change-Number: 13598 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 10:29:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 10:29:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 10:29:30 +0000 Subject: Change in osmo-gsm-manuals[master]: Add debian packaging for osmo-gsm-manuals-dev In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13599 ) Change subject: Add debian packaging for osmo-gsm-manuals-dev ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13599 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 Gerrit-Change-Number: 13599 Gerrit-PatchSet: 3 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 10:29:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 10:33:16 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 10:33:16 +0000 Subject: Change in libosmocore[master]: add OSMO_IMSI_BUF_SIZE In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13575 ) Change subject: add OSMO_IMSI_BUF_SIZE ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 Gerrit-Change-Number: 13575 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 12 Apr 2019 10:33:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 10:33:33 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 10:33:33 +0000 Subject: Change in libosmocore[master]: GSUP: add Message Class IE In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13576 ) Change subject: GSUP: add Message Class IE ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef Gerrit-Change-Number: 13576 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 12 Apr 2019 10:33:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 12:10:41 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 12 Apr 2019 12:10:41 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.common.inc: add {, un}install targets 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/13597 to look at the new patch set (#3). Change subject: Makefile.common.inc: add {,un}install targets ...................................................................... Makefile.common.inc: add {,un}install targets Allow installing generated pdfs with 'make install' in all Osmocom projects using osmo-gsm-manuals. This makes proper debian packaging of the manuals easier. Autotools will automatically run this file's install target, when running 'make install' in the top source dir. Do not install anything, when OSMO_GSM_MANUALS_NO_INSTALL is set, and set this variable for the tests dir, so we don't install the test pdfs. Related: OS#3899 Change-Id: I66f33172fa410681acbaef4592e9405627948705 --- M build/Makefile.common.inc M tests/Makefile.am 2 files changed, 30 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/97/13597/3 -- To view, visit https://gerrit.osmocom.org/13597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I66f33172fa410681acbaef4592e9405627948705 Gerrit-Change-Number: 13597 Gerrit-PatchSet: 3 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 12:23:44 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 12 Apr 2019 12:23:44 +0000 Subject: Change in osmo-gsm-manuals[master]: Add debian packaging for osmo-gsm-manuals-dev 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/13599 to look at the new patch set (#5). Change subject: Add debian packaging for osmo-gsm-manuals-dev ...................................................................... Add debian packaging for osmo-gsm-manuals-dev Allow including pdf manuals in each Osmocom repositories -doc debian package, by depending on osmo-gsm-manuals-dev. Related: OS#3899 Example usage: I4c184c62804c0b805a0a2425a5bd0312e94e49ab (osmo-bts.git) Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 --- M build/Makefile.common.inc A debian/changelog A debian/compat A debian/control A debian/copyright A debian/rules A debian/source/format 7 files changed, 77 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/99/13599/5 -- To view, visit https://gerrit.osmocom.org/13599 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 Gerrit-Change-Number: 13599 Gerrit-PatchSet: 5 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 12:26:34 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 12 Apr 2019 12:26:34 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.common.inc: add {, un}install targets 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/13597 to look at the new patch set (#4). Change subject: Makefile.common.inc: add {,un}install targets ...................................................................... Makefile.common.inc: add {,un}install targets Allow installing generated pdfs with 'make install' in all Osmocom projects using osmo-gsm-manuals. This makes proper debian packaging of the manuals easier. Autotools will automatically run this file's install target, when running 'make install' in the top source dir. Do not install anything, when OSMO_GSM_MANUALS_NO_INSTALL is set, and set this variable for the tests dir, so we don't install the test pdfs. Related: OS#3899 Change-Id: I66f33172fa410681acbaef4592e9405627948705 --- M build/Makefile.common.inc M tests/Makefile.am 2 files changed, 30 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/97/13597/4 -- To view, visit https://gerrit.osmocom.org/13597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I66f33172fa410681acbaef4592e9405627948705 Gerrit-Change-Number: 13597 Gerrit-PatchSet: 4 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 12:29:43 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 12 Apr 2019 12:29:43 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.common.inc: add {, un}install targets In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13597 ) Change subject: Makefile.common.inc: add {,un}install targets ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/13597/1/build/Makefile.common.inc File build/Makefile.common.inc: https://gerrit.osmocom.org/#/c/13597/1/build/Makefile.common.inc at 36 PS1, Line 36: OS > Done Update after Harald's review in https://gerrit.osmocom.org/#/c/osmo-bts/+/13601/ - it uses the repository name in the install dir now, e.g. /usr/share/doc/osmo-bts-doc/*.pdf -- To view, visit https://gerrit.osmocom.org/13597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I66f33172fa410681acbaef4592e9405627948705 Gerrit-Change-Number: 13597 Gerrit-PatchSet: 4 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 12:29:43 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 12:32:30 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Fri, 12 Apr 2019 12:32:30 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.common.inc: add {, un}install targets 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/13597 to look at the new patch set (#5). Change subject: Makefile.common.inc: add {,un}install targets ...................................................................... Makefile.common.inc: add {,un}install targets Allow installing generated pdfs with 'make install' in all Osmocom projects using osmo-gsm-manuals. This makes proper debian packaging of the manuals easier. Autotools will automatically run this file's install target, when running 'make install' in the top source dir. Do not install anything, when OSMO_GSM_MANUALS_NO_INSTALL is set, and set this variable for the tests dir, so we don't install the test pdfs. Related: OS#3899 Change-Id: I66f33172fa410681acbaef4592e9405627948705 --- M build/Makefile.common.inc M tests/Makefile.am 2 files changed, 30 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/97/13597/5 -- To view, visit https://gerrit.osmocom.org/13597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I66f33172fa410681acbaef4592e9405627948705 Gerrit-Change-Number: 13597 Gerrit-PatchSet: 5 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 13:09:01 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 13:09:01 +0000 Subject: Change in osmo-hlr[master]: use new OSMO_IMSI_BUF_SIZE In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13589 ) Change subject: use new OSMO_IMSI_BUF_SIZE ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13589 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8e8fa221e97303df3c6cce96b25d31a53f67b939 Gerrit-Change-Number: 13589 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 13:09:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 13:16:19 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 13:16:19 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Add minimalistic PAP support In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13608 ) Change subject: ggsn: Add minimalistic PAP support ...................................................................... Patch Set 4: (2 comments) https://gerrit.osmocom.org/#/c/13608/4/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13608/4/ggsn/ggsn.c at 531 PS4, Line 531: if (pap_in->len < 1) That's wrong, because len includes header according to line 501. Also, you are accessing data[0] and data[1], so you miss one byte len. if (pap_in->len < sizeof(*pap_in) + 2) https://gerrit.osmocom.org/#/c/13608/4/ggsn/ggsn.c at 535 PS4, Line 535: if (pap_in->len < 1 + peer_id_len) if (pap_in->len < sizeof(*pap_in) + 2 + peer_id_len) -- To view, visit https://gerrit.osmocom.org/13608 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I81875f30f9f1497199253497f84718510747f731 Gerrit-Change-Number: 13608 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 13:16:19 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 13:16:55 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 13:16:55 +0000 Subject: Change in libosmocore[master]: add OSMO_IMSI_BUF_SIZE In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13575 ) Change subject: add OSMO_IMSI_BUF_SIZE ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 Gerrit-Change-Number: 13575 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 12 Apr 2019 13:16:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 13:19:48 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 13:19:48 +0000 Subject: Change in osmo-gsm-manuals[master]: Add debian packaging for osmo-gsm-manuals-dev In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13599 ) Change subject: Add debian packaging for osmo-gsm-manuals-dev ...................................................................... Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/13599/2/debian/copyright File debian/copyright: https://gerrit.osmocom.org/#/c/13599/2/debian/copyright at 10 PS2, Line 10: Copyright: 2019 Oliver Smith > Changed to [?] We'll then need to change the company name ;) https://gerrit.osmocom.org/#/c/13599/2/debian/copyright at 13 PS2, Line 13: License: GPL-3.0+ > That was generated by dh_make, and it fits debian's copyright-format: [?] Ah fine, it looked weird specially having the gerrit patch commits in between. -- To view, visit https://gerrit.osmocom.org/13599 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 Gerrit-Change-Number: 13599 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 13:19:48 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 13:26:59 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 13:26:59 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.common.inc: add {, un}install targets In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13597 ) Change subject: Makefile.common.inc: add {,un}install targets ...................................................................... Patch Set 5: Code-Review+1 Leaving +2 to Harald since he suggested using "foo-doc" directory naming scheme. -- To view, visit https://gerrit.osmocom.org/13597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I66f33172fa410681acbaef4592e9405627948705 Gerrit-Change-Number: 13597 Gerrit-PatchSet: 5 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Fri, 12 Apr 2019 13:26:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 13:27:18 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 13:27:18 +0000 Subject: Change in osmo-gsm-manuals[master]: Add debian packaging for osmo-gsm-manuals-dev In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13599 ) Change subject: Add debian packaging for osmo-gsm-manuals-dev ...................................................................... Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13599 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 Gerrit-Change-Number: 13599 Gerrit-PatchSet: 7 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Fri, 12 Apr 2019 13:27:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 13:45:20 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Apr 2019 13:45:20 +0000 Subject: Change in libosmocore[master]: add OSMO_IMSI_BUF_SIZE In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13575 ) Change subject: add OSMO_IMSI_BUF_SIZE ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 Gerrit-Change-Number: 13575 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 12 Apr 2019 13:45:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 14:02:05 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Apr 2019 14:02:05 +0000 Subject: Change in libosmocore[master]: GSUP: add Message Class IE In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13576 ) Change subject: GSUP: add Message Class IE ...................................................................... Patch Set 4: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/13576/4/include/osmocom/gsm/gsup.h File include/osmocom/gsm/gsup.h: https://gerrit.osmocom.org/#/c/13576/4/include/osmocom/gsm/gsup.h at 71 PS4, Line 71: = 0x0a, alignment https://gerrit.osmocom.org/#/c/13576/3/src/gsm/gsup.c File src/gsm/gsup.c: https://gerrit.osmocom.org/#/c/13576/3/src/gsm/gsup.c at 739 PS3, Line 739: {} > I always use {}, and have been doing that all over the place. But in this particular file all 'value_string' arrays are using '{ 0, NULL }'. Let's please keep the code consistent. -- To view, visit https://gerrit.osmocom.org/13576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef Gerrit-Change-Number: 13576 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 12 Apr 2019 14:02:05 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 14:29:59 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Apr 2019 14:29:59 +0000 Subject: Change in osmo-bts[master]: common/pcu_sock.c: fix possible memleaks in pcu_sock_read() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13618 Change subject: common/pcu_sock.c: fix possible memleaks in pcu_sock_read() ...................................................................... common/pcu_sock.c: fix possible memleaks in pcu_sock_read() Change-Id: I58352e5f2b5715361c7089d0e134a42975171022 --- M src/common/pcu_sock.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/13618/1 diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index d694602..d496a49 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -790,14 +790,17 @@ goto close; if (rc < 0) { - if (errno == EAGAIN) + if (errno == EAGAIN) { + msgb_free(msg); return 0; + } goto close; } if (rc < sizeof(*pcu_prim)) { LOGP(DPCU, LOGL_ERROR, "Received %d bytes on PCU Socket, but primitive size " "is %lu, discarding\n", rc, sizeof(*pcu_prim)); + msgb_free(msg); return 0; } -- To view, visit https://gerrit.osmocom.org/13618 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I58352e5f2b5715361c7089d0e134a42975171022 Gerrit-Change-Number: 13618 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 14:31:16 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Apr 2019 14:31:16 +0000 Subject: Change in osmo-bts[master]: pcu_sock: use %zu conversion specifier for printing sizeof() result In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13267 ) Change subject: pcu_sock: use %zu conversion specifier for printing sizeof() result ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/13267/4/src/common/pcu_sock.c File src/common/pcu_sock.c: https://gerrit.osmocom.org/#/c/13267/4/src/common/pcu_sock.c at 794 PS4, Line 794: return 0; > Here too, memleak. [?] Oh, right! Please see: https://gerrit.osmocom.org/#/c/osmo-bts/+/13618 -- To view, visit https://gerrit.osmocom.org/13267 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709 Gerrit-Change-Number: 13267 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-Comment-Date: Fri, 12 Apr 2019 14:31:16 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 14:42:17 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Fri, 12 Apr 2019 14:42:17 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Ensure BcdMccMnc is encoded as 24.008 10.5.5.15 Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/13619 Change subject: Ensure BcdMccMnc is encoded as 24.008 10.5.5.15 ...................................................................... Ensure BcdMccMnc is encoded as 24.008 10.5.5.15 PCU is using BcdMccMnc as it's encoded as 24.008. But SGSN code is using it as it would be byte by byte sorted. Fixes: OS#3878 Change-Id: Ie8f67f16f18e4c5090bc5a4c46a866a7e7e00206 --- M library/L3_Common.ttcn M library/Osmocom_Gb_Types.ttcn M sgsn/SGSN_Tests.ttcn 3 files changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/19/13619/1 diff --git a/library/L3_Common.ttcn b/library/L3_Common.ttcn index 57db6b3..01f0a34 100644 --- a/library/L3_Common.ttcn +++ b/library/L3_Common.ttcn @@ -106,9 +106,9 @@ rai.mccDigit1 & rai.mccDigit2 & rai.mccDigit3 + & rai.mncDigit3 & rai.mncDigit1 - & rai.mncDigit2 - & rai.mncDigit3; + & rai.mncDigit2; return plmn; } diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn index 95d3028..55a2816 100644 --- a/library/Osmocom_Gb_Types.ttcn +++ b/library/Osmocom_Gb_Types.ttcn @@ -868,8 +868,8 @@ ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1]; ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2]; ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3]; - ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4]; + ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; } if (isvalue(cid.ra_id.lai.lac)) { ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2); diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 8b639e6..74cdece 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -137,15 +137,16 @@ }; private function f_cellid_to_RAI(in BssgpCellId cell_id) return RoutingAreaIdentificationV { + /* mcc_mnc is encoded as of 24.008 10.5.5.15 */ var BcdMccMnc mcc_mnc := cell_id.ra_id.lai.mcc_mnc; var RoutingAreaIdentificationV ret := { mccDigit1 := mcc_mnc[0], mccDigit2 := mcc_mnc[1], mccDigit3 := mcc_mnc[2], - mncDigit3 := mcc_mnc[5], - mncDigit1 := mcc_mnc[3], - mncDigit2 := mcc_mnc[4], + mncDigit3 := mcc_mnc[3], + mncDigit1 := mcc_mnc[4], + mncDigit2 := mcc_mnc[5], lac := int2oct(cell_id.ra_id.lai.lac, 16), rac := int2oct(cell_id.ra_id.rac, 8) } @@ -225,7 +226,8 @@ } -function f_init(BcdMccMnc mcc_mnc := '26242F'H) runs on test_CT { +/* mcc_mnc is 24.008 10.5.5.15 encoded. 262 42 */ +function f_init(BcdMccMnc mcc_mnc := '262F42'H) runs on test_CT { if (g_initialized == true) { return; } -- To view, visit https://gerrit.osmocom.org/13619 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie8f67f16f18e4c5090bc5a4c46a866a7e7e00206 Gerrit-Change-Number: 13619 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 14:53:04 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 14:53:04 +0000 Subject: Change in osmo-bts[master]: common/pcu_sock.c: fix possible memleaks in pcu_sock_read() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13618 ) Change subject: common/pcu_sock.c: fix possible memleaks in pcu_sock_read() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13618 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I58352e5f2b5715361c7089d0e134a42975171022 Gerrit-Change-Number: 13618 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 14:53:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 14:58:28 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Apr 2019 14:58:28 +0000 Subject: Change in libosmocore[master]: Fix incorrect buffer size calculation Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13620 Change subject: Fix incorrect buffer size calculation ...................................................................... Fix incorrect buffer size calculation Calling sizeof() on a pointer to dynamically allocated memory would result in getting size of the pointer (usually 4 or 8 bytes) itself, but not the size of allocated memory. Change-Id: I8ffda4dea2b7f9b4b76dfeecad1fab6384c5a62c Fixes: CID#197629, CID#197628, CID#197627 Fixes: CID#197626, CID#197625, CID#197624 --- M src/msgb.c M src/socket.c M src/utils.c 3 files changed, 16 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/13620/1 diff --git a/src/msgb.c b/src/msgb.c index 5a154e5..940135f 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -522,10 +522,11 @@ */ char *msgb_hexdump_c(const void *ctx, const struct msgb *msg) { - char *buf = talloc_size(ctx, msgb_length(msg)*3 + 100); + size_t buf_len = msgb_length(msg) * 3 + 100; + char *buf = talloc_size(ctx, buf_len); if (!buf) return NULL; - return msgb_hexdump_buf(buf, sizeof(buf), msg); + return msgb_hexdump_buf(buf, buf_len, msg); } /*! Print a string to the end of message buffer. diff --git a/src/socket.c b/src/socket.c index c817e72..7c412b6 100644 --- a/src/socket.c +++ b/src/socket.c @@ -837,7 +837,7 @@ char *str = talloc_size(ctx, OSMO_SOCK_NAME_MAXLEN); if (!str) return NULL; - osmo_sock_get_name_buf(str, sizeof(str), fd); + osmo_sock_get_name_buf(str, OSMO_SOCK_NAME_MAXLEN, fd); return str; } diff --git a/src/utils.c b/src/utils.c index 896e917..b66721e 100644 --- a/src/utils.c +++ b/src/utils.c @@ -351,10 +351,11 @@ */ char *osmo_hexdump_c(const void *ctx, const unsigned char *buf, int len) { - char *hexd_buff = talloc_size(ctx, len*3 + 1); + size_t hexd_buff_len = len * 3 + 1; + char *hexd_buff = talloc_size(ctx, hexd_buff_len); if (!hexd_buff) return NULL; - osmo_hexdump_buf(hexd_buff, sizeof(hexd_buff), buf, len, " ", true); + osmo_hexdump_buf(hexd_buff, hexd_buff_len, buf, len, " ", true); return hexd_buff; } @@ -389,10 +390,11 @@ */ char *osmo_hexdump_nospc_c(const void *ctx, const unsigned char *buf, int len) { - char *hexd_buff = talloc_size(ctx, len*2 + 1); + size_t hexd_buff_len = len * 2 + 1; + char *hexd_buff = talloc_size(ctx, hexd_buff_len); if (!hexd_buff) return NULL; - osmo_hexdump_buf(hexd_buff, sizeof(hexd_buff), buf, len, "", true); + osmo_hexdump_buf(hexd_buff, hexd_buff_len, buf, len, "", true); return hexd_buff; } @@ -908,10 +910,11 @@ */ char *osmo_str_tolower_c(const void *ctx, const char *src) { - char *buf = talloc_size(ctx, strlen(src)+1); + size_t buf_len = strlen(src) + 1; + char *buf = talloc_size(ctx, buf_len); if (!buf) return NULL; - osmo_str_tolower_buf(buf, sizeof(buf), src); + osmo_str_tolower_buf(buf, buf_len, src); return buf; } @@ -966,10 +969,11 @@ */ char *osmo_str_toupper_c(const void *ctx, const char *src) { - char *buf = talloc_size(ctx, strlen(src)+1); + size_t buf_len = strlen(src) + 1; + char *buf = talloc_size(ctx, buf_len); if (!buf) return NULL; - osmo_str_toupper_buf(buf, sizeof(buf), src); + osmo_str_toupper_buf(buf, buf_len, src); return buf; } -- To view, visit https://gerrit.osmocom.org/13620 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8ffda4dea2b7f9b4b76dfeecad1fab6384c5a62c Gerrit-Change-Number: 13620 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:02:18 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 15:02:18 +0000 Subject: Change in osmo-gsm-tester[master]: powersupply: Add support for Intellinet PDU Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13621 Change subject: powersupply: Add support for Intellinet PDU ...................................................................... powersupply: Add support for Intellinet PDU Based on original pdutool code from Joachim Steiger. Change-Id: Iab4f7aec1c50f47da4cd734441bb36fa09d171a3 --- M check_dependencies.py M src/osmo_gsm_tester/powersupply.py A src/osmo_gsm_tester/powersupply_intellinet.py 3 files changed, 103 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/21/13621/1 diff --git a/check_dependencies.py b/check_dependencies.py index 83df7a9..28bfdf7 100755 --- a/check_dependencies.py +++ b/check_dependencies.py @@ -26,5 +26,7 @@ import sqlite3 import sispm import smpplib +import urllib.request +import xml.etree.ElementTree print('dependencies ok') diff --git a/src/osmo_gsm_tester/powersupply.py b/src/osmo_gsm_tester/powersupply.py index 86fc010..1cf7106 100644 --- a/src/osmo_gsm_tester/powersupply.py +++ b/src/osmo_gsm_tester/powersupply.py @@ -1,6 +1,6 @@ # osmo_gsm_tester: class defining a Power Supply object # -# Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH +# Copyright (C) 2018-2019 by sysmocom - s.f.m.c. GmbH # # Author: Pau Espin Pedrol # @@ -51,10 +51,11 @@ self.power_set(True) -from . import powersupply_sispm +from . import powersupply_sispm, powersupply_intellinet KNOWN_PWSUPPLY_TYPES = { 'sispm' : powersupply_sispm.PowerSupplySispm, + 'intellinet' : powersupply_intellinet.PowerSupplyIntellinet, } def register_type(name, clazz): diff --git a/src/osmo_gsm_tester/powersupply_intellinet.py b/src/osmo_gsm_tester/powersupply_intellinet.py new file mode 100644 index 0000000..c2bf2c8 --- /dev/null +++ b/src/osmo_gsm_tester/powersupply_intellinet.py @@ -0,0 +1,98 @@ +# osmo_gsm_tester: class defining a Power Supply object +# +# Copyright (C) 2019 by sysmocom - s.f.m.c. GmbH +# +# Author: Pau Espin Pedrol +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import urllib.request +import xml.etree.ElementTree as ET + +from . import log +from .powersupply import PowerSupply + +class PowerSupplyIntellinet(PowerSupply): + """PowerSupply implementation to controll Intellinet devices.""" + + # HTTP request timeout, in seconds + PDU_TIMEOUT = 5 + + PDU_CMD_ON = 0 + PDU_CMD_OFF = 1 + + def _url_prefix(self): + return 'http://' + self.device_ip + + def _url_status(self): + return self._url_prefix() + '/status.xml' + + def _url_set_port_status(self, pdu_cmd): + return self._url_prefix() + "/control_outlet.htm?" + "outlet" + str(self.port - 1) + "=1" + "&op=" + str(pdu_cmd) + "&submit=Anwenden" + + def _port_stat_name(self): + # Names start with idx 0, while in ogt we count sockets starting from 1. + return 'outletStat' + str(self.port - 1) + + def _fetch_status(self): + data = urllib.request.urlopen(self._url_status(), timeout = self.PDU_TIMEOUT).read() + if not data: + raise log.Error('empty status xml') + return data + + def _get_port_status(self): + data = self._fetch_status() + root = ET.fromstring(data) + for child in root: + if child.tag == self._port_stat_name(): + return child.text + raise log.Error('no state for %s' % self._port_stat_name()) + + def _set_port_status(self, pdu_cmd): + urllib.request.urlopen(self._url_set_port_status(pdu_cmd),timeout = self.PDU_TIMEOUT).read() + + +######################## +# PUBLIC - INTERNAL API +######################## + def __init__(self, conf): + super().__init__(conf, 'intellinet') + mydevid = conf.get('device') + if mydevid is None: + raise log.Error('No "device" attribute provided in supply conf!') + self.set_name('intellinet-'+mydevid) + myport = conf.get('port') + if myport is None: + raise log.Error('No "port" attribute provided in power_supply conf!') + if not int(myport): + raise log.Error('Wrong non numeric "port" attribute provided in power_supply conf!') + self.set_name('intellinet-'+mydevid+'-'+myport) + self.device_ip = mydevid + self.port = int(myport) + + def is_powered(self): + """Get whether the device is powered on or off.""" + return self._get_port_status() == 'on' + + def power_set(self, onoff): + """Turn on (onoff=True) or off (onoff=False) the device.""" + if onoff: + self.dbg('switchon') + self._set_port_status(self.PDU_CMD_ON) + else: + self.dbg('switchoff') + self._set_port_status(self.PDU_CMD_OFF) + + +# vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/13621 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iab4f7aec1c50f47da4cd734441bb36fa09d171a3 Gerrit-Change-Number: 13621 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:08:48 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 15:08:48 +0000 Subject: Change in osmo-sgsn[master]: LLC XID: Fix string representation of N201_U Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13622 Change subject: LLC XID: Fix string representation of N201_U ...................................................................... LLC XID: Fix string representation of N201_U Change-Id: I8799e3a3c47377aeeb9923d9d73f5d0b73cd8d0b --- M src/gprs/gprs_llc_xid.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/22/13622/1 diff --git a/src/gprs/gprs_llc_xid.c b/src/gprs/gprs_llc_xid.c index de60e49..b91fa6b 100644 --- a/src/gprs/gprs_llc_xid.c +++ b/src/gprs/gprs_llc_xid.c @@ -41,7 +41,7 @@ { GPRS_LLC_XID_T_IOV_I, "IOV_I"}, { GPRS_LLC_XID_T_T200, "T200"}, { GPRS_LLC_XID_T_N200, "N200"}, - { GPRS_LLC_XID_T_N201_U, "N201_"}, + { GPRS_LLC_XID_T_N201_U, "N201_U"}, { GPRS_LLC_XID_T_N201_I, "N201_I"}, { GPRS_LLC_XID_T_mD, "mD"}, { GPRS_LLC_XID_T_mU, "mU"}, -- To view, visit https://gerrit.osmocom.org/13622 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8799e3a3c47377aeeb9923d9d73f5d0b73cd8d0b Gerrit-Change-Number: 13622 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:08:48 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 15:08:48 +0000 Subject: Change in osmo-sgsn[master]: LLC: Store the XID inside the LLC Entity, not LLC Mgmg Entity Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13623 Change subject: LLC: Store the XID inside the LLC Entity, not LLC Mgmg Entity ...................................................................... LLC: Store the XID inside the LLC Entity, not LLC Mgmg Entity The LLC XID exchange is negotiating parameters for a given SAPI, and not for the entire connection from/to that given subscriber. Change-Id: Iaeb54ca5ac58391be45e56c2e721f531969f3a9e --- M include/osmocom/sgsn/gprs_llc.h M src/gprs/gprs_llc.c M src/gprs/gprs_sndcp.c 3 files changed, 25 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/23/13623/1 diff --git a/include/osmocom/sgsn/gprs_llc.h b/include/osmocom/sgsn/gprs_llc.h index 376ae9a..711bcd6 100644 --- a/include/osmocom/sgsn/gprs_llc.h +++ b/include/osmocom/sgsn/gprs_llc.h @@ -145,6 +145,13 @@ unsigned int retrans_ctr; struct gprs_llc_params params; + + /* Copy of the XID fields we have sent with the last + * network originated XID-Request. Since the phone + * may strip the optional fields in the confirmation + * we need to remeber those fields in order to be + * able to create the compression entity. */ + struct llist_head *xid; }; #define NUM_SAPIS 16 @@ -169,13 +176,6 @@ uint16_t nsei; struct gprs_llc_lle lle[NUM_SAPIS]; - /* Copy of the XID fields we have sent with the last - * network originated XID-Request. Since the phone - * may strip the optional fields in the confirmation - * we need to remeber those fields in order to be - * able to create the compression entity. */ - struct llist_head *xid; - /* Compression entities */ struct { /* In these two list_heads we will store the diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index abbb742..1cb0f5d 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -52,7 +52,7 @@ /* Generate XID message */ static int gprs_llc_generate_xid(uint8_t *bytes, int bytes_len, struct gprs_llc_xid_field *l3_xid_field, - struct gprs_llc_llme *llme) + struct gprs_llc_lle *lle) { /* Note: Called by gprs_ll_xid_req() */ @@ -89,8 +89,8 @@ } /* Store generated XID for later reference */ - talloc_free(llme->xid); - llme->xid = gprs_llc_copy_xid(llme, &xid_fields); + talloc_free(lle->xid); + lle->xid = gprs_llc_copy_xid(lle->llme, &xid_fields); return gprs_llc_compile_xid(bytes, bytes_len, &xid_fields); } @@ -98,7 +98,7 @@ /* Generate XID message that will cause the GMM to reset */ static int gprs_llc_generate_xid_for_gmm_reset(uint8_t *bytes, int bytes_len, uint32_t iov_ui, - struct gprs_llc_llme *llme) + struct gprs_llc_lle *lle) { /* Called by gprs_llgmm_reset() and * gprs_llgmm_reset_oldmsg() */ @@ -123,8 +123,8 @@ llist_add(&xid_reset.list, &xid_fields); /* Store generated XID for later reference */ - talloc_free(llme->xid); - llme->xid = gprs_llc_copy_xid(llme, &xid_fields); + talloc_free(lle->xid); + lle->xid = gprs_llc_copy_xid(lle->llme, &xid_fields); return gprs_llc_compile_xid(bytes, bytes_len, &xid_fields); } @@ -143,8 +143,8 @@ struct gprs_llc_xid_field *xid_field_request_l3 = NULL; /* Pick layer3 XID from the XID request we have sent last */ - if (lle->llme->xid) { - llist_for_each_entry(xid_field_request, lle->llme->xid, list) { + if (lle->xid) { + llist_for_each_entry(xid_field_request, lle->xid, list) { if (xid_field_request->type == GPRS_LLC_XID_T_L3_PAR) xid_field_request_l3 = xid_field_request; } @@ -188,8 +188,8 @@ } /* Flush pending XID fields */ - talloc_free(lle->llme->xid); - lle->llme->xid = NULL; + talloc_free(lle->xid); + lle->xid = NULL; return 0; } @@ -324,8 +324,7 @@ /* Generate XID */ xid_bytes_len = - gprs_llc_generate_xid(xid_bytes, sizeof(xid_bytes), - l3_xid_field, lle->llme); + gprs_llc_generate_xid(xid_bytes, sizeof(xid_bytes), l3_xid_field, lle); /* Only perform XID sending if the XID message contains something */ if (xid_bytes_len > 0) { @@ -576,7 +575,6 @@ { gprs_sndcp_comp_free(llme->comp.proto); gprs_sndcp_comp_free(llme->comp.data); - talloc_free(llme->xid); llist_del(&llme->list); talloc_free(llme); } @@ -1084,8 +1082,8 @@ } /* Generate XID message */ - xid_bytes_len = gprs_llc_generate_xid_for_gmm_reset(xid_bytes, - sizeof(xid_bytes),llme->iov_ui,llme); + xid_bytes_len = gprs_llc_generate_xid_for_gmm_reset(xid_bytes, sizeof(xid_bytes), + llme->iov_ui, lle); if (xid_bytes_len < 0) return -EINVAL; xid = msgb_put(msg, xid_bytes_len); @@ -1105,6 +1103,7 @@ struct gprs_llc_llme *llme) { struct msgb *msg = msgb_alloc_headroom(4096, 1024, "LLC_XID"); + struct gprs_llc_lle *lle = &llme->lle[sapi]; uint8_t xid_bytes[1024]; int xid_bytes_len, rc; uint8_t *xid; @@ -1118,8 +1117,8 @@ } /* Generate XID message */ - xid_bytes_len = gprs_llc_generate_xid_for_gmm_reset(xid_bytes, - sizeof(xid_bytes),llme->iov_ui,llme); + xid_bytes_len = gprs_llc_generate_xid_for_gmm_reset(xid_bytes, sizeof(xid_bytes), + llme->iov_ui, lle); if (xid_bytes_len < 0) return -EINVAL; xid = msgb_put(msg, xid_bytes_len); diff --git a/src/gprs/gprs_sndcp.c b/src/gprs/gprs_sndcp.c index f0239cb..23d1e9a 100644 --- a/src/gprs/gprs_sndcp.c +++ b/src/gprs/gprs_sndcp.c @@ -989,8 +989,8 @@ gprs_sndcp_comp_free(lle->llme->comp.data); lle->llme->comp.proto = gprs_sndcp_comp_alloc(lle->llme); lle->llme->comp.data = gprs_sndcp_comp_alloc(lle->llme); - talloc_free(lle->llme->xid); - lle->llme->xid = NULL; + talloc_free(lle->xid); + lle->xid = NULL; /* Generate compression parameter bytestream */ xid_len = gprs_llc_gen_sndcp_xid(l3params, sizeof(l3params), nsapi); -- To view, visit https://gerrit.osmocom.org/13623 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iaeb54ca5ac58391be45e56c2e721f531969f3a9e Gerrit-Change-Number: 13623 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:08:48 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 15:08:48 +0000 Subject: Change in osmo-sgsn[master]: LLC: Don't use hard-coded N201-U / N201-I values in XID Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13624 Change subject: LLC: Don't use hard-coded N201-U / N201-I values in XID ...................................................................... LLC: Don't use hard-coded N201-U / N201-I values in XID The N201 values are negotiated per SAPI, and there are default values per each SAPI. Let's use those rather than hard-coded values. Change-Id: I447a3c6dd85311772a6e219c62dc820d2726857f --- M src/gprs/gprs_llc.c 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/24/13624/1 diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 1cb0f5d..2111e10 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -61,17 +61,20 @@ struct gprs_llc_xid_field xid_version; struct gprs_llc_xid_field xid_n201u; struct gprs_llc_xid_field xid_n201i; + uint16_t n201_u, n201_i; xid_version.type = GPRS_LLC_XID_T_VERSION; xid_version.data = (uint8_t *) "\x00"; xid_version.data_len = 1; + n201_u = htons(lle->params.n201_u); xid_n201u.type = GPRS_LLC_XID_T_N201_U; - xid_n201u.data = (uint8_t *) "\x05\xf0"; + xid_n201u.data = (uint8_t *) &n201_u; xid_n201u.data_len = 2; + n201_i = htons(lle->params.n201_i); xid_n201i.type = GPRS_LLC_XID_T_N201_I; - xid_n201i.data = (uint8_t *) "\x05\xf0"; + xid_n201i.data = (uint8_t *) &n201_i; xid_n201i.data_len = 2; /* Add locally managed XID Fields */ -- To view, visit https://gerrit.osmocom.org/13624 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I447a3c6dd85311772a6e219c62dc820d2726857f Gerrit-Change-Number: 13624 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:08:52 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 15:08:52 +0000 Subject: Change in libosmocore[master]: Fix incorrect buffer size calculation In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13620 ) Change subject: Fix incorrect buffer size calculation ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13620 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8ffda4dea2b7f9b4b76dfeecad1fab6384c5a62c Gerrit-Change-Number: 13620 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 15:08:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:09:54 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 15:09:54 +0000 Subject: Change in osmo-sgsn[master]: LLC XID: Fix string representation of N201_U In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13622 ) Change subject: LLC XID: Fix string representation of N201_U ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13622 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8799e3a3c47377aeeb9923d9d73f5d0b73cd8d0b Gerrit-Change-Number: 13622 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Fri, 12 Apr 2019 15:09:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:09:56 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 15:09:56 +0000 Subject: Change in libosmocore[master]: Fix incorrect buffer size calculation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13620 ) Change subject: Fix incorrect buffer size calculation ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13620 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8ffda4dea2b7f9b4b76dfeecad1fab6384c5a62c Gerrit-Change-Number: 13620 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 15:09:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:09:58 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 15:09:58 +0000 Subject: Change in libosmocore[master]: Fix incorrect buffer size calculation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13620 ) Change subject: Fix incorrect buffer size calculation ...................................................................... Fix incorrect buffer size calculation Calling sizeof() on a pointer to dynamically allocated memory would result in getting size of the pointer (usually 4 or 8 bytes) itself, but not the size of allocated memory. Change-Id: I8ffda4dea2b7f9b4b76dfeecad1fab6384c5a62c Fixes: CID#197629, CID#197628, CID#197627 Fixes: CID#197626, CID#197625, CID#197624 --- M src/msgb.c M src/socket.c M src/utils.c 3 files changed, 16 insertions(+), 11 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved Harald Welte: Looks good to me, approved diff --git a/src/msgb.c b/src/msgb.c index 5a154e5..940135f 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -522,10 +522,11 @@ */ char *msgb_hexdump_c(const void *ctx, const struct msgb *msg) { - char *buf = talloc_size(ctx, msgb_length(msg)*3 + 100); + size_t buf_len = msgb_length(msg) * 3 + 100; + char *buf = talloc_size(ctx, buf_len); if (!buf) return NULL; - return msgb_hexdump_buf(buf, sizeof(buf), msg); + return msgb_hexdump_buf(buf, buf_len, msg); } /*! Print a string to the end of message buffer. diff --git a/src/socket.c b/src/socket.c index c817e72..7c412b6 100644 --- a/src/socket.c +++ b/src/socket.c @@ -837,7 +837,7 @@ char *str = talloc_size(ctx, OSMO_SOCK_NAME_MAXLEN); if (!str) return NULL; - osmo_sock_get_name_buf(str, sizeof(str), fd); + osmo_sock_get_name_buf(str, OSMO_SOCK_NAME_MAXLEN, fd); return str; } diff --git a/src/utils.c b/src/utils.c index 896e917..b66721e 100644 --- a/src/utils.c +++ b/src/utils.c @@ -351,10 +351,11 @@ */ char *osmo_hexdump_c(const void *ctx, const unsigned char *buf, int len) { - char *hexd_buff = talloc_size(ctx, len*3 + 1); + size_t hexd_buff_len = len * 3 + 1; + char *hexd_buff = talloc_size(ctx, hexd_buff_len); if (!hexd_buff) return NULL; - osmo_hexdump_buf(hexd_buff, sizeof(hexd_buff), buf, len, " ", true); + osmo_hexdump_buf(hexd_buff, hexd_buff_len, buf, len, " ", true); return hexd_buff; } @@ -389,10 +390,11 @@ */ char *osmo_hexdump_nospc_c(const void *ctx, const unsigned char *buf, int len) { - char *hexd_buff = talloc_size(ctx, len*2 + 1); + size_t hexd_buff_len = len * 2 + 1; + char *hexd_buff = talloc_size(ctx, hexd_buff_len); if (!hexd_buff) return NULL; - osmo_hexdump_buf(hexd_buff, sizeof(hexd_buff), buf, len, "", true); + osmo_hexdump_buf(hexd_buff, hexd_buff_len, buf, len, "", true); return hexd_buff; } @@ -908,10 +910,11 @@ */ char *osmo_str_tolower_c(const void *ctx, const char *src) { - char *buf = talloc_size(ctx, strlen(src)+1); + size_t buf_len = strlen(src) + 1; + char *buf = talloc_size(ctx, buf_len); if (!buf) return NULL; - osmo_str_tolower_buf(buf, sizeof(buf), src); + osmo_str_tolower_buf(buf, buf_len, src); return buf; } @@ -966,10 +969,11 @@ */ char *osmo_str_toupper_c(const void *ctx, const char *src) { - char *buf = talloc_size(ctx, strlen(src)+1); + size_t buf_len = strlen(src) + 1; + char *buf = talloc_size(ctx, buf_len); if (!buf) return NULL; - osmo_str_toupper_buf(buf, sizeof(buf), src); + osmo_str_toupper_buf(buf, buf_len, src); return buf; } -- To view, visit https://gerrit.osmocom.org/13620 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8ffda4dea2b7f9b4b76dfeecad1fab6384c5a62c Gerrit-Change-Number: 13620 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:10:22 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 15:10:22 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Ensure BcdMccMnc is encoded as 24.008 10.5.5.15 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13619 ) Change subject: Ensure BcdMccMnc is encoded as 24.008 10.5.5.15 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13619 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8f67f16f18e4c5090bc5a4c46a866a7e7e00206 Gerrit-Change-Number: 13619 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Fri, 12 Apr 2019 15:10:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:10:24 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 15:10:24 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Ensure BcdMccMnc is encoded as 24.008 10.5.5.15 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13619 ) Change subject: Ensure BcdMccMnc is encoded as 24.008 10.5.5.15 ...................................................................... Ensure BcdMccMnc is encoded as 24.008 10.5.5.15 PCU is using BcdMccMnc as it's encoded as 24.008. But SGSN code is using it as it would be byte by byte sorted. Fixes: OS#3878 Change-Id: Ie8f67f16f18e4c5090bc5a4c46a866a7e7e00206 --- M library/L3_Common.ttcn M library/Osmocom_Gb_Types.ttcn M sgsn/SGSN_Tests.ttcn 3 files changed, 9 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Common.ttcn b/library/L3_Common.ttcn index 57db6b3..01f0a34 100644 --- a/library/L3_Common.ttcn +++ b/library/L3_Common.ttcn @@ -106,9 +106,9 @@ rai.mccDigit1 & rai.mccDigit2 & rai.mccDigit3 + & rai.mncDigit3 & rai.mncDigit1 - & rai.mncDigit2 - & rai.mncDigit3; + & rai.mncDigit2; return plmn; } diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn index 95d3028..55a2816 100644 --- a/library/Osmocom_Gb_Types.ttcn +++ b/library/Osmocom_Gb_Types.ttcn @@ -868,8 +868,8 @@ ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1]; ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2]; ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3]; - ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4]; + ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; } if (isvalue(cid.ra_id.lai.lac)) { ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2); diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 8b639e6..74cdece 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -137,15 +137,16 @@ }; private function f_cellid_to_RAI(in BssgpCellId cell_id) return RoutingAreaIdentificationV { + /* mcc_mnc is encoded as of 24.008 10.5.5.15 */ var BcdMccMnc mcc_mnc := cell_id.ra_id.lai.mcc_mnc; var RoutingAreaIdentificationV ret := { mccDigit1 := mcc_mnc[0], mccDigit2 := mcc_mnc[1], mccDigit3 := mcc_mnc[2], - mncDigit3 := mcc_mnc[5], - mncDigit1 := mcc_mnc[3], - mncDigit2 := mcc_mnc[4], + mncDigit3 := mcc_mnc[3], + mncDigit1 := mcc_mnc[4], + mncDigit2 := mcc_mnc[5], lac := int2oct(cell_id.ra_id.lai.lac, 16), rac := int2oct(cell_id.ra_id.rac, 8) } @@ -225,7 +226,8 @@ } -function f_init(BcdMccMnc mcc_mnc := '26242F'H) runs on test_CT { +/* mcc_mnc is 24.008 10.5.5.15 encoded. 262 42 */ +function f_init(BcdMccMnc mcc_mnc := '262F42'H) runs on test_CT { if (g_initialized == true) { return; } -- To view, visit https://gerrit.osmocom.org/13619 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie8f67f16f18e4c5090bc5a4c46a866a7e7e00206 Gerrit-Change-Number: 13619 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:11:10 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Apr 2019 15:11:10 +0000 Subject: Change in libosmocore[master]: gb/gprs_ns_sns.c: fix incorrect buffer size calculation Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13625 Change subject: gb/gprs_ns_sns.c: fix incorrect buffer size calculation ...................................................................... gb/gprs_ns_sns.c: fix incorrect buffer size calculation Calling sizeof() on a pointer to dynamically allocated memory would result in getting size of the pointer (usually 4 or 8 bytes) itself, but not the size of allocated memory. Change-Id: I83f55a9638b75d9097d37992f7c84707791f10f6 Fixes: CID#194266 --- M src/gb/gprs_ns_sns.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/25/13625/1 diff --git a/src/gb/gprs_ns_sns.c b/src/gb/gprs_ns_sns.c index dd8d3a2..aa8b121 100644 --- a/src/gb/gprs_ns_sns.c +++ b/src/gb/gprs_ns_sns.c @@ -498,7 +498,7 @@ } /* make a copy as do_sns_delete() will change the array underneath us */ ip4_remote = talloc_memdup(fi, gss->ip4_remote, - gss->num_ip4_remote*sizeof(v4_list)); + gss->num_ip4_remote*sizeof(*v4_list)); for (i = 0; i < gss->num_ip4_remote; i++) { if (ip4_remote[i].ip_addr == ip_addr) { rc = do_sns_delete(fi, &ip4_remote[i]); -- To view, visit https://gerrit.osmocom.org/13625 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I83f55a9638b75d9097d37992f7c84707791f10f6 Gerrit-Change-Number: 13625 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:11:34 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 15:11:34 +0000 Subject: Change in osmo-bts[master]: common/pcu_sock.c: fix possible memleaks in pcu_sock_read() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13618 ) Change subject: common/pcu_sock.c: fix possible memleaks in pcu_sock_read() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13618 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I58352e5f2b5715361c7089d0e134a42975171022 Gerrit-Change-Number: 13618 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 15:11:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:11:35 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 15:11:35 +0000 Subject: Change in osmo-bts[master]: common/pcu_sock.c: fix possible memleaks in pcu_sock_read() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13618 ) Change subject: common/pcu_sock.c: fix possible memleaks in pcu_sock_read() ...................................................................... common/pcu_sock.c: fix possible memleaks in pcu_sock_read() Change-Id: I58352e5f2b5715361c7089d0e134a42975171022 --- M src/common/pcu_sock.c 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved Harald Welte: Looks good to me, approved diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index d694602..d496a49 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -790,14 +790,17 @@ goto close; if (rc < 0) { - if (errno == EAGAIN) + if (errno == EAGAIN) { + msgb_free(msg); return 0; + } goto close; } if (rc < sizeof(*pcu_prim)) { LOGP(DPCU, LOGL_ERROR, "Received %d bytes on PCU Socket, but primitive size " "is %lu, discarding\n", rc, sizeof(*pcu_prim)); + msgb_free(msg); return 0; } -- To view, visit https://gerrit.osmocom.org/13618 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I58352e5f2b5715361c7089d0e134a42975171022 Gerrit-Change-Number: 13618 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:13:04 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 15:13:04 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.common.inc: add {, un}install targets In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13597 ) Change subject: Makefile.common.inc: add {,un}install targets ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I66f33172fa410681acbaef4592e9405627948705 Gerrit-Change-Number: 13597 Gerrit-PatchSet: 5 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Fri, 12 Apr 2019 15:13:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:13:48 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Apr 2019 15:13:48 +0000 Subject: Change in libosmocore[master]: gb/gprs_ns_sns.c: fix incorrect buffer size calculation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13625 ) Change subject: gb/gprs_ns_sns.c: fix incorrect buffer size calculation ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13625 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I83f55a9638b75d9097d37992f7c84707791f10f6 Gerrit-Change-Number: 13625 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Fri, 12 Apr 2019 15:13:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:19:14 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Apr 2019 15:19:14 +0000 Subject: Change in libosmocore[master]: gb/gprs_ns_sns.c: fix incorrect sizeof() calculation In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13625 ) Change subject: gb/gprs_ns_sns.c: fix incorrect sizeof() calculation ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13625 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I83f55a9638b75d9097d37992f7c84707791f10f6 Gerrit-Change-Number: 13625 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Fri, 12 Apr 2019 15:19:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:19:16 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Apr 2019 15:19:16 +0000 Subject: Change in libosmocore[master]: gb/gprs_ns_sns.c: fix incorrect sizeof() calculation In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13625 ) Change subject: gb/gprs_ns_sns.c: fix incorrect sizeof() calculation ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13625 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I83f55a9638b75d9097d37992f7c84707791f10f6 Gerrit-Change-Number: 13625 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 12 Apr 2019 15:19:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:22:54 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 15:22:54 +0000 Subject: Change in libosmocore[master]: gb/gprs_ns_sns.c: fix incorrect sizeof() calculation In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13625 ) Change subject: gb/gprs_ns_sns.c: fix incorrect sizeof() calculation ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13625 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I83f55a9638b75d9097d37992f7c84707791f10f6 Gerrit-Change-Number: 13625 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 12 Apr 2019 15:22:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:29:28 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Apr 2019 15:29:28 +0000 Subject: Change in libosmocore[master]: GSUP: add inter-MSC handover related msgs and IEs In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/12860 ) Change subject: GSUP: add inter-MSC handover related msgs and IEs ...................................................................... Patch Set 9: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/12860/9/include/osmocom/gsm/gsup.h File include/osmocom/gsm/gsup.h: https://gerrit.osmocom.org/#/c/12860/9/include/osmocom/gsm/gsup.h at 369 PS9, Line 369: cause_rr_set An alternative solution is to use pointers, i.e.: uint8_t *cause_rr; enum gsm0808_cause *cause_bssap; This is how we do for sm_rp_cause and sm_rp_mms, so there is no need for such bool flags. -- To view, visit https://gerrit.osmocom.org/12860 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic00b0601eacff6d72927cea51767801142ee75db Gerrit-Change-Number: 12860 Gerrit-PatchSet: 9 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Fri, 12 Apr 2019 15:29:28 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:32:05 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Apr 2019 15:32:05 +0000 Subject: Change in libosmocore[master]: add vty_is_active() In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13581 ) Change subject: add vty_is_active() ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13581 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I42cf2af47283dd42c101faae0fac293c3a68d599 Gerrit-Change-Number: 13581 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 12 Apr 2019 15:32:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:36:34 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Apr 2019 15:36:34 +0000 Subject: Change in libosmocore[master]: gb/gprs_ns_sns.c: fix incorrect sizeof() calculation In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13625 ) Change subject: gb/gprs_ns_sns.c: fix incorrect sizeof() calculation ...................................................................... gb/gprs_ns_sns.c: fix incorrect sizeof() calculation Calling sizeof() on a pointer would result in getting size of the pointer (usually 4 or 8 bytes) itself, but not the size of the memory it points to. Change-Id: I83f55a9638b75d9097d37992f7c84707791f10f6 Fixes: CID#194266 --- M src/gb/gprs_ns_sns.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Vadim Yanitskiy: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gb/gprs_ns_sns.c b/src/gb/gprs_ns_sns.c index dd8d3a2..aa8b121 100644 --- a/src/gb/gprs_ns_sns.c +++ b/src/gb/gprs_ns_sns.c @@ -498,7 +498,7 @@ } /* make a copy as do_sns_delete() will change the array underneath us */ ip4_remote = talloc_memdup(fi, gss->ip4_remote, - gss->num_ip4_remote*sizeof(v4_list)); + gss->num_ip4_remote*sizeof(*v4_list)); for (i = 0; i < gss->num_ip4_remote; i++) { if (ip4_remote[i].ip_addr == ip_addr) { rc = do_sns_delete(fi, &ip4_remote[i]); -- To view, visit https://gerrit.osmocom.org/13625 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I83f55a9638b75d9097d37992f7c84707791f10f6 Gerrit-Change-Number: 13625 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:37:21 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 15:37:21 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Move some code and rename some vars to look similar... In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13604 ) Change subject: nightly-packages: Move some code and rename some vars to look similar to latest-packages ...................................................................... Patch Set 1: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/13604 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I177bb7fb75e293ef665e95363a38c6b4f8e49c13 Gerrit-Change-Number: 13604 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 15:37:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:43:14 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Apr 2019 15:43:14 +0000 Subject: Change in libosmocore[master]: gsm/gsm_utils.c: indicate intentional fall-through Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13626 Change subject: gsm/gsm_utils.c: indicate intentional fall-through ...................................................................... gsm/gsm_utils.c: indicate intentional fall-through Change-Id: Ica7d2d1884b745fe30234d6c50d93828c4930680 Fixes: CID#57700 --- M src/gsm/gsm_utils.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/13626/1 diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 94c6ca5..07f053c 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -307,6 +307,7 @@ case 0x5d: case 0x7c: result[y++] = 0x1b; + /* fall-through */ default: result[y] = gsm_7bit_alphabet[ch]; break; -- To view, visit https://gerrit.osmocom.org/13626 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ica7d2d1884b745fe30234d6c50d93828c4930680 Gerrit-Change-Number: 13626 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:49:15 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 15:49:15 +0000 Subject: Change in libosmocore[master]: gsm/gsm_utils.c: indicate intentional fall-through In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13626 ) Change subject: gsm/gsm_utils.c: indicate intentional fall-through ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13626 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ica7d2d1884b745fe30234d6c50d93828c4930680 Gerrit-Change-Number: 13626 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 15:49:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:55:45 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 15:55:45 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Move some code and rename some vars to look similar... In-Reply-To: References: Message-ID: Pau Espin Pedrol has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13604 ) Change subject: nightly-packages: Move some code and rename some vars to look similar to latest-packages ...................................................................... nightly-packages: Move some code and rename some vars to look similar to latest-packages Change-Id: I177bb7fb75e293ef665e95363a38c6b4f8e49c13 --- M scripts/osmocom-latest-packages.sh M scripts/osmocom-nightly-packages.sh 2 files changed, 28 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/04/13604/2 -- To view, visit https://gerrit.osmocom.org/13604 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I177bb7fb75e293ef665e95363a38c6b4f8e49c13 Gerrit-Change-Number: 13604 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:56:07 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 15:56:07 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Remove duplicated check In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13602 ) Change subject: nightly-packages: Remove duplicated check ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13602 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9659e71d87b03971673da3bfb2101de9d5fe3c6a Gerrit-Change-Number: 13602 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 15:56:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:56:10 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 15:56:10 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Remove unused variable In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13603 ) Change subject: nightly-packages: Remove unused variable ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13603 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic120dbc134cba9bd77098ab14a5dba3d5c4d71b9 Gerrit-Change-Number: 13603 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 15:56:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:56:16 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 15:56:16 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Move some code and rename some vars to look similar... In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13604 ) Change subject: nightly-packages: Move some code and rename some vars to look similar to latest-packages ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13604 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I177bb7fb75e293ef665e95363a38c6b4f8e49c13 Gerrit-Change-Number: 13604 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 15:56:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 15:56:20 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 15:56:20 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Build latest tag of limesuite In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13605 ) Change subject: nightly-packages: Build latest tag of limesuite ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/13605 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5a9e97a7a93c1d2a9983926cd0f5d7255e9666bd Gerrit-Change-Number: 13605 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 15:56:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 17:13:12 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Apr 2019 17:13:12 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Move some code and rename some vars to look similar... In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13604 ) Change subject: nightly-packages: Move some code and rename some vars to look similar to latest-packages ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/13604 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I177bb7fb75e293ef665e95363a38c6b4f8e49c13 Gerrit-Change-Number: 13604 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 12 Apr 2019 17:13:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 12 22:24:00 2019 From: gerrit-no-reply at lists.osmocom.org (Omar Ramadan) Date: Fri, 12 Apr 2019 22:24:00 +0000 Subject: Change in osmo-msc[master]: Allow MME name preformatted as FQDN in SGsAP Message-ID: Omar Ramadan has uploaded this change for review. ( https://gerrit.osmocom.org/13627 Change subject: Allow MME name preformatted as FQDN in SGsAP ...................................................................... Allow MME name preformatted as FQDN in SGsAP Change-Id: I2d55f9524b9fc15d661e5cb6b5df6d715c52ccf9 --- M src/libmsc/sgs_iface.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/27/13627/1 diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c index f64b191..9ad8021 100644 --- a/src/libmsc/sgs_iface.c +++ b/src/libmsc/sgs_iface.c @@ -167,6 +167,12 @@ if (!mme_name_enc) return -EINVAL; + /* some implementations use FDQN format violating TS 29.118 9.3.14 */ + if (!osmo_parse_mme_domain(&gummei, (const char *) mme_name_enc)) { + memcpy(mme_name, mme_name_enc, TLVP_LEN(tp, SGSAP_IE_MME_NAME)); + return 0; + } + /* decode the MME name from DNS labels to string */ osmo_apn_to_str(mme_name, TLVP_VAL(tp, SGSAP_IE_MME_NAME), TLVP_LEN(tp, SGSAP_IE_MME_NAME)); -- To view, visit https://gerrit.osmocom.org/13627 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2d55f9524b9fc15d661e5cb6b5df6d715c52ccf9 Gerrit-Change-Number: 13627 Gerrit-PatchSet: 1 Gerrit-Owner: Omar Ramadan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 13 21:37:09 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 13 Apr 2019 21:37:09 +0000 Subject: Change in osmo-msc[master]: Allow MME name preformatted as FQDN in SGsAP In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13627 ) Change subject: Allow MME name preformatted as FQDN in SGsAP ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13627 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2d55f9524b9fc15d661e5cb6b5df6d715c52ccf9 Gerrit-Change-Number: 13627 Gerrit-PatchSet: 1 Gerrit-Owner: Omar Ramadan Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sat, 13 Apr 2019 21:37:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 13 21:37:39 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 13 Apr 2019 21:37:39 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Remove duplicated check In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13602 ) Change subject: nightly-packages: Remove duplicated check ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13602 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9659e71d87b03971673da3bfb2101de9d5fe3c6a Gerrit-Change-Number: 13602 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 13 Apr 2019 21:37:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 13 21:37:48 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 13 Apr 2019 21:37:48 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Remove unused variable In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13603 ) Change subject: nightly-packages: Remove unused variable ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13603 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic120dbc134cba9bd77098ab14a5dba3d5c4d71b9 Gerrit-Change-Number: 13603 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 13 Apr 2019 21:37:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 13 21:38:02 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 13 Apr 2019 21:38:02 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Move some code and rename some vars to look similar... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13604 ) Change subject: nightly-packages: Move some code and rename some vars to look similar to latest-packages ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13604 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I177bb7fb75e293ef665e95363a38c6b4f8e49c13 Gerrit-Change-Number: 13604 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 13 Apr 2019 21:38:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 13 21:38:16 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 13 Apr 2019 21:38:16 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Build latest tag of limesuite In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13605 ) Change subject: nightly-packages: Build latest tag of limesuite ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13605 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5a9e97a7a93c1d2a9983926cd0f5d7255e9666bd Gerrit-Change-Number: 13605 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 13 Apr 2019 21:38:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 13 21:38:37 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 13 Apr 2019 21:38:37 +0000 Subject: Change in libosmocore[master]: gsm/gsm_utils.c: indicate intentional fall-through In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13626 ) Change subject: gsm/gsm_utils.c: indicate intentional fall-through ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13626 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ica7d2d1884b745fe30234d6c50d93828c4930680 Gerrit-Change-Number: 13626 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 13 Apr 2019 21:38:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 13 21:38:39 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 13 Apr 2019 21:38:39 +0000 Subject: Change in libosmocore[master]: gsm/gsm_utils.c: indicate intentional fall-through In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13626 ) Change subject: gsm/gsm_utils.c: indicate intentional fall-through ...................................................................... gsm/gsm_utils.c: indicate intentional fall-through Change-Id: Ica7d2d1884b745fe30234d6c50d93828c4930680 Fixes: CID#57700 --- M src/gsm/gsm_utils.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c index 94c6ca5..07f053c 100644 --- a/src/gsm/gsm_utils.c +++ b/src/gsm/gsm_utils.c @@ -307,6 +307,7 @@ case 0x5d: case 0x7c: result[y++] = 0x1b; + /* fall-through */ default: result[y] = gsm_7bit_alphabet[ch]; break; -- To view, visit https://gerrit.osmocom.org/13626 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ica7d2d1884b745fe30234d6c50d93828c4930680 Gerrit-Change-Number: 13626 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 13 21:38:58 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 13 Apr 2019 21:38:58 +0000 Subject: Change in libosmocore[master]: add OSMO_IMSI_BUF_SIZE In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13575 ) Change subject: add OSMO_IMSI_BUF_SIZE ...................................................................... add OSMO_IMSI_BUF_SIZE Various places in our code base figure out how many chars they need to safely store an IMSI. An IMSI can have a checksum digit, which is not reflected by GSM23003_IMSI_MAX_DIGITS. And we usually need a terminating \0. Instead of having a magic +2 repeated every so often, rather define OSMO_IMSI_BUF_SIZE to contain both checksum digit and nul char, and have the explanatory comment with it here in libosmocore. Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 --- M include/osmocom/gsm/gsup.h M include/osmocom/gsm/protocol/gsm_23_003.h 2 files changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 29ea11a..9a583aa 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -232,7 +232,7 @@ /*! parsed/decoded GSUP protocol message */ struct osmo_gsup_message { enum osmo_gsup_message_type message_type; - char imsi[GSM23003_IMSI_MAX_DIGITS+2]; + char imsi[OSMO_IMSI_BUF_SIZE]; enum gsm48_gmm_cause cause; enum osmo_gsup_cancel_type cancel_type; int pdp_info_compl; diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h b/include/osmocom/gsm/protocol/gsm_23_003.h index babd0f4..be1b157 100644 --- a/include/osmocom/gsm/protocol/gsm_23_003.h +++ b/include/osmocom/gsm/protocol/gsm_23_003.h @@ -5,6 +5,9 @@ /* Chapter 2.2 */ #define GSM23003_IMSI_MAX_DIGITS 15 #define GSM23003_IMSI_MIN_DIGITS 6 +/*! The char[] buffer size to completely contain an IMSI including the optional checksum digit as well as the + * terminating nul character. */ +#define OSMO_IMSI_BUF_SIZE (GSM23003_IMSI_MAX_DIGITS+2) /* Chapter 2.4 */ #define GSM23003_TMSI_NUM_BYTES 4 /* Chapter 2.5 */ -- To view, visit https://gerrit.osmocom.org/13575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770 Gerrit-Change-Number: 13575 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 13 21:38:59 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 13 Apr 2019 21:38:59 +0000 Subject: Change in libosmocore[master]: GSUP: add Message Class IE In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13576 ) Change subject: GSUP: add Message Class IE ...................................................................... GSUP: add Message Class IE osmo-msc and osmo-hlr have distinct subsystems handling incoming GSUP messages. So far we decide entirely by message type which code path should handle a GSUP message. Thus no GSUP message type may be re-used across subsystems. If we add a GSUP message to indicate a routing error, it would have to be a distinct message type for subscriber management, another one for SMS, another one for USSD... To allow introducing common message types, introduce a GSUP Message Class IE. In the presence of this IE, GSUP handlers can trivially direct a received message to the right code path. If it is missing, handlers can fall back to the previous switch(message_type) method. Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c M src/gsm/libosmogsm.map M tests/gsup/gsup_test.c M tests/gsup/gsup_test.err 5 files changed, 47 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 9a583aa..7f304a3 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -68,6 +68,7 @@ OSMO_GSUP_FREEZE_PTMSI_IE = 0x07, OSMO_GSUP_MSISDN_IE = 0x08, OSMO_GSUP_HLR_NUMBER_IE = 0x09, + OSMO_GSUP_MESSAGE_CLASS_IE = 0x0a, OSMO_GSUP_PDP_CONTEXT_ID_IE = 0x10, OSMO_GSUP_PDP_TYPE_IE = 0x11, OSMO_GSUP_ACCESS_POINT_NAME_IE = 0x12, @@ -229,6 +230,21 @@ size_t pdp_charg_enc_len; }; +enum osmo_gsup_message_class { + OSMO_GSUP_MESSAGE_CLASS_UNSET = 0, + OSMO_GSUP_MESSAGE_CLASS_SUBSCRIBER_MANAGEMENT = 1, + OSMO_GSUP_MESSAGE_CLASS_SMS = 2, + OSMO_GSUP_MESSAGE_CLASS_USSD = 3, + OSMO_GSUP_MESSAGE_CLASS_INTER_MSC = 4, + /* Keep this as last entry with a value of max(enum osmo_gsup_message_class) + 1. + * This value shall serve as the size for an array to aid de-muxing all known GSUP classes. */ + OSMO_GSUP_MESSAGE_CLASS_ARRAYSIZE +}; + +extern const struct value_string osmo_gsup_message_class_names[]; +static inline const char *osmo_gsup_message_class_name(enum osmo_gsup_message_class val) +{ return get_value_string(osmo_gsup_message_class_names, val); } + /*! parsed/decoded GSUP protocol message */ struct osmo_gsup_message { enum osmo_gsup_message_type message_type; @@ -286,6 +302,11 @@ const uint8_t *imei_enc; size_t imei_enc_len; enum osmo_gsup_imei_result imei_result; + + /*! Indicate the message class to trivially dispatch incoming GSUP messages to the right code paths. + * Inter-MSC messages are *required* to set a class = OSMO_GSUP_MESSAGE_CLASS_INTER_MSC. For older message classes, this may + * be omitted (for backwards compatibility only -- if in doubt, include it). */ + enum osmo_gsup_message_class message_class; }; int osmo_gsup_decode(const uint8_t *data, size_t data_len, diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index a089322..71dbbe1 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -477,6 +477,10 @@ gsup_msg->imei_result = osmo_decode_big_endian(value, value_len) + 1; break; + case OSMO_GSUP_MESSAGE_CLASS_IE: + gsup_msg->message_class = value[0]; + break; + default: LOGP(DLGSUP, LOGL_NOTICE, "GSUP IE type %d unknown\n", iei); @@ -718,7 +722,21 @@ msgb_tlv_put(msg, OSMO_GSUP_IMEI_RESULT_IE, sizeof(u8), &u8); } + if (gsup_msg->message_class != OSMO_GSUP_MESSAGE_CLASS_UNSET) { + u8 = gsup_msg->message_class; + msgb_tlv_put(msg, OSMO_GSUP_MESSAGE_CLASS_IE, sizeof(u8), &u8); + } + return 0; } +const struct value_string osmo_gsup_message_class_names[] = { + { OSMO_GSUP_MESSAGE_CLASS_UNSET, "unset" }, + { OSMO_GSUP_MESSAGE_CLASS_SUBSCRIBER_MANAGEMENT, "Subscriber-Management" }, + { OSMO_GSUP_MESSAGE_CLASS_SMS, "SMS" }, + { OSMO_GSUP_MESSAGE_CLASS_USSD, "USSD" }, + { OSMO_GSUP_MESSAGE_CLASS_INTER_MSC, "Inter-MSC" }, + {} +}; + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 56481fd..47f3b45 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -586,6 +586,7 @@ osmo_gsup_decode; osmo_gsup_message_type_names; osmo_gsup_session_state_names; +osmo_gsup_message_class_names; osmo_gsup_get_err_msg_type; osmo_gsup_sms_encode_sm_rp_da; diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c index 4ad7431..0631a51 100644 --- a/tests/gsup/gsup_test.c +++ b/tests/gsup/gsup_test.c @@ -11,6 +11,7 @@ #define TEST_IMSI_IE 0x01, 0x08, 0x21, 0x43, 0x65, 0x87, 0x09, 0x21, 0x43, 0xf5 #define TEST_IMSI_STR "123456789012345" +#define TEST_CLASS_SUBSCR_IE 0xa, 0x1, 0x1 static void test_gsup_messages_dec_enc(void) { @@ -20,7 +21,8 @@ static const uint8_t send_auth_info_req[] = { 0x08, - TEST_IMSI_IE + TEST_IMSI_IE, + TEST_CLASS_SUBSCR_IE }; static const uint8_t send_auth_info_err[] = { diff --git a/tests/gsup/gsup_test.err b/tests/gsup/gsup_test.err index 225735e..9283823 100644 --- a/tests/gsup/gsup_test.err +++ b/tests/gsup/gsup_test.err @@ -1,5 +1,5 @@ - generated message: 08 01 08 21 43 65 87 09 21 43 f5 - original message: 08 01 08 21 43 65 87 09 21 43 f5 + generated message: 08 01 08 21 43 65 87 09 21 43 f5 0a 01 01 + original message: 08 01 08 21 43 65 87 09 21 43 f5 0a 01 01 IMSI: 123456789012345 generated message: 09 01 08 21 43 65 87 09 21 43 f5 02 01 07 original message: 09 01 08 21 43 65 87 09 21 43 f5 02 01 07 @@ -73,7 +73,7 @@ generated message: 32 01 08 21 43 65 87 09 21 43 f5 51 01 00 original message: 32 01 08 21 43 65 87 09 21 43 f5 51 01 00 IMSI: 123456789012345 - message 0: tested 11 truncations, 11 parse failures + message 0: tested 14 truncations, 13 parse failures message 1: tested 14 truncations, 13 parse failures message 2: tested 83 truncations, 81 parse failures message 3: tested 11 truncations, 11 parse failures @@ -99,7 +99,7 @@ message 23: tested 14 truncations, 13 parse failures message 24: tested 14 truncations, 13 parse failures DLGSUP Stopping DLGSUP logging - message 0: tested 2816 modifications, 510 parse failures + message 0: tested 3584 modifications, 771 parse failures message 1: tested 3584 modifications, 770 parse failures message 2: tested 21248 modifications, 2575 parse failures message 3: tested 2816 modifications, 510 parse failures -- To view, visit https://gerrit.osmocom.org/13576 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic397a9f2c4a7224e47cab944c72e75ca5592efef Gerrit-Change-Number: 13576 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 13 21:55:19 2019 From: gerrit-no-reply at lists.osmocom.org (Omar Ramadan) Date: Sat, 13 Apr 2019 21:55:19 +0000 Subject: Change in osmo-msc[master]: Allow MME name preformatted as FQDN in SGsAP In-Reply-To: References: Message-ID: Omar Ramadan has submitted this change and it was merged. ( https://gerrit.osmocom.org/13627 ) Change subject: Allow MME name preformatted as FQDN in SGsAP ...................................................................... Allow MME name preformatted as FQDN in SGsAP Change-Id: I2d55f9524b9fc15d661e5cb6b5df6d715c52ccf9 --- M src/libmsc/sgs_iface.c 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c index eed107a..8b4b61d 100644 --- a/src/libmsc/sgs_iface.c +++ b/src/libmsc/sgs_iface.c @@ -168,6 +168,12 @@ if (!mme_name_enc) return -EINVAL; + /* some implementations use FDQN format violating TS 29.118 9.3.14 */ + if (!osmo_parse_mme_domain(&gummei, (const char *) mme_name_enc)) { + memcpy(mme_name, mme_name_enc, TLVP_LEN(tp, SGSAP_IE_MME_NAME)); + return 0; + } + /* decode the MME name from DNS labels to string */ osmo_apn_to_str(mme_name, TLVP_VAL(tp, SGSAP_IE_MME_NAME), TLVP_LEN(tp, SGSAP_IE_MME_NAME)); -- To view, visit https://gerrit.osmocom.org/13627 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2d55f9524b9fc15d661e5cb6b5df6d715c52ccf9 Gerrit-Change-Number: 13627 Gerrit-PatchSet: 2 Gerrit-Owner: Omar Ramadan Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Omar Ramadan -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 03:37:26 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Sun, 14 Apr 2019 03:37:26 +0000 Subject: Change in osmo-sgsn[master]: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/13628 Change subject: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK ...................................................................... gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK Fix a warning "Unhandled GSM 04.08 message type ...". Fixes: OS#3466 Change-Id: I20bf4db8da746e0b994bfe3f8178188831b67ed3 --- M src/gprs/gprs_gb_parse.c 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/28/13628/1 diff --git a/src/gprs/gprs_gb_parse.c b/src/gprs/gprs_gb_parse.c index 93b90a2..379674a 100644 --- a/src/gprs/gprs_gb_parse.c +++ b/src/gprs/gprs_gb_parse.c @@ -383,6 +383,14 @@ parse_ctx->invalidate_tlli = 1; break; + case GSM48_MT_GSM_DEACT_PDP_REQ: + parse_ctx->llc_msg_name = "DEACT_PDP_REQ"; + break; + + case GSM48_MT_GSM_DEACT_PDP_ACK: + parse_ctx->llc_msg_name = "DEACT_PDP_ACK"; + break; + default: LOGP(DLLC, LOGL_NOTICE, "Unhandled GSM 04.08 message type %s for protocol discriminator %s.\n", -- To view, visit https://gerrit.osmocom.org/13628 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I20bf4db8da746e0b994bfe3f8178188831b67ed3 Gerrit-Change-Number: 13628 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 03:38:41 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Sun, 14 Apr 2019 03:38:41 +0000 Subject: Change in osmo-sgsn[master]: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/13628 ) Change subject: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK ...................................................................... Patch Set 1: Hi Daniel, those to messages doesn't contain any further information (except for the REQ also adding a cause). But as far I understood, this does not need to be intercepted by the gbproxy. So please be careful with this patch :). -- To view, visit https://gerrit.osmocom.org/13628 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I20bf4db8da746e0b994bfe3f8178188831b67ed3 Gerrit-Change-Number: 13628 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: lynxis lazus Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Sun, 14 Apr 2019 03:38:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 09:41:47 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Apr 2019 09:41:47 +0000 Subject: Change in osmo-msc[master]: Introduce initial unit test for db_sms_* API Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13629 Change subject: Introduce initial unit test for db_sms_* API ...................................................................... Introduce initial unit test for db_sms_* API Since OsmoMSC has built-in SMSC, it needs to store the messages somewhere. Currently we use libdbi and SQLite3 back-end for that. For a long time, the db_sms_* API remained uncovered by unit tests. This change aims to fix that, and does cover the following: - db_sms_store(), - db_sms_get(), - db_sms_get_next_unsent(), - db_sms_mark_delivered(), - db_sms_delete_sent_message_by_id(), - db_sms_delete_by_msisdn(), - db_sms_delete_oldest_expired_message(). Due to performance reasons, the test database is initialized in RAM using the magic filename ':memory:'. This is a feature of SQLite3 (and not libdbi), see: https://www.sqlite.org/inmemorydb.html Of course, this unit test helped to discover some problems: 1) Storing an SMS with empty TP-User-Data (TP-UDL=0) causes buffer overruns in both db_sms_store() and db_sms_get(). 2) TP-User-Data-Length is always being interpreted in octets, regardless of DCS (Data Coding Scheme). This results in storing garbage in the database if the default 7-bit encoding is used. Fortunately, the 'user_data' buffer in structure 'gsm_sms' is large emough, so we don't experience buffer overruns. 3) db_sms_delete_oldest_expired_message() doesn't work as expected. Instead of removing the *oldest* expired message, it tries to remove the *newest* one. The current test expectations do reflect these problems. All of them will be fixed in the follow-up patches. Change-Id: Id94ad35b6f78f839137db2e17010fbf9b40111a3 --- M configure.ac M src/libmsc/db.c M tests/Makefile.am A tests/db_sms/Makefile.am A tests/db_sms/db_sms_test.c A tests/db_sms/db_sms_test.err A tests/db_sms/db_sms_test.ok M tests/testsuite.at 8 files changed, 724 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/29/13629/1 diff --git a/configure.ac b/configure.ac index f8787cf..15e6e07 100644 --- a/configure.ac +++ b/configure.ac @@ -268,6 +268,7 @@ tests/Makefile tests/atlocal tests/smpp/Makefile + tests/db_sms/Makefile tests/sms_queue/Makefile tests/msc_vlr/Makefile doc/Makefile diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 0384320..423787b 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -769,7 +769,10 @@ daddr = dbi_result_get_string(result, "dest_addr"); if (daddr) OSMO_STRLCPY_ARRAY(sms->dst.addr, daddr); - sms->receiver = vlr_subscr_find_by_msisdn(net->vlr, sms->dst.addr, VSUB_USE_SMS_RECEIVER); + + if (net != NULL) /* db_sms_test passes NULL, so we need to be tolerant */ + sms->receiver = vlr_subscr_find_by_msisdn(net->vlr, sms->dst.addr, + VSUB_USE_SMS_RECEIVER); sms->src.npi = dbi_result_get_ulonglong(result, "src_npi"); sms->src.ton = dbi_result_get_ulonglong(result, "src_ton"); diff --git a/tests/Makefile.am b/tests/Makefile.am index dc5194c..9f758f1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,7 @@ SUBDIRS = \ sms_queue \ msc_vlr \ + db_sms \ $(NULL) if BUILD_SMPP diff --git a/tests/db_sms/Makefile.am b/tests/db_sms/Makefile.am new file mode 100644 index 0000000..5e1f48b --- /dev/null +++ b/tests/db_sms/Makefile.am @@ -0,0 +1,48 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMORANAP_CFLAGS) \ + $(LIBASN1C_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ + $(LIBOSMOGSUPCLIENT_CFLAGS) \ + $(NULL) + +EXTRA_DIST = \ + db_sms_test.ok \ + db_sms_test.err \ + $(NULL) + +noinst_PROGRAMS = \ + db_sms_test \ + $(NULL) + +db_sms_test_SOURCES = \ + db_sms_test.c \ + $(NULL) + +db_sms_test_LDADD = \ + $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libvlr/libvlr.a \ + $(LIBSMPP34_LIBS) \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOVTY_LIBS) \ + $(LIBOSMOABIS_LIBS) \ + $(LIBOSMOSIGTRAN_LIBS) \ + $(LIBOSMORANAP_LIBS) \ + $(LIBOSMOMGCPCLIENT_LIBS) \ + $(LIBOSMOGSUPCLIENT_LIBS) \ + $(LIBRARY_GSM) \ + -ldbi \ + -lrt \ + $(NULL) diff --git a/tests/db_sms/db_sms_test.c b/tests/db_sms/db_sms_test.c new file mode 100644 index 0000000..e78bb53 --- /dev/null +++ b/tests/db_sms/db_sms_test.c @@ -0,0 +1,593 @@ +/* + * Test the storage API of the internal SMS Centre. + * + * (C) 2019 by Vadim Yanitskiy + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include + +/* Talloc context of this unit test */ +static void *talloc_ctx = NULL; + +static const struct sms_tp_ud { + /* Data Coding Scheme */ + uint8_t dcs; + /* TP User-Data-Length (depends on DCS) */ + uint8_t length; + /* Static TP User-Data filler (0 means disabled) */ + uint8_t filler_byte; + /* TP User-Data */ + uint8_t data[GSM340_UDL_OCT_MAX]; + /* Decoded text (for 7-bit default alphabet only) */ + char dec_text[GSM340_UDL_SPT_MAX + 1]; +} sms_tp_ud_set[] = { + { + .dcs = 0x00, /* Default GSM 7-bit alphabet */ + .length = 9, /* in septets */ + .dec_text = "Mahlzeit!", + .data = { + 0xcd, 0x30, 0x9a, 0xad, 0x2f, 0xa7, 0xe9, 0x21, + }, + }, + { + .dcs = 0x08, /* UCS-2 (16-bit) / UTF-16 */ + .length = 120, /* in octets */ + .data = { + 0x04, 0x23, 0x04, 0x32, 0x04, 0x30, 0x04, 0x36, + 0x04, 0x30, 0x04, 0x35, 0x04, 0x3c, 0x04, 0x4b, + 0x04, 0x39, 0x00, 0x20, 0x04, 0x3a, 0x04, 0x3b, + 0x04, 0x38, 0x04, 0x35, 0x04, 0x3d, 0x04, 0x42, + 0x00, 0x21, 0x00, 0x20, 0x04, 0x1d, 0x04, 0x30, + 0x04, 0x41, 0x04, 0x42, 0x04, 0x40, 0x04, 0x3e, + 0x04, 0x39, 0x04, 0x3a, 0x04, 0x38, 0x00, 0x20, + 0x00, 0x49, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x65, + 0x00, 0x72, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x74, + 0x00, 0x20, 0x04, 0x38, 0x00, 0x20, 0x00, 0x4d, + 0x00, 0x4d, 0x00, 0x53, 0x00, 0x20, 0x04, 0x31, + 0x04, 0x43, 0x04, 0x34, 0x04, 0x43, 0x04, 0x42, + 0x00, 0x20, 0x04, 0x34, 0x04, 0x3e, 0x04, 0x41, + 0x04, 0x42, 0x04, 0x30, 0x04, 0x32, 0x04, 0x3b, + 0x04, 0x35, 0x04, 0x3d, 0x04, 0x4b, 0x00, 0x2e, + }, + }, + { + .dcs = 0x04, /* 8-bit data */ + .length = 12, /* in octets */ + .data = { + /* User-Data-Header */ + 0x1e, /* Buffer-overflow! (should be 0x05) */ + /* Concatenated SM, 8-bit reference number */ + 0x00, 0x03, 0x5a, 0x05, 0x01, + + /* Dummy payload... */ + 0x05, 0x04, 0x0b, 0x84, 0x0b, 0x84, + }, + }, + { + .dcs = 0x00, /* Default GSM 7-bit alphabet */ + .length = 160, /* maximum, in septets */ + .filler_byte = 0x41, + }, + { + .dcs = 0x04, /* 8-bit data */ + .length = 140, /* maximum, in octets */ + .filler_byte = 0x42, + }, + { + .dcs = 0x00, /* Default GSM 7-bit alphabet */ + .length = 200, /* invalid, buffer overflow */ + .filler_byte = 0x41, + }, + { + .dcs = 0x04, /* 8-bit data */ + .length = 0xff, /* invalid, buffer overflow */ + .filler_byte = 0x42, + }, +}; + +#define SMS_ADDR(addr) \ + { 0x00, 0x00, addr } + +static struct sms_test { + /* Human-readable name of particular test message */ + const char *name; + /* Whether we expect db_sms_store() to fail */ + bool exp_db_sms_store_fail; + /* Whether we expect db_sms_get() to fail */ + bool exp_db_sms_get_fail; + /* SM TP-User-Data from sms_tp_ud_set[] */ + const struct sms_tp_ud *ud; + /* The message itself */ + struct gsm_sms sms; +} sms_test_set[] = { + { + .name = "Regular MO SMS", + .sms = { + .msg_ref = 0xde, + .src = SMS_ADDR("123456"), + .dst = SMS_ADDR("654321"), + .validity_minutes = 10, + .protocol_id = 0x00, + /* SM TP-User-Data is taken from sms_tp_ud_set[] */ + }, + .ud = &sms_tp_ud_set[0], + }, + { + .name = "Regular MT SMS", + .sms = { + .msg_ref = 0xbe, + .src = SMS_ADDR("654321"), + .dst = SMS_ADDR("123456"), + .validity_minutes = 180, + .protocol_id = 0x00, + /* SM TP-User-Data is taken from sms_tp_ud_set[] */ + }, + .ud = &sms_tp_ud_set[1], + }, + { + .name = "Complete TP-UD (160 septets, 7-bit encoding)", + .sms = { + .msg_ref = 0xee, + .src = SMS_ADDR("266753837248772"), + .dst = SMS_ADDR("266753837248378"), + .validity_minutes = 360, + .protocol_id = 0x00, + /* SM TP-User-Data is taken from sms_tp_ud_set[] */ + }, + .ud = &sms_tp_ud_set[3], + }, + { + .name = "Complete TP-UD (140 octets, 8-bit encoding)", + .sms = { + .msg_ref = 0xee, + .src = SMS_ADDR("266753838248772"), + .dst = SMS_ADDR("266753838248378"), + .validity_minutes = 360, + .protocol_id = 0xaa, + /* SM TP-User-Data is taken from sms_tp_ud_set[] */ + }, + .ud = &sms_tp_ud_set[4], + }, + { + .name = "TP-UD buffer overflow (UDH-Length > UD-Length)", + .sms = { + .msg_ref = 0x88, + .src = SMS_ADDR("834568373569772"), + .dst = SMS_ADDR("834568373569378"), + .validity_minutes = 200, + .protocol_id = 0xbb, + .ud_hdr_ind = 0x01, + /* SM TP-User-Data is taken from sms_tp_ud_set[] */ + }, + .ud = &sms_tp_ud_set[2], + }, + { + .name = "Truncated TP-UD (200 septets, 7-bit encoding)", + .sms = { + .msg_ref = 0xee, + .src = { 0x01, 0x00, "8786228337248772" }, + .dst = { 0x00, 0x01, "8786228337248378" }, + .validity_minutes = 360, + .protocol_id = 0xcc, + /* SM TP-User-Data is taken from sms_tp_ud_set[] */ + }, + .ud = &sms_tp_ud_set[5], + }, + { + .name = "Truncated TP-UD (255 octets, 8-bit encoding)", + .sms = { + .msg_ref = 0xee, + .src = { 0x01, 0x01, "8786228338248772" }, + .dst = { 0xaa, 0xff, "8786228338248378" }, + .validity_minutes = 360, + .protocol_id = 0xbb, + /* SM TP-User-Data is taken from sms_tp_ud_set[] */ + }, + .ud = &sms_tp_ud_set[6], + }, + { + .name = "Same MSISDN #1", + .sms = { + .msg_ref = 0x11, + .src = SMS_ADDR("72631"), + .dst = SMS_ADDR("72632"), + .validity_minutes = 10, + /* SM TP-User-Data is taken from sms_tp_ud_set[] */ + }, + .ud = &sms_tp_ud_set[0], + }, + { + .name = "Same MSISDN #2", + .sms = { + .msg_ref = 0x12, + .src = SMS_ADDR("72632"), + .dst = SMS_ADDR("72631"), + .validity_minutes = 10, + /* SM TP-User-Data is taken from sms_tp_ud_set[] */ + }, + .ud = &sms_tp_ud_set[0], + }, + { + .name = "Expired SMS", + .sms = { + .msg_ref = 0xde, + .src = SMS_ADDR("3974733772"), + .dst = SMS_ADDR("3974733378"), + .validity_minutes = 0, + /* SM TP-User-Data is taken from sms_tp_ud_set[] */ + }, + .ud = &sms_tp_ud_set[0], + }, +#if 0 + /* FIXME: there is a bug that causes ASAN / Valgrind to complain */ + { + .name = "Empty TP-UD", + .sms = { + .msg_ref = 0x38, + .src = SMS_ADDR("3678983772"), + .dst = SMS_ADDR("3678983378"), + .validity_minutes = 450, + .is_report = true, + .reply_path_req = 0x01, + .status_rep_req = 0x01, + .protocol_id = 0x55, + .data_coding_scheme = 0x08, + .ud_hdr_ind = 0x00, + .user_data_len = 0x00, + /* No TP-User-Data */ + }, + .ud = NULL, + }, +#endif +}; + +static void prepare_sms_test_set(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(sms_test_set); i++) { + struct sms_test *test = sms_test_set + i; + const struct sms_tp_ud *ud = test->ud; + + /* ID auto-increment */ + test->sms.id = i + 1; + + if (ud == NULL) + continue; + + test->sms.data_coding_scheme = ud->dcs; + test->sms.user_data_len = ud->length; + + if (ud->filler_byte) { + memset(test->sms.user_data, ud->filler_byte, + sizeof(test->sms.user_data)); + } else { + memcpy(test->sms.user_data, ud->data, sizeof(ud->data)); + if (ud->dec_text[0] != '\0') + strcpy(test->sms.text, ud->dec_text); + } + } +} + +static void test_db_sms_store(void) +{ + int rc, i; + + LOGP(DDB, LOGL_INFO, "Testing db_sms_store()...\n"); + + /* Store test SMS messages */ + for (i = 0; i < ARRAY_SIZE(sms_test_set); i++) { + struct sms_test *test = &sms_test_set[i]; + + LOGP(DDB, LOGL_NOTICE, "%s('%s'): ", __func__, test->name); + + rc = db_sms_store(&test->sms); + if (!test->exp_db_sms_store_fail && rc == 0) + LOGPC(DDB, LOGL_INFO, "success, as expected\n"); + else if (test->exp_db_sms_store_fail && rc != 0) + LOGPC(DDB, LOGL_INFO, "failure, as expected\n"); + else + LOGPC(DDB, LOGL_ERROR, "unexpected rc=%d\n", rc); + } +} + +static int verify_sms(const struct sms_test *test, const struct gsm_sms *sms) +{ + int rc; + + LOGP(DDB, LOGL_NOTICE, "%s('%s'): ", __func__, test->name); + +#define MATCH_SMS_ADDR(ADDR) \ + if (strcmp(sms->ADDR.addr, test->sms.ADDR.addr) \ + || sms->ADDR.npi != test->sms.ADDR.npi \ + || sms->ADDR.ton != test->sms.ADDR.ton) { \ + LOGPC(DDB, LOGL_ERROR, #ADDR " address mismatch\n"); \ + return -EINVAL; \ + } + + MATCH_SMS_ADDR(src); + MATCH_SMS_ADDR(dst); + +#define MATCH_SMS_PARAM(PARAM, FMT) \ + if (sms->PARAM != test->sms.PARAM) { \ + LOGPC(DDB, LOGL_ERROR, \ + #PARAM " mismatch: E%" FMT " vs A%" FMT "\n", \ + test->sms.PARAM, sms->PARAM); \ + return -EINVAL; \ + } + + MATCH_SMS_PARAM(id, "llu"); + MATCH_SMS_PARAM(validity_minutes, "lu"); + MATCH_SMS_PARAM(is_report, "i"); + MATCH_SMS_PARAM(reply_path_req, PRIu8); + MATCH_SMS_PARAM(status_rep_req, PRIu8); + MATCH_SMS_PARAM(ud_hdr_ind, PRIu8); + MATCH_SMS_PARAM(protocol_id, PRIu8); + MATCH_SMS_PARAM(data_coding_scheme, PRIu8); + MATCH_SMS_PARAM(msg_ref, PRIu8); + MATCH_SMS_PARAM(user_data_len, PRIu8); + + /* Compare TP-User-Data */ + rc = memcmp(sms->user_data, test->sms.user_data, + sizeof(sms->user_data)); + if (rc) { + LOGPC(DDB, LOGL_ERROR, "TP-User-Data mismatch (diff=%d/%zu)\n", + rc, sizeof(sms->user_data)); + return -EINVAL; + } + + /* Compare decoded text */ + rc = strncmp(sms->text, test->sms.text, sizeof(sms->text)); + if (rc) { + LOGPC(DDB, LOGL_ERROR, "TP-User-Data (text) mismatch (diff=%d/%zu)\n", + rc, sizeof(sms->text)); + return -EINVAL; + } + + LOGPC(DDB, LOGL_NOTICE, "match\n"); + return 0; +} + +static void test_db_sms_get(void) +{ + struct gsm_sms *sms; + int i; + + LOGP(DDB, LOGL_INFO, "Testing db_sms_get()...\n"); + + /* Retrieve stored SMS messages */ + for (i = 0; i < ARRAY_SIZE(sms_test_set); i++) { + const struct sms_test *test = &sms_test_set[i]; + + LOGP(DDB, LOGL_NOTICE, "%s('%s'): ", __func__, test->name); + + sms = db_sms_get(NULL, test->sms.id); + if (!test->exp_db_sms_get_fail && sms != NULL) + LOGPC(DDB, LOGL_INFO, "success, as expected\n"); + else if (test->exp_db_sms_get_fail && sms == NULL) + LOGPC(DDB, LOGL_INFO, "failure, as expected\n"); + else + LOGPC(DDB, LOGL_ERROR, "unexpected result\n"); + + if (sms) { + verify_sms(test, sms); + talloc_free(sms); + } + } +} + +static void test_db_sms_delivery(void) +{ + struct gsm_sms *sms1, *sms2; + struct gsm_sms *sms; + int rc; + + LOGP(DDB, LOGL_INFO, "Testing db_sms_get_next_unsent() " + "and db_sms_mark_delivered()...\n"); + + /* Retrieve both #1 and #2 */ + sms1 = db_sms_get_next_unsent(NULL, 1, 0); + LOGP(DDB, LOGL_NOTICE, "db_sms_get_next_unsent(#1): %s\n", + sms1 ? "found" : "not found"); + if (sms1 != NULL) + verify_sms(&sms_test_set[0], sms1); + + sms2 = db_sms_get_next_unsent(NULL, 2, 0); + LOGP(DDB, LOGL_NOTICE, "db_sms_get_next_unsent(#2): %s\n", + sms2 ? "found" : "not found"); + if (sms2 != NULL) + verify_sms(&sms_test_set[1], sms2); + + /* Mark both #1 and #2 and delivered, release memory */ + if (sms1) { + LOGP(DDB, LOGL_DEBUG, "Marking #%llu as delivered: ", sms1->id); + rc = db_sms_mark_delivered(sms1); + LOGPC(DDB, LOGL_DEBUG, "rc=%d\n", rc); + talloc_free(sms1); + } + + if (sms2) { + LOGP(DDB, LOGL_DEBUG, "Marking #%llu as delivered: ", sms2->id); + rc = db_sms_mark_delivered(sms2); + LOGPC(DDB, LOGL_DEBUG, "rc=%d\n", rc); + talloc_free(sms2); + } + + /* Expect #3 as the next undelivered */ + sms = db_sms_get_next_unsent(NULL, 1, 0); + LOGP(DDB, LOGL_NOTICE, "db_sms_get_next_unsent(starting from #1): %s\n", + sms ? "found" : "not found"); + if (sms) { + verify_sms(&sms_test_set[2], sms); + talloc_free(sms); + } +} + +static void test_db_sms_delete(void) +{ + int rc; + + LOGP(DDB, LOGL_INFO, "Testing db_sms_delete_sent_message_by_id()...\n"); + + /* Delete #1, which is marked as sent */ + LOGP(DDB, LOGL_NOTICE, "db_sms_delete_sent_message_by_id(#1, sent): "); + rc = db_sms_delete_sent_message_by_id(1); + LOGPC(DDB, LOGL_NOTICE, "rc=%d\n", rc); + /* Don't expect to retrieve this message anymore */ + sms_test_set[0].exp_db_sms_get_fail = true; + + /* Try to delete #3, which is not marked as sent */ + LOGP(DDB, LOGL_NOTICE, "db_sms_delete_sent_message_by_id(#3, not sent): "); + rc = db_sms_delete_sent_message_by_id(3); + LOGPC(DDB, LOGL_NOTICE, "rc=%d\n", rc); + /* Do expect to retrieve this message anyway */ + sms_test_set[2].exp_db_sms_get_fail = false; + + LOGP(DDB, LOGL_INFO, "Testing db_sms_delete_by_msisdn()...\n"); + + LOGP(DDB, LOGL_NOTICE, "db_sms_delete_by_msisdn('72631'): "); + rc = db_sms_delete_by_msisdn("72631"); + LOGPC(DDB, LOGL_NOTICE, "rc=%d\n", rc); + + /* Don't expect both #8 and #9 anymore */ + sms_test_set[7].exp_db_sms_get_fail = true; + sms_test_set[8].exp_db_sms_get_fail = true; + + LOGP(DDB, LOGL_INFO, "Testing db_sms_delete_oldest_expired_message()...\n"); + + LOGP(DDB, LOGL_NOTICE, "db_sms_delete_oldest_expired_message()\n"); + db_sms_delete_oldest_expired_message(); + + /* Don't expect #10 anymore */ + sms_test_set[9].exp_db_sms_get_fail = true; + + /* We need to make sure that we removed exactly what we expected to remove */ + LOGP(DDB, LOGL_INFO, "Expectations updated, retrieving all messages again\n"); + test_db_sms_get(); +} + +static struct log_info_cat db_sms_test_categories[] = { + [DDB] = { + .name = "DDB", + .description = "Database Layer", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, +}; + +static struct log_info info = { + .cat = db_sms_test_categories, + .num_cat = ARRAY_SIZE(db_sms_test_categories), +}; + +int main(int argc, char **argv) +{ + void *logging_ctx; + int rc; + + /* Track the use of talloc NULL memory contexts */ + talloc_enable_null_tracking(); + + talloc_ctx = talloc_named_const(NULL, 0, "db_sms_test"); + logging_ctx = talloc_named_const(talloc_ctx, 0, "logging"); + osmo_init_logging2(logging_ctx, &info); + + OSMO_ASSERT(osmo_stderr_target); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_timestamp(osmo_stderr_target, 0); + log_set_print_filename(osmo_stderr_target, 0); + log_set_print_category(osmo_stderr_target, 1); + log_set_print_level(osmo_stderr_target, 1); + +#if 0 + /* Having the database stored in a regular file may be useful + * for debugging, but this comes at the price of performance. */ + FILE *dbf = fopen("db_sms_test.db", "wb"); + OSMO_ASSERT(dbf != NULL); + fclose(dbf); +#endif + + /* Init a volatile database in RAM */ + LOGP(DDB, LOGL_DEBUG, "Init a new database\n"); + rc = db_init(":memory:"); + OSMO_ASSERT(rc == 0); + + /* Prepare some tables */ + rc = db_prepare(); + OSMO_ASSERT(rc == 0); + LOGP(DDB, LOGL_DEBUG, "Init complete\n"); + + /* Prepare the test set */ + prepare_sms_test_set(); + + test_db_sms_store(); + test_db_sms_get(); + + test_db_sms_delivery(); + test_db_sms_delete(); + + /* Close the database */ + db_fini(); + + /* Deinit logging */ + log_fini(); + + /* Check for memory leaks */ + rc = talloc_total_blocks(talloc_ctx); + OSMO_ASSERT(rc == 2); /* db_sms_test + logging */ + talloc_free(talloc_ctx); + + talloc_report_full(NULL, stderr); + talloc_disable_null_tracking(); + + return 0; +} + +void osmo_stream_srv_link_set_data(struct osmo_stream_srv_link *link, void *data) {} +struct osmo_fd *osmo_stream_srv_get_ofd(struct osmo_stream_srv *srv) { return NULL; } +void osmo_stream_srv_destroy(struct osmo_stream_srv *conn) {} +struct osmo_stream_srv *osmo_stream_srv_create(void *ctx, struct osmo_stream_srv_link *link, + int fd, int (*cb)(struct osmo_stream_srv *conn), + int (*closed_cb)(struct osmo_stream_srv *conn), + void *data) { return NULL; } +void osmo_stream_srv_send(struct osmo_stream_srv *conn, struct msgb *msg) {} +void osmo_stream_srv_link_set_proto(struct osmo_stream_srv_link *link, uint16_t proto) {} +struct osmo_fd *osmo_stream_srv_link_get_ofd(struct osmo_stream_srv_link *link) { return NULL; } +struct osmo_stream_srv_link *osmo_stream_srv_link_create(void *ctx) { return NULL; } +void *osmo_stream_srv_get_data(struct osmo_stream_srv *conn) { return NULL; } +void osmo_stream_srv_link_set_nodelay(struct osmo_stream_srv_link *link, bool nodelay) {} +void osmo_stream_srv_link_set_accept_cb(struct osmo_stream_srv_link *link, int (*accept_cb) + (struct osmo_stream_srv_link *link, int fd)) {} +int osmo_stream_srv_link_open(struct osmo_stream_srv_link *link) { return 0; } +void *osmo_stream_srv_link_get_data(struct osmo_stream_srv_link *link) { return NULL; } +void osmo_stream_srv_link_set_port(struct osmo_stream_srv_link *link, uint16_t port) {} +void osmo_stream_srv_link_set_addr(struct osmo_stream_srv_link *link, const char *addr) {} +int sctp_recvmsg(int sd, void *msg, size_t len, void *from, void *fromlen, void *info, int *msg_flags) { return 0; } diff --git a/tests/db_sms/db_sms_test.err b/tests/db_sms/db_sms_test.err new file mode 100644 index 0000000..73dbd8e --- /dev/null +++ b/tests/db_sms/db_sms_test.err @@ -0,0 +1,70 @@ +DDB DEBUG Init a new database +DDB DEBUG Init complete +DDB INFO Testing db_sms_store()... +DDB NOTICE test_db_sms_store('Regular MO SMS'): success, as expected +DDB NOTICE test_db_sms_store('Regular MT SMS'): success, as expected +DDB NOTICE test_db_sms_store('Complete TP-UD (160 septets, 7-bit encoding)'): success, as expected +DDB NOTICE test_db_sms_store('Complete TP-UD (140 octets, 8-bit encoding)'): success, as expected +DDB NOTICE test_db_sms_store('TP-UD buffer overflow (UDH-Length > UD-Length)'): success, as expected +DDB NOTICE test_db_sms_store('Truncated TP-UD (200 septets, 7-bit encoding)'): success, as expected +DDB NOTICE test_db_sms_store('Truncated TP-UD (255 octets, 8-bit encoding)'): success, as expected +DDB NOTICE test_db_sms_store('Same MSISDN #1'): success, as expected +DDB NOTICE test_db_sms_store('Same MSISDN #2'): success, as expected +DDB NOTICE test_db_sms_store('Expired SMS'): success, as expected +DDB INFO Testing db_sms_get()... +DDB NOTICE test_db_sms_get('Regular MO SMS'): success, as expected +DDB NOTICE verify_sms('Regular MO SMS'): match +DDB NOTICE test_db_sms_get('Regular MT SMS'): success, as expected +DDB NOTICE verify_sms('Regular MT SMS'): match +DDB NOTICE test_db_sms_get('Complete TP-UD (160 septets, 7-bit encoding)'): success, as expected +DDB NOTICE verify_sms('Complete TP-UD (160 septets, 7-bit encoding)'): TP-User-Data mismatch (diff=-65/256) +DDB NOTICE test_db_sms_get('Complete TP-UD (140 octets, 8-bit encoding)'): success, as expected +DDB NOTICE verify_sms('Complete TP-UD (140 octets, 8-bit encoding)'): TP-User-Data mismatch (diff=-66/256) +DDB NOTICE test_db_sms_get('TP-UD buffer overflow (UDH-Length > UD-Length)'): success, as expected +DDB NOTICE verify_sms('TP-UD buffer overflow (UDH-Length > UD-Length)'): match +DDB NOTICE test_db_sms_get('Truncated TP-UD (200 septets, 7-bit encoding)'): success, as expected +DDB NOTICE verify_sms('Truncated TP-UD (200 septets, 7-bit encoding)'): TP-User-Data mismatch (diff=-65/256) +DDB NOTICE test_db_sms_get('Truncated TP-UD (255 octets, 8-bit encoding)'): success, as expected +DDB NOTICE verify_sms('Truncated TP-UD (255 octets, 8-bit encoding)'): TP-User-Data mismatch (diff=-16896/256) +DDB NOTICE test_db_sms_get('Same MSISDN #1'): success, as expected +DDB NOTICE verify_sms('Same MSISDN #1'): match +DDB NOTICE test_db_sms_get('Same MSISDN #2'): success, as expected +DDB NOTICE verify_sms('Same MSISDN #2'): match +DDB NOTICE test_db_sms_get('Expired SMS'): success, as expected +DDB NOTICE verify_sms('Expired SMS'): match +DDB INFO Testing db_sms_get_next_unsent() and db_sms_mark_delivered()... +DDB NOTICE db_sms_get_next_unsent(#1): found +DDB NOTICE verify_sms('Regular MO SMS'): match +DDB NOTICE db_sms_get_next_unsent(#2): found +DDB NOTICE verify_sms('Regular MT SMS'): match +DDB DEBUG Marking #1 as delivered: rc=0 +DDB DEBUG Marking #2 as delivered: rc=0 +DDB NOTICE db_sms_get_next_unsent(starting from #1): found +DDB NOTICE verify_sms('Complete TP-UD (160 septets, 7-bit encoding)'): TP-User-Data mismatch (diff=-65/256) +DDB INFO Testing db_sms_delete_sent_message_by_id()... +DDB NOTICE db_sms_delete_sent_message_by_id(#1, sent): rc=0 +DDB NOTICE db_sms_delete_sent_message_by_id(#3, not sent): rc=0 +DDB INFO Testing db_sms_delete_by_msisdn()... +DDB NOTICE db_sms_delete_by_msisdn('72631'): rc=0 +DDB INFO Testing db_sms_delete_oldest_expired_message()... +DDB NOTICE db_sms_delete_oldest_expired_message() +DDB INFO Expectations updated, retrieving all messages again +DDB INFO Testing db_sms_get()... +DDB NOTICE test_db_sms_get('Regular MO SMS'): failure, as expected +DDB NOTICE test_db_sms_get('Regular MT SMS'): success, as expected +DDB NOTICE verify_sms('Regular MT SMS'): match +DDB NOTICE test_db_sms_get('Complete TP-UD (160 septets, 7-bit encoding)'): success, as expected +DDB NOTICE verify_sms('Complete TP-UD (160 septets, 7-bit encoding)'): TP-User-Data mismatch (diff=-65/256) +DDB NOTICE test_db_sms_get('Complete TP-UD (140 octets, 8-bit encoding)'): success, as expected +DDB NOTICE verify_sms('Complete TP-UD (140 octets, 8-bit encoding)'): TP-User-Data mismatch (diff=-66/256) +DDB NOTICE test_db_sms_get('TP-UD buffer overflow (UDH-Length > UD-Length)'): success, as expected +DDB NOTICE verify_sms('TP-UD buffer overflow (UDH-Length > UD-Length)'): match +DDB NOTICE test_db_sms_get('Truncated TP-UD (200 septets, 7-bit encoding)'): success, as expected +DDB NOTICE verify_sms('Truncated TP-UD (200 septets, 7-bit encoding)'): TP-User-Data mismatch (diff=-65/256) +DDB NOTICE test_db_sms_get('Truncated TP-UD (255 octets, 8-bit encoding)'): success, as expected +DDB NOTICE verify_sms('Truncated TP-UD (255 octets, 8-bit encoding)'): TP-User-Data mismatch (diff=-16896/256) +DDB NOTICE test_db_sms_get('Same MSISDN #1'): failure, as expected +DDB NOTICE test_db_sms_get('Same MSISDN #2'): failure, as expected +DDB NOTICE test_db_sms_get('Expired SMS'): unexpected result +DDB NOTICE verify_sms('Expired SMS'): match +full talloc report on 'null_context' (total 0 bytes in 1 blocks) diff --git a/tests/db_sms/db_sms_test.ok b/tests/db_sms/db_sms_test.ok new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/db_sms/db_sms_test.ok diff --git a/tests/testsuite.at b/tests/testsuite.at index f27b60c..cd01bf1 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -16,6 +16,13 @@ AT_CHECK([$abs_top_builddir/tests/sms_queue/sms_queue_test], [], [expout], [experr]) AT_CLEANUP +AT_SETUP([db_sms_test]) +AT_KEYWORDS([db_sms_test]) +cat $abs_srcdir/db_sms/db_sms_test.ok > expout +cat $abs_srcdir/db_sms/db_sms_test.err > experr +AT_CHECK([$abs_top_builddir/tests/db_sms/db_sms_test], [], [expout], [experr]) +AT_CLEANUP + AT_SETUP([msc_vlr_test_no_authen]) AT_KEYWORDS([msc_vlr_test_no_authen]) cat $abs_srcdir/msc_vlr/msc_vlr_test_no_authen.ok > expout -- To view, visit https://gerrit.osmocom.org/13629 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id94ad35b6f78f839137db2e17010fbf9b40111a3 Gerrit-Change-Number: 13629 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 09:41:48 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Apr 2019 09:41:48 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: fix storing SMS with empty TP-User-Data Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13630 Change subject: libmsc/db.c: fix storing SMS with empty TP-User-Data ...................................................................... libmsc/db.c: fix storing SMS with empty TP-User-Data Thanks to db_sms_test, it was discovered that storing an SMS with empty TP-User-Data (TP-UDL=1) causes buffer overruns in libdbi and it's SQLite3 driver (libdbdsqlite3): DDB NOTICE test_db_sms_store('Empty TP-UD'): ==7791== Invalid write of size 2 ==7791== at 0x857DC60: dbd_quote_binary (in /usr/lib/x86_64-linux-gnu/dbd/libdbdsqlite3.so) ==7791== by 0x5B2B321: dbi_conn_quote_binary_copy (in /usr/lib/x86_64-linux-gnu/libdbi.so.1.1.0) ==7791== by 0x4073B1: db_sms_store (db.c:701) ==7791== by 0x405BB5: test_db_sms_store (db_sms_test.c:310) ==7791== by 0x405BB5: main (db_sms_test.c:546) ==7791== Address 0x7ed1cf0 is 0 bytes after a block of size 0 alloc'd ==7791== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==7791== by 0x857DC4B: dbd_quote_binary (in /usr/lib/x86_64-linux-gnu/dbd/libdbdsqlite3.so) ==7791== by 0x5B2B321: dbi_conn_quote_binary_copy (in /usr/lib/x86_64-linux-gnu/libdbi.so.1.1.0) ==7791== by 0x4073B1: db_sms_store (db.c:701) ==7791== by 0x405BB5: test_db_sms_store (db_sms_test.c:310) ==7791== by 0x405BB5: main (db_sms_test.c:546) ... DDB NOTICE test_db_sms_get('Empty TP-UD'): ==8051== Invalid read of size 1 ==8051== at 0x5B30510: _dbd_decode_binary (in /usr/lib/x86_64-linux-gnu/libdbi.so.1.1.0) ==8051== by 0x857D957: dbd_fetch_row (in /usr/lib/x86_64-linux-gnu/dbd/libdbdsqlite3.so) ==8051== by 0x5B2C86E: dbi_result_seek_row (in /usr/lib/x86_64-linux-gnu/libdbi.so.1.1.0) ==8051== by 0x40828F: next_row (db.c:188) ==8051== by 0x40828F: db_sms_get (db.c:805) ==8051== by 0x406C29: test_db_sms_get (db_sms_test.c:390) ==8051== by 0x405C14: main (db_sms_test.c:547) ==8051== Address 0x8f74641 is 0 bytes after a block of size 1 alloc'd ==8051== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==8051== by 0x5DBEB49: strdup (strdup.c:42) ==8051== by 0x857D93C: dbd_fetch_row (in /usr/lib/x86_64-linux-gnu/dbd/libdbdsqlite3.so) ==8051== by 0x5B2C86E: dbi_result_seek_row (in /usr/lib/x86_64-linux-gnu/libdbi.so.1.1.0) ==8051== by 0x40828F: next_row (db.c:188) ==8051== by 0x40828F: db_sms_get (db.c:805) ==8051== by 0x406C29: test_db_sms_get (db_sms_test.c:390) ==8051== by 0x405C14: main (db_sms_test.c:547) ==8051== success, as expected DDB NOTICE verify_sms('Empty TP-UD'): user_data_len mismatch: E0 vs A3 Apparently, dbi_conn_quote_binary_copy() doesn't properly handle zero-length input. Let's guard against this. Observed with: - libdbi-dev 0.9.0-1 - libdbd-sqlite3:amd64 0.9.0-2ubuntu2 Change-Id: If0b2bb557118c5f0e520a2e6c2816336f6028661 --- M src/libmsc/db.c M tests/db_sms/db_sms_test.c M tests/db_sms/db_sms_test.err 3 files changed, 14 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/30/13630/1 diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 423787b..3f9a9bd 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -692,14 +692,20 @@ { dbi_result result; char *q_text, *q_daddr, *q_saddr; - unsigned char *q_udata; + unsigned char *q_udata = NULL; time_t now, validity_timestamp; dbi_conn_quote_string_copy(conn, (char *)sms->text, &q_text); dbi_conn_quote_string_copy(conn, (char *)sms->dst.addr, &q_daddr); dbi_conn_quote_string_copy(conn, (char *)sms->src.addr, &q_saddr); - dbi_conn_quote_binary_copy(conn, sms->user_data, sms->user_data_len, - &q_udata); + + /* Guard against zero-length input, as this may cause + * buffer overruns in libdbi / libdbdsqlite3. */ + if (sms->user_data_len > 0) { + dbi_conn_quote_binary_copy(conn, sms->user_data, + sms->user_data_len, + &q_udata); + } now = time(NULL); validity_timestamp = now + sms->validity_minutes * 60; diff --git a/tests/db_sms/db_sms_test.c b/tests/db_sms/db_sms_test.c index e78bb53..b4d782e 100644 --- a/tests/db_sms/db_sms_test.c +++ b/tests/db_sms/db_sms_test.c @@ -247,8 +247,6 @@ }, .ud = &sms_tp_ud_set[0], }, -#if 0 - /* FIXME: there is a bug that causes ASAN / Valgrind to complain */ { .name = "Empty TP-UD", .sms = { @@ -267,7 +265,6 @@ }, .ud = NULL, }, -#endif }; static void prepare_sms_test_set(void) diff --git a/tests/db_sms/db_sms_test.err b/tests/db_sms/db_sms_test.err index 73dbd8e..e0a329d 100644 --- a/tests/db_sms/db_sms_test.err +++ b/tests/db_sms/db_sms_test.err @@ -11,6 +11,7 @@ DDB NOTICE test_db_sms_store('Same MSISDN #1'): success, as expected DDB NOTICE test_db_sms_store('Same MSISDN #2'): success, as expected DDB NOTICE test_db_sms_store('Expired SMS'): success, as expected +DDB NOTICE test_db_sms_store('Empty TP-UD'): success, as expected DDB INFO Testing db_sms_get()... DDB NOTICE test_db_sms_get('Regular MO SMS'): success, as expected DDB NOTICE verify_sms('Regular MO SMS'): match @@ -32,6 +33,8 @@ DDB NOTICE verify_sms('Same MSISDN #2'): match DDB NOTICE test_db_sms_get('Expired SMS'): success, as expected DDB NOTICE verify_sms('Expired SMS'): match +DDB NOTICE test_db_sms_get('Empty TP-UD'): success, as expected +DDB NOTICE verify_sms('Empty TP-UD'): match DDB INFO Testing db_sms_get_next_unsent() and db_sms_mark_delivered()... DDB NOTICE db_sms_get_next_unsent(#1): found DDB NOTICE verify_sms('Regular MO SMS'): match @@ -67,4 +70,6 @@ DDB NOTICE test_db_sms_get('Same MSISDN #2'): failure, as expected DDB NOTICE test_db_sms_get('Expired SMS'): unexpected result DDB NOTICE verify_sms('Expired SMS'): match +DDB NOTICE test_db_sms_get('Empty TP-UD'): success, as expected +DDB NOTICE verify_sms('Empty TP-UD'): match full talloc report on 'null_context' (total 0 bytes in 1 blocks) -- To view, visit https://gerrit.osmocom.org/13630 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If0b2bb557118c5f0e520a2e6c2816336f6028661 Gerrit-Change-Number: 13630 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 09:41:49 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Apr 2019 09:41:49 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: get rid of hard-coded SMS expiry threshold Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13631 Change subject: libmsc/db.c: get rid of hard-coded SMS expiry threshold ...................................................................... libmsc/db.c: get rid of hard-coded SMS expiry threshold Change-Id: I0ce6b1ab50986dc69a2be4ea62b6a24c7f3f8f0a --- M src/libmsc/db.c M tests/db_sms/db_sms_test.err 2 files changed, 12 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/31/13631/1 diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 3f9a9bd..b4150fb 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -1001,20 +1001,15 @@ } -static int delete_expired_sms(unsigned long long sms_id, time_t created, time_t validity_timestamp) +static int delete_expired_sms(unsigned long long sms_id, time_t validity_timestamp) { dbi_result result; - time_t now, min_created; + time_t now; now = time(NULL); - if (validity_timestamp > now) - return -1; - /* Our SMS expiry threshold is hard-coded to roughly 2 weeks at the moment. */ - min_created = now - (time_t)(60 * 60 * 24 * 7 * 2); - if (min_created < 0) /* bogus system clock? */ - return -1; - if (created >= min_created) /* not yet expired */ + /* Net yet expired */ + if (validity_timestamp > now) return -1; result = dbi_conn_queryf(conn, "DELETE FROM SMS WHERE id = %llu", sms_id); @@ -1029,9 +1024,9 @@ int db_sms_delete_expired_message_by_id(unsigned long long sms_id) { dbi_result result; - time_t created, validity_timestamp; + time_t validity_timestamp; - result = dbi_conn_queryf(conn, "SELECT created,valid_until FROM SMS WHERE id = %llu", sms_id); + result = dbi_conn_queryf(conn, "SELECT valid_until FROM SMS WHERE id = %llu", sms_id); if (!result) return -1; if (!next_row(result)) { @@ -1039,29 +1034,28 @@ return -1; } - created = dbi_result_get_datetime(result, "created"); validity_timestamp = dbi_result_get_datetime(result, "valid_until"); dbi_result_free(result); - return delete_expired_sms(sms_id, created, validity_timestamp); + return delete_expired_sms(sms_id, validity_timestamp); } void db_sms_delete_oldest_expired_message(void) { dbi_result result; - result = dbi_conn_queryf(conn, "SELECT id,created,valid_until FROM SMS ORDER BY created LIMIT 1"); + result = dbi_conn_queryf(conn, "SELECT id,valid_until FROM SMS " + "ORDER BY valid_until LIMIT 1"); if (!result) return; if (next_row(result)) { unsigned long long sms_id; - time_t created, validity_timestamp; + time_t validity_timestamp; sms_id = dbi_result_get_ulonglong(result, "id"); - created = dbi_result_get_datetime(result, "created"); validity_timestamp = dbi_result_get_datetime(result, "valid_until"); - delete_expired_sms(sms_id, created, validity_timestamp); + delete_expired_sms(sms_id, validity_timestamp); } dbi_result_free(result); diff --git a/tests/db_sms/db_sms_test.err b/tests/db_sms/db_sms_test.err index e0a329d..958294f 100644 --- a/tests/db_sms/db_sms_test.err +++ b/tests/db_sms/db_sms_test.err @@ -68,8 +68,7 @@ DDB NOTICE verify_sms('Truncated TP-UD (255 octets, 8-bit encoding)'): TP-User-Data mismatch (diff=-16896/256) DDB NOTICE test_db_sms_get('Same MSISDN #1'): failure, as expected DDB NOTICE test_db_sms_get('Same MSISDN #2'): failure, as expected -DDB NOTICE test_db_sms_get('Expired SMS'): unexpected result -DDB NOTICE verify_sms('Expired SMS'): match +DDB NOTICE test_db_sms_get('Expired SMS'): failure, as expected DDB NOTICE test_db_sms_get('Empty TP-UD'): success, as expected DDB NOTICE verify_sms('Empty TP-UD'): match full talloc report on 'null_context' (total 0 bytes in 1 blocks) -- To view, visit https://gerrit.osmocom.org/13631 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0ce6b1ab50986dc69a2be4ea62b6a24c7f3f8f0a Gerrit-Change-Number: 13631 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 09:41:49 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Apr 2019 09:41:49 +0000 Subject: Change in osmo-msc[master]: WIP: store SM-TP-UDL in the database Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13632 Change subject: WIP: store SM-TP-UDL in the database ...................................................................... WIP: store SM-TP-UDL in the database Change-Id: I747a795ca486f3fcfa7583c5ab8aa2aee07a8ec2 --- M src/libmsc/db.c 1 file changed, 133 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/32/13632/1 diff --git a/src/libmsc/db.c b/src/libmsc/db.c index d9717d9..a9d6f0b 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -48,7 +48,7 @@ static dbi_conn conn; static dbi_inst inst; -#define SCHEMA_REVISION "5" +#define SCHEMA_REVISION "6" enum { SCHEMA_META, @@ -133,6 +133,7 @@ "dest_addr TEXT NOT NULL, " "dest_ton INTEGER NOT NULL, " "dest_npi INTEGER NOT NULL, " + "user_data_len INTEGER NOT NULL, " /* TP-UDL */ "user_data BLOB, " /* TP-UD */ /* additional data, interpreted from SMS */ "header BLOB, " /* UD Header */ @@ -227,20 +228,32 @@ static void parse_tp_ud_from_result(struct gsm_sms *sms, dbi_result result) { + unsigned int user_data_len, tp_udl; const unsigned char *user_data; - unsigned int user_data_len; unsigned int text_len; const char *text; /* Retrieve TP-UDL (User-Data-Length) in octets (regardless of DCS) */ user_data_len = dbi_result_get_field_length(result, "user_data"); + + /* Retrieve the original TP-UDL (User-Data-Length) value. + * Depending on DCS, may indicate the amount of octets or septets. + * Backwards compatibility: this field is available since v6. + * For older versions this call will return 0 (zero). */ + tp_udl = dbi_result_get_ulonglong(result, "user_data_len"); + if (tp_udl == 0) { + if (user_data_len > 0) + } else { + sms->user_data_len = tp_udl; + } + + /* Prevent TP-UD buffer overflow */ if (user_data_len > sizeof(sms->user_data)) { LOGP(DDB, LOGL_ERROR, "SMS TP-UD length %u is too big, truncating to %zu\n", user_data_len, sizeof(sms->user_data)); user_data_len = (uint8_t) sizeof(sms->user_data); } - sms->user_data_len = user_data_len; /* Retrieve the TP-UD (User-Data) itself */ user_data = dbi_result_get_binary(result, "user_data"); @@ -555,6 +568,119 @@ return -EINVAL; } +/* Just like v4, but there is a new TP-UDL (User-Data-Length) field */ +static struct gsm_sms *sms_from_result_v5(dbi_result result) +{ + struct gsm_sms *sms; + + + sms = sms_from_result_v4(result); +} + +static int update_db_revision_5(void) +{ + struct gsm_sms *sms; + dbi_result result; + + LOGP(DDB, LOGL_NOTICE, "Going to migrate from revision 5\n"); + + result = dbi_conn_query(conn, "BEGIN EXCLUSIVE TRANSACTION"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to begin transaction (upgrade from rev 5)\n"); + return -EINVAL; + } + dbi_result_free(result); + + /* Rename old SMS table to be able create a new one */ + result = dbi_conn_query(conn, "ALTER TABLE SMS RENAME TO SMS_5"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to rename the old SMS table (upgrade from rev 5)\n"); + goto rollback; + } + dbi_result_free(result); + + /* Create new SMS table with all the bells and whistles! */ + result = dbi_conn_query(conn, create_stmts[SCHEMA_SMS]); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to create a new SMS table (upgrade from rev 5)\n"); + goto rollback; + } + dbi_result_free(result); + + /* Cycle through old messages and convert them to the new format */ + result = dbi_conn_query(conn, "SELECT * FROM SMS_5"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed fetch messages from the old SMS table " + "(upgrade from rev 5)\n"); + goto rollback; + } + while (next_row(result)) { + sms = sms_from_result_v5(result); + if (db_sms_store(sms) != 0) { + LOGP(DDB, LOGL_ERROR, + "Failed to store message to the new SMS table " + "(upgrade from rev 5)\n"); + dbi_result_free(result); + sms_free(sms); + goto rollback; + } + sms_free(sms); + } + dbi_result_free(result); + + /* Remove the temporary table */ + result = dbi_conn_query(conn, "DROP TABLE SMS_5"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to drop the old SMS table (upgrade from rev 5)\n"); + goto rollback; + } + dbi_result_free(result); + + /* We're done, bump DB Meta revision */ + result = dbi_conn_query(conn, + "UPDATE Meta " + "SET value = '6' " + "WHERE key = 'revision'"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to update DB schema revision (upgrade from rev 5)\n"); + goto rollback; + } + dbi_result_free(result); + + result = dbi_conn_query(conn, "COMMIT TRANSACTION"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to commit the transaction (upgrade from rev 5)\n"); + return -EINVAL; + } else { + dbi_result_free(result); + } + + /* Shrink DB file size by actually wiping out SMS_4 table data */ + result = dbi_conn_query(conn, "VACUUM"); + if (!result) + LOGP(DDB, LOGL_ERROR, + "VACUUM failed. Ignoring it (upgrade from rev 5)\n"); + else + dbi_result_free(result); + + return 0; + +rollback: + result = dbi_conn_query(conn, "ROLLBACK TRANSACTION"); + if (!result) + LOGP(DDB, LOGL_ERROR, "Rollback failed (upgrade from rev 5)\n"); + else + dbi_result_free(result); + return -EINVAL; +} + static int check_db_revision(void) { dbi_result result; @@ -603,6 +729,10 @@ case 4: if (update_db_revision_4()) goto error; + /* fall through */ + case 5: + if (update_db_revision_5()) + goto error; /* The end of waterfall */ break; -- To view, visit https://gerrit.osmocom.org/13632 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I747a795ca486f3fcfa7583c5ab8aa2aee07a8ec2 Gerrit-Change-Number: 13632 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 11:34:53 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Apr 2019 11:34:53 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_04_11.c: clarify implicit CP-ACK handling Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13633 Change subject: libmsc/gsm_04_11.c: clarify implicit CP-ACK handling ...................................................................... libmsc/gsm_04_11.c: clarify implicit CP-ACK handling Change-Id: I3c5327a5019590c65d0ccb33a52f07b3988ea952 --- M src/libmsc/gsm_04_11.c 1 file changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/33/13633/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 434f878..da0744a 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -1238,11 +1238,13 @@ LOG_TRANS(trans, LOGL_DEBUG, "receiving SMS message %s\n", gsm48_pdisc_msgtype_name(gsm48_hdr_pdisc(gh), gsm48_hdr_msg_type(gh))); - /* 5.4: For MO, if a CP-DATA is received for a new - * transaction, equals reception of an implicit - * last CP-ACK for previous transaction */ + /* According to section 5.3.4, due to structure of message flow on + * SAPI 0 and 3 it is possible that the CP-ACK of a short message + * transfer might not be received. In this case the reception of + * CP-DATA may be interpreted as the reception of the awaited + * CP-ACK (implicit) and CP-DATA message. */ if (trans->sms.smc_inst.cp_state == GSM411_CPS_IDLE - && msg_type == GSM411_MT_CP_DATA) { + && msg_type == GSM411_MT_CP_DATA) { int i; struct gsm_trans *ptrans; -- To view, visit https://gerrit.osmocom.org/13633 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3c5327a5019590c65d0ccb33a52f07b3988ea952 Gerrit-Change-Number: 13633 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 14:01:55 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 14 Apr 2019 14:01:55 +0000 Subject: Change in osmo-msc[master]: Introduce initial unit test for db_sms_* API In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13629 ) Change subject: Introduce initial unit test for db_sms_* API ...................................................................... Patch Set 1: is this entire branch based on top of neels/ho? -- To view, visit https://gerrit.osmocom.org/13629 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id94ad35b6f78f839137db2e17010fbf9b40111a3 Gerrit-Change-Number: 13629 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sun, 14 Apr 2019 14:01:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 14:02:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 14 Apr 2019 14:02:21 +0000 Subject: Change in osmo-sgsn[master]: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13628 ) Change subject: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13628 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I20bf4db8da746e0b994bfe3f8178188831b67ed3 Gerrit-Change-Number: 13628 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Sun, 14 Apr 2019 14:02:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 14:04:27 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 14 Apr 2019 14:04:27 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.common.inc: add {, un}install targets In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13597 ) Change subject: Makefile.common.inc: add {,un}install targets ...................................................................... Makefile.common.inc: add {,un}install targets Allow installing generated pdfs with 'make install' in all Osmocom projects using osmo-gsm-manuals. This makes proper debian packaging of the manuals easier. Autotools will automatically run this file's install target, when running 'make install' in the top source dir. Do not install anything, when OSMO_GSM_MANUALS_NO_INSTALL is set, and set this variable for the tests dir, so we don't install the test pdfs. Related: OS#3899 Change-Id: I66f33172fa410681acbaef4592e9405627948705 --- M build/Makefile.common.inc M tests/Makefile.am 2 files changed, 30 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/build/Makefile.common.inc b/build/Makefile.common.inc index aaad088..b98e83f 100644 --- a/build/Makefile.common.inc +++ b/build/Makefile.common.inc @@ -3,12 +3,18 @@ # Other makefiles like Makefile.asciidoc.inc and Makefile.vty-reference.inc add # entries to UPLOAD_FILES and CLEAN_FILES. # -# Include this file at the end to have the common targets (upload, clean etc.). +# Put the repository name (e.g. "osmo-bts") into OSMO_REPOSITORY and include +# this file at the end to have the common targets (upload, clean, install etc.). SSH_COMMAND = ssh -o 'UserKnownHostsFile=$(OSMO_GSM_MANUALS_DIR)/build/known_hosts' -p 48 UPLOAD_PATH ?= generic at sysmocom-downloads:documents SYMLINKS = common build CLEAN_FILES += $(SYMLINKS) +PDF_FILES = $(patsubst %.adoc,%.pdf,$(ASCIIDOC)) $(patsubst %.xml,%.pdf,$(VTY_REFERENCE)) +OSMO_REPOSITORY ?= osmo-gsm-manuals + +# Prefix (Makefile.am sets this to configure's --prefix when including) +prefix ?= /usr/local $(SYMLINKS): ln -s $(OSMO_GSM_MANUALS_DIR)/$@ $@ @@ -25,3 +31,23 @@ mkdir -p out cp *.pdf out rsync -avz -e "$(SSH_COMMAND)" ./out/ docs at rita.osmocom.org:web-files/latest/ + +# Install and uninstall targets +# Notes about OSMO_GSM_MANUALS_NO_INSTALL: +# - osmo-gsm-manuals.git's tests/Makefile.am sets this, so the test pdfs will not +# get installed +# - installing manuals by default is fine, because Osmocom projects won't include +# the whole Makefile.common.inc unless --enable-manuals is passed to configure. +install: $(PDF_FILES) + if [ "$(OSMO_GSM_MANUALS_NO_INSTALL)" != "1" ]; then \ + for i in $(PDF_FILES); do \ + install -vDm644 "$$i" "$(DESTDIR)$(prefix)/share/doc/$(OSMO_REPOSITORY)-doc/$$i" || exit 1; \ + done; \ + fi + +uninstall: + if [ "$(OSMO_GSM_MANUALS_NO_INSTALL)" != "1" ]; then \ + for i in $(PDF_FILES); do \ + rm -v "$(DESTDIR)$(prefix)/share/doc/$(OSMO_REPOSITORY)-doc/$$i"; \ + done; \ + fi diff --git a/tests/Makefile.am b/tests/Makefile.am index 32f23b0..7dc9544 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -3,6 +3,9 @@ test-vty-reference.xml \ vty +# Do not install any of the test pdfs +OSMO_GSM_MANUALS_NO_INSTALL = 1 + # Generate adoc file that includes all chapters ASCIIDOC = test-usermanual.adoc ASCIIDOC_DEPS = -- To view, visit https://gerrit.osmocom.org/13597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I66f33172fa410681acbaef4592e9405627948705 Gerrit-Change-Number: 13597 Gerrit-PatchSet: 5 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 14:04:28 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 14 Apr 2019 14:04:28 +0000 Subject: Change in osmo-gsm-manuals[master]: Makefile.am: proper noarch pkgconfig install dir In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13598 ) Change subject: Makefile.am: proper noarch pkgconfig install dir ...................................................................... Makefile.am: proper noarch pkgconfig install dir Don't install the noarch osmo-gsm-manuals.pc file to $prefix/lib/x86_64-linux-gnu/pkgconfig when building a debian package (dpkg-buildpackage seems to set $libdir accordingly). Always install to $prefix/lib/pkgconfig. The debian dir for creating a package from this repository will be added in a follow up patch. Related: OS#3899 Change-Id: I63bc8ab6d2845751079f40383d2aa92c709ce2fe --- M Makefile.am 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, but someone else must approve diff --git a/Makefile.am b/Makefile.am index 2a7b881..479fe8e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,8 @@ share_files = $(srcdir)/build $(srcdir)/common $(srcdir)/*.xsl share_path = "$(DESTDIR)$(prefix)/share/osmo-gsm-manuals" -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = osmo-gsm-manuals.pc +noarch_pkgconfigdir = $(prefix)/lib/pkgconfig +noarch_pkgconfig_DATA = osmo-gsm-manuals.pc BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen .version check-depends.sh $(share_files) SUBDIRS = tests -- To view, visit https://gerrit.osmocom.org/13598 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I63bc8ab6d2845751079f40383d2aa92c709ce2fe Gerrit-Change-Number: 13598 Gerrit-PatchSet: 5 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 14:04:28 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 14 Apr 2019 14:04:28 +0000 Subject: Change in osmo-gsm-manuals[master]: Add debian packaging for osmo-gsm-manuals-dev In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13599 ) Change subject: Add debian packaging for osmo-gsm-manuals-dev ...................................................................... Add debian packaging for osmo-gsm-manuals-dev Allow including pdf manuals in each Osmocom repositories -doc debian package, by depending on osmo-gsm-manuals-dev. Related: OS#3899 Example usage: I4c184c62804c0b805a0a2425a5bd0312e94e49ab (osmo-bts.git) Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 --- A debian/changelog A debian/compat A debian/control A debian/copyright A debian/rules A debian/source/format 6 files changed, 76 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved Harald Welte: Looks good to me, approved diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..975644a --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +osmo-gsm-manuals-dev (0.0.0) unstable; urgency=medium + + * Initial Release. + + -- Oliver Smith Tue, 09 Apr 2019 13:19:25 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..9dc03cb --- /dev/null +++ b/debian/control @@ -0,0 +1,36 @@ +Source: osmo-gsm-manuals-dev +Section: devel +Priority: optional +Maintainer: Oliver Smith +Build-Depends: autotools-dev, + debhelper (>= 9), + pkg-config, +# All below also need to be in Depends + asciidoc, + asciidoc-dblatex, + dblatex, + docbook5-xml, + graphviz, + mscgen, + python, + python-nwdiag, + python-pychart, + xsltproc +Standards-Version: 3.9.8 +Homepage: https://git.osmocom.org/osmo-gsm-manuals/ + +Package: osmo-gsm-manuals-dev +Architecture: all +Depends: ${misc:Depends}, + asciidoc, + asciidoc-dblatex, + dblatex, + docbook5-xml, + graphviz, + mscgen, + python, + python-nwdiag, + python-pychart, + xsltproc +Description: Osmocom manuals shared code + All Osomocom repositories require this package to build their manuals. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..bbc0d9a --- /dev/null +++ b/debian/copyright @@ -0,0 +1,28 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: osmo-gsm-manuals +Source: + +Files: * +Copyright: 2009-2019 Harald Welte +License: GFDL-1.3 + +Files: debian/* +Copyright: 2019 sysmocom s.f.m.c. GmbH +License: GPL-3.0+ + +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 package is distributed in the hope that 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". diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..272596d --- /dev/null +++ b/debian/rules @@ -0,0 +1,5 @@ +#!/usr/bin/make -f + +#export DH_VERBOSE = 1 +%: + dh $@ --with autotools_dev diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) -- To view, visit https://gerrit.osmocom.org/13599 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7edb5093e5b58eb3b0f7af2376476db4026db735 Gerrit-Change-Number: 13599 Gerrit-PatchSet: 7 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 14:05:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 14 Apr 2019 14:05:12 +0000 Subject: Change in osmo-gsm-tester[master]: powersupply: Add support for Intellinet PDU In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13621 ) Change subject: powersupply: Add support for Intellinet PDU ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13621 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iab4f7aec1c50f47da4cd734441bb36fa09d171a3 Gerrit-Change-Number: 13621 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sun, 14 Apr 2019 14:05:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 14:21:26 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Apr 2019 14:21:26 +0000 Subject: Change in osmo-msc[master]: Introduce initial unit test for db_sms_* API In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13629 ) Change subject: Introduce initial unit test for db_sms_* API ...................................................................... Patch Set 1: > is this entire branch based on top of neels/ho? No. There are no conflicts with neels/ho, so either neels/ho can be safely rebased over this patch set, or vice-versa. Just checked. -- To view, visit https://gerrit.osmocom.org/13629 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id94ad35b6f78f839137db2e17010fbf9b40111a3 Gerrit-Change-Number: 13629 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sun, 14 Apr 2019 14:21:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 14:22:46 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Apr 2019 14:22:46 +0000 Subject: Change in osmo-sgsn[master]: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13628 ) Change subject: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13628 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I20bf4db8da746e0b994bfe3f8178188831b67ed3 Gerrit-Change-Number: 13628 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Sun, 14 Apr 2019 14:22:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 15:29:15 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 14 Apr 2019 15:29:15 +0000 Subject: Change in osmo-msc[master]: large refactoring: support inter-BSC and inter-MSC Handover In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13137 ) Change subject: large refactoring: support inter-BSC and inter-MSC Handover ...................................................................... Patch Set 6: (59 comments) https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/gsup_client_mux.h File include/osmocom/msc/gsup_client_mux.h: https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/gsup_client_mux.h at 13 PS6, Line 13: could use some comment about what a "GSUP Client Mux" actually is all about. https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc.h File include/osmocom/msc/mncc.h: https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc.h at 200 PS6, Line 200: union mncc_msg { : uint32_t msg_type; : struct gsm_mncc signal; : struct gsm_mncc_hello hello; : struct gsm_mncc_rtp rtp; : struct gsm_mncc_bridge bridge; : }; why do we have a union of just a few MNCC mesage types? I could understand a union of all the possible options, but why only specificaly those? https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc_fsm.h File include/osmocom/msc/mncc_fsm.h: https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc_fsm.h at 8 PS6, Line 8: GPL-2.0+ osmo-msc in general is AGPLv3+, why is GPLv2+ sggested here? Is there a plan to move this to a shared library whihc might also be used from non-AGPLv3+ programs? https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc_fsm.h at 35 PS6, Line 35: enum mncc_fsm_event { I think this file definitely needs quite a lot more comments. In general the states and events deserve some kind of description, as do the structs. https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc_fsm.h at 64 PS6, Line 64: struct mncc_outgoing_call_req { the struct has a self-explanatory name, good. https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc_fsm.h at 105 PS6, Line 105: struct mncc { this one unfortunately not. "MNCC" is mobile netowkr call control. So I would expect some kind of global object, but the fact that a single callref is referenced, this appears to be something related to a single call? This should be expressed in the name of the struct and a comment should describe what the struct is representing. https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc_fsm.h at 125 PS6, Line 125: int parent_event_call_setup_complete; the name seems to hint a true/false property? https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/msc_a.h File include/osmocom/msc/msc_a.h: https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/msc_a.h at 8 PS6, Line 8: GPL-2.0+ same AGPLv3+ comment https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/msc_a.h at 75 PS6, Line 75: } ciphering; neither AKA nor IMEISV retrieval are strictly speaking part of ciphering. Just saying. This isn't bikeshedding, I just want to make sure we use as precise naming as possible to ease readability and avoid any misunderstandings. https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/msc_a.h at 80 PS6, Line 80: /* struct msc_role_common must remain at start */ not imporant, but one could have an OSMO_ASSERT on the 'offsetof() == 0' somewhere during program startup. https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/msc_ho.h File include/osmocom/msc/msc_ho.h: https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/msc_ho.h at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/msc_roles.h File include/osmocom/msc/msc_roles.h: https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/msc_roles.h at 379 PS6, Line 379: struct an_apdu { : /* accessNetworkProtocolId */ : enum osmo_gsup_access_network_protocol an_proto; : /* signalInfo */ : struct msgb *msg; : /* If this AN-APDU is sent between MSCs, additional information from the E-interface messaging, like the : * Handover Number, will placed/available here. Otherwise may be left NULL. */ : const struct osmo_gsup_message *e_info; : }; as this just adds two 'long' words to 'struct msgb' one could have implemented this in arguably more osmocom-style using the msgb->cb[] array and some accessor macros. No need to change it, I'm just sharing my thoughts. https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/nas.h File include/osmocom/msc/nas.h: https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/nas.h at 111 PS6, Line 111: struct geran_encr *chosen_encryption; the comment explains that "0 means no such IE was present". But the member is a pointer. So where's the semantic differenece to chosen_encryption = NULL? https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/call_leg.c File src/libmsc/call_leg.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/call_leg.c at 64 PS6, Line 64: OSMO_ASSERT( osmo_fsm_register(&call_leg_fsm) == 0 ); I would typically try to move as much as possible (particularly fsm registrations) into automatically-called __attribute__((constructor)) functions. Sure, the 'gsm_network' doesn't exist yet, so not everything can be done like this without larger changes. Not needed to change now, but we should do that in follow-up patches https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/cell_id_list.c File src/libmsc/cell_id_list.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/cell_id_list.c at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/e_link.c File src/libmsc/e_link.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/e_link.c at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/e_link.c at 380 PS6, Line 380: Point a struct msgb's data members directly at the data buffer of gsup_msg->an_apdu. This *is* a hack, and the msgb : * returned is a static struct msgb: it must *not* be freed, put in a queue or kept around after gsup_msg->an_apdu is : * gone. The returned msgb can *not* be passed down a RAN peer's SCCP user SAP. This can be useful to "peek" at the : * included data by passing to a nas_decode implementation in a code path that does not pass any PDU on and wants to : * avoid dynamic allocation. *really* ugly and easy to abuse/introduce bugs. How often do we do this? I'd say let's rather make a copy of the msgb in such situations or find another solution. https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsm_04_08.c File src/libmsc/gsm_04_08.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsm_04_08.c at 248 PS6, Line 248: int compl_l3_msg_is_r99(const struct msgb *msg) comment and function name don't seem to agree on what this function is doing https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsm_04_80.c File src/libmsc/gsm_04_80.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsm_04_80.c at 39 PS6, Line 39: subscriber does msc_a really refference a subscriber? https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsup_client_mux.c File src/libmsc/gsup_client_mux.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsup_client_mux.c at 37 PS6, Line 37: LOGP(DLGSUP, LOGL_DEBUG, "No explicit GSUP Message Class, trying to guess from message type %s\n", : osmo_gsup_message_type_name(gsup_msg->message_type)); as pretty much all existing GSUP messages by any existing program don't have the message_class set, I'm not sure we should log a DEBUG message for each of them. Maye in a few years time, but not today. https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/mncc_fsm.c File src/libmsc/mncc_fsm.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/mncc_fsm.c at 10 PS6, Line 10: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_a.c File src/libmsc/msc_a.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_a.c at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ licnese https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_a.c at 983 PS6, Line 983: OSMO_ASSERT(osmo_fsm_register(&msc_a_fsm) == 0); can be moved to __Attribute__((constructor)) https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_a_remote.c File src/libmsc/msc_a_remote.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_a_remote.c at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_a_remote.c at 364 PS6, Line 364: OSMO_ASSERT(osmo_fsm_register(&msc_a_remote_fsm) == 0); can be moved to __attribute__((constructor)) https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_ho.c File src/libmsc/msc_ho.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_ho.c at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_ho.c at 65 PS6, Line 65: osmo_fsm_register(&msc_ho_fsm); can be moved to __attribute__((constructor)) https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_ho.c at 138 PS6, Line 138: } : : if (success) { else ? https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_i.c File src/libmsc/msc_i.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_i.c at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_i.c at 310 PS6, Line 310: { __attribute__((constructor)) avoids having to explicitly call this function and can make it static. https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_i_remote.c File src/libmsc/msc_i_remote.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_i_remote.c at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_i_remote.c at 225 PS6, Line 225: OSMO_ASSERT(osmo_fsm_register(&msc_i_remote_fsm) == 0); __attribute__((constructor)) https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_t.c File src/libmsc/msc_t.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_t.c at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_t.c at 872 PS6, Line 872: { constructor https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_t_remote.c File src/libmsc/msc_t_remote.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_t_remote.c at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_t_remote.c at 204 PS6, Line 204: OSMO_ASSERT(osmo_fsm_register(&msc_t_remote_fsm) == 0); constructor https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_vty.c File src/libmsc/msc_vty.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_vty.c at 512 PS6, Line 512: DEFUN(cfg_msc_handover_number_range, cfg_msc_handover_number_range_cmd, MSISDNs typically also have NPI/TON (numbering plan / type of number). probably makes sense to configure those explicitly somewhere and include them in the match? https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_vty.c at 522 PS6, Line 522: FIXME leading zeros?? Indeded, it probably makes sense not to treat this as unsigned integers but as some kind of "digit prefix". numbers with leading zeroes are very well valid numbers. One example (in terms of the VTY/UI) is 00123456xxx" where then basically 1000 numbers with a common prefix are allocated as pool for handover numbers. https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msub.c File src/libmsc/msub.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msub.c at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msub.c at 152 PS6, Line 152: OSMO_ASSERT(osmo_fsm_register(&msub_fsm) == 0); constructor https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas.c File src/libmsc/nas.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas.c at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas_a.c File src/libmsc/nas_a.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas_a.c at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas_iu.c File src/libmsc/nas_iu.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas_iu.c at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas_iu.c at 95 PS6, Line 95: static void nas_iu_decode_l3(struct nas_dec *nas_iu_decode, RANAP_NAS_PDU_t *nas_pdu, const char *msg_name) const https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas_iu.c at 114 PS6, Line 114: static void nas_iu_decode_err(struct nas_dec *nas_iu_decode, RANAP_ErrorIndicationIEs_t *ies) const https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas_iu.c at 123 PS6, Line 123: RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies) const https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas_iu.c at 125 PS6, Line 125: RANAP_RAB_SetupOrModifiedItem_t *item; these here then subsequently also all const https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas_iu.c at 173 PS6, Line 173: RANAP_IE_t *ranap_ie; don't we get warnings here? 'ies' is const but the stack variables here not? https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas_iu.c at 256 PS6, Line 256: static void nas_iu_decode_ranap_msg(void *_nas_dec, ranap_message *message) ideally the entire input '*message' would be const here, to ensure all downstream users also are 'const' https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas_iu.c at 416 PS6, Line 416: static void ranap_handle_cl(void *ctx, ranap_message *message) maybe even here const? https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/neighbor_ident.c File src/libmsc/neighbor_ident.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/neighbor_ident.c at 8 PS6, Line 8: * no SPDX identifier https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/paging.c File src/libmsc/paging.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/paging.c at 9 PS6, Line 9: mo license header at all https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/ran_infra.c File src/libmsc/ran_infra.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/ran_infra.c at 8 PS6, Line 8: * SPDX-License-Identifier: GPL-2.0+ license https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/ran_peer.c File src/libmsc/ran_peer.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/ran_peer.c at 14 PS6, Line 14: license header missing https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/ran_peer.c at 19 PS6, Line 19: OSMO_ASSERT( osmo_fsm_register(&ran_peer_fsm) == 0); constructor https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/rtp_stream.c File src/libmsc/rtp_stream.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/rtp_stream.c at 12 PS6, Line 12: license header missing https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/rtp_stream.c at 38 PS6, Line 38: OSMO_ASSERT(osmo_fsm_register(&rtp_stream_fsm) == 0); constructor https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/sccp_ran.c File src/libmsc/sccp_ran.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/sccp_ran.c at 5 PS6, Line 5: * mp SPDX identifier https://gerrit.osmocom.org/#/c/13137/6/src/osmo-msc/msc_main.c File src/osmo-msc/msc_main.c: https://gerrit.osmocom.org/#/c/13137/6/src/osmo-msc/msc_main.c at 83 PS6, Line 83: 2016 at the very least that line here should be updated to 2016-2019 now with those significant changes. -- To view, visit https://gerrit.osmocom.org/13137 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I27e4988e0371808b512c757d2b52ada1615067bd Gerrit-Change-Number: 13137 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Sun, 14 Apr 2019 15:29:15 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 15:31:02 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 14 Apr 2019 15:31:02 +0000 Subject: Change in osmo-msc[master]: GSUP: include terminating nul in inter-MSC source/destination name In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13612 ) Change subject: GSUP: include terminating nul in inter-MSC source/destination name ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13612 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9ca8c9eef104519ed1ea46e2fef46dcdc0d554eb Gerrit-Change-Number: 13612 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sun, 14 Apr 2019 15:31:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 17:06:09 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 14 Apr 2019 17:06:09 +0000 Subject: Change in osmo-msc[master]: large refactoring: support inter-BSC and inter-MSC Handover In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13137 ) Change subject: large refactoring: support inter-BSC and inter-MSC Handover ...................................................................... Patch Set 6: (18 comments) I agree with all license,const comments. I actually neglected to do a final pass for those things. Another patch set will follow. https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc.h File include/osmocom/msc/mncc.h: https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc.h at 200 PS6, Line 200: union mncc_msg { : uint32_t msg_type; : struct gsm_mncc signal; : struct gsm_mncc_hello hello; : struct gsm_mncc_rtp rtp; : struct gsm_mncc_bridge bridge; : }; > why do we have a union of just a few MNCC mesage types? I could understand a union of all the possib [?] I didn't come across any others? I even added 'hello' and 'bridge' even though they aren't used in this union and thought I had them all... Ah, maybe I excluded the data_frame because we route all RTP via the MGW now? Any others still missing? https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc_fsm.h File include/osmocom/msc/mncc_fsm.h: https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc_fsm.h at 8 PS6, Line 8: GPL-2.0+ > osmo-msc in general is AGPLv3+, why is GPLv2+ sggested here? Is there a plan to move this to a share [?] no intention from my side at all, I will put here whatever is appropriate, this is most probably just a copy-paste/ignorance error https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc_fsm.h at 35 PS6, Line 35: enum mncc_fsm_event { > I think this file definitely needs quite a lot more comments. [?] ack, got increasingly impatient towards finishing this patch... I appreciate the review to highlight these places. https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc_fsm.h at 105 PS6, Line 105: struct mncc { > this one unfortunately not. "MNCC" is mobile netowkr call control. [?] came from removing "fsm" from "mncc_fsm" ... it is the FSM instance's "priv pointer struct". Also the underlying intent is to pull the older MNCC implementation in gsm_04_08_cc.c away from the intermingled GSM CC and replace also the non-inter-MSC MNCC handling with this FSM. Then we would have only a single MNCC handler implementation, and this would be *the* definitive MNCC state for each and any call leg. Should I change it? Suggestions? mncc_fsm_priv? mncc_fsm_state? mncc_state? Usually I called things lchan_fsm and struct gsm_lchan, msc_a_fsm and struct msc_a, ran_peer_fsm and struct ran_peer; But I notice now, also I have msc_ho_fsm and msc_ho_state, in this patch. Any preferences? https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc_fsm.h at 125 PS6, Line 125: int parent_event_call_setup_complete; > the name seems to hint a true/false property? it's an event to be dispatched when it is complete, and indeed a negative value indicates that nothing should be dispatched. Event numbers must range 0 <= event < 32. Documented at mncc_alloc(), could also use a comment here. https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/msc_a.h File include/osmocom/msc/msc_a.h: https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/msc_a.h at 75 PS6, Line 75: } ciphering; > neither AKA nor IMEISV retrieval are strictly speaking part of ciphering. Just saying. [?] Once the Classmark Update is finished, this is the state that allows continuing whatever code path triggered the Classmark Request. So far there is only one code path that triggers a Classmark Request: ciphering, but the idea is that other callers could be added later. The MSC is asked by the VLR to do Ciphering. The MSC notices that it doesn't have sufficient Ciphering algo capabilities information. Hence the Ciphering code path of the MSC triggers a Classmark Update. This is state needed for encoding the Ciphering Mode Command message, which the VLR requested when asking for the Ciphering originally. The idea is to not involve the VLR in the Classmark Update, by storing the VLR's request. --> should become a comment https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/msc_a.h at 80 PS6, Line 80: /* struct msc_role_common must remain at start */ > not imporant, but one could have an OSMO_ASSERT on the 'offsetof() == 0' somewhere during program st [?] good idea https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/msc_roles.h File include/osmocom/msc/msc_roles.h: https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/msc_roles.h at 379 PS6, Line 379: struct an_apdu { : /* accessNetworkProtocolId */ : enum osmo_gsup_access_network_protocol an_proto; : /* signalInfo */ : struct msgb *msg; : /* If this AN-APDU is sent between MSCs, additional information from the E-interface messaging, like the : * Handover Number, will placed/available here. Otherwise may be left NULL. */ : const struct osmo_gsup_message *e_info; : }; > as this just adds two 'long' words to 'struct msgb' one could have implemented this in arguably more [?] hmm, indeed, didn't see that... will consider it https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/nas.h File include/osmocom/msc/nas.h: https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/nas.h at 111 PS6, Line 111: struct geran_encr *chosen_encryption; > the comment explains that "0 means no such IE was present". But the member is a pointer. [?] geran_encr consists of the Key and an Algorithm ID. The Key has its own IE, and the Algorithm is only used for when one specific algo has already been chosen. A Handover Request sends separate IEs for - the key - permitted algorithms, composed from the a5_encryption_mask, - actually chosen Algo ("Serving") I guess the new BSS could choose a different ciphering algorithm(?) (but using the same key). In this patch we always send both the "Chosen Encryption Algorithm (Serving)" (which is optional in the specs) and the "Encryption Information" (mandatory), but technically one could want to omit the Algorithm IE(??) -- doesn't really make sense, I agree, but I tried to be least restrictive. https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/call_leg.c File src/libmsc/call_leg.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/call_leg.c at 64 PS6, Line 64: OSMO_ASSERT( osmo_fsm_register(&call_leg_fsm) == 0 ); > I would typically try to move as much as possible (particularly fsm registrations) into automaticall [?] agree. The net is not required for registration; we could even define one global reference to the gsm_network and use it here. This is only "shadowing" the msc_main.c allocated gsm_network struct, to make it more explicit where the gsm_network is coming from == cosmetics only. (gsm_network simply is our global kitchen sink, and this can only be feeble / cute attempts to make it look slightly less like a magic global singleton that everyone accesses chaotically.) https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/e_link.c File src/libmsc/e_link.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/e_link.c at 380 PS6, Line 380: Point a struct msgb's data members directly at the data buffer of gsup_msg->an_apdu. This *is* a hack, and the msgb : * returned is a static struct msgb: it must *not* be freed, put in a queue or kept around after gsup_msg->an_apdu is : * gone. The returned msgb can *not* be passed down a RAN peer's SCCP user SAP. This can be useful to "peek" at the : * included data by passing to a nas_decode implementation in a code path that does not pass any PDU on and wants to : * avoid dynamic allocation. > *really* ugly and easy to abuse/introduce bugs. [?] wha, this is a leftover that is not used. It was a useless premature optimization which didn't work out anyway, because it becomes impossible to transparently send/receive messages via an e-link with this. Should have been dropped, thanks for noticing. https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsm_04_08.c File src/libmsc/gsm_04_08.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsm_04_08.c at 248 PS6, Line 248: int compl_l3_msg_is_r99(const struct msgb *msg) > comment and function name don't seem to agree on what this function is doing indeed, copy paste error https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsm_04_80.c File src/libmsc/gsm_04_80.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsm_04_80.c at 39 PS6, Line 39: subscriber > does msc_a really refference a subscriber? yes; the MSC-A is the role that handles all subscriber management, and could be seen as "the subscriber". The MSC-I/T roles are merely the active/transitional RAN connections. The msub is the combination of MSC-A,-I and -T, which might be distributed across several MSC instances. So it is technically correct to call msc_a the active subscriber. But I also agree that the comment could say "The active subscriber's MSC-A role" https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsup_client_mux.c File src/libmsc/gsup_client_mux.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsup_client_mux.c at 37 PS6, Line 37: LOGP(DLGSUP, LOGL_DEBUG, "No explicit GSUP Message Class, trying to guess from message type %s\n", : osmo_gsup_message_type_name(gsup_msg->message_type)); > as pretty much all existing GSUP messages by any existing program don't have the message_class set, [?] I could understand the comment if it was an Error or Notice, but a Debug is fine, isn't it? https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_ho.c File src/libmsc/msc_ho.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_ho.c at 138 PS6, Line 138: } : : if (success) { > else ? (I think this happened because there was a 'return' above in an earlier version) https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_vty.c File src/libmsc/msc_vty.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_vty.c at 512 PS6, Line 512: DEFUN(cfg_msc_handover_number_range, cfg_msc_handover_number_range_cmd, > MSISDNs typically also have NPI/TON (numbering plan / type of number). [?] My only problem is that we apparently have no precedence of configuring an MSISDN as anything else than just a plain MSISDN ... ? I would invent them without using them ... We could also keep this for a future patch, an I think I already put the 'range' keyword in there to allow easily adding more variants, or modifiers like handover-number ton TON_VAL handover-number npi NPI_VAL handover-number range ... https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/msc_vty.c at 522 PS6, Line 522: FIXME leading zeros?? > Indeded, it probably makes sense not to treat this as unsigned integers but as some kind of "digit p [?] I picked what seemed most trivial to implement, but also: what if you want to assign handover numbers to a range not corresponding to decimal digits? Like handover range 12323 12342 If we enforce always using entire digits, then the above case could only utilize 12330..12339: handover digits 1233x So I thought it would be better to indicate an explicit start and end. But rethinking it now, I agree the 0012345xxx format is better and can even be extended to support partial digits: handover number digits 0012345xxx [ range 123 417 ] where the range is overlayed to replace the 'x' of the digits mask, and if the range is omitted uses 0..MAX. And we don't need to implement the 'range' part yet. I have no really strong opinion. Unsure: doesn't the TON also affect the prefix? e.g. 0049 vs. +49? I'm not familiar with the subject... https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas_iu.c File src/libmsc/nas_iu.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/nas_iu.c at 173 PS6, Line 173: RANAP_IE_t *ranap_ie; > don't we get warnings here? 'ies' is const but the stack variables here not? I think the IEs_t is a const "parent struct" that has pointers to (non-const) dynamic allocations (which is a direct consequence and drawback of using the same structures for encoding and decoding in combination with dynamic allocation). -- To view, visit https://gerrit.osmocom.org/13137 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I27e4988e0371808b512c757d2b52ada1615067bd Gerrit-Change-Number: 13137 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Sun, 14 Apr 2019 17:06:09 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Sun Apr 14 20:05:30 2019 From: admin at opensuse.org (OBS Notification) Date: Sun, 14 Apr 2019 20:05:30 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-netif in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5cb392b0588cb_18d032c5f85878cc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/Debian_9.0/x86_64 Package network:osmocom:nightly/libosmo-netif failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-netif Last lines of build log: [ 159s] autoreconnecting test step 3 [client OK, server OK], FD reg 1 [ 159s] [ 159s] autoreconnecting test step 2 [client OK, server OK], FD reg 0 [ 159s] + [ 159s] +autoreconnecting test step 1 [client OK, server OK], FD reg 0 [ 159s] connection closed with srv [ 159s] [ 159s] -autoreconnecting test step 1 [client OK, server NA], FD reg 0 [ 159s] +autoreconnecting test step 0 [client OK, server NA], FD reg 0 [ 159s] [ 159s] non-reconnecting test step 7 [client NA, server OK], FD reg 1 [ 159s] [ 159s] 1. testsuite.at:4: 1. stream_test (testsuite.at:4): FAILED (testsuite.at:8) [ 159s] debian/rules:27: recipe for target 'override_dh_auto_test' failed [ 159s] make[1]: *** [override_dh_auto_test] Error 1 [ 159s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 159s] debian/rules:13: recipe for target 'build' failed [ 159s] make: *** [build] Error 2 [ 159s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 159s] [ 159s] lamb13 failed "build libosmo-netif_0.4.0.25.e380.dsc" at Sun Apr 14 20:05:23 UTC 2019. [ 159s] [ 159s] ### VM INTERACTION START ### [ 162s] [ 148.348931] sysrq: SysRq : Power Off [ 162s] [ 148.361404] reboot: Power down [ 162s] ### VM INTERACTION END ### [ 162s] [ 162s] lamb13 failed "build libosmo-netif_0.4.0.25.e380.dsc" at Sun Apr 14 20:05:27 UTC 2019. [ 162s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sun Apr 14 22:01:06 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 14 Apr 2019 22:01:06 +0000 Subject: Change in osmo-gsm-tester[master]: powersupply: Add support for Intellinet PDU In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13621 ) Change subject: powersupply: Add support for Intellinet PDU ...................................................................... powersupply: Add support for Intellinet PDU Based on original pdutool code from Joachim Steiger. Change-Id: Iab4f7aec1c50f47da4cd734441bb36fa09d171a3 --- M check_dependencies.py M src/osmo_gsm_tester/powersupply.py A src/osmo_gsm_tester/powersupply_intellinet.py 3 files changed, 103 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/check_dependencies.py b/check_dependencies.py index 83df7a9..28bfdf7 100755 --- a/check_dependencies.py +++ b/check_dependencies.py @@ -26,5 +26,7 @@ import sqlite3 import sispm import smpplib +import urllib.request +import xml.etree.ElementTree print('dependencies ok') diff --git a/src/osmo_gsm_tester/powersupply.py b/src/osmo_gsm_tester/powersupply.py index 86fc010..1cf7106 100644 --- a/src/osmo_gsm_tester/powersupply.py +++ b/src/osmo_gsm_tester/powersupply.py @@ -1,6 +1,6 @@ # osmo_gsm_tester: class defining a Power Supply object # -# Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH +# Copyright (C) 2018-2019 by sysmocom - s.f.m.c. GmbH # # Author: Pau Espin Pedrol # @@ -51,10 +51,11 @@ self.power_set(True) -from . import powersupply_sispm +from . import powersupply_sispm, powersupply_intellinet KNOWN_PWSUPPLY_TYPES = { 'sispm' : powersupply_sispm.PowerSupplySispm, + 'intellinet' : powersupply_intellinet.PowerSupplyIntellinet, } def register_type(name, clazz): diff --git a/src/osmo_gsm_tester/powersupply_intellinet.py b/src/osmo_gsm_tester/powersupply_intellinet.py new file mode 100644 index 0000000..c2bf2c8 --- /dev/null +++ b/src/osmo_gsm_tester/powersupply_intellinet.py @@ -0,0 +1,98 @@ +# osmo_gsm_tester: class defining a Power Supply object +# +# Copyright (C) 2019 by sysmocom - s.f.m.c. GmbH +# +# Author: Pau Espin Pedrol +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import urllib.request +import xml.etree.ElementTree as ET + +from . import log +from .powersupply import PowerSupply + +class PowerSupplyIntellinet(PowerSupply): + """PowerSupply implementation to controll Intellinet devices.""" + + # HTTP request timeout, in seconds + PDU_TIMEOUT = 5 + + PDU_CMD_ON = 0 + PDU_CMD_OFF = 1 + + def _url_prefix(self): + return 'http://' + self.device_ip + + def _url_status(self): + return self._url_prefix() + '/status.xml' + + def _url_set_port_status(self, pdu_cmd): + return self._url_prefix() + "/control_outlet.htm?" + "outlet" + str(self.port - 1) + "=1" + "&op=" + str(pdu_cmd) + "&submit=Anwenden" + + def _port_stat_name(self): + # Names start with idx 0, while in ogt we count sockets starting from 1. + return 'outletStat' + str(self.port - 1) + + def _fetch_status(self): + data = urllib.request.urlopen(self._url_status(), timeout = self.PDU_TIMEOUT).read() + if not data: + raise log.Error('empty status xml') + return data + + def _get_port_status(self): + data = self._fetch_status() + root = ET.fromstring(data) + for child in root: + if child.tag == self._port_stat_name(): + return child.text + raise log.Error('no state for %s' % self._port_stat_name()) + + def _set_port_status(self, pdu_cmd): + urllib.request.urlopen(self._url_set_port_status(pdu_cmd),timeout = self.PDU_TIMEOUT).read() + + +######################## +# PUBLIC - INTERNAL API +######################## + def __init__(self, conf): + super().__init__(conf, 'intellinet') + mydevid = conf.get('device') + if mydevid is None: + raise log.Error('No "device" attribute provided in supply conf!') + self.set_name('intellinet-'+mydevid) + myport = conf.get('port') + if myport is None: + raise log.Error('No "port" attribute provided in power_supply conf!') + if not int(myport): + raise log.Error('Wrong non numeric "port" attribute provided in power_supply conf!') + self.set_name('intellinet-'+mydevid+'-'+myport) + self.device_ip = mydevid + self.port = int(myport) + + def is_powered(self): + """Get whether the device is powered on or off.""" + return self._get_port_status() == 'on' + + def power_set(self, onoff): + """Turn on (onoff=True) or off (onoff=False) the device.""" + if onoff: + self.dbg('switchon') + self._set_port_status(self.PDU_CMD_ON) + else: + self.dbg('switchoff') + self._set_port_status(self.PDU_CMD_OFF) + + +# vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/13621 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iab4f7aec1c50f47da4cd734441bb36fa09d171a3 Gerrit-Change-Number: 13621 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 22:01:14 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 14 Apr 2019 22:01:14 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Remove duplicated check In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13602 ) Change subject: nightly-packages: Remove duplicated check ...................................................................... nightly-packages: Remove duplicated check Change-Id: I9659e71d87b03971673da3bfb2101de9d5fe3c6a --- M scripts/osmocom-nightly-packages.sh 1 file changed, 0 insertions(+), 5 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 7e1cede..052eb09 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -225,11 +225,6 @@ post } -if ! which osc >/dev/null 2>/dev/null ; then - echo "osc binary is not installed" - exit 1 -fi - TMPDIR=$(mktemp -d nightly-3g_XXXXXX) cd "$TMPDIR" build_osmocom -- To view, visit https://gerrit.osmocom.org/13602 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9659e71d87b03971673da3bfb2101de9d5fe3c6a Gerrit-Change-Number: 13602 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 22:01:15 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 14 Apr 2019 22:01:15 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Remove unused variable In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13603 ) Change subject: nightly-packages: Remove unused variable ...................................................................... nightly-packages: Remove unused variable Change-Id: Ic120dbc134cba9bd77098ab14a5dba3d5c4d71b9 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 052eb09..26b8bc9 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -40,7 +40,6 @@ get_commit_version() { # return a version based on the commit local version - local date # determine git version *and generate the .tarball-version file* test -x ./git-version-gen && ./git-version-gen . > .tarball-version 2>/dev/null -- To view, visit https://gerrit.osmocom.org/13603 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic120dbc134cba9bd77098ab14a5dba3d5c4d71b9 Gerrit-Change-Number: 13603 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 22:01:16 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 14 Apr 2019 22:01:16 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Move some code and rename some vars to look similar... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13604 ) Change subject: nightly-packages: Move some code and rename some vars to look similar to latest-packages ...................................................................... nightly-packages: Move some code and rename some vars to look similar to latest-packages Change-Id: I177bb7fb75e293ef665e95363a38c6b4f8e49c13 --- M scripts/osmocom-latest-packages.sh M scripts/osmocom-nightly-packages.sh 2 files changed, 28 insertions(+), 25 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve; Verified Harald Welte: Looks good to me, approved diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh index d647d32..e70dd92 100755 --- a/scripts/osmocom-latest-packages.sh +++ b/scripts/osmocom-latest-packages.sh @@ -18,6 +18,7 @@ exit 1 fi +### OBS build prepare() { # start with a checkout of the project if [ -d $PROJ ]; then diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 26b8bc9..e9cc778 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -1,33 +1,21 @@ #!/bin/bash + # requirements # apt install devscripts git-buildpackage osc git set -e set -x +# OBS project name +PROJ=network:osmocom:nightly + +DT=$(date +%Y%m%d) +TOP=$(pwd)/$(mktemp -d nightly-3g_XXXXXX) + if ! which osc >/dev/null 2>/dev/null ; then echo "osc binary not found" exit 1 fi -DT=$(date +%Y%m%d) -PROJ=network:osmocom:nightly - -### common -checkout() { - local name=$1 - local branch=$2 - local url="https://git.osmocom.org" - - cd "$REPO" - - if [ -n "$branch" ] ; then - git clone "$url/$name" -b "$branch" - else - git clone "$url/$name" - fi - - cd - -} ### OBS build prepare() { @@ -56,6 +44,23 @@ echo -n "$version" } +### common +checkout() { + local name=$1 + local branch=$2 + local url="https://git.osmocom.org" + + cd "$REPO" + + if [ -n "$branch" ] ; then + git clone "$url/$name" -b "$branch" + else + git clone "$url/$name" + fi + + cd - +} + build() { local name=$1 local changelog=$2 @@ -144,12 +149,11 @@ } build_osmocom() { - BASE=$PWD - DATA=$BASE/data - REPO=$BASE/repo + DATA=$TOP/data + REPO=$TOP/repo # rather than including a dangerous 'rm -rf *' here, lets delegate to the user: - if [ -n "$(ls)" ]; then + if [ -n "$(ls $TOP)" ]; then echo "ERROR: I need to run in an empty directory." exit 1 fi @@ -224,6 +228,4 @@ post } -TMPDIR=$(mktemp -d nightly-3g_XXXXXX) -cd "$TMPDIR" build_osmocom -- To view, visit https://gerrit.osmocom.org/13604 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I177bb7fb75e293ef665e95363a38c6b4f8e49c13 Gerrit-Change-Number: 13604 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 22:01:17 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 14 Apr 2019 22:01:17 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Build latest tag of limesuite In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13605 ) Change subject: nightly-packages: Build latest tag of limesuite ...................................................................... nightly-packages: Build latest tag of limesuite Like we actually do already on latest-packages. Change-Id: I5a9e97a7a93c1d2a9983926cd0f5d7255e9666bd --- M scripts/osmocom-nightly-packages.sh 1 file changed, 13 insertions(+), 3 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index e9cc778..9afed1e 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -25,6 +25,17 @@ osc co "$PROJ" } +get_last_tag() { + project="$1" + if [ "$project" = "limesuite" ]; then + ver_regexp="^v[0-9]*.[0-9]*.[0-9]*$" + else + ver_regexp="^[0-9]*.[0-9]*.[0-9]*$" + fi + VER=$(git -C "${REPO}/${project}" tag -l --sort=v:refname | grep "$ver_regexp" | tail -n 1) + echo "${VER}" +} + get_commit_version() { # return a version based on the commit local version @@ -130,10 +141,9 @@ } checkout_limesuite() { - TAG="v18.10.0" - cd "$REPO" git clone https://github.com/myriadrf/LimeSuite limesuite + TAG="$(get_last_tag limesuite)" cd limesuite git checkout "$TAG" } @@ -192,7 +202,7 @@ create_osmo_trx_debian8_jessie - build limesuite no_commit --git-upstream-tree=v18.10.0 + build limesuite no_commit --git-upstream-tree="$(get_last_tag limesuite)" build libosmocore build libosmo-sccp build libosmo-abis -- To view, visit https://gerrit.osmocom.org/13605 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5a9e97a7a93c1d2a9983926cd0f5d7255e9666bd Gerrit-Change-Number: 13605 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 22:39:59 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 14 Apr 2019 22:39:59 +0000 Subject: Change in osmo-msc[master]: Introduce initial unit test for db_sms_* API In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13629 ) Change subject: Introduce initial unit test for db_sms_* API ...................................................................... Patch Set 1: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/13629/1/tests/db_sms/Makefile.am File tests/db_sms/Makefile.am: https://gerrit.osmocom.org/#/c/13629/1/tests/db_sms/Makefile.am at 47 PS1, Line 47: -lrt \ why is -lrt needed? https://gerrit.osmocom.org/#/c/13629/1/tests/db_sms/db_sms_test.c File tests/db_sms/db_sms_test.c: https://gerrit.osmocom.org/#/c/13629/1/tests/db_sms/db_sms_test.c at 278 PS1, Line 278: struct sms_test *test = sms_test_set + i; Use sms_test_set[i] -- To view, visit https://gerrit.osmocom.org/13629 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id94ad35b6f78f839137db2e17010fbf9b40111a3 Gerrit-Change-Number: 13629 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sun, 14 Apr 2019 22:39:59 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 14 22:41:51 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 14 Apr 2019 22:41:51 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: fix storing SMS with empty TP-User-Data In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13630 ) Change subject: libmsc/db.c: fix storing SMS with empty TP-User-Data ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13630 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If0b2bb557118c5f0e520a2e6c2816336f6028661 Gerrit-Change-Number: 13630 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sun, 14 Apr 2019 22:41:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 06:46:21 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 15 Apr 2019 06:46:21 +0000 Subject: Change in osmo-ci[master]: jobs: use "cmd: |", not "# keep first line ..." Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13634 Change subject: jobs: use "cmd: |", not "# keep first line ..." ...................................................................... jobs: use "cmd: |", not "# keep first line ..." Adjust README.adoc to mention "cmd: |" instead of the workaround and replace this: cmd: > # keep first line with less indent to preserve newlines docker run ... With that: cmd: | docker run ... Change-Id: I65a06acb76e5d693aa187f9ac38970b73e7fead6 --- M jobs/README.adoc M jobs/gerrit-verifications.yml M jobs/master-builds.yml 3 files changed, 23 insertions(+), 41 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/34/13634/1 diff --git a/jobs/README.adoc b/jobs/README.adoc index 1d4d405..bea1d9f 100644 --- a/jobs/README.adoc +++ b/jobs/README.adoc @@ -58,17 +58,14 @@ - newlines: -The build commands may be multiline, but especially in the -gerrit-verifications.yml, where the commands are first stored in 'cmd' and -later inserted in a 'shell' section, the newlines between individual shell -lines don't all survive. Interestingly enough, only a line that has more -indenting than the first line also receives an actual newline in the resulting -jenkins Execute Shell section; take a look at the job's config page on jenkins. -Hence we often have a '# keep first line with less indent' comment. Note that -issuing backslashes to span a shell command across several lines will break the -command if the newlines are not preserved, so we need a '# keep...' comment -where there are more than one shell command, and where there are backslashes -'\' to join multiple lines. +Use 'key: |' to keep new lines in multiline values, e.g.: + - shell: | + echo hello + echo world + +See also: +* https://yaml-multiline.info/ +* https://stackoverflow.com/a/21699210 - jobs named on cmdline are not updated: diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 6128dc5..b2cc1dd 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -30,8 +30,7 @@ - cellmgr-ng: concurrent: true - cmd: > - # keep first line with less indent to preserve newlines + cmd: | docker run --rm=true \ -e HOME=/build \ -e MAKE=make \ @@ -66,8 +65,7 @@ a3_name: IU a3: !!python/tuple [--disable-iu] concurrent: true - cmd: > - # keep first line with less indent to preserve newlines + cmd: | ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" mkdir -p "$ARTIFACT_STORE" docker run --rm=true \ @@ -95,8 +93,7 @@ - osmo-bsc: concurrent: true - cmd: > - # keep first line with less indent to preserve newlines + cmd: | docker run --rm=true \ -e HOME=/build \ -e MAKE=make \ @@ -147,8 +144,7 @@ - osmo-mgw: concurrent: true - cmd: > - # keep first line with less indent to preserve newlines + cmd: | docker run --rm=true \ -e HOME=/build \ -e MAKE=make \ @@ -169,8 +165,7 @@ combination_filter: > (IU == "--enable-iu" && WITH_MANUALS == "0") || (IU == "--disable-iu" && WITH_MANUALS == "1") - cmd: > - # keep first line with less indent to preserve newlines + cmd: | ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" mkdir -p "$ARTIFACT_STORE" docker run --rm=true -i \ @@ -221,8 +216,7 @@ combination_filter: > (IU == "--enable-iu" && WITH_MANUALS == "0") || (IU == "--disable-iu" && WITH_MANUALS == "1") - cmd: > - # keep first line with less indent to preserve newlines + cmd: | docker run --rm=true \ -e HOME=/build \ -e MAKE=make \ @@ -265,8 +259,7 @@ - osmo-ttcn3-hacks: repos_url: 'https://gerrit.osmocom.org/{repos}' slave_axis: !!python/tuple [ttcn3] - cmd: > - # keep first line with less indent to preserve newlines + cmd: | set -e make deps; make clean; make compile diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 3bac7b6..373e975 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -50,8 +50,7 @@ master-libosmo-netif, master-osmo-bts - libosmo-dsp: - cmd: > - # keep first line with less indent to preserve newlines + cmd: | autoreconf --install --force ./configure $MAKE $PARALLEL_MAKE @@ -144,8 +143,7 @@ a3_name: IU a3: !!python/tuple [--disable-iu] concurrent: true - cmd: > - # keep first line with less indent to preserve newlines + cmd: | ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" mkdir -p "$ARTIFACT_STORE" docker run --rm=true \ @@ -170,8 +168,7 @@ - osmo-bsc: concurrent: true - cmd: > - # keep first line with less indent to preserve newlines + cmd: | docker run --rm=true \ -e HOME=/build \ -e MAKE=make \ @@ -220,8 +217,7 @@ - osmo-gsm-manuals: node: 'osmocom-master-debian9' - cmd: > - # keep first line with less indent to preserve newlines + cmd: | ./contrib/jenkins.sh - osmo-gsm-tester: @@ -241,8 +237,7 @@ - osmo-mgw: concurrent: true - cmd: > - # keep first line with less indent to preserve newlines + cmd: | docker run --rm=true \ -e HOME=/build \ -e MAKE=make \ @@ -266,8 +261,7 @@ combination_filter: > (IU == "--enable-iu" && WITH_MANUALS == "0") || (IU == "--disable-iu" && WITH_MANUALS == "1") - cmd: > - # keep first line with less indent to preserve newlines + cmd: | ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" mkdir -p "$ARTIFACT_STORE" docker run --rm=true -i \ @@ -321,8 +315,7 @@ combination_filter: > (IU == "--enable-iu" && WITH_MANUALS == "0") || (IU == "--disable-iu" && WITH_MANUALS == "1") - cmd: > - # keep first line with less indent to preserve newlines + cmd: | docker run --rm=true \ -e HOME=/build \ -e MAKE=make \ @@ -363,8 +356,7 @@ - osmo-remsim - osmo-asf4-dfu - simtrace2: - cmd: > - # keep first line with less indent to preserve newlines + cmd: | ./contrib/jenkins.sh --publish email: gerrit-log at lists.osmocom.org laforge at gnumonks.org kredon at sysmocom.de -- To view, visit https://gerrit.osmocom.org/13634 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I65a06acb76e5d693aa187f9ac38970b73e7fead6 Gerrit-Change-Number: 13634 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 06:48:13 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 15 Apr 2019 06:48:13 +0000 Subject: Change in osmo-ci[master]: jobs: use "cmd: |", not "# keep first line ..." In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13634 ) Change subject: jobs: use "cmd: |", not "# keep first line ..." ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13634 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I65a06acb76e5d693aa187f9ac38970b73e7fead6 Gerrit-Change-Number: 13634 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 15 Apr 2019 06:48:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 06:51:55 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 15 Apr 2019 06:51:55 +0000 Subject: Change in osmo-ci[master]: OBS: build osmo-gsm-manuals-dev in nightly In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13600 ) Change subject: OBS: build osmo-gsm-manuals-dev in nightly ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13600 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ideeae4f7846fa5626fe2c1f5a77e07a3c6e626fe Gerrit-Change-Number: 13600 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 15 Apr 2019 06:51:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 06:54:18 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 15 Apr 2019 06:54:18 +0000 Subject: Change in osmo-ci[master]: OBS: build osmo-gsm-manuals-dev in nightly In-Reply-To: References: Message-ID: Hello Harald Welte, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13600 to look at the new patch set (#3). Change subject: OBS: build osmo-gsm-manuals-dev in nightly ...................................................................... OBS: build osmo-gsm-manuals-dev in nightly Enable in osmo-nightly-packages.sh, and add as coment in osmocom-nightly-packages.sh for now (needs a tagged release first). Related: OS#3899 Depends: I7edb5093e5b58eb3b0f7af2376476db4026db735 (osmo-gsm-manuals.git) Change-Id: Ideeae4f7846fa5626fe2c1f5a77e07a3c6e626fe --- M scripts/osmocom-latest-packages.sh M scripts/osmocom-nightly-packages.sh 2 files changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/00/13600/3 -- To view, visit https://gerrit.osmocom.org/13600 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ideeae4f7846fa5626fe2c1f5a77e07a3c6e626fe Gerrit-Change-Number: 13600 Gerrit-PatchSet: 3 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 06:55:17 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 15 Apr 2019 06:55:17 +0000 Subject: Change in osmo-ci[master]: OBS: build osmo-gsm-manuals-dev in nightly In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13600 ) Change subject: OBS: build osmo-gsm-manuals-dev in nightly ...................................................................... Patch Set 3: Verified+1 Code-Review+2 Patchset #3 is rebased on master to resolve the merge conflict. -- To view, visit https://gerrit.osmocom.org/13600 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ideeae4f7846fa5626fe2c1f5a77e07a3c6e626fe Gerrit-Change-Number: 13600 Gerrit-PatchSet: 3 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 15 Apr 2019 06:55:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 06:55:39 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 15 Apr 2019 06:55:39 +0000 Subject: Change in osmo-ci[master]: OBS: build osmo-gsm-manuals-dev in nightly In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13600 ) Change subject: OBS: build osmo-gsm-manuals-dev in nightly ...................................................................... OBS: build osmo-gsm-manuals-dev in nightly Enable in osmo-nightly-packages.sh, and add as coment in osmocom-nightly-packages.sh for now (needs a tagged release first). Related: OS#3899 Depends: I7edb5093e5b58eb3b0f7af2376476db4026db735 (osmo-gsm-manuals.git) Change-Id: Ideeae4f7846fa5626fe2c1f5a77e07a3c6e626fe --- M scripts/osmocom-latest-packages.sh M scripts/osmocom-nightly-packages.sh 2 files changed, 4 insertions(+), 1 deletion(-) Approvals: osmith: Looks good to me, approved; Verified diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh index e70dd92..05efb90 100755 --- a/scripts/osmocom-latest-packages.sh +++ b/scripts/osmocom-latest-packages.sh @@ -99,9 +99,10 @@ cd "$TOP" } -# add those two once they have tagged any versions that include the 'debian' sub-dir: +# add those once they have tagged any versions that include the 'debian' sub-dir: #rtl-sdr #osmo-fl2k +#osmo-gsm-manuals build_osmocom() { prepare diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 9afed1e..61cb250 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -171,6 +171,7 @@ prepare checkout_limesuite + checkout osmo-gsm-manuals checkout libosmocore checkout libosmo-sccp checkout libosmo-abis @@ -203,6 +204,7 @@ create_osmo_trx_debian8_jessie build limesuite no_commit --git-upstream-tree="$(get_last_tag limesuite)" + build osmo-gsm-manuals build libosmocore build libosmo-sccp build libosmo-abis -- To view, visit https://gerrit.osmocom.org/13600 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ideeae4f7846fa5626fe2c1f5a77e07a3c6e626fe Gerrit-Change-Number: 13600 Gerrit-PatchSet: 3 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 07:41:54 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 15 Apr 2019 07:41:54 +0000 Subject: =?UTF-8?Q?Change_in_osmo-gsm-manuals=5Bosmith/release=5D=3A_Bump_version=3A_0=2E0=2E0_=E2=86=92_0=2E1=2E0?= Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13635 Change subject: Bump version: 0.0.0 ? 0.1.0 ...................................................................... Bump version: 0.0.0 ? 0.1.0 Change-Id: Ied515c46f7de5fb0224ac5b3d16ee2709d614202 --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/35/13635/1 diff --git a/debian/changelog b/debian/changelog index 975644a..33251f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-gsm-manuals-dev (0.1.0) unstable; urgency=medium + + * Proper release number, which will also get tagged. + + -- Oliver Smith Mon, 15 Apr 2019 09:39:51 +0200 + osmo-gsm-manuals-dev (0.0.0) unstable; urgency=medium * Initial Release. -- To view, visit https://gerrit.osmocom.org/13635 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: osmith/release Gerrit-MessageType: newchange Gerrit-Change-Id: Ied515c46f7de5fb0224ac5b3d16ee2709d614202 Gerrit-Change-Number: 13635 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 08:20:20 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 15 Apr 2019 08:20:20 +0000 Subject: Change in osmo-hlr[master]: GSUP routing: use Message Class IE In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13588 ) Change subject: GSUP routing: use Message Class IE ...................................................................... Patch Set 2: Change looks good, but as Vadim commented in [1], it would be nice to unify all the GSUP forwarding log messages. I have done it in patchset 12 and upwards of [2]. Would you like me to rebase this patch and make it use that unified log macro? [1]: https://gerrit.osmocom.org/#/c/osmo-hlr/+/13006/8/src/hlr.c at 478 [2]: https://gerrit.osmocom.org/#/c/osmo-hlr/+/13006/ -- To view, visit https://gerrit.osmocom.org/13588 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8dc3967d9372d63e9d57ca2608dd3316edb234a4 Gerrit-Change-Number: 13588 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy Gerrit-CC: osmith Gerrit-Comment-Date: Mon, 15 Apr 2019 08:20:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 08:22:43 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 08:22:43 +0000 Subject: Change in osmo-ci[master]: jobs: use "cmd: |", not "# keep first line ..." In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13634 ) Change subject: jobs: use "cmd: |", not "# keep first line ..." ...................................................................... Patch Set 1: I see no reference in the links your provided about "first line must have less indentation" that is announced in our README.adoc. So it could be it is some jenkins-job-builder limitation. Did you you check/test job config is generated properly with your change? -- To view, visit https://gerrit.osmocom.org/13634 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I65a06acb76e5d693aa187f9ac38970b73e7fead6 Gerrit-Change-Number: 13634 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 15 Apr 2019 08:22:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 08:23:43 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 08:23:43 +0000 Subject: =?UTF-8?Q?Change_in_osmo-gsm-manuals=5Bosmith/release=5D=3A_Bump_version=3A_0=2E0=2E0_=E2=86=92_0=2E1=2E0?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13635 ) Change subject: Bump version: 0.0.0 ? 0.1.0 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13635 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: osmith/release Gerrit-MessageType: comment Gerrit-Change-Id: Ied515c46f7de5fb0224ac5b3d16ee2709d614202 Gerrit-Change-Number: 13635 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 15 Apr 2019 08:23:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 08:27:18 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 15 Apr 2019 08:27:18 +0000 Subject: =?UTF-8?Q?Change_in_osmo-gsm-manuals=5Bosmith/release=5D=3A_Bump_version=3A_0=2E0=2E0_=E2=86=92_0=2E1=2E0?= In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13635 ) Change subject: Bump version: 0.0.0 ? 0.1.0 ...................................................................... Bump version: 0.0.0 ? 0.1.0 Change-Id: Ied515c46f7de5fb0224ac5b3d16ee2709d614202 --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/debian/changelog b/debian/changelog index 975644a..33251f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-gsm-manuals-dev (0.1.0) unstable; urgency=medium + + * Proper release number, which will also get tagged. + + -- Oliver Smith Mon, 15 Apr 2019 09:39:51 +0200 + osmo-gsm-manuals-dev (0.0.0) unstable; urgency=medium * Initial Release. -- To view, visit https://gerrit.osmocom.org/13635 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: osmith/release Gerrit-MessageType: merged Gerrit-Change-Id: Ied515c46f7de5fb0224ac5b3d16ee2709d614202 Gerrit-Change-Number: 13635 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 08:29:04 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 15 Apr 2019 08:29:04 +0000 Subject: Change in osmo-ci[master]: jobs: use "cmd: |", not "# keep first line ..." In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13634 ) Change subject: jobs: use "cmd: |", not "# keep first line ..." ...................................................................... Patch Set 1: > Did you you check/test job config is generated properly with your change? Yes, for both jobs. And for good measure I've also build master-osmo-mgw with this change, and it builds just fine. -- To view, visit https://gerrit.osmocom.org/13634 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I65a06acb76e5d693aa187f9ac38970b73e7fead6 Gerrit-Change-Number: 13634 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 15 Apr 2019 08:29:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 08:31:41 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 08:31:41 +0000 Subject: Change in osmo-ci[master]: jobs: use "cmd: |", not "# keep first line ..." In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13634 ) Change subject: jobs: use "cmd: |", not "# keep first line ..." ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13634 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I65a06acb76e5d693aa187f9ac38970b73e7fead6 Gerrit-Change-Number: 13634 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 15 Apr 2019 08:31:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 08:43:09 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 15 Apr 2019 08:43:09 +0000 Subject: =?UTF-8?Q?Change_in_osmo-gsm-manuals=5Bmaster=5D=3A_Bump_version=3A_0=2E0=2E0_=E2=86=92_0=2E1=2E0?= Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13636 Change subject: Bump version: 0.0.0 ? 0.1.0 ...................................................................... Bump version: 0.0.0 ? 0.1.0 Change-Id: Ied515c46f7de5fb0224ac5b3d16ee2709d614202 --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/36/13636/1 diff --git a/debian/changelog b/debian/changelog index 975644a..33251f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-gsm-manuals-dev (0.1.0) unstable; urgency=medium + + * Proper release number, which will also get tagged. + + -- Oliver Smith Mon, 15 Apr 2019 09:39:51 +0200 + osmo-gsm-manuals-dev (0.0.0) unstable; urgency=medium * Initial Release. -- To view, visit https://gerrit.osmocom.org/13636 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ied515c46f7de5fb0224ac5b3d16ee2709d614202 Gerrit-Change-Number: 13636 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 08:43:44 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 08:43:44 +0000 Subject: =?UTF-8?Q?Change_in_osmo-gsm-manuals=5Bmaster=5D=3A_Bump_version=3A_0=2E0=2E0_=E2=86=92_0=2E1=2E0?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13636 ) Change subject: Bump version: 0.0.0 ? 0.1.0 ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13636 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ied515c46f7de5fb0224ac5b3d16ee2709d614202 Gerrit-Change-Number: 13636 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 15 Apr 2019 08:43:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 08:43:45 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 08:43:45 +0000 Subject: =?UTF-8?Q?Change_in_osmo-gsm-manuals=5Bmaster=5D=3A_Bump_version=3A_0=2E0=2E0_=E2=86=92_0=2E1=2E0?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13636 ) Change subject: Bump version: 0.0.0 ? 0.1.0 ...................................................................... Bump version: 0.0.0 ? 0.1.0 Change-Id: Ied515c46f7de5fb0224ac5b3d16ee2709d614202 --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved; Verified diff --git a/debian/changelog b/debian/changelog index 975644a..33251f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +osmo-gsm-manuals-dev (0.1.0) unstable; urgency=medium + + * Proper release number, which will also get tagged. + + -- Oliver Smith Mon, 15 Apr 2019 09:39:51 +0200 + osmo-gsm-manuals-dev (0.0.0) unstable; urgency=medium * Initial Release. -- To view, visit https://gerrit.osmocom.org/13636 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ied515c46f7de5fb0224ac5b3d16ee2709d614202 Gerrit-Change-Number: 13636 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 09:00:53 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 09:00:53 +0000 Subject: Change in osmo-msc[master]: large refactoring: support inter-BSC and inter-MSC Handover In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13137 ) Change subject: large refactoring: support inter-BSC and inter-MSC Handover ...................................................................... Patch Set 6: (1 comment) https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsm_04_11.c File src/libmsc/gsm_04_11.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsm_04_11.c at 472 PS6, Line 472: return GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; This return looks like memleaking allocated gsms=sms_alloc() in line 467. Move it before line 467. -- To view, visit https://gerrit.osmocom.org/13137 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I27e4988e0371808b512c757d2b52ada1615067bd Gerrit-Change-Number: 13137 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 15 Apr 2019 09:00:53 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 09:09:45 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Mon, 15 Apr 2019 09:09:45 +0000 Subject: Change in libosmo-sccp[master]: add caller-owns-msgb variant osmo_sccp_user_sap_down_nofree() In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13277 ) Change subject: add caller-owns-msgb variant osmo_sccp_user_sap_down_nofree() ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13277 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic818efa78b90f727e1a94c18b60d9a306644f340 Gerrit-Change-Number: 13277 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Harald Welte Gerrit-Comment-Date: Mon, 15 Apr 2019 09:09:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 10:00:18 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 15 Apr 2019 10:00:18 +0000 Subject: Change in osmo-msc[master]: large refactoring: support inter-BSC and inter-MSC Handover In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13137 ) Change subject: large refactoring: support inter-BSC and inter-MSC Handover ...................................................................... Patch Set 6: (1 comment) https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsm_04_11.c File src/libmsc/gsm_04_11.c: https://gerrit.osmocom.org/#/c/13137/6/src/libmsc/gsm_04_11.c at 472 PS6, Line 472: return GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; > This return looks like memleaking allocated gsms=sms_alloc() in line 467. [?] Definitely, ACK. -- To view, visit https://gerrit.osmocom.org/13137 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I27e4988e0371808b512c757d2b52ada1615067bd Gerrit-Change-Number: 13137 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 15 Apr 2019 10:00:18 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 10:29:49 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 10:29:49 +0000 Subject: Change in osmo-msc[master]: smpp: Fix SMS-receiver put assertion Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13637 Change subject: smpp: Fix SMS-receiver put assertion ...................................................................... smpp: Fix SMS-receiver put assertion Catched by osmo-gsm-tester smpp/esme_ms_sms_transaction.py In sms_free(), if sms->receiver is set, then VSUB_USE_SMS_RECEIVER is put. However, If sms comes from SMPP (ESME), dest was being referenced in smpp_openbsc.c:submit_to_sms by means of VSUB_USE_SMPP. As a result, during sms_free(), following assertion was triggered: DREF gsm_04_11.c:74 VLR subscr IMSI-901700000015252:MSISDN-7846:TMSI-0x2A74BA76 - SMS-receiver: now used by 3 (attached,SMPP,SMS,conn,-1*SMS-receiver) Assert failed _osmo_use_count_get_put(&(sms->receiver)->use_count, "SMS-receiver", -1, "gsm_04_11.c", 74) == 0 gsm_04_11.c:74 Solve it by dropping reference to VSUB_USE_SMPP and referencing VSUB_USE_SMS_RECEIVER once we are done using dest in SMPP code and store it in sms->receiver. Fixes: 7c5346cd7005ad469702a2f74572b79de738fbbb ("vlr_subscr: use osmo_use_count") Change-Id: Ida8628c3c0569a2e3bd66c591d57eb93bf1fab14 --- M src/libmsc/smpp_openbsc.c 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/37/13637/1 diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 01c39f9..25d649b 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -151,7 +151,6 @@ sms->msg_ref = msg_ref; /* fill in the destination address */ - sms->receiver = dest; sms->dst.ton = submit->dest_addr_ton; sms->dst.npi = submit->dest_addr_npi; if (dest) @@ -159,6 +158,11 @@ else OSMO_STRLCPY_ARRAY(sms->dst.addr, (const char *)submit->destination_addr); + if (dest) { + sms->receiver = dest; + vlr_subscr_get(sms->receiver, VSUB_USE_SMS_RECEIVER); + vlr_subscr_put(dest, VSUB_USE_SMPP); + } /* fill in the source address */ sms->src.ton = submit->source_addr_ton; -- To view, visit https://gerrit.osmocom.org/13637 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ida8628c3c0569a2e3bd66c591d57eb93bf1fab14 Gerrit-Change-Number: 13637 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 10:50:57 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 10:50:57 +0000 Subject: Change in osmo-msc[master]: gsm_04_11: Log MT sms dst subscriber In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13555 to look at the new patch set (#4). Change subject: gsm_04_11: Log MT sms dst subscriber ...................................................................... gsm_04_11: Log MT sms dst subscriber Change-Id: I483ac61067f51d03f6f476821d8664da3d1f17b2 --- M src/libmsc/gsm_04_11.c M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_umts_authen.err 7 files changed, 20 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/55/13555/4 -- To view, visit https://gerrit.osmocom.org/13555 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I483ac61067f51d03f6f476821d8664da3d1f17b2 Gerrit-Change-Number: 13555 Gerrit-PatchSet: 4 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 11:31:31 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 15 Apr 2019 11:31:31 +0000 Subject: Change in osmo-msc[master]: smpp: Fix SMS-receiver put assertion In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13637 ) Change subject: smpp: Fix SMS-receiver put assertion ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13637 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida8628c3c0569a2e3bd66c591d57eb93bf1fab14 Gerrit-Change-Number: 13637 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 15 Apr 2019 11:31:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 11:34:56 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 15 Apr 2019 11:34:56 +0000 Subject: Change in osmo-msc[master]: gsm_04_11: Log MT sms dst subscriber In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13555 ) Change subject: gsm_04_11: Log MT sms dst subscriber ...................................................................... Patch Set 4: AFAICS, it conflicts with the bomb patch by Neels... Maybe rather rebase and push on top of it? -- To view, visit https://gerrit.osmocom.org/13555 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I483ac61067f51d03f6f476821d8664da3d1f17b2 Gerrit-Change-Number: 13555 Gerrit-PatchSet: 4 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 15 Apr 2019 11:34:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 11:49:56 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Apr 2019 11:49:56 +0000 Subject: Change in osmo-msc[master]: smpp: fix vlr_subscr use count bugs Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13638 Change subject: smpp: fix vlr_subscr use count bugs ...................................................................... smpp: fix vlr_subscr use count bugs In smpp_openbsc.c submit_to_sms(), "get" the appropriate use count upon assigning sms->receiver, fixing a -1 use count upon sms_free(). Also, avoid a "put" of a NULL subscriber in the same function. Related: OS#3930 Change-Id: Idaf01cd3cfa08088ce0d543d0576db957dc94262 --- M src/libmsc/smpp_openbsc.c 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/38/13638/1 diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 01c39f9..151c788 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -139,7 +139,8 @@ } else { LOGP(DLSMS, LOGL_ERROR, "SMPP neither message payload nor valid sm_length.\n"); - vlr_subscr_put(dest, VSUB_USE_SMPP); + if (dest) + vlr_subscr_put(dest, VSUB_USE_SMPP); return ESME_RINVPARLEN; } } @@ -152,6 +153,12 @@ /* fill in the destination address */ sms->receiver = dest; + if (dest) { + /* Replace use count from above subscr_by_dst (VSUB_USE_SMPP) by the sms->receiver use count + * (VSUB_USE_SMS_RECEIVER) */ + vlr_subscr_get(sms->receiver, VSUB_USE_SMS_RECEIVER); + vlr_subscr_put(dest, VSUB_USE_SMPP); + } sms->dst.ton = submit->dest_addr_ton; sms->dst.npi = submit->dest_addr_npi; if (dest) -- To view, visit https://gerrit.osmocom.org/13638 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Idaf01cd3cfa08088ce0d543d0576db957dc94262 Gerrit-Change-Number: 13638 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 11:51:30 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Apr 2019 11:51:30 +0000 Subject: Change in osmo-msc[master]: smpp: fix vlr_subscr use count bugs In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13638 ) Change subject: smpp: fix vlr_subscr use count bugs ...................................................................... Patch Set 1: Code-Review+2 master-fix +2 -- To view, visit https://gerrit.osmocom.org/13638 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idaf01cd3cfa08088ce0d543d0576db957dc94262 Gerrit-Change-Number: 13638 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 15 Apr 2019 11:51:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 11:57:07 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 15 Apr 2019 11:57:07 +0000 Subject: Change in osmo-msc[master]: smpp: fix vlr_subscr use count bugs In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/13638 ) Change subject: smpp: fix vlr_subscr use count bugs ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13638 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idaf01cd3cfa08088ce0d543d0576db957dc94262 Gerrit-Change-Number: 13638 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 15 Apr 2019 11:57:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 11:57:36 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 15 Apr 2019 11:57:36 +0000 Subject: Change in osmo-bts[master]: oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging() In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/13275 ) Change subject: oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging() ...................................................................... oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging() The function osmo_init_logging() is deprecated, lets use osmo_init_logging2() as suggested. Change-Id: Iebc80cd1f77f10a879d4536d788377f522dd853f --- M src/osmo-bts-oc2g/misc/oc2gbts_mgr.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/osmo-bts-oc2g/misc/oc2gbts_mgr.c b/src/osmo-bts-oc2g/misc/oc2gbts_mgr.c index 46831f6..99d2b56 100644 --- a/src/osmo-bts-oc2g/misc/oc2gbts_mgr.c +++ b/src/osmo-bts-oc2g/misc/oc2gbts_mgr.c @@ -261,9 +261,9 @@ .num_cat = ARRAY_SIZE(mgr_log_info_cat), }; -static int mgr_log_init(void) +static int mgr_log_init(void *ctx) { - osmo_init_logging(&mgr_log_info); + osmo_init_logging2(ctx, &mgr_log_info); return 0; } @@ -276,7 +276,7 @@ tall_msgb_ctx = talloc_named_const(tall_mgr_ctx, 1, "msgb"); msgb_talloc_ctx_init(tall_msgb_ctx, 0); - mgr_log_init(); + mgr_log_init(tall_mgr_ctx); osmo_init_ignore_signals(); signal(SIGINT, &signal_handler); -- To view, visit https://gerrit.osmocom.org/13275 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iebc80cd1f77f10a879d4536d788377f522dd853f Gerrit-Change-Number: 13275 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 11:57:40 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Apr 2019 11:57:40 +0000 Subject: Change in osmo-msc[master]: smpp: fix vlr_subscr use count bugs In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13638 ) Change subject: smpp: fix vlr_subscr use count bugs ...................................................................... smpp: fix vlr_subscr use count bugs In smpp_openbsc.c submit_to_sms(), "get" the appropriate use count upon assigning sms->receiver, fixing a -1 use count upon sms_free(). Also, avoid a "put" of a NULL subscriber in the same function. Related: OS#3930 Change-Id: Idaf01cd3cfa08088ce0d543d0576db957dc94262 --- M src/libmsc/smpp_openbsc.c 1 file changed, 8 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved dexter: Verified Jenkins Builder: Verified diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 01c39f9..151c788 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -139,7 +139,8 @@ } else { LOGP(DLSMS, LOGL_ERROR, "SMPP neither message payload nor valid sm_length.\n"); - vlr_subscr_put(dest, VSUB_USE_SMPP); + if (dest) + vlr_subscr_put(dest, VSUB_USE_SMPP); return ESME_RINVPARLEN; } } @@ -152,6 +153,12 @@ /* fill in the destination address */ sms->receiver = dest; + if (dest) { + /* Replace use count from above subscr_by_dst (VSUB_USE_SMPP) by the sms->receiver use count + * (VSUB_USE_SMS_RECEIVER) */ + vlr_subscr_get(sms->receiver, VSUB_USE_SMS_RECEIVER); + vlr_subscr_put(dest, VSUB_USE_SMPP); + } sms->dst.ton = submit->dest_addr_ton; sms->dst.npi = submit->dest_addr_npi; if (dest) -- To view, visit https://gerrit.osmocom.org/13638 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Idaf01cd3cfa08088ce0d543d0576db957dc94262 Gerrit-Change-Number: 13638 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 12:02:56 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 15 Apr 2019 12:02:56 +0000 Subject: Change in osmo-msc[master]: configure.ac: drop useless SQLite3 dependency Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13639 Change subject: configure.ac: drop useless SQLite3 dependency ...................................................................... configure.ac: drop useless SQLite3 dependency We don't use SQLite3 directly, we use libdbi and libdbdsqlite3. Change-Id: Ibf4eb53e60a2957eca99a2c8e613f75a8c43ac89 --- M configure.ac M src/utils/Makefile.am 2 files changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/39/13639/1 diff --git a/configure.ac b/configure.ac index f8787cf..4cfb774 100644 --- a/configure.ac +++ b/configure.ac @@ -112,11 +112,6 @@ AC_HEADER_STDC AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed)) -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/src/utils/Makefile.am b/src/utils/Makefile.am index 2d67102..cb0faf6 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -10,7 +10,6 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(COVERAGE_CFLAGS) \ - $(SQLITE3_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/13639 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf4eb53e60a2957eca99a2c8e613f75a8c43ac89 Gerrit-Change-Number: 13639 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 12:02:56 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 15 Apr 2019 12:02:56 +0000 Subject: Change in osmo-msc[master]: configure.ac: properly check for libdbi SQLite3 driver Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13640 Change subject: configure.ac: properly check for libdbi SQLite3 driver ...................................................................... configure.ac: properly check for libdbi SQLite3 driver Since we use SQLite3 driver of libdbi, we need to make sure that it is installed and available. Checking just for libdbi in not enough. For more details, please see: http://libdbi.sourceforge.net/docs/programmers-guide/addtoproject.html Change-Id: I7f7c719d41d9be28527e4ac3a8b2869c87337074 --- M configure.ac 1 file changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/40/13640/1 diff --git a/configure.ac b/configure.ac index 4cfb774..693044d 100644 --- a/configure.ac +++ b/configure.ac @@ -110,8 +110,21 @@ dnl checks for header files AC_HEADER_STDC + +dnl Check for the libdbi library +AC_CHECK_LIB(dbi,dbi_initialize) AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed)) +dnl To check for the availability and function of a particular +dnl driver, we need a runtime check (since the driver is loaded +dnl dynamically). By default, we use the SQLite3 driver. +AC_MSG_CHECKING([for libdbi SQLite3 driver (libdbd-sqlite3)]) +AC_RUN_IFELSE( + [AC_LANG_PROGRAM(, + [[dbi_initialize(0); return(dbi_conn_new("sqlite3") ? 0 : 1);]])], + [AC_MSG_RESULT([yes])], + [AC_MSG_FAILURE([SQLite3 driver is not installed])]) + dnl Checks for typedefs, structures and compiler characteristics -- To view, visit https://gerrit.osmocom.org/13640 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7f7c719d41d9be28527e4ac3a8b2869c87337074 Gerrit-Change-Number: 13640 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 12:12:49 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 12:12:49 +0000 Subject: Change in osmo-msc[master]: smpp: fix vlr_subscr use count bugs In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13638 ) Change subject: smpp: fix vlr_subscr use count bugs ...................................................................... Patch Set 1: Well, I already submitted same patch here: https://gerrit.osmocom.org/#/c/osmo-msc/+/13637/ -- To view, visit https://gerrit.osmocom.org/13638 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idaf01cd3cfa08088ce0d543d0576db957dc94262 Gerrit-Change-Number: 13638 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 15 Apr 2019 12:12:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 13:25:16 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 13:25:16 +0000 Subject: Change in osmo-msc[master]: smpp: Fix SMS-receiver put assertion In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13637 ) Change subject: smpp: Fix SMS-receiver put assertion ...................................................................... Patch Set 1: Patch https://gerrit.osmocom.org/#/c/osmo-msc/+/13638/ was merged fixing the same issue, abandoning. -- To view, visit https://gerrit.osmocom.org/13637 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida8628c3c0569a2e3bd66c591d57eb93bf1fab14 Gerrit-Change-Number: 13637 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 15 Apr 2019 13:25:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 13:25:19 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 13:25:19 +0000 Subject: Change in osmo-msc[master]: smpp: Fix SMS-receiver put assertion In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. ( https://gerrit.osmocom.org/13637 ) Change subject: smpp: Fix SMS-receiver put assertion ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/13637 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Ida8628c3c0569a2e3bd66c591d57eb93bf1fab14 Gerrit-Change-Number: 13637 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 13:26:19 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 15 Apr 2019 13:26:19 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: print info about database name and libdbi version Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13641 Change subject: libmsc/db.c: print info about database name and libdbi version ...................................................................... libmsc/db.c: print info about database name and libdbi version Change-Id: Iaed452548eb2d847738b78d3489bf6f507a2e3c1 --- M src/libmsc/db.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/41/13641/1 diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 0384320..a9aaf94 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -615,6 +615,9 @@ { dbi_initialize_r(NULL, &inst); + LOGP(DDB, LOGL_NOTICE, "Init database connection to '%s' using %s\n", + name, dbi_version()); + conn = dbi_conn_new_r("sqlite3", inst); if (conn == NULL) { LOGP(DDB, LOGL_FATAL, "Failed to create database connection to sqlite3 db '%s'; " -- To view, visit https://gerrit.osmocom.org/13641 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iaed452548eb2d847738b78d3489bf6f507a2e3c1 Gerrit-Change-Number: 13641 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 13:27:14 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 13:27:14 +0000 Subject: Change in osmo-msc[master]: configure.ac: drop useless SQLite3 dependency In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13639 ) Change subject: configure.ac: drop useless SQLite3 dependency ...................................................................... Patch Set 1: Code-Review+1 I think that's from the time we handled subscriber database inside nitb/misc. -- To view, visit https://gerrit.osmocom.org/13639 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibf4eb53e60a2957eca99a2c8e613f75a8c43ac89 Gerrit-Change-Number: 13639 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 15 Apr 2019 13:27:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 13:30:16 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 13:30:16 +0000 Subject: Change in osmo-msc[master]: configure.ac: properly check for libdbi SQLite3 driver In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13640 ) Change subject: configure.ac: properly check for libdbi SQLite3 driver ...................................................................... Patch Set 1: Code-Review-1 What you are doing here doesn't make much sense to me, since you check for some runtime dependency during build time. That doesn't make sense if buildhost != runhost. We don't need libdbi-sqlite to build the software. It would only make sense if we require libdbi-sqlite to run the unit tests, and in that case it should only be checked during make check or similar. -- To view, visit https://gerrit.osmocom.org/13640 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7f7c719d41d9be28527e4ac3a8b2869c87337074 Gerrit-Change-Number: 13640 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 15 Apr 2019 13:30:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 13:30:38 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 13:30:38 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: print info about database name and libdbi version In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13641 ) Change subject: libmsc/db.c: print info about database name and libdbi version ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13641 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaed452548eb2d847738b78d3489bf6f507a2e3c1 Gerrit-Change-Number: 13641 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 15 Apr 2019 13:30:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 14:06:32 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 15 Apr 2019 14:06:32 +0000 Subject: Change in osmo-gsm-manuals[master]: Add a chapter to explain our different counters In-Reply-To: References: Message-ID: Daniel Willmann has submitted this change and it was merged. ( https://gerrit.osmocom.org/13516 ) Change subject: Add a chapter to explain our different counters ...................................................................... Add a chapter to explain our different counters Change-Id: I01b8529136450cb50e48b0fb5c17cb2daa5e24c3 --- A common/chapters/counters-overview.adoc 1 file changed, 50 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/counters-overview.adoc b/common/chapters/counters-overview.adoc new file mode 100644 index 0000000..fbdef30 --- /dev/null +++ b/common/chapters/counters-overview.adoc @@ -0,0 +1,50 @@ +[[common-counters]] +== Osmocom Counters + +The following gives an overview of all the types of counters available: + +=== Osmo Counters + +Osmo counters are the oldest type of counters added to Osmocom projects. +They are not grouped. + +* Printed as part of VTY show stats +* Increment, Decrement +* Accessible through the control interface: counter. + +=== Rate Counters + +Rate counters count rates of events. + +* Printed as part of VTY show stats +* Intervals: per second, minute, hour, day or absolute value +* Increment only +* Accessible through the control interface +* Rate counters are grouped and different instances per group can exist + +The control interface command to get a counter (group) is: + +rate_ctr.per_{sec,min,hour,day,abs}...[counter_name] + +It is possible to get all counters from a group by omitting the counter name + +=== Stat Item + +Stat items are a grouped replacement for osmo counters, but not many stat +items are available yet. + +* Printed as part of VTY show stats +* Replacement for osmo counters +* Not yet available through the control interface +* Grouped and indexed like rate counters +* Items have a unit +* Keeps a list of the last values measured, so could return an average, min, + max, std. deviation + +=== Stats Reporter + +Statsd stats reporter can send osmo counter, rate counter and stats item values to statsd + +See the stats reporter command of the VTY reference for details on how to +setup the connection to statsd. + -- To view, visit https://gerrit.osmocom.org/13516 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I01b8529136450cb50e48b0fb5c17cb2daa5e24c3 Gerrit-Change-Number: 13516 Gerrit-PatchSet: 2 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 14:35:56 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 15 Apr 2019 14:35:56 +0000 Subject: Change in osmo-msc[master]: configure.ac: drop useless SQLite3 dependency In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13639 ) Change subject: configure.ac: drop useless SQLite3 dependency ...................................................................... Patch Set 1: > I think that's from the time we handled subscriber database inside nitb/misc. Yep, but... AFAIR, OpenBSC also doesn't use SQLite3 directly ;) Most likely, it was used by the 'meas_db' utility... -- To view, visit https://gerrit.osmocom.org/13639 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibf4eb53e60a2957eca99a2c8e613f75a8c43ac89 Gerrit-Change-Number: 13639 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 15 Apr 2019 14:35:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 14:49:03 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 15 Apr 2019 14:49:03 +0000 Subject: Change in osmo-gsm-manuals[master]: Change VTY samples from OsmoNITB to OsmoMSC Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13642 Change subject: Change VTY samples from OsmoNITB to OsmoMSC ...................................................................... Change VTY samples from OsmoNITB to OsmoMSC Change-Id: I9fb3c43ea56087900eee4427f1ae50a7c9e84698 Related: OS#2299 --- M common/chapters/vty.adoc 1 file changed, 92 insertions(+), 67 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/42/13642/1 diff --git a/common/chapters/vty.adoc b/common/chapters/vty.adoc index c9e3d59..3aed41a 100644 --- a/common/chapters/vty.adoc +++ b/common/chapters/vty.adoc @@ -133,7 +133,7 @@ NOTE: The VTY is present on most Osmocom GSM/UMTS/GPRS software, thus this chapter is present in all the relevant manuals. The detailed examples -below assume you are executing them on the OsmoNITB VTY. They will work +below assume you are executing them on the OsmoMSC VTY. They will work in similar fashion on the other VTY interfaces, while the node structure will differ in each program. @@ -147,9 +147,9 @@ even only a partial command), you will get a list of the first word of all possible commands available at this node: -.Example: Typing `?` at start of OsmoNITB prompt +.Example: Typing `?` at start of OsmoMSC prompt ---- -OpenBSC> <1> +OsmoMSC> <1> show Show running system information list Print command list exit Exit current mode and down to previous mode @@ -157,7 +157,8 @@ enable Turn on privileged mode command terminal Set terminal line parameters who Display who is on vty - logging Configure log message to this terminal + logging Configure logging + no Negate a command or set its defaults sms SMS related commands subscriber Operations on a Subscriber ---- @@ -171,35 +172,35 @@ .Example: Typing `?` after a partial command ---- -OpenBSC> show <1> - version Displays program version - online-help Online help - history Display the session command history - network Display information about a GSM NETWORK - bts Display information about a BTS - trx Display information about a TRX - timeslot Display information about a TS - lchan Display information about a logical channel - paging Display information about paging requests of a BTS - paging-group Display the paging group - logging Show current logging configuration - alarms Show current logging configuration - stats Show statistical values - e1_driver Display information about available E1 drivers - e1_line Display information about a E1 line - e1_timeslot Display information about a E1 timeslot - subscriber Operations on a Subscriber - statistics Display network statistics - sms-queue Display SMSqueue statistics +OsmoMSC> show <1> + version Displays program version + online-help Online help + history Display the session command history + cs7 ITU-T Signaling System 7 + logging Show current logging configuration + alarms Show current logging configuration + talloc-context Show talloc memory hierarchy + stats Show statistical values + asciidoc Asciidoc generation + rate-counters Show all rate counters + fsm Show information about finite state machines + fsm-instances Show information about finite state machine instances + sgs-connections Show SGs interface connections / MMEs + subscriber Operations on a Subscriber + bsc BSC + connection Subscriber Connections + transaction Transactions + statistics Display network statistics + sms-queue Display SMSqueue statistics smpp SMPP Interface ---- <1> Type `?` after the `show` command, the `?` itself will not be printed. -You may pick the `network` object and type `?` again: +You may pick the `bsc` object and type `?` again: -.Example: Typing `?` after `show network` +.Example: Typing `?` after `show bsc` ---- -OpenBSC> show network +OsmoMSC> show bsc ---- @@ -216,7 +217,7 @@ .Example: Use of `` pressed after typing only `s` as command ---- -OpenBSC> s<1> +OsmoMSC> s<1> show sms subscriber ---- <1> Type `` here. @@ -225,11 +226,11 @@ .Example: Use of `` pressed after typing `show` command ---- -OpenBSC> show <1> -version online-help history network bts trx -timeslot lchan paging paging-group logging alarms -stats e1_driver e1_line e1_timeslot subscriber statistics -sms-queue smpp +OsmoMSC> show <1> +version online-help history cs7 logging alarms +talloc-context stats asciidoc rate-counters fsm fsm-instances +sgs-connections subscriber bsc connection transaction statistics +sms-queue smpp ---- <1> Type `` here. @@ -239,9 +240,9 @@ The `list` command will give you a full list of all commands and their arguments available at the current node: -.Example: Typing `list` at start of OsmoNITB 'VIEW' node prompt +.Example: Typing `list` at start of OsmoMSC 'VIEW' node prompt ---- -OpenBSC> list +OsmoMSC> list show version show online-help list @@ -252,14 +253,15 @@ terminal no length who show history - show network - show bts [<0-255>] - show trx [<0-255>] [<0-255>] - show timeslot [<0-255>] [<0-255>] [<0-7>] - show lchan [<0-255>] [<0-255>] [<0-7>] [lchan_nr] - show lchan summary [<0-255>] [<0-255>] [<0-7>] [lchan_nr] - show paging [<0-255>] - show paging-group <0-255> IMSI + show cs7 instance <0-15> users + show cs7 (sua|m3ua|ipa) [<0-65534>] + show cs7 instance <0-15> asp + show cs7 instance <0-15> as (active|all|m3ua|sua) + show cs7 instance <0-15> sccp addressbook + show cs7 instance <0-15> sccp users + show cs7 instance <0-15> sccp ssn <0-65535> + show cs7 instance <0-15> sccp connections + show cs7 instance <0-15> sccp timers logging enable logging disable logging filter all (0|1) @@ -267,25 +269,44 @@ logging timestamp (0|1) logging print extended-timestamp (0|1) logging print category (0|1) + logging print category-hex (0|1) + logging print level (0|1) + logging print file (0|1|basename) [last] logging set-log-mask MASK - logging level (all|rll|cc|mm|rr|rsl|nm|mncc|pag|meas|sccp|msc|mgcp|ho|db|ref|gprs|ns|bssgp|llc|sndcp|nat|ctrl|smpp|filter|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats) (debug|info|notice|error|fatal) + logging level (rll|cc|mm|rr|mncc|pag|msc|mgcp|ho|db|ref|ctrl|smpp|ranap|vlr|iucs|bssap|sgs|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro) (debug|info|notice|error|fatal) + logging level set-all (debug|info|notice|error|fatal) + logging level force-all (debug|info|notice|error|fatal) + no logging level force-all show logging vty show alarms + show talloc-context (application|all) (full|brief|DEPTH) + show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS + show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP show stats show stats level (global|peer|subscriber) - show e1_driver - show e1_line [line_nr] [stats] - show e1_timeslot [line_nr] [ts_nr] - show subscriber (extension|imsi|tmsi|id) ID + show asciidoc counters + show rate-counters + show fsm NAME + show fsm all + show fsm-instances NAME + show fsm-instances all + show sgs-connections + show subscriber (msisdn|extension|imsi|tmsi|id) ID show subscriber cache + show bsc + show connection + show transaction sms send pending + sms delete expired subscriber create imsi ID - subscriber (extension|imsi|tmsi|id) ID sms sender (extension|imsi|tmsi|id) SENDER_ID send .LINE - subscriber (extension|imsi|tmsi|id) ID silent-sms sender (extension|imsi|tmsi|id) SENDER_ID send .LINE - subscriber (extension|imsi|tmsi|id) ID silent-call start (any|tch/f|tch/any|sdcch) - subscriber (extension|imsi|tmsi|id) ID silent-call stop - subscriber (extension|imsi|tmsi|id) ID ussd-notify (0|1|2) .TEXT - subscriber (extension|imsi|tmsi|id) ID update + subscriber (msisdn|extension|imsi|tmsi|id) ID sms sender (msisdn|extension|imsi|tmsi|id) SENDER_ID send .LINE + subscriber (msisdn|extension|imsi|tmsi|id) ID silent-sms sender (msisdn|extension|imsi|tmsi|id) SENDER_ID send .LINE + subscriber (msisdn|extension|imsi|tmsi|id) ID silent-call start (any|tch/f|tch/any|sdcch) + subscriber (msisdn|extension|imsi|tmsi|id) ID silent-call stop + subscriber (msisdn|extension|imsi|tmsi|id) ID ussd-notify (0|1|2) .TEXT + subscriber (msisdn|extension|imsi|tmsi|id) ID ms-test close-loop (a|b|c|d|e|f|i) + subscriber (msisdn|extension|imsi|tmsi|id) ID ms-test open-loop + subscriber (msisdn|extension|imsi|tmsi|id) ID paging show statistics show sms-queue logging filter imsi IMSI @@ -294,12 +315,12 @@ TIP: Remember, the list of available commands will change significantly depending on the Osmocom program you are accessing, its software version and -the current node you're at. Compare the above example of the OsmoNITB 'VIEW' -node with the list of the OsmoNITB 'TRX' config node: +the current node you're at. Compare the above example of the OsmoMSC 'VIEW' +node with the list of the OsmoMSC 'NETWORK' config node: -.Example: Typing `list` at start of OsmoNITB 'TRX' config node prompt +.Example: Typing `list` at start of OsmoMSC 'NETWORK' config node prompt ---- -OpenBSC(config-net-bts-trx)# list +OsmoMSC(config-net)# list help list write terminal @@ -309,13 +330,17 @@ show running-config exit end - arfcn <0-1023> - description .TEXT - no description - nominal power <0-100> - max_power_red <0-100> - rsl e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full) - rsl e1 tei <0-63> - rf_locked (0|1) - timeslot <0-7> + network country code <1-999> + mobile network code <0-999> + short name NAME + long name NAME + encryption a5 <0-3> [<0-3>] [<0-3>] [<0-3>] + authentication (optional|required) + rrlp mode (none|ms-based|ms-preferred|ass-preferred) + mm info (0|1) + timezone <-19-19> (0|15|30|45) + timezone <-19-19> (0|15|30|45) <0-2> + no timezone + periodic location update <6-1530> + no periodic location update ---- -- To view, visit https://gerrit.osmocom.org/13642 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9fb3c43ea56087900eee4427f1ae50a7c9e84698 Gerrit-Change-Number: 13642 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 14:50:49 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 14:50:49 +0000 Subject: Change in osmo-gsm-manuals[master]: Change VTY samples from OsmoNITB to OsmoMSC In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13642 ) Change subject: Change VTY samples from OsmoNITB to OsmoMSC ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13642 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9fb3c43ea56087900eee4427f1ae50a7c9e84698 Gerrit-Change-Number: 13642 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 15 Apr 2019 14:50:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 14:55:25 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 15 Apr 2019 14:55:25 +0000 Subject: Change in osmo-msc[master]: configure.ac: drop useless check for -fvisibility=hidden Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13643 Change subject: configure.ac: drop useless check for -fvisibility=hidden ...................................................................... configure.ac: drop useless check for -fvisibility=hidden This looks like a rudiment from OpenBSC, where we have: #define BSC_API __attribute__((visibility("default"))) However, we don't use this attribute in OsmoMSC. Change-Id: Ie2f18e9b47eca478f6e4702606068814546e34ce --- M configure.ac 1 file changed, 0 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/43/13643/1 diff --git a/configure.ac b/configure.ac index f8787cf..e500375 100644 --- a/configure.ac +++ b/configure.ac @@ -119,18 +119,6 @@ dnl Checks for typedefs, structures and compiler characteristics - -# The following test is taken from WebKit's webkit.m4 -saved_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -fvisibility=hidden " -AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) -AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], - [ AC_MSG_RESULT([yes]) - SYMBOL_VISIBILITY="-fvisibility=hidden"], - AC_MSG_RESULT([no])) -CFLAGS="$saved_CFLAGS" -AC_SUBST(SYMBOL_VISIBILITY) - AX_CHECK_COMPILE_FLAG([-Werror=implicit], [CFLAGS="$CFLAGS -Werror=implicit"]) AX_CHECK_COMPILE_FLAG([-Werror=maybe-uninitialized], [CFLAGS="$CFLAGS -Werror=maybe-uninitialized"]) AX_CHECK_COMPILE_FLAG([-Werror=memset-transposed-args], [CFLAGS="$CFLAGS -Werror=memset-transposed-args"]) -- To view, visit https://gerrit.osmocom.org/13643 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie2f18e9b47eca478f6e4702606068814546e34ce Gerrit-Change-Number: 13643 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 14:55:56 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 15 Apr 2019 14:55:56 +0000 Subject: Change in osmo-msc[master]: configure.ac: drop rudimentary check for -fvisibility=hidden In-Reply-To: References: Message-ID: Vadim Yanitskiy has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13643 ) Change subject: configure.ac: drop rudimentary check for -fvisibility=hidden ...................................................................... configure.ac: drop rudimentary check for -fvisibility=hidden This looks like a rudiment from OpenBSC, where we have: #define BSC_API __attribute__((visibility("default"))) However, we don't use this attribute in OsmoMSC. Change-Id: Ie2f18e9b47eca478f6e4702606068814546e34ce --- M configure.ac 1 file changed, 0 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/43/13643/2 -- To view, visit https://gerrit.osmocom.org/13643 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie2f18e9b47eca478f6e4702606068814546e34ce Gerrit-Change-Number: 13643 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-CC: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 14:58:26 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 15 Apr 2019 14:58:26 +0000 Subject: Change in osmo-msc[master]: configure.ac: properly check for libdbi SQLite3 driver In-Reply-To: References: Message-ID: Vadim Yanitskiy has abandoned this change. ( https://gerrit.osmocom.org/13640 ) Change subject: configure.ac: properly check for libdbi SQLite3 driver ...................................................................... Abandoned Thanks, Pau! You're right. -- To view, visit https://gerrit.osmocom.org/13640 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I7f7c719d41d9be28527e4ac3a8b2869c87337074 Gerrit-Change-Number: 13640 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 14:58:36 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 15 Apr 2019 14:58:36 +0000 Subject: Change in osmo-bsc[master]: doc: Add generic counter chapter in manual Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13644 Change subject: doc: Add generic counter chapter in manual ...................................................................... doc: Add generic counter chapter in manual Depends: I01b8529136450cb50e48b0fb5c17cb2daa5e24c3 (osmo-gsm-manuals) Change-Id: Ida53d79787aedc5b37a68e6795a863cb0b4a343a --- M doc/manuals/chapters/counters.adoc M doc/manuals/osmobsc-usermanual.adoc 2 files changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/44/13644/1 diff --git a/doc/manuals/chapters/counters.adoc b/doc/manuals/chapters/counters.adoc index 7fbb10c..be92369 100644 --- a/doc/manuals/chapters/counters.adoc +++ b/doc/manuals/chapters/counters.adoc @@ -1,4 +1,4 @@ [[counters]] -== Counters +== Implemented Counters include::./counters_generated.adoc[] diff --git a/doc/manuals/osmobsc-usermanual.adoc b/doc/manuals/osmobsc-usermanual.adoc index 275c436..3515aaa 100644 --- a/doc/manuals/osmobsc-usermanual.adoc +++ b/doc/manuals/osmobsc-usermanual.adoc @@ -23,6 +23,8 @@ include::{srcdir}/chapters/handover.adoc[] +include::./common/chapters/counters-overview.adoc[] + include::{srcdir}/chapters/counters.adoc[] include::./common/chapters/abis.adoc[] -- To view, visit https://gerrit.osmocom.org/13644 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ida53d79787aedc5b37a68e6795a863cb0b4a343a Gerrit-Change-Number: 13644 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 14:58:37 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 15 Apr 2019 14:58:37 +0000 Subject: Change in osmo-bsc[master]: manuals: Fix example config to reflect OsmoBSC commands Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13645 Change subject: manuals: Fix example config to reflect OsmoBSC commands ...................................................................... manuals: Fix example config to reflect OsmoBSC commands Change-Id: Ic38eec67a2cbbef57d1d6349f08249ec20ff7e8c Related: OS#2299 --- M doc/manuals/chapters/bts-examples.adoc 1 file changed, 1 insertion(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/45/13645/1 diff --git a/doc/manuals/chapters/bts-examples.adoc b/doc/manuals/chapters/bts-examples.adoc index e404989..2dd8b37 100644 --- a/doc/manuals/chapters/bts-examples.adoc +++ b/doc/manuals/chapters/bts-examples.adoc @@ -19,14 +19,8 @@ network network country code 1 mobile network code 1 - short name OpenBSC - long name OpenBSC - auth policy closed - location updating reject cause 13 encryption a5 0 neci 1 - rrlp mode none - mm info 1 handover 0 bts 0 type nanobts <2> @@ -103,14 +97,8 @@ network network country code 1 mobile network code 1 - short name OpenBSC - long name OpenBSC - auth policy closed - location updating reject cause 13 encryption a5 0 neci 1 - rrlp mode none - mm info 0 handover 0 bts 0 type nanobts @@ -179,7 +167,7 @@ first nanoBTS unit (`trx 0`) needs to be configured to 1800/0/0 and the second nanoBTS unit (`trx 1`) needs to be configured to 1800/0/1. You can configure the BTS unit IDs using the `ipaccess-config` - utility included in OpenBSC. + utility included in OsmoBSC. [NOTE] ==== -- To view, visit https://gerrit.osmocom.org/13645 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic38eec67a2cbbef57d1d6349f08249ec20ff7e8c Gerrit-Change-Number: 13645 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 14:58:37 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 15 Apr 2019 14:58:37 +0000 Subject: Change in osmo-bsc[master]: Change comments/strings from OpenBSC to OsmoBSC Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13646 Change subject: Change comments/strings from OpenBSC to OsmoBSC ...................................................................... Change comments/strings from OpenBSC to OsmoBSC Change-Id: I785278df411b13a701c8441fde798d4bfe79ffd1 --- M src/osmo-bsc/bsc_vty.c M src/utils/meas_vis.c 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/46/13646/1 diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 9413d36..767d565 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -1,4 +1,4 @@ -/* OpenBSC interface to quagga VTY */ +/* OsmoBSC interface to quagga VTY */ /* (C) 2009-2017 by Harald Welte * All Rights Reserved * @@ -3170,7 +3170,7 @@ DEFUN(cfg_bts_neigh_mode, cfg_bts_neigh_mode_cmd, "neighbor-list mode (automatic|manual|manual-si5)", "Neighbor List\n" "Mode of Neighbor List generation\n" - "Automatically from all BTS in this OpenBSC\n" "Manual\n" + "Automatically from all BTS in this BSC\n" "Manual\n" "Manual with different lists for SI2 and SI5\n") { struct gsm_bts *bts = vty->index; diff --git a/src/utils/meas_vis.c b/src/utils/meas_vis.c index 851aa03..cba08f5 100644 --- a/src/utils/meas_vis.c +++ b/src/utils/meas_vis.c @@ -274,7 +274,7 @@ g_st.cdkscreen = initCDKScreen(g_st.curses_win); initCDKColor(); - g_st.title = "OpenBSC link quality monitor"; + g_st.title = "OsmoBSC link quality monitor"; title[0] = g_st.title; g_st.cdk_title = newCDKLabel(g_st.cdkscreen, CENTER, 0, title, 1, FALSE, FALSE); -- To view, visit https://gerrit.osmocom.org/13646 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I785278df411b13a701c8441fde798d4bfe79ffd1 Gerrit-Change-Number: 13646 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 14:58:37 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 15 Apr 2019 14:58:37 +0000 Subject: Change in osmo-bsc[master]: gsm_data.h: Remove unused variable from OpenBSC times Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13647 Change subject: gsm_data.h: Remove unused variable from OpenBSC times ...................................................................... gsm_data.h: Remove unused variable from OpenBSC times This variable does not seem to be used anywere in OsmoBSC, seems to be a remnant from OpenBSC times. Change-Id: I5e4aa352fa5f16f6ff64738f25afd1a844fa4fcb --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/gsm_04_08_rr.c 2 files changed, 0 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/47/13647/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 131a53e..dc133e1 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1566,7 +1566,6 @@ struct gsm_bts *start_bts); 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) diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c index 349bfea..7ff94ad 100644 --- a/src/osmo-bsc/gsm_04_08_rr.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -45,10 +45,6 @@ #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) ? */ -int ipacc_rtp_direct = 1; - int gsm48_sendmsg(struct msgb *msg) { if (msg->lchan) -- To view, visit https://gerrit.osmocom.org/13647 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5e4aa352fa5f16f6ff64738f25afd1a844fa4fcb Gerrit-Change-Number: 13647 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 14:59:08 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 14:59:08 +0000 Subject: Change in osmo-msc[master]: configure.ac: drop rudimentary check for -fvisibility=hidden In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13643 ) Change subject: configure.ac: drop rudimentary check for -fvisibility=hidden ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13643 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie2f18e9b47eca478f6e4702606068814546e34ce Gerrit-Change-Number: 13643 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 15 Apr 2019 14:59:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 14:59:59 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 14:59:59 +0000 Subject: Change in osmo-bsc[master]: gsm_data.h: Remove unused variable from OpenBSC times In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13647 ) Change subject: gsm_data.h: Remove unused variable from OpenBSC times ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13647 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5e4aa352fa5f16f6ff64738f25afd1a844fa4fcb Gerrit-Change-Number: 13647 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 15 Apr 2019 14:59:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 15:03:22 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 15 Apr 2019 15:03:22 +0000 Subject: Change in osmo-msc[master]: Introduce initial unit test for db_sms_* API In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13629 ) Change subject: Introduce initial unit test for db_sms_* API ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/13629/1/tests/db_sms/Makefile.am File tests/db_sms/Makefile.am: https://gerrit.osmocom.org/#/c/13629/1/tests/db_sms/Makefile.am at 47 PS1, Line 47: -lrt \ > why is -lrt needed? TBH, I just copy-pasted the whole Makefile.am from the 'sms_queue' test. It's also used in the 'msc_vlr'. Not sure if we really need this... OsmoMSC builds (and passes all tests) just fine without this library. https://gerrit.osmocom.org/#/c/13629/1/tests/db_sms/db_sms_test.c File tests/db_sms/db_sms_test.c: https://gerrit.osmocom.org/#/c/13629/1/tests/db_sms/db_sms_test.c at 278 PS1, Line 278: struct sms_test *test = sms_test_set + i; > Use sms_test_set[i] Ok, will be done in the next patch set. -- To view, visit https://gerrit.osmocom.org/13629 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id94ad35b6f78f839137db2e17010fbf9b40111a3 Gerrit-Change-Number: 13629 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 15 Apr 2019 15:03:22 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 15:04:46 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 15:04:46 +0000 Subject: Change in osmo-msc[master]: configure.ac: drop rudimentary check for -fvisibility=hidden In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13643 ) Change subject: configure.ac: drop rudimentary check for -fvisibility=hidden ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13643 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie2f18e9b47eca478f6e4702606068814546e34ce Gerrit-Change-Number: 13643 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 15 Apr 2019 15:04:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 15:04:49 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 15:04:49 +0000 Subject: Change in osmo-msc[master]: configure.ac: drop rudimentary check for -fvisibility=hidden In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13643 ) Change subject: configure.ac: drop rudimentary check for -fvisibility=hidden ...................................................................... configure.ac: drop rudimentary check for -fvisibility=hidden This looks like a rudiment from OpenBSC, where we have: #define BSC_API __attribute__((visibility("default"))) However, we don't use this attribute in OsmoMSC. Change-Id: Ie2f18e9b47eca478f6e4702606068814546e34ce --- M configure.ac 1 file changed, 0 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index f8787cf..e500375 100644 --- a/configure.ac +++ b/configure.ac @@ -119,18 +119,6 @@ dnl Checks for typedefs, structures and compiler characteristics - -# The following test is taken from WebKit's webkit.m4 -saved_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -fvisibility=hidden " -AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) -AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], - [ AC_MSG_RESULT([yes]) - SYMBOL_VISIBILITY="-fvisibility=hidden"], - AC_MSG_RESULT([no])) -CFLAGS="$saved_CFLAGS" -AC_SUBST(SYMBOL_VISIBILITY) - AX_CHECK_COMPILE_FLAG([-Werror=implicit], [CFLAGS="$CFLAGS -Werror=implicit"]) AX_CHECK_COMPILE_FLAG([-Werror=maybe-uninitialized], [CFLAGS="$CFLAGS -Werror=maybe-uninitialized"]) AX_CHECK_COMPILE_FLAG([-Werror=memset-transposed-args], [CFLAGS="$CFLAGS -Werror=memset-transposed-args"]) -- To view, visit https://gerrit.osmocom.org/13643 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie2f18e9b47eca478f6e4702606068814546e34ce Gerrit-Change-Number: 13643 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 15:05:11 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 15:05:11 +0000 Subject: Change in osmo-bsc[master]: doc: Add generic counter chapter in manual In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13644 ) Change subject: doc: Add generic counter chapter in manual ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13644 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida53d79787aedc5b37a68e6795a863cb0b4a343a Gerrit-Change-Number: 13644 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 15 Apr 2019 15:05:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 15:05:24 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 15:05:24 +0000 Subject: Change in osmo-bsc[master]: manuals: Fix example config to reflect OsmoBSC commands In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13645 ) Change subject: manuals: Fix example config to reflect OsmoBSC commands ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13645 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic38eec67a2cbbef57d1d6349f08249ec20ff7e8c Gerrit-Change-Number: 13645 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 15 Apr 2019 15:05:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 15:05:35 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 15:05:35 +0000 Subject: Change in osmo-bsc[master]: Change comments/strings from OpenBSC to OsmoBSC In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13646 ) Change subject: Change comments/strings from OpenBSC to OsmoBSC ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13646 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I785278df411b13a701c8441fde798d4bfe79ffd1 Gerrit-Change-Number: 13646 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 15 Apr 2019 15:05:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 15:05:47 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 15:05:47 +0000 Subject: Change in osmo-bsc[master]: gsm_data.h: Remove unused variable from OpenBSC times In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13647 ) Change subject: gsm_data.h: Remove unused variable from OpenBSC times ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13647 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5e4aa352fa5f16f6ff64738f25afd1a844fa4fcb Gerrit-Change-Number: 13647 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 15 Apr 2019 15:05:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 15:06:44 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 15:06:44 +0000 Subject: Change in libosmo-sccp[master]: add caller-owns-msgb variant osmo_sccp_user_sap_down_nofree() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13277 ) Change subject: add caller-owns-msgb variant osmo_sccp_user_sap_down_nofree() ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13277 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic818efa78b90f727e1a94c18b60d9a306644f340 Gerrit-Change-Number: 13277 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-Comment-Date: Mon, 15 Apr 2019 15:06:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 15:28:34 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 15 Apr 2019 15:28:34 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Check for ==/!= null instead of isvalue() Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13648 Change subject: BSSMAP_Emulation: Check for ==/!= null instead of isvalue() ...................................................................... BSSMAP_Emulation: Check for ==/!= null instead of isvalue() Related: OS#3932 Change-Id: I2434c776c6a4ee83e97bc04e7cbbaf1b546731c0 --- M library/BSSMAP_Emulation.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/48/13648/1 diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index 55ce2fb..3816ed7 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -406,7 +406,7 @@ var BSSAP_ConnHdlr client := null; client := f_imsi_table_find(bssap.pdu.bssmap.paging.iMSI.digits, bssap.pdu.bssmap.paging.tMSI.tmsiOctets); - if (isvalue(client)) { + if (client != null) { log("CommonBssmapUnitdataCallback: IMSI/TMSI found in table, dispatching to ", client); CLIENT.send(bssap) to client; -- To view, visit https://gerrit.osmocom.org/13648 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2434c776c6a4ee83e97bc04e7cbbaf1b546731c0 Gerrit-Change-Number: 13648 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 18:37:09 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 18:37:09 +0000 Subject: Change in osmo-bsc[master]: Drop unused old osmux leftover code Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13649 Change subject: Drop unused old osmux leftover code ...................................................................... Drop unused old osmux leftover code Let's better clean up old stuff before doing new implementation. Change-Id: Id4e254a1c24831afaba9ab7b330d4e09a2474c8e --- M include/osmocom/bsc/Makefile.am D include/osmocom/bsc/osmux.h 2 files changed, 0 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/49/13649/1 diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 02a4ad8..044fdc9 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -43,7 +43,6 @@ osmo_bsc_rf.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ - osmux.h \ paging.h \ pcu_if.h \ pcuif_proto.h \ diff --git a/include/osmocom/bsc/osmux.h b/include/osmocom/bsc/osmux.h deleted file mode 100644 index f3ea72a..0000000 --- a/include/osmocom/bsc/osmux.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _OPENBSC_OSMUX_H_ -#define _OPENBSC_OSMUX_H_ - -#include - -#define OSMUX_PORT 1984 - -enum { - OSMUX_ROLE_BSC = 0, - OSMUX_ROLE_BSC_NAT, -}; - -int osmux_init(int role, struct mgcp_config *cfg); -int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port); -void osmux_disable_endpoint(struct mgcp_endpoint *endp); -void osmux_allocate_cid(struct mgcp_endpoint *endp); -void osmux_release_cid(struct mgcp_endpoint *endp); - -int osmux_xfrm_to_rtp(struct mgcp_endpoint *endp, int type, char *buf, int rc); -int osmux_xfrm_to_osmux(int type, char *buf, int rc, struct mgcp_endpoint *endp); - -int osmux_send_dummy(struct mgcp_endpoint *endp); - -int osmux_get_cid(void); -void osmux_put_cid(uint8_t osmux_cid); -int osmux_used_cid(void); - -enum osmux_state { - OSMUX_STATE_DISABLED = 0, - OSMUX_STATE_NEGOTIATING, - OSMUX_STATE_ACTIVATING, - OSMUX_STATE_ENABLED, -}; - -enum osmux_usage { - OSMUX_USAGE_OFF = 0, - OSMUX_USAGE_ON = 1, - OSMUX_USAGE_ONLY = 2, -}; - -#endif -- To view, visit https://gerrit.osmocom.org/13649 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id4e254a1c24831afaba9ab7b330d4e09a2474c8e Gerrit-Change-Number: 13649 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 19:52:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 19:52:12 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Rename BSSMAP_Emulation -> RAN_Emulation Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13650 Change subject: Rename BSSMAP_Emulation -> RAN_Emulation ...................................................................... Rename BSSMAP_Emulation -> RAN_Emulation So far, BSSMAP_Emulation supported only a transport over BSSMAP. However, we soon intend to merge support for RANAP in order to simulate RANAP/Iu connections as well as BSSMAP. Let's start by renaming some of the existing types/functions/ports/modules without introducing any functional changes just yet. Related: OS#2857, OS#2856 Change-Id: Iecbcb0c6c136baad9460eca40606bb4010d8882d --- M bsc-nat/BSC_MS_ConnectionHandler.ttcn M bsc-nat/BSC_MS_Simulation.ttcn M bsc-nat/MSC_ConnectionHandler.ttcn M bsc-nat/MSC_Simulation.ttcn M bsc-nat/gen_links.sh M bsc/BSC_Tests.ttcn M bsc/BSC_Tests_LCLS.ttcn M bsc/MSC_ConnectionHandler.ttcn M bsc/gen_links.sh R library/RAN_Adapter.ttcn R library/RAN_Emulation.ttcn M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn M msc/gen_links.sh 14 files changed, 228 insertions(+), 230 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/50/13650/1 diff --git a/bsc-nat/BSC_MS_ConnectionHandler.ttcn b/bsc-nat/BSC_MS_ConnectionHandler.ttcn index 27e1b58..63d0451 100644 --- a/bsc-nat/BSC_MS_ConnectionHandler.ttcn +++ b/bsc-nat/BSC_MS_ConnectionHandler.ttcn @@ -5,7 +5,7 @@ import from SCCPasp_Types all; import from BSSAP_Types all; import from BSSAP_CodecPort all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from BSSMAP_Templates all; import from MobileL3_Types all; @@ -17,9 +17,9 @@ import from SDP_Types all; /* this component represents a single subscriber connection at the MSC. - * There is a 1:1 mapping between SCCP connections and BSSAP_ConnHdlr components. - * We inherit all component variables, ports, functions, ... from BSSAP_ConnHdlr */ -type component BSC_MS_ConnHdlr extends BSSAP_ConnHdlr { + * There is a 1:1 mapping between SCCP connections and RAN_ConnHdlr components. + * We inherit all component variables, ports, functions, ... from RAN_ConnHdlr */ +type component BSC_MS_ConnHdlr extends RAN_ConnHdlr { /* SCCP Connecction Identifier for the underlying SCCP connection */ var integer g_sccp_conn_id; var MgcpConnectionId g_mgcp_conn_id; @@ -27,18 +27,18 @@ var BSC_State g_state; } -/* Callback function from general BSSMAP_Emulation whenever a new incoming +/* Callback function from general RAN_Emulation whenever a new incoming * SCCP connection arrivces. Must create + start a new component */ private function CreateCallback(BSSAP_N_CONNECT_ind conn_ind, charstring id) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { +runs on RAN_Emulation_CT return RAN_ConnHdlr { log("Incoming SCCP Connection on BSC ?!?"); self.stop; } -/* Callback function from general BSSMAP_Emulation whenever a connectionless +/* Callback function from general RAN_Emulation whenever a connectionless * BSSMAP message arrives. Can retunr a PDU_BSSAP that should be sent in return */ private function UnitdataCallback(PDU_BSSAP bssap) -runs on BSSMAP_Emulation_CT return template PDU_BSSAP { +runs on RAN_Emulation_CT return template PDU_BSSAP { var template PDU_BSSAP resp := omit; if (match(bssap, tr_BSSMAP_Reset)) { @@ -48,7 +48,7 @@ return resp; } -const BssmapOps BSC_MS_BssmapOps := { +const RanOps BSC_MS_RanOps := { create_cb := refers(CreateCallback), unitdata_cb := refers(UnitdataCallback), decode_dtap := false, @@ -154,16 +154,16 @@ log("Unhandled DTAP ", l3); } - [g_state == BSC_STATE_WAIT_DISC_IND] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + [g_state == BSC_STATE_WAIT_DISC_IND] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { setverdict(pass); self.stop; } - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) { + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND) { } /* disconnect in invalid state */ - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { setverdict(fail); self.stop; } diff --git a/bsc-nat/BSC_MS_Simulation.ttcn b/bsc-nat/BSC_MS_Simulation.ttcn index 2f1961b..c45b5ac 100644 --- a/bsc-nat/BSC_MS_Simulation.ttcn +++ b/bsc-nat/BSC_MS_Simulation.ttcn @@ -9,7 +9,7 @@ import from SCCP_Emulation all; import from BSSAP_CodecPort all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from BSC_MS_ConnectionHandler all; @@ -17,7 +17,7 @@ /* component references */ var IPA_Emulation_CT vc_IPA; var SCCP_CT vc_SCCP; - var BSSMAP_Emulation_CT vc_BSSMAP; + var RAN_Emulation_CT vc_BSSMAP; /* test port to SCCP emulation */ port SCCPasp_PT SCCP; @@ -48,7 +48,7 @@ /* create components for IPA/SCCP/BSS[M]AP stack */ vc_IPA := IPA_Emulation_CT.create(id & "-IPA"); vc_SCCP := SCCP_CT.create(id & "-SCCP"); - vc_BSSMAP := BSSMAP_Emulation_CT.create(id & "-BSSMAP"); + vc_BSSMAP := RAN_Emulation_CT.create(id & "-BSSMAP"); map(vc_IPA:IPA_PORT, system:IPA_CODEC_PT); @@ -64,7 +64,7 @@ /* start components */ vc_IPA.start(IPA_Emulation.main_client(remote_ip, remote_port, local_ip, local_port, ccm_pars)); vc_SCCP.start(SCCPStart(sccp_pars)); - vc_BSSMAP.start(BSSMAP_Emulation.main(BSC_MS_ConnectionHandler.BSC_MS_BssmapOps, id)); + vc_BSSMAP.start(RAN_Emulation.main(BSC_MS_ConnectionHandler.BSC_MS_RanOps, id)); /* Initial delay to wait for IPA connection establishment */ T.start(2.0); diff --git a/bsc-nat/MSC_ConnectionHandler.ttcn b/bsc-nat/MSC_ConnectionHandler.ttcn index 27fbba7..383b67b 100644 --- a/bsc-nat/MSC_ConnectionHandler.ttcn +++ b/bsc-nat/MSC_ConnectionHandler.ttcn @@ -5,7 +5,7 @@ import from SCCPasp_Types all; import from BSSAP_Types all; import from BSSAP_CodecPort all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from BSSMAP_Templates all; import from MGCP_Types all; @@ -13,9 +13,9 @@ import from SDP_Types all; /* this component represents a single subscriber connection at the MSC. - * There is a 1:1 mapping between SCCP connections and BSSAP_ConnHdlr components. - * We inherit all component variables, ports, functions, ... from BSSAP_ConnHdlr */ -type component MSC_ConnHdlr extends BSSAP_ConnHdlr { + * There is a 1:1 mapping between SCCP connections and RAN_ConnHdlr components. + * We inherit all component variables, ports, functions, ... from RAN_ConnHdlr */ +type component MSC_ConnHdlr extends RAN_ConnHdlr { /* SCCP Connecction Identifier for the underlying SCCP connection */ var integer g_sccp_conn_id; @@ -28,10 +28,10 @@ /* Callback function from general BSSMAP_Emulation whenever a new incoming * SCCP connection arrivces. Must create + start a new component */ private function CreateCallback(BSSAP_N_CONNECT_ind conn_ind, charstring id) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { +runs on RAN_Emulation_CT return RAN_ConnHdlr { var MSC_ConnHdlr vc_conn; - /* Create a new BSSAP_ConnHdlr component */ - vc_conn := MSC_ConnHdlr.create(g_bssmap_id & "-Conn-" & int2str(conn_ind.connectionId)); + /* Create a new RAN_ConnHdlr component */ + vc_conn := MSC_ConnHdlr.create(g_ran_id & "-Conn-" & int2str(conn_ind.connectionId)); /* connect it to the port */ connect(vc_conn:BSSAP, self:CLIENT); /* start it */ @@ -44,7 +44,7 @@ /* Callback function from general BSSMAP_Emulation whenever a connectionless * BSSMAP message arrives. Can retunr a PDU_BSSAP that should be sent in return */ private function UnitdataCallback(PDU_BSSAP bssap) -runs on BSSMAP_Emulation_CT return template PDU_BSSAP { +runs on RAN_Emulation_CT return template PDU_BSSAP { var template PDU_BSSAP resp := omit; if (match(bssap, tr_BSSMAP_Reset)) { @@ -54,7 +54,7 @@ return resp; } -const BssmapOps MSC_BssmapOps := { +const RanOps MSC_RanOps := { create_cb := refers(CreateCallback), unitdata_cb := refers(UnitdataCallback), decode_dtap := false, @@ -129,14 +129,14 @@ } [g_state == MSC_STATE_WAIT_DLCX_ACK] BSSAP.receive(tr_DLCX_ACK) { - BSSAP.send(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); + BSSAP.send(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); setverdict(pass); self.stop; } /* TODO: CLEAR REQUEST from BSS */ - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { setverdict(fail); self.stop; } @@ -147,7 +147,7 @@ /* Guard timer has expired, close connection */ [] T.timeout { - BSSAP.send(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); + BSSAP.send(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); setverdict(fail, "Timeout of guard timer"); self.stop; } diff --git a/bsc-nat/MSC_Simulation.ttcn b/bsc-nat/MSC_Simulation.ttcn index 0a13509..bc47f89 100755 --- a/bsc-nat/MSC_Simulation.ttcn +++ b/bsc-nat/MSC_Simulation.ttcn @@ -16,7 +16,7 @@ import from BSSAP_Types all; import from BSSMAP_Templates all; */ -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from MGCP_Adapter all; @@ -26,7 +26,7 @@ /* component references */ var IPA_Emulation_CT vc_IPA; var SCCP_CT vc_SCCP; - var BSSMAP_Emulation_CT vc_BSSMAP; + var RAN_Emulation_CT vc_BSSMAP; var MGCP_Adapter_CT vc_MGCP_UDP; /* test port to SCCP emulation */ port SCCPasp_PT SCCP; @@ -43,7 +43,7 @@ /* create components */ vc_IPA := IPA_Emulation_CT.create(id & "-IPA"); vc_SCCP := SCCP_CT.create(id & "-SCCP"); - vc_BSSMAP := BSSMAP_Emulation_CT.create(id & "-BSSMAP"); + vc_BSSMAP := RAN_Emulation_CT.create(id & "-BSSMAP"); map(vc_IPA:IPA_PORT, system:IPA_CODEC_PT); @@ -64,7 +64,7 @@ vc_IPA.start(IPA_Emulation.main_server(local_ip, local_port)); vc_SCCP.start(SCCPStart(sccp_pars)); - vc_BSSMAP.start(BSSMAP_Emulation.main(MSC_ConnectionHandler.MSC_BssmapOps, id & "-BSSMAP")); + vc_BSSMAP.start(RAN_Emulation.main(MSC_ConnectionHandler.MSC_RanOps, id & "-BSSMAP")); /* wait until termination of respective components */ vc_IPA.done; diff --git a/bsc-nat/gen_links.sh b/bsc-nat/gen_links.sh index 1ab54f1..e54eec4 100755 --- a/bsc-nat/gen_links.sh +++ b/bsc-nat/gen_links.sh @@ -47,7 +47,7 @@ gen_links $DIR $FILES DIR=../library -FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn BSSAP_CodecPort.ttcn" +FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn BSSAP_CodecPort.ttcn" gen_links $DIR $FILES ignore_pp_results diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 1e89cf3..720669b 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -24,7 +24,7 @@ import from IPL4asp_Types all; import from BSSAP_Types all; -import from BSSAP_Adapter all; +import from RAN_Adapter all; import from BSSAP_CodecPort all; import from BSSMAP_Templates all; import from IPA_Emulation all; @@ -82,7 +82,7 @@ var MGCP_Emulation_CT vc_MGCP; port TELNETasp_PT BSCVTY; - var BSSAP_Adapter g_bssap; + var RAN_Adapter g_bssap; /* for old legacy-tests only */ port BSSAP_CODEC_PT BSSAP; @@ -106,7 +106,7 @@ /* IP address at which the test binds */ charstring mp_test_ip := "127.0.0.1"; - BSSAP_Configuration mp_bssap_cfg := { + RAN_Configuration mp_bssap_cfg := { transport := BSSAP_TRANSPORT_AoIP, sccp_service_type := "mtp3_itu", sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" }, @@ -313,10 +313,10 @@ T_guard.start; activate(as_Tguard()); - /* Call a function of our 'parent component' BSSAP_Adapter_CT to start the + /* Call a function of our 'parent component' RAN_Adapter_CT to start the * MSC-side BSSAP emulation */ if (handler_mode) { - f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", MSC_BssmapOps); + f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", MSC_RanOps); f_bssap_start(g_bssap); } else { f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", omit); @@ -1625,10 +1625,10 @@ /*********************************************************************** - * "New world" test cases using RSL_Emulation + BSSMAP_Emulation + * "New world" test cases using RSL_Emulation + RAN_Emulation ***********************************************************************/ -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from RSL_Emulation all; import from MSC_ConnectionHandler all; @@ -1636,7 +1636,7 @@ /* helper function to create and connect a MSC_ConnHdlr component */ private function f_connect_handler(inout MSC_ConnHdlr vc_conn) runs on test_CT { - connect(vc_conn:BSSMAPEM, g_bssap.vc_BSSMAP:PROC); + connect(vc_conn:RAN, g_bssap.vc_RAN:PROC); connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); connect(vc_conn:RSL, bts[0].rsl.vc_RSL:CLIENT_PT); connect(vc_conn:RSL_PROC, bts[0].rsl.vc_RSL:RSL_PROC); @@ -1644,7 +1644,7 @@ connect(vc_conn:RSL1, bts[1].rsl.vc_RSL:CLIENT_PT); connect(vc_conn:RSL1_PROC, bts[1].rsl.vc_RSL:RSL_PROC); } - connect(vc_conn:BSSAP, g_bssap.vc_BSSMAP:CLIENT); + connect(vc_conn:BSSAP, g_bssap.vc_RAN:CLIENT); connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); } @@ -3096,7 +3096,7 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.handover.sccp_addr_bsc, g_pars.handover.sccp_addr_msc, f_gen_handover_req())); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND); /* The RSL Emulation magically accepts the Chan Activ behind the scenes. */ @@ -3168,7 +3168,7 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.handover.sccp_addr_bsc, g_pars.handover.sccp_addr_msc, f_gen_handover_req())); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND); /* The RSL Emulation magically accepts the Chan Activ behind the scenes. */ @@ -3253,7 +3253,7 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.handover.sccp_addr_bsc, g_pars.handover.sccp_addr_msc, f_gen_handover_req())); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND); /* The RSL Emulation magically accepts the Chan Activ behind the scenes. */ @@ -3339,7 +3339,7 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.handover.sccp_addr_bsc, g_pars.handover.sccp_addr_msc, f_gen_handover_req())); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND); /* The RSL Emulation magically accepts the Chan Activ behind the scenes. */ @@ -3430,7 +3430,7 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.handover.sccp_addr_bsc, g_pars.handover.sccp_addr_msc, f_gen_handover_req())); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND); /* The RSL Emulation magically accepts the Chan Activ behind the scenes. */ diff --git a/bsc/BSC_Tests_LCLS.ttcn b/bsc/BSC_Tests_LCLS.ttcn index 67ccecf..f2b9b5d 100644 --- a/bsc/BSC_Tests_LCLS.ttcn +++ b/bsc/BSC_Tests_LCLS.ttcn @@ -24,7 +24,7 @@ import from IPL4asp_Types all; import from BSSAP_Types all; -import from BSSAP_Adapter all; +import from RAN_Adapter all; import from BSSAP_CodecPort all; import from BSSMAP_Templates all; import from IPA_Emulation all; @@ -51,7 +51,7 @@ import from GSM_RR_Types all; import from BSSMAP_Templates all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from MSC_ConnectionHandler all; import from BSC_Tests all; @@ -84,7 +84,7 @@ /* port type between lcls_test_CT and LCLS_MSC_ConnHdlr */ type port LCLS_InterComp_PT message { /* BSSAP from BSSA_ConnHdlr */ - inout PDU_BSSAP, BSSAP_Conn_Prim, PDU_DTAP_MO, PDU_DTAP_MT, + inout PDU_BSSAP, RAN_Conn_Prim, PDU_DTAP_MO, PDU_DTAP_MT, /* RSL from RSL_DchanHdlr */ RSLDC_ChanRqd, RSL_Message, /* MGCP from MGCP_ConnHdlr */ @@ -101,7 +101,7 @@ /* forward messages between the RSL/MGCP/BSSAP Emulation and the master component */ private altstep as_lcls_conn_hdlr_proxy() runs on LCLS_MSC_ConnHdlr { var PDU_BSSAP bssap; - var BSSAP_Conn_Prim bssap_p; + var RAN_Conn_Prim bssap_p; var PDU_DTAP_MO dtap_mo; var PDU_DTAP_MT dtap_mt; var MgcpCommand mgcp_cmd; @@ -109,7 +109,7 @@ var RSL_Message rsl_msg; /* from ConnHdlr to master process */ [] BSSAP.receive(PDU_BSSAP:?) -> value bssap { MASTER.send(bssap); } - [] BSSAP.receive(BSSAP_Conn_Prim:?) -> value bssap_p { MASTER.send(bssap_p); } + [] BSSAP.receive(RAN_Conn_Prim:?) -> value bssap_p { MASTER.send(bssap_p); } [] BSSAP.receive(PDU_DTAP_MO:?) -> value dtap_mo { MASTER.send(dtap_mo); } [] BSSAP.receive(PDU_DTAP_MT:?) -> value dtap_mt { MASTER.send(dtap_mt); } [] MGCP.receive(MgcpCommand:?) -> value mgcp_cmd { MASTER.send(mgcp_cmd); } @@ -117,7 +117,7 @@ [] RSL.receive(RSL_Message:?) -> value rsl_msg { MASTER.send(rsl_msg); } /* from master process to ConnHdlr */ [] MASTER.receive(PDU_BSSAP:?) -> value bssap { BSSAP.send(bssap); } - [] MASTER.receive(BSSAP_Conn_Prim:?) -> value bssap_p { BSSAP.send(bssap_p); } + [] MASTER.receive(RAN_Conn_Prim:?) -> value bssap_p { BSSAP.send(bssap_p); } [] MASTER.receive(PDU_DTAP_MO:?) -> value dtap_mo { BSSAP.send(dtap_mo); } [] MASTER.receive(PDU_DTAP_MT:?) -> value dtap_mt { BSSAP.send(dtap_mt); } [] MASTER.receive(MgcpCommand:?) -> value mgcp_cmd { MGCP.send(mgcp_cmd); } @@ -160,7 +160,7 @@ /* helper function to create and connect a MSC_ConnHdlr component */ /* FIXME: Why can't we use BSC_Tests.f_connect_andler() ?!? */ private function f_connect_handler(inout LCLS_MSC_ConnHdlr vc_conn) runs on lcls_test_CT { - connect(vc_conn:BSSMAPEM, g_bssap.vc_BSSMAP:PROC); + connect(vc_conn:RAN, g_bssap.vc_RAN:PROC); connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); connect(vc_conn:RSL, bts[0].rsl.vc_RSL:CLIENT_PT); connect(vc_conn:RSL_PROC, bts[0].rsl.vc_RSL:RSL_PROC); @@ -168,7 +168,7 @@ connect(vc_conn:RSL1, bts[1].rsl.vc_RSL:CLIENT_PT); connect(vc_conn:RSL1_PROC, bts[1].rsl.vc_RSL:RSL_PROC); } - connect(vc_conn:BSSAP, g_bssap.vc_BSSMAP:CLIENT); + connect(vc_conn:BSSAP, g_bssap.vc_RAN:CLIENT); connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); } @@ -713,7 +713,7 @@ } } [] CONN_A.receive(tr_BSSMAP_ClearComplete) { - CONN_A.send(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); + CONN_A.send(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); } [] CONN_B.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_possible_ls)); } diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 96797c9..36e554d 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -6,7 +6,7 @@ import from GSM_Types all; import from SCCPasp_Types all; import from BSSAP_Types all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from BSSMAP_Templates all; import from IPL4asp_Types all; @@ -330,14 +330,14 @@ } /* this component represents a single subscriber connection at the MSC. - * There is a 1:1 mapping between SCCP connections and BSSAP_ConnHdlr components. - * We inherit all component variables, ports, functions, ... from BSSAP_ConnHdlr */ -type component MSC_ConnHdlr extends BSSAP_ConnHdlr, RSL_DchanHdlr, MGCP_ConnHdlr { + * There is a 1:1 mapping between SCCP connections and RAN_ConnHdlr components. + * We inherit all component variables, ports, functions, ... from RAN_ConnHdlr */ +type component MSC_ConnHdlr extends RAN_ConnHdlr, RSL_DchanHdlr, MGCP_ConnHdlr { /* SCCP Connecction Identifier for the underlying SCCP connection */ var integer g_sccp_conn_id; - /* procedure port back to our parent (BSSMAP_Emulation_CT) for control */ - port BSSMAPEM_PROC_PT BSSMAPEM; + /* procedure port back to our parent (RAN_Emulation_CT) for control */ + port RAN_PROC_PT RAN; port TELNETasp_PT BSCVTY; var MediaState g_media; @@ -357,10 +357,10 @@ } } -/* Callback function from general BSSMAP_Emulation whenever a connectionless +/* Callback function from general RAN_Emulation whenever a connectionless * BSSMAP message arrives. Can retunr a PDU_BSSAP that should be sent in return */ private function UnitdataCallback(PDU_BSSAP bssap) -runs on BSSMAP_Emulation_CT return template PDU_BSSAP { +runs on RAN_Emulation_CT return template PDU_BSSAP { var template PDU_BSSAP resp := omit; /* answer all RESET with a RESET ACK */ @@ -371,8 +371,8 @@ return resp; } -const BssmapOps MSC_BssmapOps := { - create_cb := refers(BSSMAP_Emulation.ExpectedCreateCallback), +const RanOps MSC_RanOps := { + create_cb := refers(RAN_Emulation.ExpectedCreateCallback), unitdata_cb := refers(UnitdataCallback), decode_dtap := false, role_ms := false, @@ -387,8 +387,8 @@ /* register an expect with the BSSMAP core */ private function f_create_bssmap_exp(octetstring l3_enc) runs on MSC_ConnHdlr { - BSSMAPEM.call(BSSMAPEM_register:{l3_enc, self}) { - [] BSSMAPEM.getreply(BSSMAPEM_register:{?, ?}) {}; + RAN.call(RAN_register:{l3_enc, self}) { + [] RAN.getreply(RAN_register:{?, ?}) {}; } } diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh index bf10761..d8393c3 100755 --- a/bsc/gen_links.sh +++ b/bsc/gen_links.sh @@ -67,7 +67,7 @@ gen_links $DIR $FILES DIR=../library -FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn BSSAP_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn" +FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn RAN_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn" gen_links $DIR $FILES ignore_pp_results diff --git a/library/BSSAP_Adapter.ttcn b/library/RAN_Adapter.ttcn similarity index 77% rename from library/BSSAP_Adapter.ttcn rename to library/RAN_Adapter.ttcn index cebdffe..294f747 100644 --- a/library/BSSAP_Adapter.ttcn +++ b/library/RAN_Adapter.ttcn @@ -1,14 +1,13 @@ -module BSSAP_Adapter { +module RAN_Adapter { -/* This module implements a 'dumb' BSSAP adapter. It creates the M3UA and SCCP components and stacks a BSSAP - * codec port on top. As a result, it provides the ability to transceive SCCP-User-SAP primitives with - * deoded BSSAP payload. Use this if you want to have full control about what you transmit or receive, - * without any automatisms in place. Allows you to refuse connections or other abnormal behavior. */ +/* This module implements a 'dumb' RAN adapter. It creates the M3UA and SCCP components and stacks a + * BSSAP/RANAP codec port on top. As a result, it provides the ability to transceive SCCP-User-SAP primitives + * with deoded BSSAP/RANAP payload. Use this if you want to have full control about what you transmit or + * receive, without any automatisms in place. Allows you to refuse connections or other abnormal behavior. */ import from General_Types all; import from Osmocom_Types all; -import from M3UA_Types all; import from M3UA_Emulation all; import from MTP3asp_Types all; import from MTP3asp_PortType all; @@ -23,11 +22,10 @@ import from SCTPasp_Types all; import from SCTPasp_PortType all; -import from BSSAP_CodecPort all; import from BSSMAP_Templates all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; -type record BSSAP_Adapter { +type record RAN_Adapter { /* component references */ M3UA_CT vc_M3UA, /* only in 3GPP AoIP */ IPA_Emulation_CT vc_IPA, /* only in SCCPlite */ @@ -39,17 +37,17 @@ SCCP_PAR_Address sccp_addr_peer, /* handler mode */ - BSSMAP_Emulation_CT vc_BSSMAP + RAN_Emulation_CT vc_RAN } -type enumerated BSSAP_Transport { +type enumerated RAN_Transport { BSSAP_TRANSPORT_AoIP, /* 3GPP AoIP: SCCP over M3UA over SCTP */ BSSAP_TRANSPORT_SCCPlite_SERVER, /* SCCPlite: SCCP over IPA over TCP */ BSSAP_TRANSPORT_SCCPlite_CLIENT /* SCCPlite: SCCP over IPA over TCP */ }; -type record BSSAP_Configuration { - BSSAP_Transport transport, +type record RAN_Configuration { + RAN_Transport transport, charstring sccp_service_type, SCTP_Association_Address sctp_addr, integer own_pc, @@ -60,7 +58,7 @@ integer rctx }; -private function init_pars(inout BSSAP_Adapter ba, in BSSAP_Configuration cfg) { +private function init_pars(inout RAN_Adapter ba, in RAN_Configuration cfg) { ba.sccp_pars := { sio := { ni := substr(oct2bit(cfg.sio),0,2), @@ -78,8 +76,8 @@ } -function f_bssap_init(inout BSSAP_Adapter ba, in BSSAP_Configuration cfg, charstring id, - template BssmapOps ops) { +function f_bssap_init(inout RAN_Adapter ba, in RAN_Configuration cfg, charstring id, + template RanOps ops) { init_pars(ba, cfg); ops.sccp_addr_local := ba.sccp_addr_own; ops.sccp_addr_peer := ba.sccp_addr_peer; @@ -87,7 +85,7 @@ /* create components */ ba.vc_SCCP := SCCP_CT.create(id & "-SCCP"); if (isvalue(ops)) { - ba.vc_BSSMAP := BSSMAP_Emulation_CT.create(id & "-BSSMAP"); + ba.vc_RAN := RAN_Emulation_CT.create(id & "-RAN"); } select (cfg.transport) { case (BSSAP_TRANSPORT_AoIP) { @@ -131,7 +129,7 @@ disconnect(ba.vc_IPA:IPA_SP_PORT, ba.vc_WAIT:IPA_SP_PORT); } case else { - setverdict(fail, "Unsuppored BSSAP_Transport"); + setverdict(fail, "Unsuppored RAN_Transport"); mtc.stop; } } @@ -142,20 +140,20 @@ //T.timeout; log("Connecting BSSMAP Emulation to SCCP_SP_PORT and starting emulation"); /* connect BSSNAP component to upper side of SCCP */ - connect(ba.vc_BSSMAP:BSSAP, ba.vc_SCCP:SCCP_SP_PORT); + connect(ba.vc_RAN:BSSAP, ba.vc_SCCP:SCCP_SP_PORT); if (cfg.transport == BSSAP_TRANSPORT_SCCPlite_SERVER or cfg.transport == BSSAP_TRANSPORT_SCCPlite_CLIENT) { /* connect IPA MGCP port with BSSMAP MGCP port */ - connect(ba.vc_IPA:IPA_MGCP_PORT, ba.vc_BSSMAP:MGCP); + connect(ba.vc_IPA:IPA_MGCP_PORT, ba.vc_RAN:MGCP); } /* start the BSSMAP emulation */ - ba.vc_BSSMAP.start(BSSMAP_Emulation.main(valueof(ops), "")); + ba.vc_RAN.start(RAN_Emulation.main(valueof(ops), "")); } } -function f_bssap_start(inout BSSAP_Adapter ba) { +function f_bssap_start(inout RAN_Adapter ba) { ba.vc_SCCP.start(SCCPStart(ba.sccp_pars)); } diff --git a/library/BSSMAP_Emulation.ttcn b/library/RAN_Emulation.ttcn similarity index 82% rename from library/BSSMAP_Emulation.ttcn rename to library/RAN_Emulation.ttcn index 55ce2fb..5a97a6e 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/RAN_Emulation.ttcn @@ -1,16 +1,16 @@ -module BSSMAP_Emulation { +module RAN_Emulation { -/* BSSMAP Emulation, runs on top of BSSAP_CodecPort. It multiplexes/demultiplexes +/* RAN Emulation, runs on top of BSSAP_CodecPort. It multiplexes/demultiplexes * the individual connections, so there can be separate TTCN-3 components handling * each of the connections. * - * The BSSMAP_Emulation.main() function processes SCCP primitives from the SCCP + * The RAN_Emulation.main() function processes SCCP primitives from the SCCP * stack via the BSSAP_CodecPort, and dispatches them to the per-connection components. * * Outbound BSSAP/SCCP connections are initiated by sending a BSSAP_Conn_Req primitive - * to the component running the BSSMAP_Emulation.main() function. + * to the component running the RAN_Emulation.main() function. * - * For each new inbound connections, the BssmapOps.create_cb() is called. It can create + * For each new inbound connections, the RanOps.create_cb() is called. It can create * or resolve a TTCN-3 component, and returns a component reference to which that inbound * connection is routed/dispatched. * @@ -19,7 +19,7 @@ * if you are simulating BTS + MSC, and first trigger a connection from BTS/RSL side in a * component which then subsequently should also handle the MSC emulation. * - * Inbound Unit Data messages (such as are dispatched to the BssmapOps.unitdata_cb() callback, + * Inbound Unit Data messages (such as are dispatched to the RanOps.unitdata_cb() callback, * which is registered with an argument to the main() function below. * * (C) 2017-2018 by Harald Welte @@ -44,15 +44,15 @@ /* General "base class" component definition, of which specific implementations * derive themselves by means of the "extends" feature */ -type component BSSAP_ConnHdlr { +type component RAN_ConnHdlr { /* port towards MSC Emulator core / SCCP connection dispatchar */ - port BSSAP_Conn_PT BSSAP; + port RAN_Conn_PT BSSAP; /* procedure based port to register for incoming connections */ - port BSSMAPEM_PROC_PT BSSAP_PROC; + port RAN_PROC_PT BSSAP_PROC; } /* Auxiliary primitive that can happen on the port between per-connection client and this dispatcher */ -type enumerated BSSAP_Conn_Prim { +type enumerated RAN_Conn_Prim { /* SCCP tell us that connection was released */ MSC_CONN_PRIM_DISC_IND, /* we tell SCCP to release connection */ @@ -110,11 +110,11 @@ /* port between individual per-connection components and this dispatcher */ -type port BSSAP_Conn_PT message { +type port RAN_Conn_PT message { /* BSSAP or direct DTAP messages from/to clients */ inout PDU_BSSAP, PDU_DTAP_MO, PDU_DTAP_MT, /* misc indications / requests between SCCP and client */ - BSSAP_Conn_Prim, + RAN_Conn_Prim, /* Client requests us to create SCCP Connection */ BSSAP_Conn_Req, /* MGCP, only used for IPA SCCPlite (MGCP in IPA mux) */ @@ -125,7 +125,7 @@ /* represents a single BSSAP connection over SCCP */ type record ConnectionData { /* reference to the instance of the per-connection component */ - BSSAP_ConnHdlr comp_ref, + RAN_ConnHdlr comp_ref, integer sccp_conn_id, /* most recent MGCP transaction ID (Used on MSC side) */ MgcpTransId mgcp_trans_id optional, @@ -136,16 +136,16 @@ } type record ImsiMapping { - BSSAP_ConnHdlr comp_ref, + RAN_ConnHdlr comp_ref, hexstring imsi optional, OCT4 tmsi } -type component BSSMAP_Emulation_CT { +type component RAN_Emulation_CT { /* SCCP port on the bottom side, using ASP primitives */ port BSSAP_CODEC_PT BSSAP; /* BSSAP port to the per-connection clients */ - port BSSAP_Conn_PT CLIENT; + port RAN_Conn_PT CLIENT; /* MGCP port */ port IPA_MGCP_PT MGCP; @@ -159,15 +159,15 @@ var ImsiMapping ImsiTable[16]; /* procedure based port to register for incoming connections */ - port BSSMAPEM_PROC_PT PROC; + port RAN_PROC_PT PROC; - var charstring g_bssmap_id; + var charstring g_ran_id; var integer g_next_e1_ts := 1; - var BssmapOps g_bssmap_ops; + var RanOps g_ran_ops; }; private function f_conn_id_known(integer sccp_conn_id) -runs on BSSMAP_Emulation_CT return boolean { +runs on RAN_Emulation_CT return boolean { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].sccp_conn_id == sccp_conn_id){ @@ -177,8 +177,8 @@ return false; } -private function f_comp_known(BSSAP_ConnHdlr client) -runs on BSSMAP_Emulation_CT return boolean { +private function f_comp_known(RAN_ConnHdlr client) +runs on RAN_Emulation_CT return boolean { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].comp_ref == client) { @@ -189,7 +189,7 @@ } private function f_cic_known(integer cic) -runs on BSSMAP_Emulation_CT return boolean { +runs on RAN_Emulation_CT return boolean { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].cic == cic) { @@ -201,32 +201,32 @@ /* resolve component reference by connection ID */ private function f_comp_by_conn_id(integer sccp_conn_id) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { +runs on RAN_Emulation_CT return RAN_ConnHdlr { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].sccp_conn_id == sccp_conn_id) { return ConnectionTable[i].comp_ref; } } - setverdict(fail, "BSSMAP Connection table not found by SCCP Connection ID ", sccp_conn_id); + setverdict(fail, "RAN Connection table not found by SCCP Connection ID ", sccp_conn_id); mtc.stop; } /* resolve component reference by CIC */ private function f_comp_by_mgcp_tid(MgcpTransId tid) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { +runs on RAN_Emulation_CT return RAN_ConnHdlr { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].mgcp_trans_id == tid) { return ConnectionTable[i].comp_ref; } } - setverdict(fail, "BSSMAP Connection table not found by MGCP Transaction ID ", tid); + setverdict(fail, "RAN Connection table not found by MGCP Transaction ID ", tid); mtc.stop; } -private function f_comp_store_mgcp_tid(BSSAP_ConnHdlr client, MgcpTransId tid) -runs on BSSMAP_Emulation_CT { +private function f_comp_store_mgcp_tid(RAN_ConnHdlr client, MgcpTransId tid) +runs on RAN_Emulation_CT { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].comp_ref == client) { @@ -234,24 +234,24 @@ return; } } - setverdict(fail, "BSSMAP Connection table not found by component ", client); + setverdict(fail, "RAN Connection table not found by component ", client); mtc.stop; } private function f_comp_by_cic(integer cic) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { +runs on RAN_Emulation_CT return RAN_ConnHdlr { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].cic == cic) { return ConnectionTable[i].comp_ref; } } - setverdict(fail, "BSSMAP Connection table not found by CIC ", cic); + setverdict(fail, "RAN Connection table not found by CIC ", cic); mtc.stop; } -private function f_comp_store_cic(BSSAP_ConnHdlr client, integer cic) -runs on BSSMAP_Emulation_CT { +private function f_comp_store_cic(RAN_ConnHdlr client, integer cic) +runs on RAN_Emulation_CT { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].comp_ref == client) { @@ -259,36 +259,36 @@ return; } } - setverdict(fail, "BSSMAP Connection table not found by component ", client); + setverdict(fail, "RAN Connection table not found by component ", client); mtc.stop; } /* resolve connection ID by component reference */ -private function f_conn_id_by_comp(BSSAP_ConnHdlr client) -runs on BSSMAP_Emulation_CT return integer { +private function f_conn_id_by_comp(RAN_ConnHdlr client) +runs on RAN_Emulation_CT return integer { for (var integer i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].comp_ref == client) { return ConnectionTable[i].sccp_conn_id; } } - setverdict(fail, "BSSMAP Connection table not found by component ", client); + setverdict(fail, "RAN Connection table not found by component ", client); mtc.stop; } /* resolve ConnectionTable index component reference */ -private function f_idx_by_comp(BSSAP_ConnHdlr client) -runs on BSSMAP_Emulation_CT return integer { +private function f_idx_by_comp(RAN_ConnHdlr client) +runs on RAN_Emulation_CT return integer { for (var integer i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].comp_ref == client) { return i; } } - setverdict(fail, "BSSMAP Connection table not found by component ", client); + setverdict(fail, "RAN Connection table not found by component ", client); mtc.stop; } private function f_gen_conn_id() -runs on BSSMAP_Emulation_CT return integer { +runs on RAN_Emulation_CT return integer { var integer conn_id; do { @@ -299,7 +299,7 @@ } private function f_conn_table_init() -runs on BSSMAP_Emulation_CT { +runs on RAN_Emulation_CT { for (var integer i := 0; i < sizeof(ConnectionTable); i := i+1) { ConnectionTable[i].comp_ref := null; ConnectionTable[i].sccp_conn_id := -1; @@ -314,8 +314,8 @@ } } -private function f_conn_table_add(BSSAP_ConnHdlr comp_ref, integer sccp_conn_id) -runs on BSSMAP_Emulation_CT { +private function f_conn_table_add(RAN_ConnHdlr comp_ref, integer sccp_conn_id) +runs on RAN_Emulation_CT { for (var integer i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].sccp_conn_id == -1) { ConnectionTable[i].comp_ref := comp_ref; @@ -325,11 +325,11 @@ return; } } - testcase.stop("BSSMAP Connection table full!"); + testcase.stop("RAN Connection table full!"); } private function f_conn_table_del(integer sccp_conn_id) -runs on BSSMAP_Emulation_CT { +runs on RAN_Emulation_CT { for (var integer i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].sccp_conn_id == sccp_conn_id) { log("Deleted conn table entry ", i, @@ -339,12 +339,12 @@ return } } - setverdict(fail, "BSSMAP Connection table attempt to delete non-existant ", sccp_conn_id); + setverdict(fail, "RAN Connection table attempt to delete non-existant ", sccp_conn_id); mtc.stop; } private function f_imsi_table_find(hexstring imsi, template OCT4 tmsi) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { +runs on RAN_Emulation_CT return RAN_ConnHdlr { for (var integer i := 0; i < sizeof(ImsiTable); i := i+1) { if (ImsiTable[i].imsi == imsi or isvalue(tmsi) and match(ImsiTable[i].tmsi, tmsi)) { @@ -355,8 +355,8 @@ } /* handle (optional) userData portion of various primitives and dispatch it to the client */ -private function f_handle_userData(BSSAP_ConnHdlr client, PDU_BSSAP bssap) -runs on BSSMAP_Emulation_CT { +private function f_handle_userData(RAN_ConnHdlr client, PDU_BSSAP bssap) +runs on RAN_Emulation_CT { /* decode + send decoded BSSAP to client */ if (ischosen(bssap.pdu.bssmap)) { @@ -370,8 +370,8 @@ } } - if (ischosen(bssap.pdu.dtap) and g_bssmap_ops.decode_dtap) { - if (g_bssmap_ops.role_ms) { + if (ischosen(bssap.pdu.dtap) and g_ran_ops.decode_dtap) { + if (g_ran_ops.role_ms) { /* we are the MS, so any message to us must be MT */ var PDU_DTAP_MT mt := { dlci := bssap.dlci, @@ -394,16 +394,16 @@ /* call-back type, to be provided by specific implementation; called when new SCCP connection * arrives */ type function BssmapCreateCallback(BSSAP_N_CONNECT_ind conn_ind, charstring id) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr; +runs on RAN_Emulation_CT return RAN_ConnHdlr; type function BssmapUnitdataCallback(PDU_BSSAP bssap) -runs on BSSMAP_Emulation_CT return template PDU_BSSAP; +runs on RAN_Emulation_CT return template PDU_BSSAP; /* handle common Unitdata such as Paging */ private function CommonBssmapUnitdataCallback(PDU_BSSAP bssap) -runs on BSSMAP_Emulation_CT return template PDU_BSSAP { +runs on RAN_Emulation_CT return template PDU_BSSAP { if (match(bssap, tr_BSSMAP_Paging)) { - var BSSAP_ConnHdlr client := null; + var RAN_ConnHdlr client := null; client := f_imsi_table_find(bssap.pdu.bssmap.paging.iMSI.digits, bssap.pdu.bssmap.paging.tMSI.tmsiOctets); if (isvalue(client)) { @@ -417,10 +417,10 @@ log("CommonBssmapUnitdataCallback: Not a paging message"); } /* ELSE: handle in user callback */ - return g_bssmap_ops.unitdata_cb.apply(bssap); + return g_ran_ops.unitdata_cb.apply(bssap); } -type record BssmapOps { +type record RanOps { BssmapCreateCallback create_cb, BssmapUnitdataCallback unitdata_cb, boolean decode_dtap, @@ -472,7 +472,7 @@ return false; } -private altstep as_reset_ack() runs on BSSMAP_Emulation_CT { +private altstep as_reset_ack() runs on RAN_Emulation_CT { var BSSAP_N_UNITDATA_ind ud_ind; [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) -> value ud_ind { log("Respoding to inbound RESET with RESET-ACK"); @@ -483,7 +483,7 @@ } -private function f_bssap_wait_for_reset() runs on BSSMAP_Emulation_CT { +private function f_bssap_wait_for_reset() runs on RAN_Emulation_CT { var BSSAP_N_UNITDATA_ind ud_ind; timer T := 20.0; @@ -504,7 +504,7 @@ } } -function f_bssap_reset(SCCP_PAR_Address peer, SCCP_PAR_Address own) runs on BSSMAP_Emulation_CT { +function f_bssap_reset(SCCP_PAR_Address peer, SCCP_PAR_Address own) runs on RAN_Emulation_CT { timer T := 5.0; BSSAP.send(ts_BSSAP_UNITDATA_req(peer, own, ts_BSSMAP_Reset(0))); @@ -522,10 +522,10 @@ } } -function main(BssmapOps ops, charstring id) runs on BSSMAP_Emulation_CT { +function main(RanOps ops, charstring id) runs on RAN_Emulation_CT { - g_bssmap_id := id; - g_bssmap_ops := ops; + g_ran_id := id; + g_ran_ops := ops; f_conn_table_init(); f_expect_table_init(); @@ -541,13 +541,13 @@ var BSSAP_N_DATA_ind data_ind; var BSSAP_N_DISCONNECT_ind disc_ind; var BSSAP_Conn_Req creq; - var BSSAP_ConnHdlr vc_conn; + var RAN_ConnHdlr vc_conn; var PDU_BSSAP bssap; var PDU_DTAP_MO dtap_mo; var PDU_DTAP_MT dtap_mt; var MgcpCommand mgcp_req; var MgcpResponse mgcp_resp; - var BSSAP_ConnHdlr vc_hdlr; + var RAN_ConnHdlr vc_hdlr; var octetstring l3_info; var hexstring imsi; var OCT4 tmsi; @@ -590,7 +590,7 @@ f_handle_userData(vc_conn, disc_ind.userData); } /* notify client about termination */ - var BSSAP_Conn_Prim prim := MSC_CONN_PRIM_DISC_IND; + var RAN_Conn_Prim prim := MSC_CONN_PRIM_DISC_IND; CLIENT.send(prim) to vc_conn; f_conn_table_del(disc_ind.connectionId); /* TOOD: return confirm to other side? */ @@ -599,7 +599,7 @@ /* SCCP -> Client: connection confirm for outbound connection */ [] BSSAP.receive(BSSAP_N_CONNECT_cfm:?) -> value conn_cfm { vc_conn := f_comp_by_conn_id(conn_cfm.connectionId); - var BSSAP_Conn_Prim prim := MSC_CONN_PRIM_CONF_IND; + var RAN_Conn_Prim prim := MSC_CONN_PRIM_CONF_IND; CLIENT.send(prim) to vc_conn; /* handle user payload */ if (ispresent(conn_cfm.userData)) { @@ -608,7 +608,7 @@ } /* Disconnect request client -> SCCP */ - [] CLIENT.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_REQ) -> sender vc_conn { + [] CLIENT.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ) -> sender vc_conn { var integer conn_id := f_conn_id_by_comp(vc_conn); BSSAP.send(ts_BSSAP_DISC_req(conn_id, 0)); f_conn_table_del(conn_id); @@ -636,7 +636,7 @@ /* InitialL3 contains RR (PAG RESP) or MM (CM SRV REQ), we must increment * counter only on MM/CC/SS, but not on RR */ - if (g_bssmap_ops.role_ms and not f_bssap_l3_is_rr(creq.bssap)) { + if (g_ran_ops.role_ms and not f_bssap_l3_is_rr(creq.bssap)) { /* we have just sent the first MM message, increment the counter */ var integer idx := f_idx_by_comp(vc_conn); ConnectionTable[idx].n_sd[0] := 1; @@ -651,7 +651,7 @@ BSSAP.send(ts_BSSAP_DATA_req(conn_id, bssap)); } - [g_bssmap_ops.role_ms] CLIENT.receive(PDU_DTAP_MO:?) -> value dtap_mo sender vc_conn { + [g_ran_ops.role_ms] CLIENT.receive(PDU_DTAP_MO:?) -> value dtap_mo sender vc_conn { var integer idx := f_idx_by_comp(vc_conn); /* convert from decoded DTAP to encoded DTAP */ var octetstring l3_enc := enc_PDU_ML3_MS_NW(dtap_mo.dtap); @@ -663,7 +663,7 @@ BSSAP.send(ts_BSSAP_DATA_req(ConnectionTable[idx].sccp_conn_id, bssap)); } - [not g_bssmap_ops.role_ms] CLIENT.receive(PDU_DTAP_MT:?) -> value dtap_mt sender vc_conn { + [not g_ran_ops.role_ms] CLIENT.receive(PDU_DTAP_MT:?) -> value dtap_mt sender vc_conn { var integer conn_id := f_conn_id_by_comp(vc_conn); /* convert from decoded DTAP to encoded DTAP */ var octetstring l3_enc := enc_PDU_ML3_NW_MS(dtap_mt.dtap); @@ -712,14 +712,14 @@ } - [] PROC.getcall(BSSMAPEM_register:{?,?}) -> param(l3_info, vc_hdlr) { + [] PROC.getcall(RAN_register:{?,?}) -> param(l3_info, vc_hdlr) { f_create_expect(l3_info, vc_hdlr); - PROC.reply(BSSMAPEM_register:{l3_info, vc_hdlr}) to vc_hdlr; + PROC.reply(RAN_register:{l3_info, vc_hdlr}) to vc_hdlr; } - [] PROC.getcall(BSSMAPEM_register_imsi:{?,?,?}) -> param(imsi, tmsi, vc_hdlr) { + [] PROC.getcall(RAN_register_imsi:{?,?,?}) -> param(imsi, tmsi, vc_hdlr) { f_create_imsi(imsi, tmsi, vc_hdlr); - PROC.reply(BSSMAPEM_register_imsi:{imsi, tmsi, vc_hdlr}) to vc_hdlr; + PROC.reply(RAN_register_imsi:{imsi, tmsi, vc_hdlr}) to vc_hdlr; } @@ -742,23 +742,23 @@ /* L3 payload based on which we can match it */ octetstring l3_payload optional, /* component reference for this connection */ - BSSAP_ConnHdlr vc_conn + RAN_ConnHdlr vc_conn } /* procedure based port to register for incoming connections */ -signature BSSMAPEM_register(in octetstring l3, in BSSAP_ConnHdlr hdlr); +signature RAN_register(in octetstring l3, in RAN_ConnHdlr hdlr); /* procedure based port to register for incoming IMSI/TMSI */ -signature BSSMAPEM_register_imsi(in hexstring imsi, in OCT4 tmsi, in BSSAP_ConnHdlr hdlr); +signature RAN_register_imsi(in hexstring imsi, in OCT4 tmsi, in RAN_ConnHdlr hdlr); -type port BSSMAPEM_PROC_PT procedure { - inout BSSMAPEM_register, BSSMAPEM_register_imsi; +type port RAN_PROC_PT procedure { + inout RAN_register, RAN_register_imsi; } with { extension "internal" }; /* CreateCallback that can be used as create_cb and will use the expectation table */ function ExpectedCreateCallback(BSSAP_N_CONNECT_ind conn_ind, charstring id) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { - var BSSAP_ConnHdlr ret := null; +runs on RAN_Emulation_CT return RAN_ConnHdlr { + var RAN_ConnHdlr ret := null; var octetstring l3_info; var integer i; @@ -788,8 +788,8 @@ return ret; } -private function f_create_expect(octetstring l3, BSSAP_ConnHdlr hdlr) -runs on BSSMAP_Emulation_CT { +private function f_create_expect(octetstring l3, RAN_ConnHdlr hdlr) +runs on RAN_Emulation_CT { var integer i; for (i := 0; i < sizeof(ExpectTable); i := i+1) { if (not ispresent(ExpectTable[i].l3_payload)) { @@ -802,8 +802,8 @@ testcase.stop("No space left in ExpectTable"); } -private function f_create_imsi(hexstring imsi, OCT4 tmsi, BSSAP_ConnHdlr hdlr) -runs on BSSMAP_Emulation_CT { +private function f_create_imsi(hexstring imsi, OCT4 tmsi, RAN_ConnHdlr hdlr) +runs on RAN_Emulation_CT { for (var integer i := 0; i < sizeof(ImsiTable); i := i+1) { if (not ispresent(ImsiTable[i].imsi)) { ImsiTable[i].imsi := imsi; @@ -818,17 +818,17 @@ private function f_expect_table_init() -runs on BSSMAP_Emulation_CT { +runs on RAN_Emulation_CT { for (var integer i := 0; i < sizeof(ExpectTable); i := i+1) { ExpectTable[i].l3_payload := omit; } } /* helper function for clients to register their IMSI/TMSI */ -function f_bssmap_register_imsi(hexstring imsi, OCT4 tmsi) -runs on BSSAP_ConnHdlr { - BSSAP_PROC.call(BSSMAPEM_register_imsi:{imsi, tmsi, self}) { - [] BSSAP_PROC.getreply(BSSMAPEM_register_imsi:{?,?,?}) {}; +function f_ran_register_imsi(hexstring imsi, OCT4 tmsi) +runs on RAN_ConnHdlr { + BSSAP_PROC.call(RAN_register_imsi:{imsi, tmsi, self}) { + [] BSSAP_PROC.getreply(RAN_register_imsi:{?,?,?}) {}; } } diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 8e5c5f2..00e86f1 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -7,7 +7,7 @@ import from IPL4asp_Types all; import from SCCPasp_Types all; import from BSSAP_Types all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from BSSMAP_Templates all; import from GSUP_Types all; @@ -42,7 +42,7 @@ import from SGsAP_Emulation all; /* this component represents a single subscriber connection */ -type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr, MGCP_ConnHdlr, SMPP_ConnHdlr, CTRL_Adapter_CT, SGsAP_ConnHdlr { +type component BSC_ConnHdlr extends RAN_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr, MGCP_ConnHdlr, SMPP_ConnHdlr, CTRL_Adapter_CT, SGsAP_ConnHdlr { var BSC_ConnHdlrPars g_pars; timer g_Tguard := 60.0; port TELNETasp_PT MSCVTY; @@ -155,10 +155,10 @@ } -/* Callback function from general BSSMAP_Emulation whenever a connectionless +/* Callback function from general RAN_Emulation whenever a connectionless * BSSMAP message arrives. Canreturn a PDU_BSSAPthat should be sent in return */ private function BscUnitdataCallback(PDU_BSSAP bssap) -runs on BSSMAP_Emulation_CT return template PDU_BSSAP { +runs on RAN_Emulation_CT return template PDU_BSSAP { var template PDU_BSSAP resp := omit; log("BSSMAP_BscUnitdataCallback"); @@ -172,9 +172,9 @@ return resp; } -const BssmapOps BSC_BssmapOps := { +const RanOps BSC_RanOps := { /* Create call-back for inbound connections from MSC (hand-over) */ - create_cb := refers(BSSMAP_Emulation.ExpectedCreateCallback), + create_cb := refers(RAN_Emulation.ExpectedCreateCallback), unitdata_cb := refers(BscUnitdataCallback), decode_dtap := true, role_ms := true, @@ -196,7 +196,7 @@ -/* Encode 'l3' and ask BSSMAP_Emulation to create new connection with COMPL L3 INFO */ +/* Encode 'l3' and ask RAN_Emulation to create new connection with COMPL L3 INFO */ function f_bssap_compl_l3(PDU_ML3_MS_NW l3) runs on BSC_ConnHdlr { log("Sending COMPL L3: ", l3); @@ -204,8 +204,8 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, l3_enc)))); alt { - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {} - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {} + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { setverdict(fail, "DISC.ind from SCCP"); mtc.stop; } @@ -386,12 +386,12 @@ /* FIXME: there could be pending SMS or other common procedures by the MSC, let's ignore them */ BSSAP.receive(tr_BSSMAP_ClearCommand); BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND); setverdict(pass); } function f_foo() runs on BSC_ConnHdlr{ - /* SCCP CC handled by BSSMAP_Emulation_CT.main() */ + /* SCCP CC handled by RAN_Emulation_CT.main() */ /* Expect auth, if enabled */ /* TODO: ISD */ @@ -475,7 +475,7 @@ var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); f_establish_fully(EST_TYPE_PAG_RESP); @@ -557,7 +557,7 @@ f_mt_call_initate(cpars); /* BSC <- MSC: Expect paging. FIXME: By TMSI or not? */ - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); /* Complete the call via BSSAP */ @@ -693,7 +693,7 @@ interleave { [] BSSAP.receive(t_clear) { BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND); } [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { if (respond_to_dlcx) { @@ -793,7 +793,7 @@ [] BSSAP.receive(tr_BSSMAP_ClearCommand) { BSSAP.send(ts_BSSMAP_ClearComplete); alt { - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { setverdict(pass); } [] BSSAP.receive { diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 13d1ddb..b6b1038 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -36,10 +36,10 @@ import from IPA_Emulation all; import from BSSAP_Types all; -import from BSSAP_Adapter all; +import from RAN_Adapter all; import from BSSAP_CodecPort all; import from BSSMAP_Templates all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from BSC_ConnectionHandler all; import from SGsAP_Templates all; @@ -66,7 +66,7 @@ import from TCCConversion_Functions all; const integer NUM_BSC := 2; -type record of BSSAP_Configuration BSSAP_Configurations; +type record of RAN_Configuration RAN_Configurations; /* Needed for SGsAP SMS */ import from MobileL3_SMS_Types all; @@ -74,7 +74,7 @@ type component MTC_CT extends CTRL_Adapter_CT { var boolean g_initialized := false; - var BSSAP_Adapter g_bssap[NUM_BSC]; + var RAN_Adapter g_bssap[NUM_BSC]; /* no 'adapter_CT' for MNCC or GSUP */ var MNCC_Emulation_CT vc_MNCC; @@ -121,7 +121,7 @@ charstring mp_mme_name := "mmec01.mmegi0001.mme.epc.mnc070.mcc901.3gppnetwork.org"; charstring mp_vlr_name := "vlr.example.net"; - BSSAP_Configurations mp_bssap_cfg := { + RAN_Configurations mp_bssap_cfg := { { sccp_service_type := "mtp3_itu", sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" }, @@ -277,7 +277,7 @@ for (var integer i := 0; i < num_bsc; i := i + 1) { if (isbound(mp_bssap_cfg[i])) { - f_bssap_init(g_bssap[i], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), BSC_BssmapOps); + f_bssap_init(g_bssap[i], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), BSC_RanOps); f_bssap_start(g_bssap[i]); } else { testcase.stop("missing BSSAP configuration"); @@ -522,8 +522,8 @@ vc_conn := BSC_ConnHdlr.create(id); /* BSSMAP part / A interface */ - connect(vc_conn:BSSAP, g_bssap[0].vc_BSSMAP:CLIENT); - connect(vc_conn:BSSAP_PROC, g_bssap[0].vc_BSSMAP:PROC); + connect(vc_conn:BSSAP, g_bssap[0].vc_RAN:CLIENT); + connect(vc_conn:BSSAP_PROC, g_bssap[0].vc_RAN:PROC); /* MNCC part */ connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT); connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC); @@ -804,7 +804,7 @@ mtc.stop; repeat; } - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} } setverdict(pass); } @@ -834,7 +834,7 @@ f_sleep(1.0); /* send clear request in the middle of the LU */ - BSSAP.send(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); + BSSAP.send(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); setverdict(pass); f_sleep(1.0); } @@ -1197,10 +1197,10 @@ timer T := 5.0; T.start; alt { - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} /* Expect LU REJECT with Cause == Illegal MS */ [] BSSAP.receive(tr_PDU_DTAP_MT(?)) { repeat; } - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) { repeat; } + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND) { repeat; } [] as_clear_cmd_compl_disc(); [] T.timeout { setverdict(fail, "Timeout waiting for ClearCommand or SCCP Release"); @@ -1236,9 +1236,9 @@ T.start; alt { /* Immediate disconnect */ - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} [] BSSAP.receive(tr_PDU_DTAP_MT(?)) { repeat; } - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) { repeat; } + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND) { repeat; } [] as_clear_cmd_compl_disc(); [] T.timeout { setverdict(fail, "Timeout waiting for ClearCommand or SCCP Release"); @@ -1435,7 +1435,7 @@ } else { tmsi := 'FFFFFFFF'O; } - f_bssmap_register_imsi(g_pars.imsi, tmsi); + f_ran_register_imsi(g_pars.imsi, tmsi); /* Allocate call reference and send SETUP via MNCC to MSC */ cpars.mncc_callref := f_rnd_int(2147483648); @@ -2010,7 +2010,7 @@ } else { tmsi := 'FFFFFFFF'O; } - f_bssmap_register_imsi(g_pars.imsi, tmsi); + f_ran_register_imsi(g_pars.imsi, tmsi); f_vty_sms_send(hex2str(pars.imsi), "2342", "Hello SMS"); @@ -2049,7 +2049,7 @@ } else { tmsi := 'FFFFFFFF'O; } - f_bssmap_register_imsi(g_pars.imsi, tmsi); + f_ran_register_imsi(g_pars.imsi, tmsi); f_vty_sms_send(hex2str(pars.imsi), "2342", "Hello SMS"); @@ -2316,9 +2316,9 @@ /* Register an 'expect' for given IMSI (+TMSI) */ if (isvalue(g_pars.tmsi)) { - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); } else { - f_bssmap_register_imsi(g_pars.imsi, 'FFFFFFFF'O); + f_ran_register_imsi(g_pars.imsi, 'FFFFFFFF'O); } var template GSUP_PDU mt_forwardSM_res := tr_GSUP_MT_FORWARD_SM_RES( @@ -2380,9 +2380,9 @@ /* Register an 'expect' for given IMSI (+TMSI) */ if (isvalue(g_pars.tmsi)) { - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); } else { - f_bssmap_register_imsi(g_pars.imsi, 'FFFFFFFF'O); + f_ran_register_imsi(g_pars.imsi, 'FFFFFFFF'O); } var template GSUP_PDU mt_forwardSM_err := tr_GSUP_MT_FORWARD_SM_ERR( @@ -2446,9 +2446,9 @@ /* Register an 'expect' for given IMSI (+TMSI) */ if (isvalue(g_pars.tmsi)) { - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); } else { - f_bssmap_register_imsi(g_pars.imsi, 'FFFFFFFF'O); + f_ran_register_imsi(g_pars.imsi, 'FFFFFFFF'O); } /* Submit the 1st MT SMS on GSUP */ @@ -2558,9 +2558,9 @@ /* Register an 'expect' for given IMSI (+TMSI) */ if (isvalue(g_pars.tmsi)) { - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); } else { - f_bssmap_register_imsi(g_pars.imsi, 'FFFFFFFF'O); + f_ran_register_imsi(g_pars.imsi, 'FFFFFFFF'O); } /* Send CM Service Request for MO SMMA */ @@ -2661,9 +2661,9 @@ /* Register an 'expect' for given IMSI (+TMSI) */ if (isvalue(g_pars.tmsi)) { - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); } else { - f_bssmap_register_imsi(g_pars.imsi, 'FFFFFFFF'O); + f_ran_register_imsi(g_pars.imsi, 'FFFFFFFF'O); } var template GSUP_PDU mt_forwardSM_res := tr_GSUP_MT_FORWARD_SM_RES( @@ -2818,7 +2818,7 @@ } else { tmsi := 'FFFFFFFF'O; } - f_bssmap_register_imsi(g_pars.imsi, tmsi); + f_ran_register_imsi(g_pars.imsi, tmsi); var SmsParameters spars := valueof(t_SmsPars); /* TODO: test with more intelligent user data; test different coding schemes */ @@ -2969,7 +2969,7 @@ /* Perform location update */ f_perform_lu(); - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); /* We need to inspect GSUP activity */ f_create_gsup_expect(hex2str(g_pars.imsi)); @@ -3582,7 +3582,7 @@ /* Trigger a paging request and expect the paging on BSSMAP, this is * to make sure that pagings are sent throught the A-Interface again * and not throught the SGs interface.*/ - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); f_vty_transceive(MSCVTY, "subscriber imsi " & hex2str(g_pars.imsi) & " paging"); alt { diff --git a/msc/gen_links.sh b/msc/gen_links.sh index 117564e..a29118a 100755 --- a/msc/gen_links.sh +++ b/msc/gen_links.sh @@ -89,7 +89,7 @@ FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc " FILES+="IPA_Types.ttcn IPA_Emulation.ttcnpp IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc GSUP_Types.ttcn GSUP_Emulation.ttcn " FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Common.ttcn " -FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn " +FILES+="RAN_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn RAN_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn " FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc " FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc " FILES+="SMPP_CodecPort.ttcn SMPP_CodecPort_CtrlFunct.ttcn SMPP_CodecPort_CtrlFunctDef.cc SMPP_Emulation.ttcn SMPP_Templates.ttcn " -- To view, visit https://gerrit.osmocom.org/13650 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iecbcb0c6c136baad9460eca40606bb4010d8882d Gerrit-Change-Number: 13650 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 19:52:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 19:52:12 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Modularize protocol support Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13651 Change subject: RAN_Emulation: Modularize protocol support ...................................................................... RAN_Emulation: Modularize protocol support The RAN_Emulation currently unconditionally provides BSSAP and MGCP support. Let's re-structure the code so that support for those protocols is now possible to enable/disable at compile time. This patch is in preparation of introducing RANAP support in RAN_Emulation. Change-Id: Id53ba3ff05f9946230e0e4a759245de14a0f9fbd Related: OS#2856 --- M bsc-nat/BSC_MS_ConnectionHandler.ttcn M bsc-nat/MSC_ConnectionHandler.ttcn M bsc-nat/gen_links.sh M bsc-nat/regen_makefile.sh M bsc/MSC_ConnectionHandler.ttcn M bsc/gen_links.sh M bsc/regen_makefile.sh R library/RAN_Adapter.ttcnpp R library/RAN_Emulation.ttcnpp M msc/BSC_ConnectionHandler.ttcn M msc/gen_links.sh M msc/regen_makefile.sh 12 files changed, 216 insertions(+), 141 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/51/13651/1 diff --git a/bsc-nat/BSC_MS_ConnectionHandler.ttcn b/bsc-nat/BSC_MS_ConnectionHandler.ttcn index 63d0451..e52b678 100644 --- a/bsc-nat/BSC_MS_ConnectionHandler.ttcn +++ b/bsc-nat/BSC_MS_ConnectionHandler.ttcn @@ -53,6 +53,7 @@ unitdata_cb := refers(UnitdataCallback), decode_dtap := false, role_ms := true, + protocol := RAN_PROTOCOL_BSSAP, sccp_addr_local := omit, sccp_addr_peer := omit } diff --git a/bsc-nat/MSC_ConnectionHandler.ttcn b/bsc-nat/MSC_ConnectionHandler.ttcn index 383b67b..8635a29 100644 --- a/bsc-nat/MSC_ConnectionHandler.ttcn +++ b/bsc-nat/MSC_ConnectionHandler.ttcn @@ -59,6 +59,7 @@ unitdata_cb := refers(UnitdataCallback), decode_dtap := false, role_ms := false, + protocol := RAN_PROTOCOL_BSSAP, sccp_addr_local := omit, sccp_addr_peer := omit } diff --git a/bsc-nat/gen_links.sh b/bsc-nat/gen_links.sh index e54eec4..16e32b7 100755 --- a/bsc-nat/gen_links.sh +++ b/bsc-nat/gen_links.sh @@ -47,7 +47,7 @@ gen_links $DIR $FILES DIR=../library -FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn BSSAP_CodecPort.ttcn" +FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcnpp MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn BSSAP_CodecPort.ttcn" gen_links $DIR $FILES ignore_pp_results diff --git a/bsc-nat/regen_makefile.sh b/bsc-nat/regen_makefile.sh index c5fe64c..f49df7e 100755 --- a/bsc-nat/regen_makefile.sh +++ b/bsc-nat/regen_makefile.sh @@ -4,6 +4,6 @@ FILES="*.ttcn *.ttcnpp SCCP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc RTP_EncDec.cc SDP_EncDec.cc *.c MGCP_CodecPort_CtrlFunctDef.cc" -export CPPFLAGS_TTCN3="-DIPA_EMULATION_SCCP -DIPA_EMULATION_MGCP -DUSE_MTP3_DISTRIBUTOR" +export CPPFLAGS_TTCN3="-DIPA_EMULATION_SCCP -DIPA_EMULATION_MGCP -DRAN_EMULATION_BSSAP -DRAN_EMULATION_MGCP -DUSE_MTP3_DISTRIBUTOR" ../regen-makefile.sh $MAIN $FILES diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 36e554d..520cc3e 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -376,6 +376,7 @@ unitdata_cb := refers(UnitdataCallback), decode_dtap := false, role_ms := false, + protocol := RAN_PROTOCOL_BSSAP, sccp_addr_local := omit, sccp_addr_peer := omit } diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh index d8393c3..a4f09f4 100755 --- a/bsc/gen_links.sh +++ b/bsc/gen_links.sh @@ -67,7 +67,7 @@ gen_links $DIR $FILES DIR=../library -FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn RAN_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn" +FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcnpp RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn RAN_Adapter.ttcnpp Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn" gen_links $DIR $FILES ignore_pp_results diff --git a/bsc/regen_makefile.sh b/bsc/regen_makefile.sh index 08629d2..06fa812 100755 --- a/bsc/regen_makefile.sh +++ b/bsc/regen_makefile.sh @@ -4,6 +4,6 @@ FILES="*.ttcn *.ttcnpp IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc SCTPasp_PT.cc RTP_EncDec.cc SDP_EncDec.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc IuUP_EncDec.cc Native_FunctionDefs.cc TELNETasp_PT.cc *.c" -export CPPFLAGS_TTCN3="-DIPA_EMULATION_RSL -DIPA_EMULATION_MGCP -DIPA_EMULATION_SCCP -DUSE_MTP3_DISTRIBUTOR" +export CPPFLAGS_TTCN3="-DIPA_EMULATION_RSL -DIPA_EMULATION_MGCP -DIPA_EMULATION_SCCP -DRAN_EMULATION_BSSAP -DRAN_EMULATION_MGCP -DUSE_MTP3_DISTRIBUTOR" ../regen-makefile.sh $MAIN $FILES diff --git a/library/RAN_Adapter.ttcn b/library/RAN_Adapter.ttcnpp similarity index 98% rename from library/RAN_Adapter.ttcn rename to library/RAN_Adapter.ttcnpp index 294f747..43b4988 100644 --- a/library/RAN_Adapter.ttcn +++ b/library/RAN_Adapter.ttcnpp @@ -88,6 +88,7 @@ ba.vc_RAN := RAN_Emulation_CT.create(id & "-RAN"); } select (cfg.transport) { +#ifdef RAN_EMULATION_BSSAP case (BSSAP_TRANSPORT_AoIP) { ba.vc_M3UA := M3UA_CT.create(id & "-M3UA"); map(ba.vc_M3UA:SCTP_PORT, system:sctp); @@ -128,6 +129,7 @@ ba.vc_WAIT.done; disconnect(ba.vc_IPA:IPA_SP_PORT, ba.vc_WAIT:IPA_SP_PORT); } +#endif case else { setverdict(fail, "Unsuppored RAN_Transport"); mtc.stop; @@ -139,8 +141,10 @@ T.start; //T.timeout; log("Connecting BSSMAP Emulation to SCCP_SP_PORT and starting emulation"); +#if RAN_EMULATION_BSSAP /* connect BSSNAP component to upper side of SCCP */ connect(ba.vc_RAN:BSSAP, ba.vc_SCCP:SCCP_SP_PORT); +#endif if (cfg.transport == BSSAP_TRANSPORT_SCCPlite_SERVER or cfg.transport == BSSAP_TRANSPORT_SCCPlite_CLIENT) { /* connect IPA MGCP port with BSSMAP MGCP port */ diff --git a/library/RAN_Emulation.ttcn b/library/RAN_Emulation.ttcnpp similarity index 92% rename from library/RAN_Emulation.ttcn rename to library/RAN_Emulation.ttcnpp index 5a97a6e..21dbea9 100644 --- a/library/RAN_Emulation.ttcn +++ b/library/RAN_Emulation.ttcnpp @@ -22,7 +22,7 @@ * Inbound Unit Data messages (such as are dispatched to the RanOps.unitdata_cb() callback, * which is registered with an argument to the main() function below. * - * (C) 2017-2018 by Harald Welte + * (C) 2017-2019 by Harald Welte * All rights reserved. * * Released under the terms of GNU General Public License, Version 2 or @@ -34,13 +34,19 @@ import from Osmocom_Types all; import from SCCP_Emulation all; import from SCCPasp_Types all; +import from IPA_Emulation all; +import from MobileL3_Types all; + +#ifdef RAN_EMULATION_BSSAP import from BSSAP_Types all; import from BSSAP_CodecPort all; import from BSSMAP_Templates all; +#endif + +#ifdef RAN_EMULATION_MGCP import from MGCP_Types all; import from MGCP_Templates all; -import from IPA_Emulation all; -import from MobileL3_Types all; +#endif /* General "base class" component definition, of which specific implementations * derive themselves by means of the "extends" feature */ @@ -61,12 +67,6 @@ MSC_CONN_PRIM_CONF_IND } -type record BSSAP_Conn_Req { - SCCP_PAR_Address addr_peer, - SCCP_PAR_Address addr_own, - PDU_BSSAP bssap -} - /* similar to PDU_BSSAP with DTAP, but DTAP is already decoded! */ type record PDU_DTAP_MO { OCT1 dlci optional, @@ -102,23 +102,22 @@ dtap := dtap } -template BSSAP_Conn_Req ts_BSSAP_Conn_Req(SCCP_PAR_Address peer, SCCP_PAR_Address own, PDU_BSSAP bssap) := { - addr_peer := peer, - addr_own := own, - bssap := bssap -}; - - /* port between individual per-connection components and this dispatcher */ type port RAN_Conn_PT message { - /* BSSAP or direct DTAP messages from/to clients */ - inout PDU_BSSAP, PDU_DTAP_MO, PDU_DTAP_MT, - /* misc indications / requests between SCCP and client */ - RAN_Conn_Prim, + inout +#ifdef RAN_EMULATION_BSSAP + PDU_BSSAP, /* Client requests us to create SCCP Connection */ BSSAP_Conn_Req, +#endif +#ifdef RAN_EMULATION_MGCP /* MGCP, only used for IPA SCCPlite (MGCP in IPA mux) */ - MgcpCommand, MgcpResponse; + MgcpCommand, MgcpResponse, +#endif + /* direct DTAP messages from/to clients */ + PDU_DTAP_MO, PDU_DTAP_MT, + /* misc indications / requests between SCCP and client */ + RAN_Conn_Prim; } with { extension "internal" }; @@ -127,8 +126,10 @@ /* reference to the instance of the per-connection component */ RAN_ConnHdlr comp_ref, integer sccp_conn_id, +#ifdef RAN_EMULATION_MGCP /* most recent MGCP transaction ID (Used on MSC side) */ MgcpTransId mgcp_trans_id optional, +#endif /* CIC that has been used for voice of this channel (BSC side) */ integer cic optional, /* array of N(SD) values for MO DTAP messages, indexed by discriminator */ @@ -142,12 +143,16 @@ } type component RAN_Emulation_CT { - /* SCCP port on the bottom side, using ASP primitives */ + /* SCCP ports on the bottom side, using ASP primitives */ +#ifdef RAN_EMULATION_BSSAP port BSSAP_CODEC_PT BSSAP; +#endif /* BSSAP port to the per-connection clients */ port RAN_Conn_PT CLIENT; +#ifdef RAN_EMULATION_MGCP /* MGCP port */ port IPA_MGCP_PT MGCP; +#endif /* use 16 as this is also the number of SCCP connections that SCCP_Emulation can handle */ var ConnectionData ConnectionTable[16]; @@ -212,6 +217,8 @@ mtc.stop; } + +#ifdef RAN_EMULATION_MGCP /* resolve component reference by CIC */ private function f_comp_by_mgcp_tid(MgcpTransId tid) runs on RAN_Emulation_CT return RAN_ConnHdlr { @@ -237,6 +244,7 @@ setverdict(fail, "RAN Connection table not found by component ", client); mtc.stop; } +#endif private function f_comp_by_cic(integer cic) runs on RAN_Emulation_CT return RAN_ConnHdlr { @@ -303,7 +311,9 @@ for (var integer i := 0; i < sizeof(ConnectionTable); i := i+1) { ConnectionTable[i].comp_ref := null; ConnectionTable[i].sccp_conn_id := -1; +#ifdef RAN_EMULATION_MGCP ConnectionTable[i].mgcp_trans_id := omit; +#endif ConnectionTable[i].cic := omit; ConnectionTable[i].n_sd := { 0, 0, 0, 0 }; } @@ -354,6 +364,18 @@ return null; } +#ifdef RAN_EMULATION_BSSAP +type record BSSAP_Conn_Req { + SCCP_PAR_Address addr_peer, + SCCP_PAR_Address addr_own, + PDU_BSSAP bssap +} +template BSSAP_Conn_Req ts_BSSAP_Conn_Req(SCCP_PAR_Address peer, SCCP_PAR_Address own, PDU_BSSAP bssap) := { + addr_peer := peer, + addr_own := own, + bssap := bssap +}; + /* handle (optional) userData portion of various primitives and dispatch it to the client */ private function f_handle_userData(RAN_ConnHdlr client, PDU_BSSAP bssap) runs on RAN_Emulation_CT { @@ -420,69 +442,6 @@ return g_ran_ops.unitdata_cb.apply(bssap); } -type record RanOps { - BssmapCreateCallback create_cb, - BssmapUnitdataCallback unitdata_cb, - boolean decode_dtap, - boolean role_ms, - /* needed for performing BSSMAP RESET */ - SCCP_PAR_Address sccp_addr_local optional, - SCCP_PAR_Address sccp_addr_peer optional -} - -template BIT4 t_ML3_DISC_CC_MM_SS := ('0011'B, '0101'B, '1011'B); - -/* patch N(SD) into enc_l3, according to 24.007 11.2.3.2 */ -function f_ML3_patch_seq(inout ConnectionData cd, in PDU_ML3_MS_NW dtap, inout octetstring enc_l3) { - var uint2_t seq_nr; - if (ischosen(dtap.msgs.cc) or ischosen(dtap.msgs.mm) or ischosen(dtap.msgs.ss)) { - seq_nr := cd.n_sd[0]; - cd.n_sd[0] := (cd.n_sd[0] + 1) mod 4; - } else if (ischosen(dtap.msgs.gcc)) { - seq_nr := cd.n_sd[1]; - cd.n_sd[1] := (cd.n_sd[1] + 1) mod 2; - } else if (ischosen(dtap.msgs.bcc)) { - seq_nr := cd.n_sd[2]; - cd.n_sd[2] := (cd.n_sd[2] + 1) mod 2; - } else if (ischosen(dtap.msgs.loc)) { - seq_nr := cd.n_sd[3]; - cd.n_sd[3] := (cd.n_sd[3] + 1) mod 2; - } else { - /* no sequence number to patch */ - return; - } - log("patching N(SD)=", seq_nr, " into dtap ", enc_l3); - enc_l3[1] := (enc_l3[1] and4b '3f'O) or4b bit2oct(int2bit(seq_nr, 8) << 6); - log("patched enc_l3: ", enc_l3); -} - -private function f_bssap_l3_is_rr(PDU_BSSAP bssap) return boolean { - var template octetstring l3 := f_bssap_extract_l3(bssap); - if (not isvalue(l3)) { - return false; - } - var octetstring l3v := valueof(l3); - if (lengthof(l3v) < 1) { - return false; - } - /* lower 4 bits of first octet are protocol discriminator */ - if ((oct2bit(l3v[0]) and4b '00001111'B) == '00000110'B) { - return true; - } - return false; -} - -private altstep as_reset_ack() runs on RAN_Emulation_CT { - var BSSAP_N_UNITDATA_ind ud_ind; - [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) -> value ud_ind { - log("Respoding to inbound RESET with RESET-ACK"); - BSSAP.send(ts_BSSAP_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress, - ts_BSSMAP_ResetAck)); - repeat; - } -} - - private function f_bssap_wait_for_reset() runs on RAN_Emulation_CT { var BSSAP_N_UNITDATA_ind ud_ind; timer T := 20.0; @@ -522,37 +481,98 @@ } } -function main(RanOps ops, charstring id) runs on RAN_Emulation_CT { +private function f_bssap_l3_is_rr(PDU_BSSAP bssap) return boolean { + var template octetstring l3 := f_bssap_extract_l3(bssap); + return f_L3_is_rr(l3); +} +#endif - g_ran_id := id; - g_ran_ops := ops; - f_conn_table_init(); - f_expect_table_init(); - if (isvalue(ops.sccp_addr_peer) and isvalue(ops.sccp_addr_local)) { - f_sleep(1.0); /* HACK to wait for M3UA/ASP to be ACTIVE */ - f_bssap_reset(ops.sccp_addr_peer, ops.sccp_addr_local); + +type enumerated RanProtocol { + RAN_PROTOCOL_BSSAP +} + +type record RanOps { +#ifdef RAN_EMULATION_BSSAP + BssmapCreateCallback create_cb optional, + BssmapUnitdataCallback unitdata_cb optional, +#endif + boolean decode_dtap, + boolean role_ms, + RanProtocol protocol, + /* needed for performing BSSMAP RESET */ + SCCP_PAR_Address sccp_addr_local optional, + SCCP_PAR_Address sccp_addr_peer optional +} + +template BIT4 t_ML3_DISC_CC_MM_SS := ('0011'B, '0101'B, '1011'B); + +private function f_L3_is_rr(template octetstring l3) return boolean { + if (not isvalue(l3)) { + return false; } + var octetstring l3v := valueof(l3); + if (lengthof(l3v) < 1) { + return false; + } + /* lower 4 bits of first octet are protocol discriminator */ + if ((oct2bit(l3v[0]) and4b '00001111'B) == '00000110'B) { + return true; + } + return false; +} - while (true) { +/* patch N(SD) into enc_l3, according to 24.007 11.2.3.2 */ +function f_ML3_patch_seq(inout ConnectionData cd, in PDU_ML3_MS_NW dtap, inout octetstring enc_l3) { + var uint2_t seq_nr; + if (ischosen(dtap.msgs.cc) or ischosen(dtap.msgs.mm) or ischosen(dtap.msgs.ss)) { + seq_nr := cd.n_sd[0]; + cd.n_sd[0] := (cd.n_sd[0] + 1) mod 4; + } else if (ischosen(dtap.msgs.gcc)) { + seq_nr := cd.n_sd[1]; + cd.n_sd[1] := (cd.n_sd[1] + 1) mod 2; + } else if (ischosen(dtap.msgs.bcc)) { + seq_nr := cd.n_sd[2]; + cd.n_sd[2] := (cd.n_sd[2] + 1) mod 2; + } else if (ischosen(dtap.msgs.loc)) { + seq_nr := cd.n_sd[3]; + cd.n_sd[3] := (cd.n_sd[3] + 1) mod 2; + } else { + /* no sequence number to patch */ + return; + } + log("patching N(SD)=", seq_nr, " into dtap ", enc_l3); + enc_l3[1] := (enc_l3[1] and4b '3f'O) or4b bit2oct(int2bit(seq_nr, 8) << 6); + log("patched enc_l3: ", enc_l3); +} + +private altstep as_reset_ack() runs on RAN_Emulation_CT { +#ifdef RAN_EMULATION_BSSAP + var BSSAP_N_UNITDATA_ind ud_ind; +#endif +#ifdef RAN_EMULATION_BSSAP + [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) -> value ud_ind { + log("Respoding to inbound RESET with RESET-ACK"); + BSSAP.send(ts_BSSAP_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress, + ts_BSSMAP_ResetAck)); + repeat; + } +#endif +} + + +private altstep as_main_bssap() runs on RAN_Emulation_CT { +#ifdef RAN_EMULATION_BSSAP var BSSAP_N_UNITDATA_ind ud_ind; var BSSAP_N_CONNECT_ind conn_ind; var BSSAP_N_CONNECT_cfm conn_cfm; var BSSAP_N_DATA_ind data_ind; var BSSAP_N_DISCONNECT_ind disc_ind; var BSSAP_Conn_Req creq; - var RAN_ConnHdlr vc_conn; var PDU_BSSAP bssap; - var PDU_DTAP_MO dtap_mo; - var PDU_DTAP_MT dtap_mt; - var MgcpCommand mgcp_req; - var MgcpResponse mgcp_resp; - var RAN_ConnHdlr vc_hdlr; - var octetstring l3_info; - var hexstring imsi; - var OCT4 tmsi; + var RAN_ConnHdlr vc_conn; - alt { /* SCCP -> Client: UNIT-DATA (connectionless SCCP) from a BSC */ [] BSSAP.receive(BSSAP_N_UNITDATA_ind:?) -> value ud_ind { /* Connectionless Procedures like RESET */ @@ -563,10 +583,9 @@ ud_ind.calledAddress, resp)); } } - /* SCCP -> Client: new connection from BSC */ [] BSSAP.receive(BSSAP_N_CONNECT_ind:?) -> value conn_ind { - vc_conn := ops.create_cb.apply(conn_ind, id); + vc_conn := g_ran_ops.create_cb.apply(conn_ind, g_ran_id); /* store mapping between client components and SCCP connectionId */ f_conn_table_add(vc_conn, conn_ind.connectionId); /* handle user payload */ @@ -574,7 +593,6 @@ /* confirm connection establishment */ BSSAP.send(ts_BSSAP_CONNECT_res(conn_ind.connectionId, omit)); } - /* SCCP -> Client: connection-oriented data in existing connection */ [] BSSAP.receive(BSSAP_N_DATA_ind:?) -> value data_ind { vc_conn := f_comp_by_conn_id(data_ind.connectionId); @@ -582,7 +600,6 @@ f_handle_userData(vc_conn, data_ind.userData); } } - /* SCCP -> Client: disconnect of an existing connection */ [] BSSAP.receive(BSSAP_N_DISCONNECT_ind:?) -> value disc_ind { vc_conn := f_comp_by_conn_id(disc_ind.connectionId); @@ -595,7 +612,6 @@ f_conn_table_del(disc_ind.connectionId); /* TOOD: return confirm to other side? */ } - /* SCCP -> Client: connection confirm for outbound connection */ [] BSSAP.receive(BSSAP_N_CONNECT_cfm:?) -> value conn_cfm { vc_conn := f_comp_by_conn_id(conn_cfm.connectionId); @@ -606,6 +622,11 @@ f_handle_userData(vc_conn, conn_cfm.userData); } } + [] CLIENT.receive(PDU_BSSAP:?) -> value bssap sender vc_conn { + var integer conn_id := f_conn_id_by_comp(vc_conn); + /* send it to dispatcher */ + BSSAP.send(ts_BSSAP_DATA_req(conn_id, bssap)); + } /* Disconnect request client -> SCCP */ [] CLIENT.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ) -> sender vc_conn { @@ -644,33 +665,16 @@ } } +#else + [false] CLIENT.receive(false) {} +#endif +} - [] CLIENT.receive(PDU_BSSAP:?) -> value bssap sender vc_conn { - var integer conn_id := f_conn_id_by_comp(vc_conn); - /* send it to dispatcher */ - BSSAP.send(ts_BSSAP_DATA_req(conn_id, bssap)); - } - - [g_ran_ops.role_ms] CLIENT.receive(PDU_DTAP_MO:?) -> value dtap_mo sender vc_conn { - var integer idx := f_idx_by_comp(vc_conn); - /* convert from decoded DTAP to encoded DTAP */ - var octetstring l3_enc := enc_PDU_ML3_MS_NW(dtap_mo.dtap); - /* patch correct L3 send sequence number N(SD) into l3_enc */ - if (dtap_mo.skip_seq_patching == false) { - f_ML3_patch_seq(ConnectionTable[idx], dtap_mo.dtap, l3_enc); - } - bssap := valueof(ts_BSSAP_DTAP(l3_enc, dtap_mo.dlci)); - BSSAP.send(ts_BSSAP_DATA_req(ConnectionTable[idx].sccp_conn_id, bssap)); - } - - [not g_ran_ops.role_ms] CLIENT.receive(PDU_DTAP_MT:?) -> value dtap_mt sender vc_conn { - var integer conn_id := f_conn_id_by_comp(vc_conn); - /* convert from decoded DTAP to encoded DTAP */ - var octetstring l3_enc := enc_PDU_ML3_NW_MS(dtap_mt.dtap); - bssap := valueof(ts_BSSAP_DTAP(l3_enc, dtap_mo.dlci)); - BSSAP.send(ts_BSSAP_DATA_req(conn_id, bssap)); - } - +private altstep as_main_mgcp() runs on RAN_Emulation_CT { +#ifdef RAN_EMULATION_MGCP + var MgcpCommand mgcp_req; + var MgcpResponse mgcp_resp; + var RAN_ConnHdlr vc_conn; /* Handling of MGCP in IPA SCCPLite case. This predates 3GPP AoIP * and uses a MGCP session in parallel to BSSAP. BSSAP uses CIC @@ -710,7 +714,68 @@ vc_conn := f_comp_by_mgcp_tid(mgcp_resp.line.trans_id); CLIENT.send(mgcp_resp) to vc_conn; } +#else + [false] CLIENT.receive {} +#endif +} +/* send a raw (encoded) L3 message over given SCCP connection */ +private function f_xmit_raw_l3(integer sccp_conn_id, OCT1 dlci, octetstring l3_enc) runs on RAN_Emulation_CT +{ + select (g_ran_ops.protocol) { +#ifdef RAN_EMULATION_BSSAP + case (RAN_PROTOCOL_BSSAP) { + var PDU_BSSAP bssap; + bssap := valueof(ts_BSSAP_DTAP(l3_enc, dlci)); + BSSAP.send(ts_BSSAP_DATA_req(sccp_conn_id, bssap)); + } +#endif + } +} + +function main(RanOps ops, charstring id) runs on RAN_Emulation_CT { + + g_ran_id := id; + g_ran_ops := ops; + f_conn_table_init(); + f_expect_table_init(); + + if (isvalue(ops.sccp_addr_peer) and isvalue(ops.sccp_addr_local)) { + f_sleep(1.0); /* HACK to wait for M3UA/ASP to be ACTIVE */ + f_bssap_reset(ops.sccp_addr_peer, ops.sccp_addr_local); + } + + while (true) { + var RAN_ConnHdlr vc_conn; + var PDU_DTAP_MO dtap_mo; + var PDU_DTAP_MT dtap_mt; + var RAN_ConnHdlr vc_hdlr; + var octetstring l3_info; + var hexstring imsi; + var OCT4 tmsi; + + alt { + [g_ran_ops.protocol == RAN_PROTOCOL_BSSAP] as_main_bssap(); + + [g_ran_ops.role_ms] CLIENT.receive(PDU_DTAP_MO:?) -> value dtap_mo sender vc_conn { + var integer idx := f_idx_by_comp(vc_conn); + /* convert from decoded DTAP to encoded DTAP */ + var octetstring l3_enc := enc_PDU_ML3_MS_NW(dtap_mo.dtap); + /* patch correct L3 send sequence number N(SD) into l3_enc */ + if (dtap_mo.skip_seq_patching == false) { + f_ML3_patch_seq(ConnectionTable[idx], dtap_mo.dtap, l3_enc); + } + f_xmit_raw_l3(ConnectionTable[idx].sccp_conn_id, dtap_mo.dlci, l3_enc); + } + + [not g_ran_ops.role_ms] CLIENT.receive(PDU_DTAP_MT:?) -> value dtap_mt sender vc_conn { + var integer idx := f_idx_by_comp(vc_conn); + /* convert from decoded DTAP to encoded DTAP */ + var octetstring l3_enc := enc_PDU_ML3_NW_MS(dtap_mt.dtap); + f_xmit_raw_l3(ConnectionTable[idx].sccp_conn_id, dtap_mt.dlci, l3_enc); + } + + [] as_main_mgcp(); [] PROC.getcall(RAN_register:{?,?}) -> param(l3_info, vc_hdlr) { f_create_expect(l3_info, vc_hdlr); @@ -727,11 +792,13 @@ } } +#ifdef RAN_EMULATION_MGCP private function f_mgcp_ep_extract_cic(charstring inp) return integer { var charstring local_part := regexp(inp, "(*)@*", 0); return hex2int(str2hex(local_part)); } +#endif /*********************************************************************** * "Expect" Handling (mapping for expected incoming SCCP connections) diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 00e86f1..730e57c 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -178,6 +178,7 @@ unitdata_cb := refers(BscUnitdataCallback), decode_dtap := true, role_ms := true, + protocol := RAN_PROTOCOL_BSSAP, sccp_addr_local := omit, sccp_addr_peer := omit } diff --git a/msc/gen_links.sh b/msc/gen_links.sh index a29118a..e4e142b 100755 --- a/msc/gen_links.sh +++ b/msc/gen_links.sh @@ -89,7 +89,7 @@ FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc " FILES+="IPA_Types.ttcn IPA_Emulation.ttcnpp IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc GSUP_Types.ttcn GSUP_Emulation.ttcn " FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Common.ttcn " -FILES+="RAN_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn RAN_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn " +FILES+="RAN_Emulation.ttcnpp BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn RAN_Adapter.ttcnpp MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn " FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc " FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc " FILES+="SMPP_CodecPort.ttcn SMPP_CodecPort_CtrlFunct.ttcn SMPP_CodecPort_CtrlFunctDef.cc SMPP_Emulation.ttcn SMPP_Templates.ttcn " diff --git a/msc/regen_makefile.sh b/msc/regen_makefile.sh index 5645fdd..091faf8 100755 --- a/msc/regen_makefile.sh +++ b/msc/regen_makefile.sh @@ -2,6 +2,6 @@ FILES="*.ttcn *.ttcnpp SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc Native_FunctionDefs.cc SMPP_EncDec.cc SMPP_CodecPort_CtrlFunctDef.cc MAP_EncDec.cc SS_EncDec.cc TCCEncoding.cc SGsAP_CodecPort_CtrlFunctDef.cc *.c *.asn" -export CPPFLAGS_TTCN3="-DIPA_EMULATION_MGCP -DIPA_EMULATION_GSUP -DIPA_EMULATION_SCCP -DUSE_MTP3_DISTRIBUTOR" +export CPPFLAGS_TTCN3="-DIPA_EMULATION_MGCP -DIPA_EMULATION_GSUP -DIPA_EMULATION_SCCP -DRAN_EMULATION_BSSAP -DRAN_EMULATION_MGCP -DUSE_MTP3_DISTRIBUTOR" ../regen-makefile.sh MSC_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/13651 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id53ba3ff05f9946230e0e4a759245de14a0f9fbd Gerrit-Change-Number: 13651 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 19:52:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 19:52:13 +0000 Subject: Change in osmo-ttcn3-hacks[master]: HNBAP, RUA and RANAP protocol codecs Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13652 Change subject: HNBAP, RUA and RANAP protocol codecs ...................................................................... HNBAP, RUA and RANAP protocol codecs This patch introduces protocol codecs for the HNBAP, RUA and RANAP protocols, which is mandatory for testing IuCS, IuPS or Iuh in the future. As Eclipse TITAN ASN.1 only supports the BER codec and the above protocols all use APER, we need to use an external transcoder from APER to BER and vice-versa. This was implemented using a proprietary ASN.1 compiler / trnaslator which sysmocom is packaging as libfftranscode, and which will be made available as bianry package for Debian 9. Related: OS#2856, OS#2857, OS#2858 Change-Id: If4a72de9bc54d6e6a7daaca78a4d4aa5684203a5 --- A asn-test/ttcn3_asn1_rename.sh A library/hnbap/HNBAP_CommonDataTypes.asn A library/hnbap/HNBAP_Constants.asn A library/hnbap/HNBAP_Containers.asn A library/hnbap/HNBAP_EncDec.cc A library/hnbap/HNBAP_IEs.asn A library/hnbap/HNBAP_PDU_Contents.asn A library/hnbap/HNBAP_PDU_Descriptions.asn A library/hnbap/HNBAP_Types.ttcn A library/hnbap/regen_makefile.sh A library/ranap/RANAP_CodecPort.ttcn A library/ranap/RANAP_CommonDataTypes.asn A library/ranap/RANAP_Constants.asn A library/ranap/RANAP_Containers.asn A library/ranap/RANAP_EncDec.cc A library/ranap/RANAP_IEs.asn A library/ranap/RANAP_PDU_Contents.asn A library/ranap/RANAP_PDU_Descriptions.asn A library/ranap/RANAP_Selftests.ttcn A library/ranap/RANAP_Templates.ttcn A library/ranap/RANAP_Types.ttcn A library/ranap/regen_makefile.sh A library/rua/RUA_CommonDataTypes.asn A library/rua/RUA_Constants.asn A library/rua/RUA_Containers.asn A library/rua/RUA_EncDec.cc A library/rua/RUA_IEs.asn A library/rua/RUA_PDU_Contents.asn A library/rua/RUA_PDU_Descriptions.asn A library/rua/RUA_Types.ttcn A library/rua/regen_makefile.sh 31 files changed, 12,295 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/52/13652/1 -- To view, visit https://gerrit.osmocom.org/13652 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If4a72de9bc54d6e6a7daaca78a4d4aa5684203a5 Gerrit-Change-Number: 13652 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 19:52:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 19:52:13 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Add RANAP support Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13653 Change subject: RAN_Emulation: Add RANAP support ...................................................................... RAN_Emulation: Add RANAP support So far, RAN_Emulation only handled BSSAP and hence could be used to emulate BSCs towards the MSC. Let's extend it with RANAP support so we can also emulate RNCs towards the MSC. We try to share as much code and logic as possible betweeb the two. Related: OS#2856, OS#2857 Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33 --- M library/RAN_Adapter.ttcnpp M library/RAN_Emulation.ttcnpp M library/ranap/RANAP_Templates.ttcn 3 files changed, 418 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/53/13653/1 diff --git a/library/RAN_Adapter.ttcnpp b/library/RAN_Adapter.ttcnpp index 43b4988..a97d148 100644 --- a/library/RAN_Adapter.ttcnpp +++ b/library/RAN_Adapter.ttcnpp @@ -43,7 +43,8 @@ type enumerated RAN_Transport { BSSAP_TRANSPORT_AoIP, /* 3GPP AoIP: SCCP over M3UA over SCTP */ BSSAP_TRANSPORT_SCCPlite_SERVER, /* SCCPlite: SCCP over IPA over TCP */ - BSSAP_TRANSPORT_SCCPlite_CLIENT /* SCCPlite: SCCP over IPA over TCP */ + BSSAP_TRANSPORT_SCCPlite_CLIENT, /* SCCPlite: SCCP over IPA over TCP */ + RANAP_TRANSPORT_IuCS /* 3GPP IuCS: SCCP over M3UA over SCTP */ }; type record RAN_Configuration { @@ -88,8 +89,7 @@ ba.vc_RAN := RAN_Emulation_CT.create(id & "-RAN"); } select (cfg.transport) { -#ifdef RAN_EMULATION_BSSAP - case (BSSAP_TRANSPORT_AoIP) { + case (BSSAP_TRANSPORT_AoIP, RANAP_TRANSPORT_IuCS) { ba.vc_M3UA := M3UA_CT.create(id & "-M3UA"); map(ba.vc_M3UA:SCTP_PORT, system:sctp); /* connect MTP3 service provider (M3UA) to lower side of SCCP */ @@ -129,7 +129,6 @@ ba.vc_WAIT.done; disconnect(ba.vc_IPA:IPA_SP_PORT, ba.vc_WAIT:IPA_SP_PORT); } -#endif case else { setverdict(fail, "Unsuppored RAN_Transport"); mtc.stop; @@ -141,16 +140,22 @@ T.start; //T.timeout; log("Connecting BSSMAP Emulation to SCCP_SP_PORT and starting emulation"); -#if RAN_EMULATION_BSSAP /* connect BSSNAP component to upper side of SCCP */ - connect(ba.vc_RAN:BSSAP, ba.vc_SCCP:SCCP_SP_PORT); + if (cfg.transport == RANAP_TRANSPORT_IuCS) { +#ifdef RAN_EMULATION_RANAP + ops.protocol := RAN_PROTOCOL_RANAP + connect(ba.vc_RAN:RANAP, ba.vc_SCCP:SCCP_SP_PORT); #endif + } else { +#ifdef RAN_EMULATION_BSSAP + connect(ba.vc_RAN:BSSAP, ba.vc_SCCP:SCCP_SP_PORT); +#endif + } if (cfg.transport == BSSAP_TRANSPORT_SCCPlite_SERVER or cfg.transport == BSSAP_TRANSPORT_SCCPlite_CLIENT) { /* connect IPA MGCP port with BSSMAP MGCP port */ connect(ba.vc_IPA:IPA_MGCP_PORT, ba.vc_RAN:MGCP); } - /* start the BSSMAP emulation */ ba.vc_RAN.start(RAN_Emulation.main(valueof(ops), "")); } diff --git a/library/RAN_Emulation.ttcnpp b/library/RAN_Emulation.ttcnpp index 21dbea9..b826982 100644 --- a/library/RAN_Emulation.ttcnpp +++ b/library/RAN_Emulation.ttcnpp @@ -48,6 +48,14 @@ import from MGCP_Templates all; #endif +#ifdef RAN_EMULATION_RANAP +import from RANAP_CodecPort all; +import from RANAP_PDU_Descriptions all; +import from RANAP_Constants all; +import from RANAP_IEs all; +import from RANAP_Templates all; +#endif + /* General "base class" component definition, of which specific implementations * derive themselves by means of the "extends" feature */ type component RAN_ConnHdlr { @@ -110,6 +118,11 @@ /* Client requests us to create SCCP Connection */ BSSAP_Conn_Req, #endif +#ifdef RAN_EMULATION_RANAP + RANAP_PDU, + /* Client requests us to create SCCP Connection */ + RANAP_Conn_Req, +#endif #ifdef RAN_EMULATION_MGCP /* MGCP, only used for IPA SCCPlite (MGCP in IPA mux) */ MgcpCommand, MgcpResponse, @@ -147,6 +160,9 @@ #ifdef RAN_EMULATION_BSSAP port BSSAP_CODEC_PT BSSAP; #endif +#ifdef RAN_EMULATION_RANAP + port RANAP_CODEC_PT RANAP; +#endif /* BSSAP port to the per-connection clients */ port RAN_Conn_PT CLIENT; #ifdef RAN_EMULATION_MGCP @@ -487,10 +503,137 @@ } #endif +#ifdef RAN_EMULATION_RANAP +type record RANAP_Conn_Req { + SCCP_PAR_Address addr_peer, + SCCP_PAR_Address addr_own, + RANAP_PDU ranap +} +template (value) RANAP_Conn_Req ts_RANAP_Conn_Req(SCCP_PAR_Address peer, SCCP_PAR_Address own, RANAP_PDU ranap) := { + addr_peer := peer, + addr_own := own, + ranap := ranap +}; + +private function fake_dlci_from_sapi(template (omit) SAPI sapi) return template (omit) OCT1 +{ + if (istemplatekind(sapi, "omit")) { + return omit; + } else if (valueof(sapi) == sapi_3) { + return '03'O; + } + return '00'O; +} + +private function f_handle_userData_RANAP(RAN_ConnHdlr client, RANAP_PDU ranap) +runs on RAN_Emulation_CT { + /* decode + send decoded RANAP to client */ + var template (omit) octetstring l3 := f_ranap_extract_l3(ranap); + if (istemplatekind(ranap, "omit")) { + CLIENT.send(ranap) to client; + } else { + var template (omit) SAPI sapi := f_ranap_extract_sapi(ranap); + var template (omit) OCT1 dlci := fake_dlci_from_sapi(sapi); + if (g_ran_ops.role_ms) { + /* we are the MS, so any message to us must be MT */ + var PDU_DTAP_MT mt := { + dlci := omit, + dtap := dec_PDU_ML3_NW_MS(valueof(l3)) + }; + if (isvalue(dlci)) { + mt.dlci := valueof(dlci) + } + CLIENT.send(mt) to client; + } else { + /* we are the Network, so any message to us must be MO */ + var PDU_DTAP_MO mo := { + dlci := omit, + dtap := dec_PDU_ML3_MS_NW(valueof(l3)) + }; + if (isvalue(dlci)) { + mo.dlci := valueof(dlci) + } + CLIENT.send(mo) to client; + } + } +} + +/* call-back type, to be provided by specific implementation; called when new SCCP connection + * arrives */ +type function RanapCreateCallback(RANAP_N_CONNECT_ind conn_ind, charstring id) +runs on RAN_Emulation_CT return RAN_ConnHdlr; + +type function RanapUnitdataCallback(RANAP_PDU ranap) +runs on RAN_Emulation_CT return template RANAP_PDU; + +private function CommonRanapUnitdataCallback(RANAP_PDU ranap) +runs on RAN_Emulation_CT return template RANAP_PDU { + if (match(ranap, tr_RANAP_Paging(?, ?))) { + var RAN_ConnHdlr client := null; + /* extract IMSI and (if present) TMSI */ + var IMSI imsi := ranap.initiatingMessage.value_.paging.protocolIEs[1].value_.permanentNAS_UE_ID.iMSI; + var template OCT4 tmsi := omit; + if (lengthof(ranap.initiatingMessage.value_.paging.protocolIEs) > 2 and + ranap.initiatingMessage.value_.paging.protocolIEs[2].id == id_TemporaryUE_ID) { + var TemporaryUE_ID ue_id; + ue_id := ranap.initiatingMessage.value_.paging.protocolIEs[2].value_.temporaryUE_ID; + if (ischosen(ue_id.tMSI)) { + tmsi := ue_id.tMSI; + } else { + tmsi := ue_id.p_TMSI; + } + } + client := f_imsi_table_find(oct2hex(imsi), tmsi); + if (isvalue(client)) { + log("CommonRanapUnitdataCallback: IMSI/TMSI found in table, dispatching to ", + client); + CLIENT.send(ranap) to client; + return omit; + } + log("CommonRanapUnitdataCallback: IMSI/TMSI not found in table"); + } else { + log("CommonRanapUnitdataCallback: Not a paging message"); + } + + /* ELSE: handle in user callback */ + return g_ran_ops.ranap_unitdata_cb.apply(ranap); +} + +private function f_ranap_l3_is_rr(RANAP_PDU ranap) return boolean { + var template (omit) SAPI sapi; + var template octetstring l3 := f_ranap_extract_l3(ranap); + return f_L3_is_rr(l3); +} + +function f_ranap_reset(SCCP_PAR_Address peer, SCCP_PAR_Address own) runs on RAN_Emulation_CT { + timer T := 5.0; + var CN_DomainIndicator dom; + if (g_ran_ops.ps_domain) { + dom := ps_domain; + } else { + dom := cs_domain; + } + + RANAP.send(ts_RANAP_UNITDATA_req(peer, own, ts_RANAP_Reset(ts_RanapCause_om_intervention, dom))); + T.start; + alt { + [] RANAP.receive(tr_RANAP_UNITDATA_ind(own, peer, tr_RANAP_ResetAck)) { + log("Received RESET-ACK in response to RESET, we're ready to go!"); + } + [] as_reset_ack(); + [] RANAP.receive { repeat }; + [] T.timeout { + setverdict(fail, "Timeout waiting for RESET-ACK after sending RESET"); + mtc.stop; + } + } +} +#endif type enumerated RanProtocol { - RAN_PROTOCOL_BSSAP + RAN_PROTOCOL_BSSAP, + RAN_PROTOCOL_RANAP } type record RanOps { @@ -498,6 +641,11 @@ BssmapCreateCallback create_cb optional, BssmapUnitdataCallback unitdata_cb optional, #endif +#ifdef RAN_EMULATION_RANAP + RanapCreateCallback ranap_create_cb optional, + RanapUnitdataCallback ranap_unitdata_cb optional, + boolean ps_domain, +#endif boolean decode_dtap, boolean role_ms, RanProtocol protocol, @@ -551,6 +699,9 @@ #ifdef RAN_EMULATION_BSSAP var BSSAP_N_UNITDATA_ind ud_ind; #endif +#ifdef RAN_EMULATION_RANAP + var RANAP_N_UNITDATA_ind rud_ind; +#endif #ifdef RAN_EMULATION_BSSAP [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) -> value ud_ind { log("Respoding to inbound RESET with RESET-ACK"); @@ -559,6 +710,15 @@ repeat; } #endif +#ifdef RAN_EMULATION_RANAP + [] RANAP.receive(tr_RANAP_UNITDATA_ind(?, ?, tr_RANAP_Reset)) -> value rud_ind { + log("Respoding to inbound IuRESET with IuRESET-ACK"); + var CN_DomainIndicator dom; + dom := rud_ind.userData.initiatingMessage.value_.Reset.protocolIEs[1].value_.cN_DomainIndicator; + RANAP.send(ts_RANAP_UNITDATA_req(rud_ind.callingAddress, rud_ind.calledAddress, + ts_RANAP_ResetAck(dom))); + } +#endif } @@ -666,7 +826,116 @@ } #else - [false] CLIENT.receive(false) {} + [false] CLIENT.receive {} +#endif +} + +private altstep as_main_ranap() runs on RAN_Emulation_CT { +#ifdef RAN_EMULATION_RANAP + var RANAP_N_UNITDATA_ind rud_ind; + var RANAP_N_CONNECT_ind rconn_ind; + var RANAP_N_CONNECT_cfm rconn_cfm; + var RANAP_N_DATA_ind rdata_ind; + var RANAP_N_DISCONNECT_ind rdisc_ind; + var RANAP_Conn_Req creq; + var RANAP_PDU ranap; + var RAN_ConnHdlr vc_conn; + + /* SCCP -> Client: UNIT-DATA (connectionless SCCP) from a BSC */ + [] RANAP.receive(RANAP_N_UNITDATA_ind:?) -> value rud_ind { + /* Connectionless Procedures like RESET */ + var template RANAP_PDU resp; + resp := CommonRanapUnitdataCallback(rud_ind.userData); + if (isvalue(resp)) { + RANAP.send(ts_RANAP_UNITDATA_req(rud_ind.callingAddress, + rud_ind.calledAddress, resp)); + } + } + /* SCCP -> Client: new connection from BSC */ + [] RANAP.receive(RANAP_N_CONNECT_ind:?) -> value rconn_ind { + vc_conn := g_ran_ops.ranap_create_cb.apply(rconn_ind, g_ran_id); + /* store mapping between client components and SCCP connectionId */ + f_conn_table_add(vc_conn, rconn_ind.connectionId); + /* handle user payload */ + f_handle_userData_RANAP(vc_conn, rconn_ind.userData); + /* confirm connection establishment */ + RANAP.send(ts_RANAP_CONNECT_res(rconn_ind.connectionId, omit)); + } + /* SCCP -> Client: connection-oriented data in existing connection */ + [] RANAP.receive(RANAP_N_DATA_ind:?) -> value rdata_ind { + vc_conn := f_comp_by_conn_id(rdata_ind.connectionId); + if (ispresent(rdata_ind.userData)) { + f_handle_userData_RANAP(vc_conn, rdata_ind.userData); + } + } + /* SCCP -> Client: disconnect of an existing connection */ + [] RANAP.receive(RANAP_N_DISCONNECT_ind:?) -> value rdisc_ind { + vc_conn := f_comp_by_conn_id(rdisc_ind.connectionId); + if (ispresent(rdisc_ind.userData)) { + f_handle_userData_RANAP(vc_conn, rdisc_ind.userData); + } + /* notify client about termination */ + var RAN_Conn_Prim prim := MSC_CONN_PRIM_DISC_IND; + CLIENT.send(prim) to vc_conn; + f_conn_table_del(rdisc_ind.connectionId); + /* TOOD: return confirm to other side? */ + } + /* SCCP -> Client: connection confirm for outbound connection */ + [] RANAP.receive(RANAP_N_CONNECT_cfm:?) -> value rconn_cfm { + vc_conn := f_comp_by_conn_id(rconn_cfm.connectionId); + var RAN_Conn_Prim prim := MSC_CONN_PRIM_CONF_IND; + CLIENT.send(prim) to vc_conn; + /* handle user payload */ + if (ispresent(rconn_cfm.userData)) { + f_handle_userData_RANAP(vc_conn, rconn_cfm.userData); + } + } + + [] CLIENT.receive(RANAP_PDU:?) -> value ranap sender vc_conn { + var integer conn_id := f_conn_id_by_comp(vc_conn); + /* send it to dispatcher */ + RANAP.send(ts_RANAP_DATA_req(conn_id, ranap)); + } + + /* Disconnect request client -> SCCP */ + [] CLIENT.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ) -> sender vc_conn { + var integer conn_id := f_conn_id_by_comp(vc_conn); + RANAP.send(ts_RANAP_DISC_req(conn_id, 0)); + f_conn_table_del(conn_id); + } + + /* BSSAP from client -> SCCP */ + [] CLIENT.receive(RANAP_Conn_Req:?) -> value creq sender vc_conn { + var integer conn_id; + /* send to dispatcher */ + + if (f_comp_known(vc_conn) == false) { + /* unknown client, create new connection */ + conn_id := f_gen_conn_id(); + + /* store mapping between client components and SCCP connectionId */ + f_conn_table_add(vc_conn, conn_id); + + RANAP.send(ts_RANAP_CONNECT_req(creq.addr_peer, creq.addr_own, conn_id, + creq.ranap)); + } else { + /* known client, send via existing connection */ + conn_id := f_conn_id_by_comp(vc_conn); + RANAP.send(ts_RANAP_DATA_req(conn_id, creq.ranap)); + } + + /* InitialL3 contains RR (PAG RESP) or MM (CM SRV REQ), we must increment + * counter only on MM/CC/SS, but not on RR */ + if (g_ran_ops.role_ms and not f_ranap_l3_is_rr(creq.ranap)) { + /* we have just sent the first MM message, increment the counter */ + var integer idx := f_idx_by_comp(vc_conn); + ConnectionTable[idx].n_sd[0] := 1; + log("patch: N(SD) for ConnIdx ", idx, " set to 1"); + } + } + +#else + [false] CLIENT.receive {} #endif } @@ -730,6 +999,18 @@ BSSAP.send(ts_BSSAP_DATA_req(sccp_conn_id, bssap)); } #endif +#ifdef RAN_EMULATION_RANAP + case (RAN_PROTOCOL_RANAP) { + var RANAP_PDU ranap; + if (false /* SAPI */) { + var RANAP_IEs.SAPI sapi := sapi_0; + ranap := valueof(ts_RANAP_DirectTransferSAPI(l3_enc, sapi)); + } else { + ranap := valueof(ts_RANAP_DirectTransfer(l3_enc)); + } + RANAP.send(ts_RANAP_DATA_req(sccp_conn_id, ranap)); + } +#endif } } @@ -742,7 +1023,18 @@ if (isvalue(ops.sccp_addr_peer) and isvalue(ops.sccp_addr_local)) { f_sleep(1.0); /* HACK to wait for M3UA/ASP to be ACTIVE */ - f_bssap_reset(ops.sccp_addr_peer, ops.sccp_addr_local); + select (g_ran_ops.protocol) { +#ifdef RAN_EMULATION_BSSAP + case (RAN_PROTOCOL_BSSAP) { + f_bssap_reset(ops.sccp_addr_peer, ops.sccp_addr_local); + } +#endif +#ifdef RAN_EMULATION_RANAP + case (RAN_PROTOCOL_RANAP) { + f_ranap_reset(ops.sccp_addr_peer, ops.sccp_addr_local); + } +#endif + } } while (true) { @@ -756,6 +1048,7 @@ alt { [g_ran_ops.protocol == RAN_PROTOCOL_BSSAP] as_main_bssap(); + [g_ran_ops.protocol == RAN_PROTOCOL_RANAP] as_main_ranap(); [g_ran_ops.role_ms] CLIENT.receive(PDU_DTAP_MO:?) -> value dtap_mo sender vc_conn { var integer idx := f_idx_by_comp(vc_conn); @@ -822,6 +1115,7 @@ inout RAN_register, RAN_register_imsi; } with { extension "internal" }; +#ifdef RAN_EMULATION_BSSAP /* CreateCallback that can be used as create_cb and will use the expectation table */ function ExpectedCreateCallback(BSSAP_N_CONNECT_ind conn_ind, charstring id) runs on RAN_Emulation_CT return RAN_ConnHdlr { @@ -854,6 +1148,42 @@ mtc.stop; return ret; } +#endif + +#ifdef RAN_EMULATION_RANAP +/* CreateCallback that can be used as create_cb and will use the expectation table */ +function RanapExpectedCreateCallback(RANAP_N_CONNECT_ind conn_ind, charstring id) +runs on RAN_Emulation_CT return RAN_ConnHdlr { + var RAN_ConnHdlr ret := null; + var template (omit) octetstring l3_info; + var integer i; + + l3_info := f_ranap_extract_l3(conn_ind.userData); + if (istemplatekind(l3_info, "omit")) { + setverdict(fail, "N-CONNECT.ind without NAS payload"); + mtc.stop; + return ret; + } + + for (i := 0; i < sizeof(ExpectTable); i:= i+1) { + if (not ispresent(ExpectTable[i].l3_payload)) { + continue; + } + if (valueof(l3_info) == ExpectTable[i].l3_payload) { + ret := ExpectTable[i].vc_conn; + /* release this entry to be used again */ + ExpectTable[i].l3_payload := omit; + ExpectTable[i].vc_conn := null; + log("Found Expect[", i, "] for ", l3_info, " handled at ", ret); + /* return the component reference */ + return ret; + } + } + setverdict(fail, "Couldn't find Expect for incoming connection ", conn_ind); + mtc.stop; + return ret; +} +#endif private function f_create_expect(octetstring l3, RAN_ConnHdlr hdlr) runs on RAN_Emulation_CT { diff --git a/library/ranap/RANAP_Templates.ttcn b/library/ranap/RANAP_Templates.ttcn index c50440c..4d18e1c 100644 --- a/library/ranap/RANAP_Templates.ttcn +++ b/library/ranap/RANAP_Templates.ttcn @@ -9,6 +9,8 @@ import from RANAP_PDU_Contents all; import from RANAP_PDU_Descriptions all; +template (value) Cause ts_RanapCause_om_intervention := { misc := 113 }; + /***************************************************************************************************** * Reset *****************************************************************************************************/ @@ -668,6 +670,37 @@ } } } +template RANAP_PDU +tr_RANAP_Paging(template CN_DomainIndicator dom, template IMSI imsi, + template Paging.protocolExtensions exts := *) := { + initiatingMessage := { + procedureCode := id_Paging, + criticality := ignore, + value_ := { + paging := { + protocolIEs := { + { + id := id_CN_DomainIndicator, + criticality := ignore, + value_ := { + cN_DomainIndicator := dom + } + }, { + id := id_PermanentNAS_UE_ID, + criticality := ignore, + value_ := { + permanentNAS_UE_ID := { + iMSI := imsi + } + } + }, * + }, + protocolExtensions := exts + } + } + } +} + /***************************************************************************************************** @@ -1308,7 +1341,47 @@ * *****************************************************************************************************/ +/* extract the L3 (NAS) from a given RANAP message */ +function f_ranap_extract_l3(RANAP_PDU ranap) return template (omit) octetstring +{ + var integer i; + if (match(ranap, tr_RANAP_initialUE_CS(?, ?, ?, ?, ?)) or + match(ranap, tr_RANAP_initialUE_PS(?, ?, ?, ?, ?, ?)) ) { + var InitialUE_Message.protocolIEs ies := ranap.initiatingMessage.value_.initialUE_Message.protocolIEs; + for (i := 0; i < lengthof(ies); i := i+1) { + if (ies[i].id == id_NAS_PDU) { + return ies[i].value_.nAS_PDU; + } + } + } else if (match(ranap, tr_RANAP_DirectTransfer(?, ?))) { + var DirectTransfer.protocolIEs ies := ranap.initiatingMessage.value_.directTransfer.protocolIEs; + for (i := 0; i < lengthof(ies); i := i+1) { + if (ies[i].id == id_NAS_PDU) { + return ies[i].value_.nAS_PDU; + } + } + } else { + /* relocationInformation not supported yet*/ + } + return omit; +} + +function f_ranap_extract_sapi(RANAP_PDU ranap) return template (omit) SAPI +{ + var integer i; + + /* InitialUE message has no SAPI */ + if (match(ranap, tr_RANAP_DirectTransfer(?, ?))) { + var DirectTransfer.protocolIEs ies := ranap.initiatingMessage.value_.directTransfer.protocolIEs; + for (i := 0; i < lengthof(ies); i := i+1) { + if (ies[i].id == id_SAPI) { + return ies[i].value_.sAPI; + } + } + } + return omit; +} } -- To view, visit https://gerrit.osmocom.org/13653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33 Gerrit-Change-Number: 13653 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 19:53:10 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 19:53:10 +0000 Subject: Change in osmo-bsc[master]: Drop unused old osmux leftover code In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13649 ) Change subject: Drop unused old osmux leftover code ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13649 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id4e254a1c24831afaba9ab7b330d4e09a2474c8e Gerrit-Change-Number: 13649 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 15 Apr 2019 19:53:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 19:53:52 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 19:53:52 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Check for ==/!= null instead of isvalue() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13648 ) Change subject: BSSMAP_Emulation: Check for ==/!= null instead of isvalue() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13648 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2434c776c6a4ee83e97bc04e7cbbaf1b546731c0 Gerrit-Change-Number: 13648 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: dexter Gerrit-Comment-Date: Mon, 15 Apr 2019 19:53:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 19:54:17 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 19:54:17 +0000 Subject: Change in osmo-msc[master]: gsm_04_11: Log MT sms dst subscriber In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13555 ) Change subject: gsm_04_11: Log MT sms dst subscriber ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13555 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I483ac61067f51d03f6f476821d8664da3d1f17b2 Gerrit-Change-Number: 13555 Gerrit-PatchSet: 4 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 15 Apr 2019 19:54:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 19:54:37 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Apr 2019 19:54:37 +0000 Subject: Change in osmo-msc[master]: gsm_04_11: Log MT sms dst subscriber In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13555 ) Change subject: gsm_04_11: Log MT sms dst subscriber ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13555 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I483ac61067f51d03f6f476821d8664da3d1f17b2 Gerrit-Change-Number: 13555 Gerrit-PatchSet: 4 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 15 Apr 2019 19:54:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 15 19:56:34 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Apr 2019 19:56:34 +0000 Subject: Change in osmo-bsc[master]: Drop unused old osmux leftover code In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13649 ) Change subject: Drop unused old osmux leftover code ...................................................................... Drop unused old osmux leftover code Let's better clean up old stuff before doing new implementation. Change-Id: Id4e254a1c24831afaba9ab7b330d4e09a2474c8e --- M include/osmocom/bsc/Makefile.am D include/osmocom/bsc/osmux.h 2 files changed, 0 insertions(+), 42 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 02a4ad8..044fdc9 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -43,7 +43,6 @@ osmo_bsc_rf.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ - osmux.h \ paging.h \ pcu_if.h \ pcuif_proto.h \ diff --git a/include/osmocom/bsc/osmux.h b/include/osmocom/bsc/osmux.h deleted file mode 100644 index f3ea72a..0000000 --- a/include/osmocom/bsc/osmux.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _OPENBSC_OSMUX_H_ -#define _OPENBSC_OSMUX_H_ - -#include - -#define OSMUX_PORT 1984 - -enum { - OSMUX_ROLE_BSC = 0, - OSMUX_ROLE_BSC_NAT, -}; - -int osmux_init(int role, struct mgcp_config *cfg); -int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port); -void osmux_disable_endpoint(struct mgcp_endpoint *endp); -void osmux_allocate_cid(struct mgcp_endpoint *endp); -void osmux_release_cid(struct mgcp_endpoint *endp); - -int osmux_xfrm_to_rtp(struct mgcp_endpoint *endp, int type, char *buf, int rc); -int osmux_xfrm_to_osmux(int type, char *buf, int rc, struct mgcp_endpoint *endp); - -int osmux_send_dummy(struct mgcp_endpoint *endp); - -int osmux_get_cid(void); -void osmux_put_cid(uint8_t osmux_cid); -int osmux_used_cid(void); - -enum osmux_state { - OSMUX_STATE_DISABLED = 0, - OSMUX_STATE_NEGOTIATING, - OSMUX_STATE_ACTIVATING, - OSMUX_STATE_ENABLED, -}; - -enum osmux_usage { - OSMUX_USAGE_OFF = 0, - OSMUX_USAGE_ON = 1, - OSMUX_USAGE_ONLY = 2, -}; - -#endif -- To view, visit https://gerrit.osmocom.org/13649 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id4e254a1c24831afaba9ab7b330d4e09a2474c8e Gerrit-Change-Number: 13649 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 07:09:03 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 16 Apr 2019 07:09:03 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling G... Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/13654 Change subject: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling GMM Attach Requests ...................................................................... gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling GMM Attach Requests A security command complete is part of multiple messages not only the GMM Attach Request and must go through the gmm authorized as long it's not completely replaced. Change-Id: I50e8e316f06ae1a6171a6b07e4e2f0761322b779 --- M src/gprs/gprs_gmm.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/54/13654/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index b0c5902..358bff9 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -205,7 +205,12 @@ REQUIRE_MM /* Continue authentication here */ mm->iu.ue_ctx->integrity_active = 1; - osmo_fsm_inst_dispatch(mm->gmm_att_req.fsm, E_IU_SECURITY_CMD_COMPLETE, NULL); + + /* FIXME: remove gmm_authorize */ + if (mm->pending_req != GSM48_MT_GMM_ATTACH_REQ) + gsm48_gmm_authorize(mm); + else + osmo_fsm_inst_dispatch(mm->gmm_att_req.fsm, E_IU_SECURITY_CMD_COMPLETE, NULL); break; default: LOGP(DRANAP, LOGL_NOTICE, "Unknown event received: %i\n", type); -- To view, visit https://gerrit.osmocom.org/13654 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I50e8e316f06ae1a6171a6b07e4e2f0761322b779 Gerrit-Change-Number: 13654 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 07:24:02 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 16 Apr 2019 07:24:02 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Check for ==/!= null instead of isvalue() In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/13648 ) Change subject: BSSMAP_Emulation: Check for ==/!= null instead of isvalue() ...................................................................... Patch Set 1: Verified+1 Code-Review+1 > Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13648 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2434c776c6a4ee83e97bc04e7cbbaf1b546731c0 Gerrit-Change-Number: 13648 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: dexter Gerrit-Comment-Date: Tue, 16 Apr 2019 07:24:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 07:24:14 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 16 Apr 2019 07:24:14 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Check for ==/!= null instead of isvalue() In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/13648 ) Change subject: BSSMAP_Emulation: Check for ==/!= null instead of isvalue() ...................................................................... BSSMAP_Emulation: Check for ==/!= null instead of isvalue() Related: OS#3932 Change-Id: I2434c776c6a4ee83e97bc04e7cbbaf1b546731c0 --- M library/BSSMAP_Emulation.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified dexter: Looks good to me, but someone else must approve; Verified Harald Welte: Looks good to me, approved diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index 55ce2fb..3816ed7 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -406,7 +406,7 @@ var BSSAP_ConnHdlr client := null; client := f_imsi_table_find(bssap.pdu.bssmap.paging.iMSI.digits, bssap.pdu.bssmap.paging.tMSI.tmsiOctets); - if (isvalue(client)) { + if (client != null) { log("CommonBssmapUnitdataCallback: IMSI/TMSI found in table, dispatching to ", client); CLIENT.send(bssap) to client; -- To view, visit https://gerrit.osmocom.org/13648 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2434c776c6a4ee83e97bc04e7cbbaf1b546731c0 Gerrit-Change-Number: 13648 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 08:07:09 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 08:07:09 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling G... In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13654 ) Change subject: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling GMM Attach Requests ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13654/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13654/1//COMMIT_MSG at 11 PS1, Line 11: I'm sorry to say that, but this description doesn't explain enough what do you intend to do here, at least for me, and the commit change looks strange too, since basically you add a function call and add a comment with FIXME stating to remove it... Is the commit related to some redmine issue? Can you extend the description of the commit? -- To view, visit https://gerrit.osmocom.org/13654 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I50e8e316f06ae1a6171a6b07e4e2f0761322b779 Gerrit-Change-Number: 13654 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 08:07:09 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 08:08:12 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 08:08:12 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Rename BSSMAP_Emulation -> RAN_Emulation In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13650 ) Change subject: Rename BSSMAP_Emulation -> RAN_Emulation ...................................................................... Patch Set 1: Looks like you need to rebase your patchset. -- To view, visit https://gerrit.osmocom.org/13650 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iecbcb0c6c136baad9460eca40606bb4010d8882d Gerrit-Change-Number: 13650 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 08:08:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 08:08:59 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 16 Apr 2019 08:08:59 +0000 Subject: Change in osmo-bts[master]: pcu_sock: use %zu conversion specifier for printing sizeof() result In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Pau Espin Pedrol, Daniel Willmann, Max, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13267 to look at the new patch set (#5). Change subject: pcu_sock: use %zu conversion specifier for printing sizeof() result ...................................................................... pcu_sock: use %zu conversion specifier for printing sizeof() result When using %lu and sizeof() for printing the compiler may throw a warning. Lets prevent this by using %zu instead of %lu as conversion specifier. Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709 --- M src/common/pcu_sock.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/13267/5 -- To view, visit https://gerrit.osmocom.org/13267 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709 Gerrit-Change-Number: 13267 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 08:12:35 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 16 Apr 2019 08:12:35 +0000 Subject: Change in osmo-bts[master]: pcu_sock: use %zu conversion specifier for printing sizeof() result In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13267 ) Change subject: pcu_sock: use %zu conversion specifier for printing sizeof() result ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13267 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709 Gerrit-Change-Number: 13267 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-Comment-Date: Tue, 16 Apr 2019 08:12:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 09:25:30 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 16 Apr 2019 09:25:30 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling G... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13654 to look at the new patch set (#2). Change subject: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling GMM Attach Requests ...................................................................... gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling GMM Attach Requests A security command is part of multiple procedures to ensure integrity (optional also encryption) between MS and RNC. It should be used for all Iu connections once. With the rewrite of the GMM Attach FSM the use of the security command procedure was broken for all procedures e.g. Service Request except GMM Attach Request. Relates: OS#3920 Change-Id: I50e8e316f06ae1a6171a6b07e4e2f0761322b779 --- M src/gprs/gprs_gmm.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/54/13654/2 -- To view, visit https://gerrit.osmocom.org/13654 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I50e8e316f06ae1a6171a6b07e4e2f0761322b779 Gerrit-Change-Number: 13654 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 10:04:27 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 16 Apr 2019 10:04:27 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_04_11.c: properly handle TP-User-Data-Length Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13655 Change subject: libmsc/gsm_04_11.c: properly handle TP-User-Data-Length ...................................................................... libmsc/gsm_04_11.c: properly handle TP-User-Data-Length As per 3GPP TS 03.40, section 9.2.3.16 "TP-User-Data-Length (TP-UDL)", if the TP-User-Data is coded using the GSM 7-bit default alphabet, the TP-User-Data-Length field indicates the *number of septets* within the TP-User-Data field to follow. Otherwise, i.e. in case of 8-bit or UCS-2 encoded data, the *number of octets* is indicated. Since we store the original TP-UDL value (as received), we might need to convert septets to octets before passing it to memcpy(). Otherwise this would lead to a buffer overrun. Also, as we receive TPDU from untrusted source (i.e. subscriber), the TP-UDL value needs to be checked against the corresponding maximum (160 septets or 140 octets) and truncated if needed. Please note that buffer overrun is still possible, e.g. when an indicated TP-UDL value is grather than the remaining TPDU length. Preventing this would require adding an additional check. Change-Id: I4b08db7665e854a045129e7695e2bdf296df1688 Depends-on: (core) I54f88d2908ac47228813fb8c049f4264e5145241 --- M src/libmsc/gsm_04_11.c 1 file changed, 29 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/55/13655/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 434f878..6eea662 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -559,19 +560,35 @@ rc = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; goto out; } - gsms->user_data_len = *smsp++; - if (gsms->user_data_len) { - memcpy(gsms->user_data, smsp, gsms->user_data_len); - switch (sms_alphabet) { - case DCS_7BIT_DEFAULT: - gsm_7bit_decode_n(gsms->text, sizeof(gsms->text), smsp, - gsms->user_data_len); - break; - case DCS_8BIT_DATA: - case DCS_UCS2: - case DCS_NONE: - break; + /* As per 3GPP TS 03.40, section 9.2.3.16, TP-User-Data-Length (TP-UDL) + * may indicate either the number of septets, or the number of octets, + * depending on Data Coding Scheme. We store TP-UDL value as-is, + * so this should be kept in mind to avoid buffer overruns. */ + gsms->user_data_len = *smsp++; + if (gsms->user_data_len > 0) { + if (sms_alphabet == DCS_7BIT_DEFAULT) { + /* TP-UDL is indicated in septets (up to 160) */ + if (gsms->user_data_len > GSM340_UDL_SPT_MAX) { + LOG_TRANS(trans, LOGL_NOTICE, + "TP-User-Data-Length %u (septets) " + "is too big, truncating to %u\n", + gsms->user_data_len, GSM340_UDL_SPT_MAX); + gsms->user_data_len = GSM340_UDL_SPT_MAX; + } + memcpy(gsms->user_data, smsp, gsm_get_octet_len(gsms->user_data_len)); + gsm_7bit_decode_n(gsms->text, sizeof(gsms->text), + smsp, gsms->user_data_len); + } else { + /* TP-UDL is indicated in octets (up to 140) */ + if (gsms->user_data_len > GSM340_UDL_OCT_MAX) { + LOG_TRANS(trans, LOGL_NOTICE, + "TP-User-Data-Length %u (octets) " + "is too big, truncating to %u\n", + gsms->user_data_len, GSM340_UDL_OCT_MAX); + gsms->user_data_len = GSM340_UDL_OCT_MAX; + } + memcpy(gsms->user_data, smsp, gsms->user_data_len); } } -- To view, visit https://gerrit.osmocom.org/13655 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4b08db7665e854a045129e7695e2bdf296df1688 Gerrit-Change-Number: 13655 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 11:21:42 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 16 Apr 2019 11:21:42 +0000 Subject: Change in osmo-gsm-manuals[master]: debian/control: depends: add texlive-htmlxml Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13656 Change subject: debian/control: depends: add texlive-htmlxml ...................................................................... debian/control: depends: add texlive-htmlxml Try to fix the "unresolvable" error in OBS for debian 9 and derivate distributions: "have choice for jadetex needed by docbook-utils: jadetex texlive-htmlxml". https://build.opensuse.org/package/show/network:osmocom:nightly/osmo-gsm-manuals Note that texlive-htmlxml is only available in debian 9 and above. But this is also the case for asciidoc-dblatex, which means we will need to add a patch file to make debian/control work with older debian releases (like it is done with osmo-trx). This will come in a follow up patch. Related: OS#3899 Change-Id: I17d88ede172046188c2a7ecae4cca460b3055ea2 --- M debian/control 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/56/13656/1 diff --git a/debian/control b/debian/control index 9dc03cb..cdc826d 100644 --- a/debian/control +++ b/debian/control @@ -15,6 +15,7 @@ python, python-nwdiag, python-pychart, + texlive-htmlxml, xsltproc Standards-Version: 3.9.8 Homepage: https://git.osmocom.org/osmo-gsm-manuals/ @@ -31,6 +32,7 @@ python, python-nwdiag, python-pychart, + texlive-htmlxml, xsltproc Description: Osmocom manuals shared code All Osomocom repositories require this package to build their manuals. -- To view, visit https://gerrit.osmocom.org/13656 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I17d88ede172046188c2a7ecae4cca460b3055ea2 Gerrit-Change-Number: 13656 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 11:21:42 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 16 Apr 2019 11:21:42 +0000 Subject: Change in osmo-gsm-manuals[master]: debian: add patch for debian 8 Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13657 Change subject: debian: add patch for debian 8 ...................................................................... debian: add patch for debian 8 Add a patch that changes the dependencies in debian/control, so the package builds for debian 8. Similar to how it's done for osmo-trx. Related: OS#3899 Change-Id: I5b9575ceb1141961e570643a5755a2bd6b6a4254 --- A debian/patches/build-for-debian8.patch 1 file changed, 34 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/57/13657/1 diff --git a/debian/patches/build-for-debian8.patch b/debian/patches/build-for-debian8.patch new file mode 100644 index 0000000..f107109 --- /dev/null +++ b/debian/patches/build-for-debian8.patch @@ -0,0 +1,34 @@ +--- a/debian/control ++++ b/debian/control +@@ -6,7 +6,6 @@ Build-Depends: autotools-dev, + debhelper (>= 9), + pkg-config, + asciidoc, +- asciidoc-dblatex, + dblatex, + docbook5-xml, + graphviz, +@@ -14,7 +13,6 @@ Build-Depends: autotools-dev, + python, + python-nwdiag, + python-pychart, +- texlive-htmlxml, + xsltproc + Standards-Version: 3.9.8 + Homepage: https://git.osmocom.org/osmo-gsm-manuals/ +@@ -23,7 +21,6 @@ Package: osmo-gsm-manuals-dev + Architecture: all + Depends: ${misc:Depends}, + asciidoc, +- asciidoc-dblatex, + dblatex, + docbook5-xml, + graphviz, +@@ -31,7 +28,6 @@ Depends: ${misc:Depends}, + python, + python-nwdiag, + python-pychart, +- texlive-htmlxml, + xsltproc + Description: Osmocom manuals shared code + All Osomocom repositories require this package to build their manuals. -- To view, visit https://gerrit.osmocom.org/13657 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5b9575ceb1141961e570643a5755a2bd6b6a4254 Gerrit-Change-Number: 13657 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 11:22:02 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 16 Apr 2019 11:22:02 +0000 Subject: Change in osmo-ci[master]: nightly-packages: add osmo-gsm-manuals-debian8-jessie Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13658 Change subject: nightly-packages: add osmo-gsm-manuals-debian8-jessie ...................................................................... nightly-packages: add osmo-gsm-manuals-debian8-jessie Create a compatible package for debian 8 with adjusted dependencies. While at it, refactor create_osmo_trx_debian8_jessie() into a generic checkout_copy_debian8_jessie() function. Related: OS#3899 Depends: I5b9575ceb1141961e570643a5755a2bd6b6a4254 (osmo-gsm-manuals) Change-Id: I3570599ede51b974d350064f44f77e360fafd8b0 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 8 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/58/13658/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 61cb250..27cd9dc 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -148,11 +148,12 @@ git checkout "$TAG" } -create_osmo_trx_debian8_jessie() { - # The package must be already checked out via `checkout osmo-trx` +# Copy an already checked out repository dir and apply its debian 8 patch. +# $1: Osmocom repository +checkout_copy_debian8_jessie() { cd "$REPO" - cp -a osmo-trx osmo-trx-debian8-jessie - cd osmo-trx-debian8-jessie/ + cp -a "$1" "$1-debian8-jessie" + cd "$1-debian8-jessie" patch -p1 < debian/patches/build-for-debian8.patch git commit -m 'auto-commit: allow debian8 to build' debian/ cd .. @@ -201,10 +202,12 @@ checkout osmo-sysmon checkout osmo-remsim - create_osmo_trx_debian8_jessie + checkout_copy_debian8_jessie "osmo-gsm-manuals" + checkout_copy_debian8_jessie "osmo-trx" build limesuite no_commit --git-upstream-tree="$(get_last_tag limesuite)" build osmo-gsm-manuals + build osmo-gsm-manuals-debian8-jessie build libosmocore build libosmo-sccp build libosmo-abis -- To view, visit https://gerrit.osmocom.org/13658 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3570599ede51b974d350064f44f77e360fafd8b0 Gerrit-Change-Number: 13658 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 11:24:39 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 11:24:39 +0000 Subject: Change in osmo-gsm-manuals[master]: debian/control: depends: add texlive-htmlxml In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13656 ) Change subject: debian/control: depends: add texlive-htmlxml ...................................................................... Patch Set 1: I think for this kind of scenario (2 packets providing same stuff) You need to add some config to OBS project stating which one you want. -- To view, visit https://gerrit.osmocom.org/13656 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I17d88ede172046188c2a7ecae4cca460b3055ea2 Gerrit-Change-Number: 13656 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 11:24:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 11:25:40 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 16 Apr 2019 11:25:40 +0000 Subject: Change in osmo-ci[master]: nightly-packages: add osmo-gsm-manuals-debian8-jessie In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13658 ) Change subject: nightly-packages: add osmo-gsm-manuals-debian8-jessie ...................................................................... Patch Set 1: Verified+1 I did: $ ln -s /bin/true /usr/local/bin/osc and then ran the script, and it went through successfully. It generated the source packages just like it should, with the right dependencies. (Setting to WIP, because it depends on another patch.) -- To view, visit https://gerrit.osmocom.org/13658 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3570599ede51b974d350064f44f77e360fafd8b0 Gerrit-Change-Number: 13658 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 16 Apr 2019 11:25:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 11:25:43 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 11:25:43 +0000 Subject: Change in osmo-gsm-manuals[master]: debian/control: depends: add texlive-htmlxml In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13656 ) Change subject: debian/control: depends: add texlive-htmlxml ...................................................................... Patch Set 1: See https://osmocom.org/issues/2537#note-5 -- To view, visit https://gerrit.osmocom.org/13656 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I17d88ede172046188c2a7ecae4cca460b3055ea2 Gerrit-Change-Number: 13656 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 11:25:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 11:27:44 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 16 Apr 2019 11:27:44 +0000 Subject: Change in osmo-gsm-manuals[master]: debian/control: depends: add texlive-htmlxml In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13656 ) Change subject: debian/control: depends: add texlive-htmlxml ...................................................................... Patch Set 1: Oh, that is how it works. Thanks for explaining, I'll adjust the OBS config then, and update the patches. This patch can then be dropped probably. -- To view, visit https://gerrit.osmocom.org/13656 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I17d88ede172046188c2a7ecae4cca460b3055ea2 Gerrit-Change-Number: 13656 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 11:27:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 13:30:26 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 16 Apr 2019 13:30:26 +0000 Subject: Change in osmo-gsm-manuals[master]: debian/control: depends: add texlive-htmlxml In-Reply-To: References: Message-ID: osmith has abandoned this change. ( https://gerrit.osmocom.org/13656 ) Change subject: debian/control: depends: add texlive-htmlxml ...................................................................... Abandoned This patch is not needed, one can set the following in the OBS project config instead: Prefer: texlive-htmlxml -- To view, visit https://gerrit.osmocom.org/13656 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I17d88ede172046188c2a7ecae4cca460b3055ea2 Gerrit-Change-Number: 13656 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 15:19:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 15:19:08 +0000 Subject: Change in osmo-trx[master]: use BSC_FD_READ and not OSMO_FD_READ Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13659 Change subject: use BSC_FD_READ and not OSMO_FD_READ ...................................................................... use BSC_FD_READ and not OSMO_FD_READ We haven't even released any tagged version of libosmocore yet which includes support for the renamed OSMO_FD_READ constant. Let's avoid any breakage and use the new constants only with considerable delay, at the very least only when released libosmocore versions provide it. Change-Id: Idb57077b2a4b2a71dd5d75a24ded8bb5887da188 --- M Transceiver52M/osmo-trx.cpp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/59/13659/1 diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 7489e7c..8c592aa 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -236,7 +236,7 @@ exit(EXIT_FAILURE); } - osmo_fd_setup(&signal_ofd, sfd, OSMO_FD_READ, signalfd_callback, NULL, 0); + osmo_fd_setup(&signal_ofd, sfd, BSC_FD_READ, signalfd_callback, NULL, 0); if (osmo_fd_register(&signal_ofd) < 0) { fprintf(stderr, "osmo_fd_register() failed.\n"); exit(EXIT_FAILURE); -- To view, visit https://gerrit.osmocom.org/13659 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Idb57077b2a4b2a71dd5d75a24ded8bb5887da188 Gerrit-Change-Number: 13659 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 15:20:27 2019 From: gerrit-no-reply at lists.osmocom.org (roh) Date: Tue, 16 Apr 2019 15:20:27 +0000 Subject: Change in osmo-trx[master]: cleanup: remove comment copied from -uhd Message-ID: roh has uploaded this change for review. ( https://gerrit.osmocom.org/13660 Change subject: cleanup: remove comment copied from -uhd ...................................................................... cleanup: remove comment copied from -uhd Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 2 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/60/13660/1 diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index b004308..52ef4a4 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -548,11 +548,8 @@ } GSM::Time LMSDevice::minLatency() { - /* Empirical data from a handful of - relatively recent machines shows that the B100 will underrun when - the transmit threshold is reduced to a time of 6 and a half frames, - so we set a minimum 7 frame threshold. */ - return GSM::Time(6,7); + /* UNUSED on limesdr (only used on usrp1/2) */ + return GSM::Time(0,0); } void LMSDevice::update_stream_stats(size_t chan, bool * underrun, bool * overrun) -- To view, visit https://gerrit.osmocom.org/13660 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d Gerrit-Change-Number: 13660 Gerrit-PatchSet: 1 Gerrit-Owner: roh -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 15:20:28 2019 From: gerrit-no-reply at lists.osmocom.org (roh) Date: Tue, 16 Apr 2019 15:20:28 +0000 Subject: Change in osmo-trx[master]: move LMS_EnableChannel from Start/Stop to Open/Close device Message-ID: roh has uploaded this change for review. ( https://gerrit.osmocom.org/13661 Change subject: move LMS_EnableChannel from Start/Stop to Open/Close device ...................................................................... move LMS_EnableChannel from Start/Stop to Open/Close device Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9 --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 14 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/61/13661/1 diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 52ef4a4..cb41858 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -78,8 +78,14 @@ LMSDevice::~LMSDevice() { + unsigned int i; LOGC(DDEV, INFO) << "Closing LMS device"; if (m_lms_dev) { + /* disable all channels */ + for (i=0; i -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 15:20:28 2019 From: gerrit-no-reply at lists.osmocom.org (roh) Date: Tue, 16 Apr 2019 15:20:28 +0000 Subject: Change in osmo-trx[master]: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start (bw... Message-ID: roh has uploaded this change for review. ( https://gerrit.osmocom.org/13662 Change subject: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start (bw, freq, power need to be set) ...................................................................... move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start (bw, freq, power need to be set) Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37 --- M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/lms/LMSDevice.h 2 files changed, 50 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/62/13662/1 diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index cb41858..ab4e868 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -153,8 +153,8 @@ { //lms_info_str_t dev_str; lms_info_str_t* info_list; - lms_range_t range_lpfbw_rx, range_lpfbw_tx, range_sr; - float_type sr_host, sr_rf, lpfbw_rx, lpfbw_tx; + lms_range_t range_sr; + float_type sr_host, sr_rf; uint16_t dac_val; unsigned int i, n; int rc, dev_id; @@ -244,36 +244,11 @@ goto out_close; } - if (LMS_GetLPFBWRange(m_lms_dev, LMS_CH_RX, &range_lpfbw_rx)) - goto out_close; - print_range("LPFBWRange Rx", &range_lpfbw_rx); - if (LMS_GetLPFBWRange(m_lms_dev, LMS_CH_RX, &range_lpfbw_tx)) - goto out_close; - print_range("LPFBWRange Tx", &range_lpfbw_tx); - lpfbw_rx = OSMO_MIN(OSMO_MAX(1.4001e6, range_lpfbw_rx.min), range_lpfbw_rx.max); - lpfbw_tx = OSMO_MIN(OSMO_MAX(5.2e6, range_lpfbw_tx.min), range_lpfbw_tx.max); - - LOGC(DDEV, INFO) << "LPFBW: Rx=" << lpfbw_rx << " Tx=" << lpfbw_tx; - if (!set_antennas()) { LOGC(DDEV, ALERT) << "LMS antenna setting failed"; return -1; } - /* Perform Rx and Tx calibration */ - for (i=0; i -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 15:20:28 2019 From: gerrit-no-reply at lists.osmocom.org (roh) Date: Tue, 16 Apr 2019 15:20:28 +0000 Subject: Change in osmo-trx[master]: add device type detection Message-ID: roh has uploaded this change for review. ( https://gerrit.osmocom.org/13663 Change subject: add device type detection ...................................................................... add device type detection device dependant max gain setup rework clock reference setup remove now unused compat_LMS_VCTCXO* functions Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181 --- M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/lms/LMSDevice.h 2 files changed, 50 insertions(+), 45 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/13663/1 diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index ab4e868..06c506e 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -41,24 +41,6 @@ #define LMS_MIN_BW_SUPPORTED 2.5e6 /* 2.5mHz, minimum supported by LMS */ #define LMS_CALIBRATE_BW_HZ OSMO_MAX(GSM_CARRIER_BW, LMS_MIN_BW_SUPPORTED) -static int compat_LMS_VCTCXORead(lms_device_t *dev, uint16_t *val, bool memory) -{ -#if HAVE_LMS_VCTCXO_EEPROM_SAVING - return LMS_VCTCXORead(dev, val, memory); -#else - return LMS_VCTCXORead(dev, val); -#endif -} - -static int compat_LMS_VCTCXOWrite(lms_device_t *dev, uint16_t val, bool memory) -{ -#if HAVE_LMS_VCTCXO_EEPROM_SAVING - return LMS_VCTCXOWrite(dev, val, memory); -#else - return LMS_VCTCXOWrite(dev, val); -#endif -} - LMSDevice::LMSDevice(size_t tx_sps, size_t rx_sps, InterfaceType iface, size_t chans, double lo_offset, const std::vector& tx_paths, const std::vector& rx_paths): @@ -151,11 +133,10 @@ int LMSDevice::open(const std::string &args, int ref, bool swap_channels) { - //lms_info_str_t dev_str; lms_info_str_t* info_list; + const lms_dev_info_t* device_info; lms_range_t range_sr; float_type sr_host, sr_rf; - uint16_t dac_val; unsigned int i, n; int rc, dev_id; @@ -194,12 +175,45 @@ delete [] info_list; + device_info = LMS_GetDeviceInfo(m_lms_dev); + + if ((ref != REF_EXTERNAL) && (ref != REF_INTERNAL)){ + LOGC(DDEV, ALERT) << "Invalid reference type"; + goto out_close; + } + + /* if reference clock is external setup must happen _before_ calling LMS_Init */ + /* FIXME make external reference frequency configurable */ + if (ref == REF_EXTERNAL) { + LOGC(DDEV, INFO) << "Setting External clock reference to 10MHz"; + /* Assume an external 10 MHz reference clock */ + if (LMS_SetClockFreq(m_lms_dev, LMS_CLOCK_EXTREF, 10000000.0) < 0) + goto out_close; + } + LOGC(DDEV, INFO) << "Init LMS device"; if (LMS_Init(m_lms_dev) != 0) { LOGC(DDEV, ERROR) << "LMS_Init() failed"; goto out_close; } + /* LimeSDR-Mini does not have switches but needs soldering to select external/internal clock */ + /* LimeNET-Micro also does not like selecting internal clock*/ + /* also set device specific maximum tx levels selected by phasenoise measurements*/ + if (strncmp(device_info->deviceName,"LimeSDR-USB",11)==0){ + /* if reference clock is internal setup must happen _after_ calling LMS_Init */ + if (ref == REF_INTERNAL) { + LOGC(DDEV, INFO) << "Setting Internal clock reference"; + if (LMS_SetClockFreq(m_lms_dev, LMS_CLOCK_EXTREF, -1) < 0) + goto out_close; + } + maxTxGainClamp = 73.0; + } else + if (strncmp(device_info->deviceName,"LimeSDR-Mini",12)==0) + maxTxGainClamp = 66.0; + else + maxTxGainClamp = 71.0; /* "LimeNET-Micro", etc FIXME pciE based LMS boards?*/ + /* enable all used channels */ for (i=0; i(8.9e-5 * GSMRATE * tx_sps); /* time * sample_rate */ - switch (ref) { - case REF_INTERNAL: - LOGC(DDEV, INFO) << "Setting Internal clock reference"; - /* Ugly API: Selecting clock source implicit by writing to VCTCXO DAC ?!? */ - if (compat_LMS_VCTCXORead(m_lms_dev, &dac_val, false) < 0) - goto out_close; - LOGC(DDEV, INFO) << "Setting VCTCXO to " << dac_val; - if (compat_LMS_VCTCXOWrite(m_lms_dev, dac_val, false) < 0) - goto out_close; - break; - case REF_EXTERNAL: - LOGC(DDEV, INFO) << "Setting External clock reference to " << 10000000.0; - /* Assume an external 10 MHz reference clock */ - if (LMS_SetClockFreq(m_lms_dev, LMS_CLOCK_EXTREF, 10000000.0) < 0) - goto out_close; - break; - default: - LOGC(DDEV, ALERT) << "Invalid reference type"; - goto out_close; - } - + /* configure antennas */ if (!set_antennas()) { LOGC(DDEV, ALERT) << "LMS antenna setting failed"; - return -1; + goto out_close; } samplesRead = 0; @@ -275,8 +270,10 @@ /* configure the channels/streams */ for (i=0; i----do_calib(chan); + return dB; } @@ -430,6 +431,9 @@ if (LMS_SetGaindB(m_lms_dev, LMS_CH_RX, chan, dB) < 0) LOGC(DDEV, ERR) << "chan "<< chan << ": Error setting RX gain to " << dB << " dB"; +//FIXME crashes when called while stream is running +//>----do_calib(chan); + return dB; } diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h index 67f4691..d1cb12a 100644 --- a/Transceiver52M/device/lms/LMSDevice.h +++ b/Transceiver52M/device/lms/LMSDevice.h @@ -64,6 +64,7 @@ TIMESTAMP ts_initial, ts_offset; double rxGain; + double maxTxGainClamp; bool do_calib(size_t chan); bool do_filters(size_t chan); -- To view, visit https://gerrit.osmocom.org/13663 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181 Gerrit-Change-Number: 13663 Gerrit-PatchSet: 1 Gerrit-Owner: roh -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 15:21:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 15:21:57 +0000 Subject: Change in osmo-trx[master]: move LMS_EnableChannel from Start/Stop to Open/Close device In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13661 ) Change subject: move LMS_EnableChannel from Start/Stop to Open/Close device ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13661/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13661/1//COMMIT_MSG at 8 PS1, Line 8: the commitlog should state *why* a change was made, not just the one-line summary of *what* was made. -- To view, visit https://gerrit.osmocom.org/13661 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9 Gerrit-Change-Number: 13661 Gerrit-PatchSet: 1 Gerrit-Owner: roh Gerrit-CC: Harald Welte Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 16 Apr 2019 15:21:57 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 15:26:27 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 15:26:27 +0000 Subject: Change in osmo-trx[master]: add device type detection In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13663 ) Change subject: add device type detection ...................................................................... Patch Set 1: Code-Review-1 (5 comments) https://gerrit.osmocom.org/#/c/13663/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13663/1//COMMIT_MSG at 9 PS1, Line 9: device dependant max gain setup again, please --verbose on why those changes are made. Nobody except you has all that context. thanks! https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp File Transceiver52M/device/lms/LMSDevice.cpp: https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp at 203 PS1, Line 203: ,11)==0){ ", 11) == 0) {" [we love our spaces] https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp at 211 PS1, Line 211: else : if we typically do "} else if {" in one line https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp at 416 PS1, Line 416: /FIXME crashes when called while stream is running : //>----do_calib(chan); that shouldn't be part of the patch, I guess that was an accident? https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp at 435 PS1, Line 435: //>----do_calib(chan); that shouldn't be part of the patch, I guess that was an accident? -- To view, visit https://gerrit.osmocom.org/13663 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181 Gerrit-Change-Number: 13663 Gerrit-PatchSet: 1 Gerrit-Owner: roh Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 16 Apr 2019 15:26:27 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 15:28:54 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 15:28:54 +0000 Subject: Change in osmo-mgw[master]: mgcp-client: whitespace cleanup in mgcp_client.c Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13664 Change subject: mgcp-client: whitespace cleanup in mgcp_client.c ...................................................................... mgcp-client: whitespace cleanup in mgcp_client.c Change-Id: Ic3495d70cb9c4e12552c6d97481cc0cf04b79f94 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/64/13664/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 88e5dab..17f40b9 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -323,8 +323,8 @@ unsigned int pt; char codec_resp[64]; unsigned int codec; - - + + if (strstr(line, "ptime")) { if (sscanf(line, "a=ptime:%u", &r->ptime) != 1) goto response_parse_failure_ptime; @@ -353,17 +353,17 @@ } else goto response_parse_failure_rtpmap; } - + return 0; response_parse_failure_ptime: LOGP(DLMGCP, LOGL_ERROR, "Failed to parse SDP parameter, invalid ptime (%s)\n", line); - return -EINVAL; + return -EINVAL; response_parse_failure_rtpmap: LOGP(DLMGCP, LOGL_ERROR, "Failed to parse SDP parameter, invalid rtpmap (%s)\n", line); - return -EINVAL; + return -EINVAL; } /* Parse a line like "c=IN IP4 10.11.12.13" */ @@ -533,7 +533,7 @@ /* If there is an SDP body attached, prevent for_each_non_empty_line() * into running in there, we are not yet interested in the parameters * stored there. */ - data_end = mgcp_find_section_end(data); + data_end = mgcp_find_section_end(data); if (data_end) *data_end = '\0'; @@ -979,7 +979,7 @@ for (i = 0; i < mgcp_msg->codecs_len; i++) { pt = mgcp_msg->codecs[i]; codec = get_value_string_or_null(osmo_mgcpc_codec_names, pt); - + /* Note: Use codec descriptors from enum mgcp_codecs * in mgcp_client only! */ OSMO_ASSERT(codec); @@ -1067,7 +1067,7 @@ for (i = 0; i < mgcp_msg->codecs_len; i++) { pt = map_codec_to_pt(mgcp_msg->ptmap, mgcp_msg->ptmap_len, mgcp_msg->codecs[i]); - + /* Note: Only dynamic payload type from the range 96-127 * require to be explained further via rtpmap. All others * are implcitly definedby the number in m=audio */ @@ -1077,11 +1077,11 @@ /* Note: Use codec descriptors from enum mgcp_codecs * in mgcp_client only! */ OSMO_ASSERT(codec); - + rc += msgb_printf(msg, "a=rtpmap:%u %s\r\n", pt, codec); } } - + if (mgcp_msg->ptime) rc += msgb_printf(msg, "a=ptime:%u\r\n", mgcp_msg->ptime); -- To view, visit https://gerrit.osmocom.org/13664 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic3495d70cb9c4e12552c6d97481cc0cf04b79f94 Gerrit-Change-Number: 13664 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 15:28:54 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 15:28:54 +0000 Subject: Change in osmo-mgw[master]: mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13665 Change subject: mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard ...................................................................... mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard * Get rid of string define containing printf statements * Split name from rest of checks to easily add new names later Change-Id: I46e05a7a3432733976760bbf1c5deb4f7610db11 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 9 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/65/13665/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 17f40b9..c216f3b 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -828,16 +828,15 @@ return mgcp->actual.endpoint_domain_name[0] ? mgcp->actual.endpoint_domain_name : "mgw"; } -const char *mgcp_client_rtpbridge_wildcard(const struct mgcp_client *mgcp) +static char *_mgcp_client_name_append_domain(const struct mgcp_client *mgcp, char *name) { static char endpoint[MGCP_ENDPOINT_MAXLEN]; int rc; -#define RTPBRIDGE_WILDCARD_FMT "rtpbridge/*@%s" - rc = snprintf(endpoint, sizeof(endpoint), RTPBRIDGE_WILDCARD_FMT, mgcp_client_endpoint_domain(mgcp)); + rc = snprintf(endpoint, sizeof(endpoint), "%s@%s", name, mgcp_client_endpoint_domain(mgcp)); if (rc > sizeof(endpoint) - 1) { - LOGP(DLMGCP, LOGL_ERROR, "MGCP endpoint exceeds maximum length of %zu: '" RTPBRIDGE_WILDCARD_FMT "'\n", - sizeof(endpoint) - 1, mgcp_client_endpoint_domain(mgcp)); + LOGP(DLMGCP, LOGL_ERROR, "MGCP endpoint exceeds maximum length of %zu: '%s@%s'\n", + sizeof(endpoint) - 1, name, mgcp_client_endpoint_domain(mgcp)); return NULL; } if (rc < 1) { @@ -847,6 +846,11 @@ return endpoint; } +const char *mgcp_client_rtpbridge_wildcard(const struct mgcp_client *mgcp) +{ + return _mgcp_client_name_append_domain(mgcp, "rtpbridge/*"); +} + struct mgcp_response_pending * mgcp_client_pending_add( struct mgcp_client *mgcp, mgcp_trans_id_t trans_id, -- To view, visit https://gerrit.osmocom.org/13665 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I46e05a7a3432733976760bbf1c5deb4f7610db11 Gerrit-Change-Number: 13665 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 15:37:15 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 15:37:15 +0000 Subject: Change in osmo-trx[master]: use BSC_FD_READ and not OSMO_FD_READ In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13659 ) Change subject: use BSC_FD_READ and not OSMO_FD_READ ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13659 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idb57077b2a4b2a71dd5d75a24ded8bb5887da188 Gerrit-Change-Number: 13659 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 15:37:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 15:40:05 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 15:40:05 +0000 Subject: Change in osmo-trx[master]: cleanup: remove comment copied from -uhd In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13660 ) Change subject: cleanup: remove comment copied from -uhd ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/13660/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13660/1//COMMIT_MSG at 7 PS1, Line 7: cleanup: remove comment copied from -uhd Better indicate the scope of the patch first. And you are not only changing comment (yes, I know actually that code is not used at all). "lms: Remove wrong unused code copied from -uhd" https://gerrit.osmocom.org/#/c/13660/1/Transceiver52M/device/lms/LMSDevice.cpp File Transceiver52M/device/lms/LMSDevice.cpp: https://gerrit.osmocom.org/#/c/13660/1/Transceiver52M/device/lms/LMSDevice.cpp at 551 PS1, Line 551: /* UNUSED on limesdr (only used on usrp1/2) */ Remove extra whitespace at the end. Better explain why is only used on usrp1/2 (TX_WINDOW_foo right?) -- To view, visit https://gerrit.osmocom.org/13660 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d Gerrit-Change-Number: 13660 Gerrit-PatchSet: 1 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 15:40:05 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 15:43:49 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 15:43:49 +0000 Subject: Change in osmo-trx[master]: move LMS_EnableChannel from Start/Stop to Open/Close device In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13661 ) Change subject: move LMS_EnableChannel from Start/Stop to Open/Close device ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13661/1/Transceiver52M/device/lms/LMSDevice.cpp File Transceiver52M/device/lms/LMSDevice.cpp: https://gerrit.osmocom.org/#/c/13661/1/Transceiver52M/device/lms/LMSDevice.cpp at 203 PS1, Line 203: /* enable all used channels */ Add short explanation why this needs to be done the first, to avoid people in the future moving it someone else without knowing about possible restrictions. -- To view, visit https://gerrit.osmocom.org/13661 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9 Gerrit-Change-Number: 13661 Gerrit-PatchSet: 1 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 15:43:49 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 15:44:42 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 15:44:42 +0000 Subject: Change in osmo-trx[master]: move LMS_EnableChannel from Start/Stop to Open/Close device In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13661 ) Change subject: move LMS_EnableChannel from Start/Stop to Open/Close device ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13661/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13661/1//COMMIT_MSG at 7 PS1, Line 7: move LMS_EnableChannel from Start/Stop to Open/Close device Same as Harald said, + prepend "lms" or similar to this line please. -- To view, visit https://gerrit.osmocom.org/13661 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9 Gerrit-Change-Number: 13661 Gerrit-PatchSet: 1 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 15:44:42 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 15:52:25 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 15:52:25 +0000 Subject: Change in osmo-trx[master]: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start (bw... In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13662 ) Change subject: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start (bw, freq, power need to be set) ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/13662/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13662/1//COMMIT_MSG at 7 PS1, Line 7: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start (bw, freq, power need to be set) Same as before: * prepend "lms:" * Move description on why it is done (your parenthesis) out of first line and extend it. https://gerrit.osmocom.org/#/c/13662/1/Transceiver52M/device/lms/LMSDevice.cpp File Transceiver52M/device/lms/LMSDevice.cpp: https://gerrit.osmocom.org/#/c/13662/1/Transceiver52M/device/lms/LMSDevice.cpp at 377 PS1, Line 377: LOGC(DDEV, INFO) << "Setting LPFBW chan " << chan; >From line 361 up to here (at least it seems) to be totally independent from channel, so you shouldn't be calling it for each chan. Better Move that out and pass lpfbw_rx and lpfbw_tx to do_filters(). -- To view, visit https://gerrit.osmocom.org/13662 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37 Gerrit-Change-Number: 13662 Gerrit-PatchSet: 1 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 15:52:25 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 16:09:47 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 16:09:47 +0000 Subject: Change in osmo-trx[master]: add device type detection In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13663 ) Change subject: add device type detection ...................................................................... Patch Set 1: (4 comments) https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp File Transceiver52M/device/lms/LMSDevice.cpp: https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp at 43 PS1, Line 43: Since you dropped compat_functions, also drop this code from configure.ac: AS_IF([test "x$with_lms" = "xyes"], [ PKG_CHECK_MODULES(LMS, LimeSuite) # LimeSuite dc124e4e2ed9b549b142410af172f0592f9f0c23 > 18.10 broke API compatibility: _cflags_save=$CFLAGS CFLAGS="$CFLAGS $LMS_CFLAGS" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[LMS_VCTCXOWrite(NULL, 0, false); LMS_VCTCXORead(NULL, 0, false);]] )], [AC_DEFINE([HAVE_LMS_VCTCXO_EEPROM_SAVING], [1], [LMS_VCTCXO* requires memory parameter])], [AC_DEFINE([HAVE_LMS_VCTCXO_EEPROM_SAVING], [0], [LMS_VCTCXO* has no memory parameter])]) CFLAGS=$_cflags_save ]) https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp at 181 PS1, Line 181: LOGC(DDEV, ALERT) << "Invalid reference type"; ALERT is a logelvel inherited from osmo-trx and we slowly drop it. Better use ERROR. https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp at 207 PS1, Line 207: if (LMS_SetClockFreq(m_lms_dev, LMS_CLOCK_EXTREF, -1) < 0) Should this NOT be EXTREF here? afaiu it should be internal one being set. Something's wrong here and you may need to re-check. https://gerrit.osmocom.org/#/c/13663/1/Transceiver52M/device/lms/LMSDevice.cpp at 225 PS1, Line 225: /* set samplerate */ This comment and next one are unrelated, I'd love if you could move non-related stuff to different patch (these patches are complex enough with stuff being moved around). -- To view, visit https://gerrit.osmocom.org/13663 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181 Gerrit-Change-Number: 13663 Gerrit-PatchSet: 1 Gerrit-Owner: roh Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 16:09:47 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 16:21:07 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 16:21:07 +0000 Subject: Change in osmo-ccid-firmware[master]: main.c: Call ncn8025_init also for SIM7 Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13666 Change subject: main.c: Call ncn8025_init also for SIM7 ...................................................................... main.c: Call ncn8025_init also for SIM7 The ncn8025 has no impact on the UART, so no matter if we use SERCOM7 as debug uart or as SIM UART, we can always initialize the NCN8025 and thereby allow control of (e.g.) the LED. Change-Id: I70ae1e050d5540627bc77626dbf1b6040e95dae4 --- M sysmoOCTSIM/main.c 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/66/13666/1 diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index dc67406..9dee504 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -39,8 +39,7 @@ for (i = 0; i < 4; i++) i2c_init(&i2c[i]); - /* only 7 slots, as last slot is debug uart! */ - for (i = 0; i < 7; i++) + for (i = 0; i < 8; i++) ncn8025_init(i); cache_init(); -- To view, visit https://gerrit.osmocom.org/13666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I70ae1e050d5540627bc77626dbf1b6040e95dae4 Gerrit-Change-Number: 13666 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 16:21:31 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 16:21:31 +0000 Subject: Change in osmo-ccid-firmware[master]: main.c: Call ncn8025_init also for SIM7 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13666 ) Change subject: main.c: Call ncn8025_init also for SIM7 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I70ae1e050d5540627bc77626dbf1b6040e95dae4 Gerrit-Change-Number: 13666 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 16 Apr 2019 16:21:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 16:22:02 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 16:22:02 +0000 Subject: Change in osmo-ccid-firmware[master]: main.c: Call ncn8025_init also for SIM7 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13666 ) Change subject: main.c: Call ncn8025_init also for SIM7 ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I70ae1e050d5540627bc77626dbf1b6040e95dae4 Gerrit-Change-Number: 13666 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 16 Apr 2019 16:22:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 16:22:03 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 16:22:03 +0000 Subject: Change in osmo-ccid-firmware[master]: main.c: Call ncn8025_init also for SIM7 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13666 ) Change subject: main.c: Call ncn8025_init also for SIM7 ...................................................................... main.c: Call ncn8025_init also for SIM7 The ncn8025 has no impact on the UART, so no matter if we use SERCOM7 as debug uart or as SIM UART, we can always initialize the NCN8025 and thereby allow control of (e.g.) the LED. Change-Id: I70ae1e050d5540627bc77626dbf1b6040e95dae4 --- M sysmoOCTSIM/main.c 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index dc67406..9dee504 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -39,8 +39,7 @@ for (i = 0; i < 4; i++) i2c_init(&i2c[i]); - /* only 7 slots, as last slot is debug uart! */ - for (i = 0; i < 7; i++) + for (i = 0; i < 8; i++) ncn8025_init(i); cache_init(); -- To view, visit https://gerrit.osmocom.org/13666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I70ae1e050d5540627bc77626dbf1b6040e95dae4 Gerrit-Change-Number: 13666 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-CC: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 17:08:29 2019 From: gerrit-no-reply at lists.osmocom.org (roh) Date: Tue, 16 Apr 2019 17:08:29 +0000 Subject: Change in osmo-trx[master]: lms: Remove wrong unused code copied from -uhd In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13660 to look at the new patch set (#2). Change subject: lms: Remove wrong unused code copied from -uhd ...................................................................... lms: Remove wrong unused code copied from -uhd Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 2 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/60/13660/2 -- To view, visit https://gerrit.osmocom.org/13660 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d Gerrit-Change-Number: 13660 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 17:08:29 2019 From: gerrit-no-reply at lists.osmocom.org (roh) Date: Tue, 16 Apr 2019 17:08:29 +0000 Subject: Change in osmo-trx[master]: lms: move LMS_EnableChannel from Start/Stop to Open/Close device In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13661 to look at the new patch set (#2). Change subject: lms: move LMS_EnableChannel from Start/Stop to Open/Close device ...................................................................... lms: move LMS_EnableChannel from Start/Stop to Open/Close device move enable: it is important that channels are actually enabled before applying any configuration (besides external clock) move disable: move to close, so channels are not disabled and not enabled again while osmotrx is active. Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9 --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 14 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/61/13661/2 -- To view, visit https://gerrit.osmocom.org/13661 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9 Gerrit-Change-Number: 13661 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 17:08:29 2019 From: gerrit-no-reply at lists.osmocom.org (roh) Date: Tue, 16 Apr 2019 17:08:29 +0000 Subject: Change in osmo-trx[master]: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13662 to look at the new patch set (#2). Change subject: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start ...................................................................... lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start bandwidth, freqency, gain stages need to be set before calibration can be successful Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37 --- M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/lms/LMSDevice.h 2 files changed, 50 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/62/13662/2 -- To view, visit https://gerrit.osmocom.org/13662 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37 Gerrit-Change-Number: 13662 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 17:08:29 2019 From: gerrit-no-reply at lists.osmocom.org (roh) Date: Tue, 16 Apr 2019 17:08:29 +0000 Subject: Change in osmo-trx[master]: lms: add device type detection and device specific gains 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/13663 to look at the new patch set (#2). Change subject: lms: add device type detection and device specific gains ...................................................................... lms: add device type detection and device specific gains add device dependant max gain setup - limesdr mini and limenet micro need slightly reduced maximum gains to get a PASS on phase error measurements rework clock reference setup - external clock needs to be selected before calling LMS_Init(), internal can only be set after. remove now unused compat_LMS_VCTCXO* functions - we do not set the VCTXCO directly anymore Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181 --- M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/lms/LMSDevice.h M configure.ac 3 files changed, 40 insertions(+), 62 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/13663/2 -- To view, visit https://gerrit.osmocom.org/13663 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181 Gerrit-Change-Number: 13663 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 17:08:31 2019 From: gerrit-no-reply at lists.osmocom.org (roh) Date: Tue, 16 Apr 2019 17:08:31 +0000 Subject: Change in osmo-trx[master]: lms: properly call close if set_antennas() fails, add some comments Message-ID: roh has uploaded this change for review. ( https://gerrit.osmocom.org/13667 Change subject: lms: properly call close if set_antennas() fails, add some comments ...................................................................... lms: properly call close if set_antennas() fails, add some comments Change-Id: I9ebe986ee3a15842a15853424ee98e9a2fa6a5df --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/67/13667/1 diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 15064e8..94160b4 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -222,6 +222,7 @@ goto out_close; } + /* set samplerate */ if (LMS_GetSampleRateRange(m_lms_dev, LMS_CH_RX, &range_sr)) goto out_close; print_range("Sample Rate", &range_sr); @@ -237,9 +238,10 @@ /* FIXME: make this device/model dependent, like UHDDevice:dev_param_map! */ ts_offset = static_cast(8.9e-5 * GSMRATE * tx_sps); /* time * sample_rate */ + /* configure antennas */ if (!set_antennas()) { LOGC(DDEV, ALERT) << "LMS antenna setting failed"; - return -1; + goto out_close; } samplesRead = 0; @@ -281,6 +283,7 @@ if (!do_calib(i)) return false; + /* configure Streams */ m_lms_stream_rx[i] = {}; m_lms_stream_rx[i].isTx = false; m_lms_stream_rx[i].channel = i; -- To view, visit https://gerrit.osmocom.org/13667 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9ebe986ee3a15842a15853424ee98e9a2fa6a5df Gerrit-Change-Number: 13667 Gerrit-PatchSet: 1 Gerrit-Owner: roh -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 17:33:58 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 16 Apr 2019 17:33:58 +0000 Subject: Change in osmo-mgw[master]: mgcp-client: whitespace cleanup in mgcp_client.c In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13664 ) Change subject: mgcp-client: whitespace cleanup in mgcp_client.c ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13664 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic3495d70cb9c4e12552c6d97481cc0cf04b79f94 Gerrit-Change-Number: 13664 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 16 Apr 2019 17:33:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 17:38:01 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 16 Apr 2019 17:38:01 +0000 Subject: Change in osmo-mgw[master]: mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13665 ) Change subject: mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13665/1/src/libosmo-mgcp-client/mgcp_client.c File src/libosmo-mgcp-client/mgcp_client.c: https://gerrit.osmocom.org/#/c/13665/1/src/libosmo-mgcp-client/mgcp_client.c at 831 PS1, Line 831: char const -- To view, visit https://gerrit.osmocom.org/13665 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I46e05a7a3432733976760bbf1c5deb4f7610db11 Gerrit-Change-Number: 13665 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 16 Apr 2019 17:38:01 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 17:45:40 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 17:45:40 +0000 Subject: Change in osmo-mgw[master]: mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13665 to look at the new patch set (#2). Change subject: mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard ...................................................................... mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard * Get rid of string define containing printf statements * Split name from rest of checks to easily add new names later Change-Id: I46e05a7a3432733976760bbf1c5deb4f7610db11 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 9 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/65/13665/2 -- To view, visit https://gerrit.osmocom.org/13665 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I46e05a7a3432733976760bbf1c5deb4f7610db11 Gerrit-Change-Number: 13665 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 17:48:37 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 17:48:37 +0000 Subject: Change in osmo-trx[master]: lms: Remove wrong unused code copied from -uhd In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13660 ) Change subject: lms: Remove wrong unused code copied from -uhd ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13660 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d Gerrit-Change-Number: 13660 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 17:48:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 17:51:13 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 17:51:13 +0000 Subject: Change in osmo-trx[master]: lms: move LMS_EnableChannel from Start/Stop to Open/Close device In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13661 ) Change subject: lms: move LMS_EnableChannel from Start/Stop to Open/Close device ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13661 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9 Gerrit-Change-Number: 13661 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 16 Apr 2019 17:51:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 17:52:29 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 17:52:29 +0000 Subject: Change in osmo-trx[master]: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13662 ) Change subject: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start ...................................................................... Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/13662/2/Transceiver52M/device/lms/LMSDevice.cpp File Transceiver52M/device/lms/LMSDevice.cpp: https://gerrit.osmocom.org/#/c/13662/2/Transceiver52M/device/lms/LMSDevice.cpp at 373 PS2, Line 373: lpfbw_tx = OSMO_MIN(OSMO_MAX(5.2e6, range_lpfbw_tx.min), range_lpfbw_tx.max); You forgot to apply my last comments regarding this section. Please look at my previous comments and re-submit with changes applied. -- To view, visit https://gerrit.osmocom.org/13662 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37 Gerrit-Change-Number: 13662 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 17:52:29 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 17:56:02 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 17:56:02 +0000 Subject: Change in osmo-trx[master]: lms: add device type detection and device specific gains In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13663 ) Change subject: lms: add device type detection and device specific gains ...................................................................... Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/13663/2/Transceiver52M/device/lms/LMSDevice.cpp File Transceiver52M/device/lms/LMSDevice.cpp: https://gerrit.osmocom.org/#/c/13663/2/Transceiver52M/device/lms/LMSDevice.cpp at 210 PS2, Line 210: } This "}" is wrongly aligned. -- To view, visit https://gerrit.osmocom.org/13663 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181 Gerrit-Change-Number: 13663 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 17:56:02 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 17:57:14 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 17:57:14 +0000 Subject: Change in osmo-trx[master]: lms: add device type detection and device specific gains In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13663 ) Change subject: lms: add device type detection and device specific gains ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13663/2/configure.ac File configure.ac: https://gerrit.osmocom.org/#/c/13663/2/configure.ac at a164 PS2, Line 164: Sorry you need to avoid dropping the AS_IF plus this line (PKG_CHECK_MODULES), otherwise it will fail to build. -- To view, visit https://gerrit.osmocom.org/13663 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181 Gerrit-Change-Number: 13663 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 17:57:14 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 17:57:48 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 17:57:48 +0000 Subject: Change in osmo-trx[master]: lms: properly call close if set_antennas() fails, add some comments In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13667 ) Change subject: lms: properly call close if set_antennas() fails, add some comments ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13667 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9ebe986ee3a15842a15853424ee98e9a2fa6a5df Gerrit-Change-Number: 13667 Gerrit-PatchSet: 1 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 17:57:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 18:44:34 2019 From: gerrit-no-reply at lists.osmocom.org (roh) Date: Tue, 16 Apr 2019 18:44:34 +0000 Subject: Change in osmo-trx[master]: lms: add device type detection and device specific gains 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/13663 to look at the new patch set (#3). Change subject: lms: add device type detection and device specific gains ...................................................................... lms: add device type detection and device specific gains add device dependant max gain setup - limesdr mini and limenet micro need slightly reduced maximum gains to get a PASS on phase error measurements rework clock reference setup - external clock needs to be selected before calling LMS_Init(), internal can only be set after. remove now unused compat_LMS_VCTCXO* functions - we do not set the VCTXCO directly anymore Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181 --- M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/lms/LMSDevice.h M configure.ac 3 files changed, 40 insertions(+), 58 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/13663/3 -- To view, visit https://gerrit.osmocom.org/13663 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181 Gerrit-Change-Number: 13663 Gerrit-PatchSet: 3 Gerrit-Owner: roh Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:04:41 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 19:04:41 +0000 Subject: Change in osmo-ccid-firmware[master]: ncn8025: Invert the software logic of RSTIN Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13668 Change subject: ncn8025: Invert the software logic of RSTIN ...................................................................... ncn8025: Invert the software logic of RSTIN In hardware, the Card RST pin is low-active. There's a level translator in the NCN8025, but there's no logic inversion, so RSTIN is also low-active. In software, we have the policy of all signals being "true-active", i.e. true represents the active state, and false the inactive state. Hence, we must invert the logic of how we handle rstin. Change-Id: Ia45246b7517b2e6ecb01d22b3af52aee7a51de64 --- M sysmoOCTSIM/ncn8025.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/68/13668/1 diff --git a/sysmoOCTSIM/ncn8025.c b/sysmoOCTSIM/ncn8025.c index 61509bc..711b082 100644 --- a/sysmoOCTSIM/ncn8025.c +++ b/sysmoOCTSIM/ncn8025.c @@ -21,7 +21,7 @@ static uint8_t ncn8025_encode(const struct ncn8025_settings *set) { uint8_t reg = 0; - if (set->rstin) + if (!set->rstin) reg |= 0x01; if (!set->cmdvcc) reg |= 0x02; @@ -43,7 +43,7 @@ { memset(set, 0, sizeof(*set)); - if (reg & 0x01) + if (!(reg & 0x01)) set->rstin = true; if (!(reg & 0x02)) set->cmdvcc = true; -- To view, visit https://gerrit.osmocom.org/13668 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia45246b7517b2e6ecb01d22b3af52aee7a51de64 Gerrit-Change-Number: 13668 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:04:41 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 19:04:41 +0000 Subject: Change in osmo-ccid-firmware[master]: manual_test.c: New manual board testing mode Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13669 Change subject: manual_test.c: New manual board testing mode ...................................................................... manual_test.c: New manual board testing mode Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9 --- M sysmoOCTSIM/gcc/Makefile M sysmoOCTSIM/main.c A sysmoOCTSIM/manual_test.c 3 files changed, 259 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/69/13669/1 diff --git a/sysmoOCTSIM/gcc/Makefile b/sysmoOCTSIM/gcc/Makefile index 7496377..376ddaf 100644 --- a/sysmoOCTSIM/gcc/Makefile +++ b/sysmoOCTSIM/gcc/Makefile @@ -77,6 +77,7 @@ gcc/gcc/startup_same54.o \ hal/src/hal_usb_device.o \ main.o \ +manual_test.o \ i2c_bitbang.o \ octsim_i2c.o \ ncn8025.o \ @@ -124,6 +125,7 @@ "gcc/gcc/startup_same54.o" \ "hal/src/hal_usb_device.o" \ "main.o" \ +"manual_test.o" \ "i2c_bitbang.o" \ "octsim_i2c.o" \ "ncn8025.o" \ @@ -177,6 +179,7 @@ "hal/src/hal_usart_async.d" \ "hpl/osc32kctrl/hpl_osc32kctrl.d" \ "main.d" \ +"manual_test.d" \ "i2c_bitbang.d" \ "octsim_i2c.d" \ "ncn8025.d" \ diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index 9dee504..99dd44d 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -211,7 +211,7 @@ - +extern void testmode_init(void); int main(void) { @@ -230,6 +230,7 @@ command_register(&cmd_sim_clkdiv); command_register(&cmd_sim_voltage); command_register(&cmd_sim_led); + testmode_init(); printf("\r\n\r\nsysmocom sysmoOCTSIM\r\n"); while (true) { // main loop diff --git a/sysmoOCTSIM/manual_test.c b/sysmoOCTSIM/manual_test.c new file mode 100644 index 0000000..5354c1b --- /dev/null +++ b/sysmoOCTSIM/manual_test.c @@ -0,0 +1,254 @@ +/* + * Copyright (C) 2019 sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "atmel_start.h" +#include "atmel_start_pins.h" + +#include "i2c_bitbang.h" +#include "octsim_i2c.h" +#include "ncn8025.h" + +#include "command.h" + +enum testmode_test { + TEST_USER_LED, + /* test the per-slot LED by blinking it shortly */ + TEST_LED, + /* test the voltages of the SIMVCC */ + TEST_VOLTAGE, + /* test the clock rates of the SIMCLK pin */ + TEST_CLOCK, + /* test the RST line by asserting it low and then back high */ + TEST_RST, + /* test the RST line by asserting it low and then back high */ + TEST_IO, + _NUM_TESTS +}; +static const char *test_names[_NUM_TESTS] = { + [TEST_USER_LED] = "USER_LED", + [TEST_LED] = "LED", + [TEST_VOLTAGE] = "VOLTAGE", + [TEST_CLOCK] = "CLOCK", + [TEST_RST] = "RST", + [TEST_IO] = "IO", +}; + +struct testmode_state { + uint8_t slot; + enum testmode_test test_nr; + int test_int; + struct ncn8025_settings ncn; +}; +static struct testmode_state g_tms; + +#define BLINK_MS 500 + +static void set_slot(uint8_t slot) +{ + printf("changing slot to %u\r\n", slot); + g_tms.slot = slot; + g_tms.ncn = (struct ncn8025_settings) { + .rstin = false, + .cmdvcc = false, + .led = false, + .clkdiv = SIM_CLKDIV_8, + .vsel = SIM_VOLT_3V0, + }; + ncn8025_set(g_tms.slot, &g_tms.ncn); + ncn8025_get(g_tms.slot, &g_tms.ncn); +} + +static void next_test(void) +{ + g_tms.test_nr = (g_tms.test_nr + 1) % _NUM_TESTS; + g_tms.test_int = 0; + printf("changing test to %s\r\n", test_names[g_tms.test_nr]); +} + +static void test_user_led(void) +{ + printf("blinking User LED\r\n"); + + gpio_set_pin_function(PIN_PC26, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_direction(PIN_PC26, GPIO_DIRECTION_OUT); + gpio_set_pin_level(PIN_PC26, true); + delay_ms(BLINK_MS); + gpio_set_pin_level(PIN_PC26, false); +} + +static void test_led(void) +{ + printf("blinking Slot LED\r\n"); + + g_tms.ncn.led = true; + ncn8025_set(g_tms.slot, &g_tms.ncn); + delay_ms(BLINK_MS); + g_tms.ncn.led = false; + ncn8025_set(g_tms.slot, &g_tms.ncn); +} + +static enum ncn8025_sim_voltage voltage[3] = { SIM_VOLT_1V8, SIM_VOLT_3V0, SIM_VOLT_5V0 }; +static const char *voltage_name[3] = { "1.8", "3.0", "5.0" }; + +static void ncn_change_voltage(enum ncn8025_sim_voltage vsel) +{ + /* first disable the output; VSEL changes require output to be disabled */ + g_tms.ncn.cmdvcc = false; + ncn8025_set(g_tms.slot, &g_tms.ncn); + + /* then re-enable it with the new voltage setting */ + g_tms.ncn.vsel = vsel; + g_tms.ncn.cmdvcc = true; + ncn8025_set(g_tms.slot, &g_tms.ncn); +} + +static void test_voltage(void) +{ + printf("Testing Voltage %s\r\n", voltage_name[g_tms.test_int]); + + ncn_change_voltage(voltage[g_tms.test_int]); + g_tms.test_int = (g_tms.test_int+1) % 3; +} + +static enum ncn8025_sim_clkdiv clk_div[4] = { SIM_CLKDIV_8, SIM_CLKDIV_4, SIM_CLKDIV_2, SIM_CLKDIV_1 }; +static const uint8_t clk_div_val[4] = { 8, 4, 2, 1 }; + +static void test_clock(void) +{ + printf("Testing Clock Divider %u\r\n", clk_div_val[g_tms.test_int]); + g_tms.ncn.cmdvcc = true; + g_tms.ncn.clkdiv = clk_div[g_tms.test_int]; + ncn8025_set(g_tms.slot, &g_tms.ncn); + g_tms.test_int = (g_tms.test_int+1) % 4; +} + +static void test_rst(void) +{ + printf("blinking RST\r\n"); + + /* well-defined voltage for LED brightness */ + ncn_change_voltage(SIM_VOLT_3V0); + + g_tms.ncn.cmdvcc = true; + g_tms.ncn.rstin = true; + ncn8025_set(g_tms.slot, &g_tms.ncn); + + delay_ms(BLINK_MS); + + g_tms.ncn.rstin = false; + ncn8025_set(g_tms.slot, &g_tms.ncn); +} + +#ifndef SIM7_IO +#define SIM7_IO PIN_PB21 +#endif +static const enum gpio_port sim_io_gpio[] = { SIM0_IO, SIM1_IO, SIM2_IO, SIM3_IO, + SIM4_IO, SIM5_IO, SIM6_IO, SIM7_IO }; + +static void test_io(void) +{ + enum gpio_port gpio = sim_io_gpio[g_tms.slot]; + printf("blinking I/O\r\n"); + + /* well-defined voltage for LED brightness */ + ncn_change_voltage(SIM_VOLT_3V0); + + gpio_set_pin_function(gpio, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_direction(gpio, GPIO_DIRECTION_OUT); + gpio_set_pin_level(gpio, false); + delay_ms(BLINK_MS); + gpio_set_pin_level(gpio, true); + + /* FIXME: restore tack to original function! */ + //gpio_set_pin_function(sim_io_gpio[g_tms.slot], GPIO_PIN_FUNCTION_OFF); +} + +typedef void (*test_fn)(void); +static const test_fn test_functions[_NUM_TESTS] = { + [TEST_USER_LED] = test_user_led, + [TEST_LED] = test_led, + [TEST_VOLTAGE] = test_voltage, + [TEST_CLOCK] = test_clock, + [TEST_RST] = test_rst, + [TEST_IO] = test_io, +}; + +static void execute_test(void) +{ + printf("(%u) %-10s: ", g_tms.slot, test_names[g_tms.test_nr]); + test_functions[g_tms.test_nr](); +} + +static int wait_for_key_and_process(void) +{ + int c; + + do { + } while (!usart_sync_is_rx_not_empty(&UART_debug)); + + c = getchar(); + if (c < 0) + return -1; + + switch (c) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + set_slot(c - '0'); + execute_test(); + break; + case 'n': + case 'N': + next_test(); + execute_test(); + break; + case 'Q': + case 'q': + printf("Leaving Test Mode\r\n"); + return -1; + case ' ': + execute_test(); + break; + } + return 0; +} + +DEFUN(testmode_fn, cmd_testmode, + "testmode", "Enter board testing mode (Use `Q` to exit)") +{ + printf("Manual test mode. 'Q': exit, 'N': next test, ' ': re-run, '0'-'7': slot\r\n"); + + while (1) { + if (wait_for_key_and_process() < 0) + break; + } +} + +void testmode_init(void) +{ + command_register(&cmd_testmode); +} -- To view, visit https://gerrit.osmocom.org/13669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9 Gerrit-Change-Number: 13669 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:11:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 19:11:51 +0000 Subject: Change in osmo-ccid-firmware[master]: manual_test.c: New manual board testing mode In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13669 to look at the new patch set (#2). Change subject: manual_test.c: New manual board testing mode ...................................................................... manual_test.c: New manual board testing mode Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9 --- M sysmoOCTSIM/gcc/Makefile M sysmoOCTSIM/main.c A sysmoOCTSIM/manual_test.c 3 files changed, 260 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/69/13669/2 -- To view, visit https://gerrit.osmocom.org/13669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9 Gerrit-Change-Number: 13669 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:11:52 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 19:11:52 +0000 Subject: Change in osmo-ccid-firmware[master]: command.c: Print prompt when starting up Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13670 Change subject: command.c: Print prompt when starting up ...................................................................... command.c: Print prompt when starting up Change-Id: I18e4351609ab10c06a2fa197cb9f7a66269799a0 --- M sysmoOCTSIM/command.c M sysmoOCTSIM/command.h M sysmoOCTSIM/main.c 3 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/70/13670/1 diff --git a/sysmoOCTSIM/command.c b/sysmoOCTSIM/command.c index 9502f05..3210b27 100644 --- a/sysmoOCTSIM/command.c +++ b/sysmoOCTSIM/command.c @@ -71,6 +71,11 @@ g_cmds.buf[g_cmds.buf_idx++] = c; } +void command_print_prompt(void) +{ + printf(g_cmds.prompt); +} + void command_try_recv(void) { unsigned int i = 0; diff --git a/sysmoOCTSIM/command.h b/sysmoOCTSIM/command.h index cdf256d..5d022dc 100644 --- a/sysmoOCTSIM/command.h +++ b/sysmoOCTSIM/command.h @@ -18,3 +18,4 @@ void command_init(const char *prompt); int command_register(const struct command_fn *cmd); void command_try_recv(void); +void command_print_prompt(void); diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index 9dee504..93b90db 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -232,6 +232,8 @@ command_register(&cmd_sim_led); printf("\r\n\r\nsysmocom sysmoOCTSIM\r\n"); + + command_print_prompt(); while (true) { // main loop command_try_recv(); } -- To view, visit https://gerrit.osmocom.org/13670 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I18e4351609ab10c06a2fa197cb9f7a66269799a0 Gerrit-Change-Number: 13670 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:12:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 19:12:45 +0000 Subject: Change in osmo-ccid-firmware[master]: command.c: Print prompt when starting up In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13670 ) Change subject: command.c: Print prompt when starting up ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13670 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I18e4351609ab10c06a2fa197cb9f7a66269799a0 Gerrit-Change-Number: 13670 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Tue, 16 Apr 2019 19:12:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:12:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 19:12:57 +0000 Subject: Change in osmo-ccid-firmware[master]: ncn8025: Invert the software logic of RSTIN In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13668 ) Change subject: ncn8025: Invert the software logic of RSTIN ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13668 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia45246b7517b2e6ecb01d22b3af52aee7a51de64 Gerrit-Change-Number: 13668 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 16 Apr 2019 19:12:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:13:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 19:13:57 +0000 Subject: Change in osmo-ccid-firmware[master]: manual_test.c: New manual board testing mode In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13669 to look at the new patch set (#3). Change subject: manual_test.c: New manual board testing mode ...................................................................... manual_test.c: New manual board testing mode Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9 --- M sysmoOCTSIM/gcc/Makefile M sysmoOCTSIM/main.c A sysmoOCTSIM/manual_test.c 3 files changed, 260 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/69/13669/3 -- To view, visit https://gerrit.osmocom.org/13669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9 Gerrit-Change-Number: 13669 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:14:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 19:14:12 +0000 Subject: Change in osmo-ccid-firmware[master]: manual_test.c: New manual board testing mode In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13669 ) Change subject: manual_test.c: New manual board testing mode ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9 Gerrit-Change-Number: 13669 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 16 Apr 2019 19:14:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:20:37 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 19:20:37 +0000 Subject: Change in osmo-ccid-firmware[master]: command.c: Print prompt when starting up In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13670 ) Change subject: command.c: Print prompt when starting up ...................................................................... command.c: Print prompt when starting up Change-Id: I18e4351609ab10c06a2fa197cb9f7a66269799a0 --- M sysmoOCTSIM/command.c M sysmoOCTSIM/command.h M sysmoOCTSIM/main.c 3 files changed, 8 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sysmoOCTSIM/command.c b/sysmoOCTSIM/command.c index 9502f05..3210b27 100644 --- a/sysmoOCTSIM/command.c +++ b/sysmoOCTSIM/command.c @@ -71,6 +71,11 @@ g_cmds.buf[g_cmds.buf_idx++] = c; } +void command_print_prompt(void) +{ + printf(g_cmds.prompt); +} + void command_try_recv(void) { unsigned int i = 0; diff --git a/sysmoOCTSIM/command.h b/sysmoOCTSIM/command.h index cdf256d..5d022dc 100644 --- a/sysmoOCTSIM/command.h +++ b/sysmoOCTSIM/command.h @@ -18,3 +18,4 @@ void command_init(const char *prompt); int command_register(const struct command_fn *cmd); void command_try_recv(void); +void command_print_prompt(void); diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index 9dee504..93b90db 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -232,6 +232,8 @@ command_register(&cmd_sim_led); printf("\r\n\r\nsysmocom sysmoOCTSIM\r\n"); + + command_print_prompt(); while (true) { // main loop command_try_recv(); } -- To view, visit https://gerrit.osmocom.org/13670 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I18e4351609ab10c06a2fa197cb9f7a66269799a0 Gerrit-Change-Number: 13670 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:20:37 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 19:20:37 +0000 Subject: Change in osmo-ccid-firmware[master]: ncn8025: Invert the software logic of RSTIN In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13668 ) Change subject: ncn8025: Invert the software logic of RSTIN ...................................................................... ncn8025: Invert the software logic of RSTIN In hardware, the Card RST pin is low-active. There's a level translator in the NCN8025, but there's no logic inversion, so RSTIN is also low-active. In software, we have the policy of all signals being "true-active", i.e. true represents the active state, and false the inactive state. Hence, we must invert the logic of how we handle rstin. Change-Id: Ia45246b7517b2e6ecb01d22b3af52aee7a51de64 --- M sysmoOCTSIM/ncn8025.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sysmoOCTSIM/ncn8025.c b/sysmoOCTSIM/ncn8025.c index 61509bc..711b082 100644 --- a/sysmoOCTSIM/ncn8025.c +++ b/sysmoOCTSIM/ncn8025.c @@ -21,7 +21,7 @@ static uint8_t ncn8025_encode(const struct ncn8025_settings *set) { uint8_t reg = 0; - if (set->rstin) + if (!set->rstin) reg |= 0x01; if (!set->cmdvcc) reg |= 0x02; @@ -43,7 +43,7 @@ { memset(set, 0, sizeof(*set)); - if (reg & 0x01) + if (!(reg & 0x01)) set->rstin = true; if (!(reg & 0x02)) set->cmdvcc = true; -- To view, visit https://gerrit.osmocom.org/13668 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia45246b7517b2e6ecb01d22b3af52aee7a51de64 Gerrit-Change-Number: 13668 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:20:38 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Apr 2019 19:20:38 +0000 Subject: Change in osmo-ccid-firmware[master]: manual_test.c: New manual board testing mode In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13669 ) Change subject: manual_test.c: New manual board testing mode ...................................................................... manual_test.c: New manual board testing mode Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9 --- M sysmoOCTSIM/gcc/Makefile M sysmoOCTSIM/main.c A sysmoOCTSIM/manual_test.c 3 files changed, 260 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sysmoOCTSIM/gcc/Makefile b/sysmoOCTSIM/gcc/Makefile index 7496377..376ddaf 100644 --- a/sysmoOCTSIM/gcc/Makefile +++ b/sysmoOCTSIM/gcc/Makefile @@ -77,6 +77,7 @@ gcc/gcc/startup_same54.o \ hal/src/hal_usb_device.o \ main.o \ +manual_test.o \ i2c_bitbang.o \ octsim_i2c.o \ ncn8025.o \ @@ -124,6 +125,7 @@ "gcc/gcc/startup_same54.o" \ "hal/src/hal_usb_device.o" \ "main.o" \ +"manual_test.o" \ "i2c_bitbang.o" \ "octsim_i2c.o" \ "ncn8025.o" \ @@ -177,6 +179,7 @@ "hal/src/hal_usart_async.d" \ "hpl/osc32kctrl/hpl_osc32kctrl.d" \ "main.d" \ +"manual_test.d" \ "i2c_bitbang.d" \ "octsim_i2c.d" \ "ncn8025.d" \ diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index 93b90db..6c4e9e6 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -211,7 +211,7 @@ - +extern void testmode_init(void); int main(void) { @@ -230,6 +230,7 @@ command_register(&cmd_sim_clkdiv); command_register(&cmd_sim_voltage); command_register(&cmd_sim_led); + testmode_init(); printf("\r\n\r\nsysmocom sysmoOCTSIM\r\n"); diff --git a/sysmoOCTSIM/manual_test.c b/sysmoOCTSIM/manual_test.c new file mode 100644 index 0000000..5cc9bca --- /dev/null +++ b/sysmoOCTSIM/manual_test.c @@ -0,0 +1,255 @@ +/* + * Copyright (C) 2019 Harald Welte + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "atmel_start.h" +#include "atmel_start_pins.h" + +#include "i2c_bitbang.h" +#include "octsim_i2c.h" +#include "ncn8025.h" + +#include "command.h" + +enum testmode_test { + TEST_USER_LED, + /* test the per-slot LED by blinking it shortly */ + TEST_LED, + /* test the voltages of the SIMVCC */ + TEST_VOLTAGE, + /* test the clock rates of the SIMCLK pin */ + TEST_CLOCK, + /* test the RST line by asserting it low and then back high */ + TEST_RST, + /* test the RST line by asserting it low and then back high */ + TEST_IO, + _NUM_TESTS +}; +static const char *test_names[_NUM_TESTS] = { + [TEST_USER_LED] = "USER_LED", + [TEST_LED] = "LED", + [TEST_VOLTAGE] = "VOLTAGE", + [TEST_CLOCK] = "CLOCK", + [TEST_RST] = "RST", + [TEST_IO] = "IO", +}; + +struct testmode_state { + uint8_t slot; + enum testmode_test test_nr; + int test_int; + struct ncn8025_settings ncn; +}; +static struct testmode_state g_tms; + +#define BLINK_MS 500 + +static void set_slot(uint8_t slot) +{ + printf("changing slot to %u\r\n", slot); + g_tms.slot = slot; + g_tms.ncn = (struct ncn8025_settings) { + .rstin = false, + .cmdvcc = false, + .led = false, + .clkdiv = SIM_CLKDIV_8, + .vsel = SIM_VOLT_3V0, + }; + ncn8025_set(g_tms.slot, &g_tms.ncn); + ncn8025_get(g_tms.slot, &g_tms.ncn); +} + +static void next_test(void) +{ + g_tms.test_nr = (g_tms.test_nr + 1) % _NUM_TESTS; + g_tms.test_int = 0; + printf("changing test to %s\r\n", test_names[g_tms.test_nr]); +} + +static void test_user_led(void) +{ + printf("blinking User LED\r\n"); + + gpio_set_pin_function(PIN_PC26, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_direction(PIN_PC26, GPIO_DIRECTION_OUT); + gpio_set_pin_level(PIN_PC26, true); + delay_ms(BLINK_MS); + gpio_set_pin_level(PIN_PC26, false); +} + +static void test_led(void) +{ + printf("blinking Slot LED\r\n"); + + g_tms.ncn.led = true; + ncn8025_set(g_tms.slot, &g_tms.ncn); + delay_ms(BLINK_MS); + g_tms.ncn.led = false; + ncn8025_set(g_tms.slot, &g_tms.ncn); +} + +static enum ncn8025_sim_voltage voltage[3] = { SIM_VOLT_1V8, SIM_VOLT_3V0, SIM_VOLT_5V0 }; +static const char *voltage_name[3] = { "1.8", "3.0", "5.0" }; + +static void ncn_change_voltage(enum ncn8025_sim_voltage vsel) +{ + /* first disable the output; VSEL changes require output to be disabled */ + g_tms.ncn.cmdvcc = false; + ncn8025_set(g_tms.slot, &g_tms.ncn); + + /* then re-enable it with the new voltage setting */ + g_tms.ncn.vsel = vsel; + g_tms.ncn.cmdvcc = true; + ncn8025_set(g_tms.slot, &g_tms.ncn); +} + +static void test_voltage(void) +{ + printf("Testing Voltage %s\r\n", voltage_name[g_tms.test_int]); + + ncn_change_voltage(voltage[g_tms.test_int]); + g_tms.test_int = (g_tms.test_int+1) % 3; +} + +static enum ncn8025_sim_clkdiv clk_div[4] = { SIM_CLKDIV_8, SIM_CLKDIV_4, SIM_CLKDIV_2, SIM_CLKDIV_1 }; +static const uint8_t clk_div_val[4] = { 8, 4, 2, 1 }; + +static void test_clock(void) +{ + printf("Testing Clock Divider %u\r\n", clk_div_val[g_tms.test_int]); + g_tms.ncn.cmdvcc = true; + g_tms.ncn.clkdiv = clk_div[g_tms.test_int]; + ncn8025_set(g_tms.slot, &g_tms.ncn); + g_tms.test_int = (g_tms.test_int+1) % 4; +} + +static void test_rst(void) +{ + printf("blinking RST\r\n"); + + /* well-defined voltage for LED brightness */ + ncn_change_voltage(SIM_VOLT_3V0); + + g_tms.ncn.cmdvcc = true; + g_tms.ncn.rstin = true; + ncn8025_set(g_tms.slot, &g_tms.ncn); + + delay_ms(BLINK_MS); + + g_tms.ncn.rstin = false; + ncn8025_set(g_tms.slot, &g_tms.ncn); +} + +#ifndef SIM7_IO +#define SIM7_IO PIN_PB21 +#endif +static const enum gpio_port sim_io_gpio[] = { SIM0_IO, SIM1_IO, SIM2_IO, SIM3_IO, + SIM4_IO, SIM5_IO, SIM6_IO, SIM7_IO }; + +static void test_io(void) +{ + enum gpio_port gpio = sim_io_gpio[g_tms.slot]; + printf("blinking I/O\r\n"); + + /* well-defined voltage for LED brightness */ + ncn_change_voltage(SIM_VOLT_3V0); + + gpio_set_pin_function(gpio, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_direction(gpio, GPIO_DIRECTION_OUT); + gpio_set_pin_level(gpio, false); + delay_ms(BLINK_MS); + gpio_set_pin_level(gpio, true); + + /* FIXME: restore tack to original function! */ + //gpio_set_pin_function(sim_io_gpio[g_tms.slot], GPIO_PIN_FUNCTION_OFF); +} + +typedef void (*test_fn)(void); +static const test_fn test_functions[_NUM_TESTS] = { + [TEST_USER_LED] = test_user_led, + [TEST_LED] = test_led, + [TEST_VOLTAGE] = test_voltage, + [TEST_CLOCK] = test_clock, + [TEST_RST] = test_rst, + [TEST_IO] = test_io, +}; + +static void execute_test(void) +{ + printf("(%u) %-10s: ", g_tms.slot, test_names[g_tms.test_nr]); + test_functions[g_tms.test_nr](); +} + +static int wait_for_key_and_process(void) +{ + int c; + + do { + } while (!usart_sync_is_rx_not_empty(&UART_debug)); + + c = getchar(); + if (c < 0) + return -1; + + switch (c) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + set_slot(c - '0'); + execute_test(); + break; + case 'n': + case 'N': + next_test(); + execute_test(); + break; + case 'Q': + case 'q': + printf("Leaving Test Mode\r\n"); + return -1; + case ' ': + execute_test(); + break; + } + return 0; +} + +DEFUN(testmode_fn, cmd_testmode, + "testmode", "Enter board testing mode (Use `Q` to exit)") +{ + printf("Manual test mode. 'Q': exit, 'N': next test, SPACE: re-run, '0'-'7': slot\r\n"); + + printf("SPACE will start the current test (%s)\r\n", test_names[g_tms.test_nr]); + while (1) { + if (wait_for_key_and_process() < 0) + break; + } +} + +void testmode_init(void) +{ + command_register(&cmd_testmode); +} -- To view, visit https://gerrit.osmocom.org/13669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8fc94fa08521224eff79d0aa9d7b42ceeaa760c9 Gerrit-Change-Number: 13669 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:23:08 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 19:23:08 +0000 Subject: Change in osmo-trx[master]: lms: add device type detection and device specific gains In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13663 ) Change subject: lms: add device type detection and device specific gains ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13663 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181 Gerrit-Change-Number: 13663 Gerrit-PatchSet: 3 Gerrit-Owner: roh Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 19:23:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:23:29 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 19:23:29 +0000 Subject: Change in osmo-trx[master]: lms: properly call close if set_antennas() fails, add some comments In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13667 ) Change subject: lms: properly call close if set_antennas() fails, add some comments ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13667 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9ebe986ee3a15842a15853424ee98e9a2fa6a5df Gerrit-Change-Number: 13667 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 19:23:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:24:17 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Apr 2019 19:24:17 +0000 Subject: Change in osmo-trx[master]: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13662 ) Change subject: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13662 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37 Gerrit-Change-Number: 13662 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 16 Apr 2019 19:24:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:34:51 2019 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Tue, 16 Apr 2019 19:34:51 +0000 Subject: Change in gr-gsm[master]: Improve the TCH/H decoder logs Message-ID: Hello Piotr Krysik, Vadim Yanitskiy, I'd like you to do a code review. Please visit https://gerrit.osmocom.org/13671 to review the following change. Change subject: Improve the TCH/H decoder logs ...................................................................... Improve the TCH/H decoder logs - Change "6,90 kbit/s" to "5.9 kbit/s" A typo reported in github ptrkrysik/gr-gsm#456 - Comment out the "Error! frame_nr:" message as it turns out to confuse users more then it actually helps debugging. - When voice-boundary detection is enabled write the name of decoded control channel messages Change-Id: I697ef944f30c4cabb62c888317dd3a7f8dcd5611 --- M lib/decoding/tch_h_decoder_impl.cc 1 file changed, 10 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/71/13671/1 diff --git a/lib/decoding/tch_h_decoder_impl.cc b/lib/decoding/tch_h_decoder_impl.cc index 11da907..96d6714 100644 --- a/lib/decoding/tch_h_decoder_impl.cc +++ b/lib/decoding/tch_h_decoder_impl.cc @@ -178,7 +178,7 @@ std::cout<<"5,15 kbit/s codec rate: is part of the subset"< Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:34:51 2019 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Tue, 16 Apr 2019 19:34:51 +0000 Subject: Change in gr-gsm[master]: grgsm_capture: Fix device arguments Message-ID: Hello Piotr Krysik, Vadim Yanitskiy, I'd like you to do a code review. Please visit https://gerrit.osmocom.org/13672 to review the following change. Change subject: grgsm_capture: Fix device arguments ...................................................................... grgsm_capture: Fix device arguments We need a space between numchan=1 and the rest of the device arguments otherwise when --args is specified it fails with RuntimeError: bad lexical cast $ grgsm_capture --args=soapy Traceback (most recent call last): File "/usr/local/bin/grgsm_capture", line 179, in device_args=options.device_args) File "/usr/local/bin/grgsm_capture", line 57, in __init__ osmosdr.source(args="numchan=1" + device_args ) File "/usr/local/lib64/python2.7/site-packages/osmosdr/osmosdr_swig.py", line 1170, in make return _osmosdr_swig.source_make(*args, **kwargs) RuntimeError: bad lexical cast: source type value could not be interpreted as target Change-Id: I2d1bcee835b695c91a5c44ec78a40b2d969f611c --- M apps/helpers/grgsm_capture 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/72/13672/1 diff --git a/apps/helpers/grgsm_capture b/apps/helpers/grgsm_capture index f698205..081544a 100755 --- a/apps/helpers/grgsm_capture +++ b/apps/helpers/grgsm_capture @@ -54,7 +54,8 @@ ################################################## self.sdr_source = \ - osmosdr.source(args="numchan=1" + device_args ) + osmosdr.source(args="numchan=" + str(1) + " " + device_args) + self.sdr_source.set_sample_rate(samp_rate) self.sdr_source.set_center_freq(freq, 0) self.sdr_source.set_freq_corr(freq_corr, 0) -- To view, visit https://gerrit.osmocom.org/13672 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2d1bcee835b695c91a5c44ec78a40b2d969f611c Gerrit-Change-Number: 13672 Gerrit-PatchSet: 1 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:41:08 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 16 Apr 2019 19:41:08 +0000 Subject: Change in gr-gsm[master]: Improve the TCH/H decoder logs In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13671 ) Change subject: Improve the TCH/H decoder logs ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I697ef944f30c4cabb62c888317dd3a7f8dcd5611 Gerrit-Change-Number: 13671 Gerrit-PatchSet: 1 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 16 Apr 2019 19:41:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:42:03 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 16 Apr 2019 19:42:03 +0000 Subject: Change in gr-gsm[master]: Improve the TCH/H decoder logs In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13671 ) Change subject: Improve the TCH/H decoder logs ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13671/1/lib/decoding/tch_h_decoder_impl.cc File lib/decoding/tch_h_decoder_impl.cc: https://gerrit.osmocom.org/#/c/13671/1/lib/decoding/tch_h_decoder_impl.cc at 269 PS1, Line 269: //if (!d_boundary_check || d_boundary_decode) { I would rather use: #if 0 ... #endif -- To view, visit https://gerrit.osmocom.org/13671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I697ef944f30c4cabb62c888317dd3a7f8dcd5611 Gerrit-Change-Number: 13671 Gerrit-PatchSet: 1 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 16 Apr 2019 19:42:03 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 19:42:37 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 16 Apr 2019 19:42:37 +0000 Subject: Change in gr-gsm[master]: grgsm_capture: Fix device arguments In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13672 ) Change subject: grgsm_capture: Fix device arguments ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13672 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2d1bcee835b695c91a5c44ec78a40b2d969f611c Gerrit-Change-Number: 13672 Gerrit-PatchSet: 1 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 16 Apr 2019 19:42:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Tue Apr 16 20:24:07 2019 From: admin at opensuse.org (OBS Notification) Date: Tue, 16 Apr 2019 20:24:07 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-netif in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5cb639e9dfa9a_436baa05f02382f3@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/Debian_9.0/armv7l Package network:osmocom:nightly/libosmo-netif failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly libosmo-netif Last lines of build log: [ 198s] +non-reconnecting test step 0 [client OK, server OK], FD reg 1 [ 198s] --- expout 2019-04-16 20:23:43.665000000 +0000 [ 198s] +++ /usr/src/packages/BUILD/tests/testsuite.dir/at-groups/1/stdout 2019-04-16 20:23:52.720000000 +0000 [ 198s] @@ -44,8 +44,6 @@ [ 198s] [OK|OK] Server's read_cb_srv(): received 29(29) bytes: 44 6f 68 2c 20 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 73 65 72 76 65 72 20 3a 2d 44 [ 198s] [OK|OK] Server's read_cb_srv(): sent 11 bytes message: 72 65 61 64 5f 63 62 5f 73 72 76 [ 198s] [OK|OK] Server's read_cb_srv(): force client disconnect on subsequent call [ 198s] -[OK] Client's read_cb_cli(): callback triggered [ 198s] -[OK] Client's read_cb_cli(): 0-byte read, auto-reconnect will be triggered if enabled [ 198s] non-reconnecting test complete. [ 198s] [ 198s] Stream tests completed [ 198s] 1. testsuite.at:4: 1. stream_test (testsuite.at:4): FAILED (testsuite.at:8) [ 198s] debian/rules:27: recipe for target 'override_dh_auto_test' failed [ 198s] make[1]: *** [override_dh_auto_test] Error 1 [ 198s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 198s] debian/rules:13: recipe for target 'build' failed [ 198s] make: *** [build] Error 2 [ 198s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 198s] [ 198s] armbuild24 failed "build libosmo-netif_0.4.0.25.e380.dsc" at Tue Apr 16 20:23:54 UTC 2019. [ 198s] [ 198s] ### VM INTERACTION START ### [ 200s] [ 182.789567] sysrq: SysRq : Power Off [ 200s] [ 182.807593] reboot: Power down [ 201s] ### VM INTERACTION END ### [ 201s] [ 201s] armbuild24 failed "build libosmo-netif_0.4.0.25.e380.dsc" at Tue Apr 16 20:23:58 UTC 2019. [ 201s] -- 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 Apr 16 21:32:40 2019 From: gerrit-no-reply at lists.osmocom.org (roh) Date: Tue, 16 Apr 2019 21:32:40 +0000 Subject: Change in osmo-trx[master]: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start In-Reply-To: References: Message-ID: roh has posted comments on this change. ( https://gerrit.osmocom.org/13662 ) Change subject: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13662/2/Transceiver52M/device/lms/LMSDevice.cpp File Transceiver52M/device/lms/LMSDevice.cpp: https://gerrit.osmocom.org/#/c/13662/2/Transceiver52M/device/lms/LMSDevice.cpp at 373 PS2, Line 373: lpfbw_tx = OSMO_MIN(OSMO_MAX(5.2e6, range_lpfbw_tx.min), range_lpfbw_tx.max); > You forgot to apply my last comments regarding this section. [?] i actually would like to keep it this way. otherwise i'll need to have the whole bw calculation inside whatever calls do_filters. also do_filters is not simpler if it would have 2 more parameters (dir_tx and lpfwbw) -- To view, visit https://gerrit.osmocom.org/13662 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37 Gerrit-Change-Number: 13662 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: roh Gerrit-Comment-Date: Tue, 16 Apr 2019 21:32:40 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 23:29:20 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 16 Apr 2019 23:29:20 +0000 Subject: Change in osmo-ccid-firmware[master]: switch UART_debug to ASYNC Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13673 Change subject: switch UART_debug to ASYNC ...................................................................... switch UART_debug to ASYNC using the synchronous HAL library causes RX overflow after 5 bytes on bulk incoming data (e.g. pasted). this mainly due to printing synchronously the character, but to further prevent congestion we switch to asynchronous (e.g. interrupt driven) communication. The RX part works great now (no overflow), but the TX part is malfunctioning because the HAL Async library does not buffer the data to be transmitted and expects it to be in memory until the transmission is complete (which printf does not do). This change will not be reflected in Atmel START since it does not allow to set the underlying STDIO redirect peripheral to async. Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7 --- M sysmoOCTSIM/command.c M sysmoOCTSIM/driver_init.c M sysmoOCTSIM/driver_init.h M sysmoOCTSIM/examples/driver_examples.c M sysmoOCTSIM/hpl/sercom/hpl_sercom.c M sysmoOCTSIM/main.c M sysmoOCTSIM/stdio_start.c 7 files changed, 94 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/73/13673/1 diff --git a/sysmoOCTSIM/command.c b/sysmoOCTSIM/command.c index 9502f05..7ac5662 100644 --- a/sysmoOCTSIM/command.c +++ b/sysmoOCTSIM/command.c @@ -76,7 +76,8 @@ unsigned int i = 0; /* yield CPU after maximum of 10 received characters */ - while (usart_sync_is_rx_not_empty(&UART_debug) && (i < 10)) { + while (usart_async_is_rx_not_empty(&UART_debug) && (i < 10)) { + gpio_toggle_pin_level(USER_LED); // toggle LED to show we received something int c = getchar(); if (c < 0) return; diff --git a/sysmoOCTSIM/driver_init.c b/sysmoOCTSIM/driver_init.c index 06184ee..0d5bb53 100644 --- a/sysmoOCTSIM/driver_init.c +++ b/sysmoOCTSIM/driver_init.c @@ -32,6 +32,9 @@ /*! The buffer size for USART */ #define SIM6_BUFFER_SIZE 16 +/*! The buffer size for USART */ +#define UART_DEBUG_BUFFER_SIZE 32 + struct usart_async_descriptor SIM0; struct usart_async_descriptor SIM1; struct usart_async_descriptor SIM2; @@ -48,7 +51,9 @@ static uint8_t SIM5_buffer[SIM5_BUFFER_SIZE]; static uint8_t SIM6_buffer[SIM6_BUFFER_SIZE]; -struct usart_sync_descriptor UART_debug; +struct usart_async_descriptor UART_debug; + +static uint8_t UART_DEBUG_buffer[UART_DEBUG_BUFFER_SIZE]; /** * \brief USART Clock initialization function @@ -309,7 +314,26 @@ SIM6_PORT_init(); } -void UART_debug_PORT_init(void) +/** + * \brief USART Clock initialization function + * + * Enables register interface and peripheral clock + */ +void UART_debug_CLOCK_init() +{ + + hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM7_GCLK_ID_CORE, CONF_GCLK_SERCOM7_CORE_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); + hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM7_GCLK_ID_SLOW, CONF_GCLK_SERCOM7_SLOW_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); + + hri_mclk_set_APBDMASK_SERCOM7_bit(MCLK); +} + +/** + * \brief USART pinmux initialization function + * + * Set each required pin to USART functionality + */ +void UART_debug_PORT_init() { gpio_set_pin_function(UART_TX, PINMUX_PB30C_SERCOM7_PAD0); @@ -317,18 +341,15 @@ gpio_set_pin_function(UART_RX, PINMUX_PB31C_SERCOM7_PAD1); } -void UART_debug_CLOCK_init(void) -{ - hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM7_GCLK_ID_CORE, CONF_GCLK_SERCOM7_CORE_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); - hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM7_GCLK_ID_SLOW, CONF_GCLK_SERCOM7_SLOW_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); - - hri_mclk_set_APBDMASK_SERCOM7_bit(MCLK); -} - +/** + * \brief USART initialization function + * + * Enables USART peripheral, clocks and initializes USART driver + */ void UART_debug_init(void) { UART_debug_CLOCK_init(); - usart_sync_init(&UART_debug, SERCOM7, (void *)NULL); + usart_async_init(&UART_debug, SERCOM7, UART_DEBUG_buffer, UART_DEBUG_BUFFER_SIZE, (void *)NULL); UART_debug_PORT_init(); } diff --git a/sysmoOCTSIM/driver_init.h b/sysmoOCTSIM/driver_init.h index d809db8..9d009b9 100644 --- a/sysmoOCTSIM/driver_init.h +++ b/sysmoOCTSIM/driver_init.h @@ -40,8 +40,7 @@ extern struct usart_async_descriptor SIM4; extern struct usart_async_descriptor SIM5; extern struct usart_async_descriptor SIM6; - -extern struct usart_sync_descriptor UART_debug; +extern struct usart_async_descriptor UART_debug; void SIM0_PORT_init(void); void SIM0_CLOCK_init(void); diff --git a/sysmoOCTSIM/examples/driver_examples.c b/sysmoOCTSIM/examples/driver_examples.c index 4ab0ef4..14f1ae5 100644 --- a/sysmoOCTSIM/examples/driver_examples.c +++ b/sysmoOCTSIM/examples/driver_examples.c @@ -215,12 +215,29 @@ /** * Example of using UART_debug to write "Hello World" using the IO abstraction. + * + * Since the driver is asynchronous we need to use statically allocated memory for string + * because driver initiates transfer and then returns before the transmission is completed. + * + * Once transfer has been completed the tx_cb function will be called. */ + +static uint8_t example_UART_debug[12] = "Hello World!"; + +static void tx_cb_UART_debug(const struct usart_async_descriptor *const io_descr) +{ + /* Transfer completed */ +} + void UART_debug_example(void) { struct io_descriptor *io; - usart_sync_get_io_descriptor(&UART_debug, &io); - usart_sync_enable(&UART_debug); - io_write(io, (uint8_t *)"Hello World!", 12); + usart_async_register_callback(&UART_debug, USART_ASYNC_TXC_CB, tx_cb_UART_debug); + /*usart_async_register_callback(&UART_debug, USART_ASYNC_RXC_CB, rx_cb); + usart_async_register_callback(&UART_debug, USART_ASYNC_ERROR_CB, err_cb);*/ + usart_async_get_io_descriptor(&UART_debug, &io); + usart_async_enable(&UART_debug); + + io_write(io, example_UART_debug, 12); } diff --git a/sysmoOCTSIM/hpl/sercom/hpl_sercom.c b/sysmoOCTSIM/hpl/sercom/hpl_sercom.c index b14e720..f235115 100644 --- a/sysmoOCTSIM/hpl/sercom/hpl_sercom.c +++ b/sysmoOCTSIM/hpl/sercom/hpl_sercom.c @@ -177,6 +177,8 @@ static struct _usart_async_device *_sercom6_dev = NULL; +static struct _usart_async_device *_sercom7_dev = NULL; + static uint8_t _get_sercom_index(const void *const hw); static uint8_t _sercom_get_irq_num(const void *const hw); static void _sercom_init_irq_param(const void *const hw, void *dev); @@ -665,6 +667,10 @@ if (hw == SERCOM6) { _sercom6_dev = (struct _usart_async_device *)dev; } + + if (hw == SERCOM7) { + _sercom7_dev = (struct _usart_async_device *)dev; + } } /** @@ -2628,6 +2634,35 @@ _sercom_usart_interrupt_handler(_sercom6_dev); } +/** + * \internal Sercom interrupt handler + */ +void SERCOM7_0_Handler(void) +{ + _sercom_usart_interrupt_handler(_sercom7_dev); +} +/** + * \internal Sercom interrupt handler + */ +void SERCOM7_1_Handler(void) +{ + _sercom_usart_interrupt_handler(_sercom7_dev); +} +/** + * \internal Sercom interrupt handler + */ +void SERCOM7_2_Handler(void) +{ + _sercom_usart_interrupt_handler(_sercom7_dev); +} +/** + * \internal Sercom interrupt handler + */ +void SERCOM7_3_Handler(void) +{ + _sercom_usart_interrupt_handler(_sercom7_dev); +} + int32_t _spi_m_sync_init(struct _spi_m_sync_dev *dev, void *const hw) { const struct sercomspi_regs_cfg *regs = _spi_get_regs((uint32_t)hw); diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index dc67406..afd7bf2 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -210,19 +210,14 @@ ncn8025_set(slotnr, &settings); } - - - - int main(void) { atmel_start_init(); - usart_sync_enable(&UART_debug); - usb_start(); board_init(); + command_init("sysmoOCTSIM> "); command_register(&cmd_hello); command_register(&cmd_sim_status); diff --git a/sysmoOCTSIM/stdio_start.c b/sysmoOCTSIM/stdio_start.c index 7450a08..e2fb0c2 100644 --- a/sysmoOCTSIM/stdio_start.c +++ b/sysmoOCTSIM/stdio_start.c @@ -9,15 +9,13 @@ #include "atmel_start.h" #include "stdio_start.h" -void STDIO_REDIRECT_0_example(void) +static void UART_debug_rx_cb(const struct usart_async_descriptor *const io_descr) { - /* Print welcome message */ - printf("\r\nHello ATMEL World!\r\n"); } void stdio_redirect_init(void) { - - usart_sync_enable(&UART_debug); + usart_async_register_callback(&UART_debug, USART_ASYNC_RXC_CB, UART_debug_rx_cb); // if no callback function is registered receive won't work, even if the callback does nothing + usart_async_enable(&UART_debug); stdio_io_init(&UART_debug.io); } -- To view, visit https://gerrit.osmocom.org/13673 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7 Gerrit-Change-Number: 13673 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 23:29:21 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 16 Apr 2019 23:29:21 +0000 Subject: Change in osmo-ccid-firmware[master]: remove SWO pin initialisation Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13674 Change subject: remove SWO pin initialisation ...................................................................... remove SWO pin initialisation Change-Id: I199d6e356129526e65d5d1075a264eb35904d099 --- M sysmoOCTSIM/driver_init.c 1 file changed, 0 insertions(+), 47 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/74/13674/1 diff --git a/sysmoOCTSIM/driver_init.c b/sysmoOCTSIM/driver_init.c index 0d5bb53..8a50925 100644 --- a/sysmoOCTSIM/driver_init.c +++ b/sysmoOCTSIM/driver_init.c @@ -723,53 +723,6 @@ gpio_set_pin_function(SDA1, GPIO_PIN_FUNCTION_OFF); - // GPIO on PB30 - - gpio_set_pin_direction(UART_TX, - // Pin direction - // pad_direction - // Off - // In - // Out - GPIO_DIRECTION_OUT); - - gpio_set_pin_level(UART_TX, - // Initial level - // pad_initial_level - // Low - // High - false); - - gpio_set_pin_pull_mode(UART_TX, - // Pull configuration - // pad_pull_config - // Off - // Pull-up - // Pull-down - GPIO_PULL_OFF); - - gpio_set_pin_function(UART_TX, - // Pin function - // pad_function - // Auto : use driver pinmux if signal is imported by driver, else turn off function - // Auto - // Off - // A - // B - // C - // D - // E - // F - // G - // H - // I - // J - // K - // L - // M - // N - GPIO_PIN_FUNCTION_H); - // GPIO on PC00 // Set pin direction to input -- To view, visit https://gerrit.osmocom.org/13674 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I199d6e356129526e65d5d1075a264eb35904d099 Gerrit-Change-Number: 13674 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 23:29:21 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 16 Apr 2019 23:29:21 +0000 Subject: Change in osmo-ccid-firmware[master]: add ASFv4 M2M middleware Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13675 Change subject: add ASFv4 M2M middleware ...................................................................... add ASFv4 M2M middleware Change-Id: Ib07755b2c5974af70817f5460fb0f358c631452a --- M sysmoOCTSIM/AtmelStart.gpdsc M sysmoOCTSIM/atmel_start.c M sysmoOCTSIM/atmel_start.h M sysmoOCTSIM/atmel_start_config.atstart M sysmoOCTSIM/config/hpl_dmac_config.h A sysmoOCTSIM/dma_m2m/dma_memory.c A sysmoOCTSIM/dma_m2m/dma_memory.h A sysmoOCTSIM/dma_m2m/dma_memory_config.h A sysmoOCTSIM/documentation/dma_m2m.rst M sysmoOCTSIM/gcc/Makefile 10 files changed, 359 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/75/13675/1 diff --git a/sysmoOCTSIM/AtmelStart.gpdsc b/sysmoOCTSIM/AtmelStart.gpdsc index 5d35944..05dcb15 100644 --- a/sysmoOCTSIM/AtmelStart.gpdsc +++ b/sysmoOCTSIM/AtmelStart.gpdsc @@ -164,6 +164,9 @@ + + + @@ -210,6 +213,8 @@ + + @@ -225,6 +230,7 @@ + @@ -251,6 +257,8 @@ + + diff --git a/sysmoOCTSIM/atmel_start.c b/sysmoOCTSIM/atmel_start.c index fc6016a..fd566dd 100644 --- a/sysmoOCTSIM/atmel_start.c +++ b/sysmoOCTSIM/atmel_start.c @@ -1,5 +1,11 @@ #include +/** Memory to memory DMA callback */ +static void M2M_DMA_complete_cb(void) +{ + dma_m2m_complete_flag = true; +} + /** * Initializes MCU, drivers and middleware in the project **/ @@ -7,5 +13,7 @@ { system_init(); usb_init(); + dma_memory_init(); + dma_memory_register_callback(DMA_MEMORY_COMPLETE_CB, M2M_DMA_complete_cb); stdio_redirect_init(); } diff --git a/sysmoOCTSIM/atmel_start.h b/sysmoOCTSIM/atmel_start.h index 92afa47..4892cbd 100644 --- a/sysmoOCTSIM/atmel_start.h +++ b/sysmoOCTSIM/atmel_start.h @@ -5,10 +5,15 @@ extern "C" { #endif +#include + #include "driver_init.h" #include "usb_start.h" #include "stdio_start.h" +/** flag set when the memory to memory DMA is complete */ +volatile bool dma_m2m_complete_flag; + /** * Initializes MCU, drivers and middleware in the project **/ diff --git a/sysmoOCTSIM/atmel_start_config.atstart b/sysmoOCTSIM/atmel_start_config.atstart index 290fa89..51ec4f4 100644 --- a/sysmoOCTSIM/atmel_start_config.atstart +++ b/sysmoOCTSIM/atmel_start_config.atstart @@ -82,6 +82,15 @@ dependencies: USB Device Stack Core Instance: USB_DEVICE_STACK_CORE_INSTANCE USB Class CDC: USB_CLASS_CDC + M2M_DMA_0: + user_label: M2M_DMA_0 + configuration: + conf_channel: 0 + definition: Atmel:MEMORY_DMA:0.0.1::M2M_DMA + functionality: M2M_DMA + api: DMA:M2M:Core + dependencies: + DMAC: DMAC STDIO_REDIRECT_0: user_label: STDIO_REDIRECT_0 configuration: {} @@ -209,7 +218,7 @@ the transaction dmac_blockact_9: Channel will be disabled if it is the last block transfer in the transaction - dmac_channel_0_settings: false + dmac_channel_0_settings: true dmac_channel_10_settings: false dmac_channel_11_settings: false dmac_channel_12_settings: false @@ -242,7 +251,7 @@ dmac_channel_8_settings: false dmac_channel_9_settings: false dmac_dbgrun: false - dmac_dstinc_0: false + dmac_dstinc_0: true dmac_dstinc_1: false dmac_dstinc_10: false dmac_dstinc_11: false @@ -274,7 +283,7 @@ dmac_dstinc_7: false dmac_dstinc_8: false dmac_dstinc_9: false - dmac_enable: false + dmac_enable: true dmac_evact_0: No action dmac_evact_1: No action dmac_evact_10: No action @@ -479,7 +488,7 @@ dmac_runstdby_7: false dmac_runstdby_8: false dmac_runstdby_9: false - dmac_srcinc_0: false + dmac_srcinc_0: true dmac_srcinc_1: false dmac_srcinc_10: false dmac_srcinc_11: false diff --git a/sysmoOCTSIM/config/hpl_dmac_config.h b/sysmoOCTSIM/config/hpl_dmac_config.h index 90499fc..c736778 100644 --- a/sysmoOCTSIM/config/hpl_dmac_config.h +++ b/sysmoOCTSIM/config/hpl_dmac_config.h @@ -8,7 +8,7 @@ // Indicates whether dmac is enabled or not // dmac_enable #ifndef CONF_DMAC_ENABLE -#define CONF_DMAC_ENABLE 0 +#define CONF_DMAC_ENABLE 1 #endif // Priority Level 0 @@ -105,7 +105,7 @@ // Channel 0 settings // dmac_channel_0_settings #ifndef CONF_DMAC_CHANNEL_0_SETTINGS -#define CONF_DMAC_CHANNEL_0_SETTINGS 0 +#define CONF_DMAC_CHANNEL_0_SETTINGS 1 #endif // Channel Run in Standby @@ -284,14 +284,14 @@ // Indicates whether the source address incrementation is enabled or not // dmac_srcinc_0 #ifndef CONF_DMAC_SRCINC_0 -#define CONF_DMAC_SRCINC_0 0 +#define CONF_DMAC_SRCINC_0 1 #endif // Destination Address Increment // Indicates whether the destination address incrementation is enabled or not // dmac_dstinc_0 #ifndef CONF_DMAC_DSTINC_0 -#define CONF_DMAC_DSTINC_0 0 +#define CONF_DMAC_DSTINC_0 1 #endif // Beat Size diff --git a/sysmoOCTSIM/dma_m2m/dma_memory.c b/sysmoOCTSIM/dma_m2m/dma_memory.c new file mode 100644 index 0000000..f395114 --- /dev/null +++ b/sysmoOCTSIM/dma_m2m/dma_memory.c @@ -0,0 +1,143 @@ +/** + * \file + * + * \brief Memory with DMA functionality implementation. + * + * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries. + * + * \asf_license_start + * + * \page License + * + * Subject to your compliance with these terms, you may use Microchip + * software and any derivatives exclusively with Microchip products. + * It is your responsibility to comply with third party license terms applicable + * to your use of third party software (including open source software) that + * may accompany Microchip software. + * + * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, + * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, + * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE + * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL + * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE + * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE + * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT + * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY + * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, + * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. + * + * \asf_license_stop + * + */ + +#include "dma_memory.h" +#include "dma_memory_config.h" +#include +#include +#include + +/** + * \brief Driver version + */ +#define DRIVER_VERSION 0x00000001u + +/** + * \brief memory with dma descriptor instance + */ +static struct dma_memory_descriptor descr; + +/** + * \internal Process transfer done interrupts + * + * \param[in] resource The pointer to memory resource + */ +static void dma_transfer_done(struct _dma_resource *resource) +{ + (void)resource; + if (descr.memory_cb.complete) { + descr.memory_cb.complete(); + } +} + +/** + * \internal Process transfer error interrupts + * + * \param[in] resource The pointer to memory resource + */ +static void dma_memory_error(struct _dma_resource *resource) +{ + (void)resource; + if (descr.memory_cb.error) { + descr.memory_cb.error(); + } +} + +/** + * \brief Initialize DMA + */ +int32_t dma_memory_init(void) +{ + _dma_get_channel_resource(&descr.resource, CONF_DMA_MEMORY_CHANNEL); + descr.resource->dma_cb.transfer_done = dma_transfer_done; + descr.resource->dma_cb.error = dma_memory_error; + + return ERR_NONE; +} + +/** + * \brief Register DMA callback + */ +int32_t dma_memory_register_callback(const enum dma_memory_callback_type type, dma_memory_cb_t cb) +{ + switch (type) { + case DMA_MEMORY_COMPLETE_CB: + descr.memory_cb.complete = cb; + break; + + case DMA_MEMORY_ERROR_CB: + descr.memory_cb.error = cb; + break; + + default: + return ERR_INVALID_ARG; + } + + _dma_set_irq_state(CONF_DMA_MEMORY_CHANNEL, (enum _dma_callback_type)type, (cb != NULL)); + + return ERR_NONE; +} + +/** + * \brief Memory copy with dma + */ +int32_t dma_memcpy(void *dst, void *src, uint32_t size) +{ + _dma_srcinc_enable(CONF_DMA_MEMORY_CHANNEL, true); + _dma_dstinc_enable(CONF_DMA_MEMORY_CHANNEL, true); + _dma_set_destination_address(CONF_DMA_MEMORY_CHANNEL, dst); + _dma_set_source_address(CONF_DMA_MEMORY_CHANNEL, src); + _dma_set_data_amount(CONF_DMA_MEMORY_CHANNEL, size); + _dma_enable_transaction(CONF_DMA_MEMORY_CHANNEL, true); + + return ERR_NONE; +} + +/** + * \brief Memory set with dma + */ +int32_t dma_memset(void *dst, int32_t ch, uint32_t size) +{ + static int32_t tmp_ch; + + tmp_ch = ch; + + _dma_set_source_address(CONF_DMA_MEMORY_CHANNEL, &tmp_ch); + _dma_srcinc_enable(CONF_DMA_MEMORY_CHANNEL, false); + _dma_dstinc_enable(CONF_DMA_MEMORY_CHANNEL, true); + _dma_set_destination_address(CONF_DMA_MEMORY_CHANNEL, dst); + _dma_set_data_amount(CONF_DMA_MEMORY_CHANNEL, size); + _dma_enable_transaction(CONF_DMA_MEMORY_CHANNEL, true); + + return ERR_NONE; +} diff --git a/sysmoOCTSIM/dma_m2m/dma_memory.h b/sysmoOCTSIM/dma_m2m/dma_memory.h new file mode 100644 index 0000000..3bd6dc9 --- /dev/null +++ b/sysmoOCTSIM/dma_m2m/dma_memory.h @@ -0,0 +1,132 @@ +/** + * \file + * + * \brief Memory with DMA functionality declaration. + * + * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries. + * + * \asf_license_start + * + * \page License + * + * Subject to your compliance with these terms, you may use Microchip + * software and any derivatives exclusively with Microchip products. + * It is your responsibility to comply with third party license terms applicable + * to your use of third party software (including open source software) that + * may accompany Microchip software. + * + * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, + * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, + * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE + * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL + * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE + * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE + * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT + * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY + * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, + * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. + * + * \asf_license_stop + * + */ + +#ifndef DMA_MEMORY_H_INCLUDED +#define DMA_MEMORY_H_INCLUDED + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \addtogroup dma_memory + * + * \section dma_rev Revision History + * - v0.0.0.1 Initial Commit + * + *@{ + */ + +/** + * \brief Memory with DMA descriptor + * + * The Memory with DMA descriptor forward declaration. + */ +struct dma_memory_descriptor; + +/** + * \brief memory with dma callback type + */ +typedef void (*dma_memory_cb_t)(void); + +/** + * \brief Memory with DMA callback types + */ +enum dma_memory_callback_type { DMA_MEMORY_COMPLETE_CB, DMA_MEMORY_ERROR_CB }; + +/** + * \brief Memory with DMA callbacks + */ +struct dma_memory_callbacks { + dma_memory_cb_t complete; + dma_memory_cb_t error; +}; + +/** + * \brief Memory with DMA descriptor + */ +struct dma_memory_descriptor { + struct _dma_resource * resource; + struct dma_memory_callbacks memory_cb; +}; + +/** + * \brief Initialize Memory with DMA + * + * \return Initialization status. + */ +int32_t dma_memory_init(void); + +/** + * \brief Register Memory with DMA callback + * + * \param[in] type Callback type + * \param[in] cb A callback function, passing NULL de-registers callback + * + * \return The status of callback assignment. + * \retval ERR_INVALID_ARG Passed parameters were invalid + * \retval ERR_NONE A callback is registered successfully + */ +int32_t dma_memory_register_callback(const enum dma_memory_callback_type type, dma_memory_cb_t cb); + +/** + * \brief dma memory copy + * + * \param[in] dst The pointer to destination address for transfer + * \param[in] src The pointer to source address for transfer + * \param[in] size The transfer size + * + * \return the status of operation` + */ +int32_t dma_memcpy(void *dst, void *src, uint32_t size); + +/** + * \brief dma memory set + * + * \param[in] dst The pointer to address to fill + * \param[in] ch The value to be filled + * \param[in] size Number of bytes to set to the value + * + * \return the status of operation + */ +int32_t dma_memset(void *dst, int32_t ch, uint32_t size); + +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* DMA_MEMORY_H_INCLUDED */ diff --git a/sysmoOCTSIM/dma_m2m/dma_memory_config.h b/sysmoOCTSIM/dma_m2m/dma_memory_config.h new file mode 100644 index 0000000..a5dba3c --- /dev/null +++ b/sysmoOCTSIM/dma_m2m/dma_memory_config.h @@ -0,0 +1,16 @@ +/* Auto-generated config file dma_memory_config.h */ +#ifndef DMA_MEMORY_CONFIG_H +#define DMA_MEMORY_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Channel <0-15> +// This defines DMA channel to be used +// conf_channel +#ifndef CONF_DMA_MEMORY_CHANNEL +#define CONF_DMA_MEMORY_CHANNEL 0 +#endif + +// <<< end of configuration section >>> + +#endif // DMA_MEMORY_CONFIG_H diff --git a/sysmoOCTSIM/documentation/dma_m2m.rst b/sysmoOCTSIM/documentation/dma_m2m.rst new file mode 100644 index 0000000..22bffcf --- /dev/null +++ b/sysmoOCTSIM/documentation/dma_m2m.rst @@ -0,0 +1,15 @@ +Memory DMA +========== + +Memory DMA is middleware which provides DMA-based versions of memcpy and memset +functions. + +Architecture and provided functionality +--------------------------------------- + +Memory DMA uses system DMA driver which varies depending on MCU. User must configure +system DMA driver before using Memory DMA middleware. + +DMA-based versions of memcpy and memset functions work asynchronously. Application +can be notifications about completion of copy or set operation via callbacks. +A callback can be registered via dma_memory_register_callback function. \ No newline at end of file diff --git a/sysmoOCTSIM/gcc/Makefile b/sysmoOCTSIM/gcc/Makefile index 7496377..0191815 100644 --- a/sysmoOCTSIM/gcc/Makefile +++ b/sysmoOCTSIM/gcc/Makefile @@ -39,6 +39,7 @@ stdio_redirect \ hal/utils/src \ hpl/usb \ +dma_m2m \ hpl/pm \ hpl/cmcc \ hpl/gclk \ @@ -54,12 +55,13 @@ stdio_redirect/stdio_io.o \ stdio_redirect/gcc/write.o \ hpl/core/hpl_core_m4.o \ +hal/src/hal_cache.o \ usb/class/cdc/device/cdcdf_acm.o \ hal/utils/src/utils_syscalls.o \ stdio_redirect/gcc/read.o \ -usb_start.o \ gcc/system_same54.o \ hpl/usb/hpl_usb.o \ +dma_m2m/dma_memory.o \ hal/src/hal_delay.o \ hpl/pm/hpl_pm.o \ hpl/core/hpl_init.o \ @@ -76,7 +78,6 @@ hal/src/hal_init.o \ gcc/gcc/startup_same54.o \ hal/src/hal_usb_device.o \ -main.o \ i2c_bitbang.o \ octsim_i2c.o \ ncn8025.o \ @@ -87,10 +88,11 @@ hal/src/hal_usart_async.o \ hpl/sercom/hpl_sercom.o \ hal/utils/src/utils_ringbuffer.o \ +main.o \ hal/src/hal_gpio.o \ hal/utils/src/utils_event.o \ hal/src/hal_sleep.o \ -hal/src/hal_cache.o \ +usb_start.o \ hpl/cmcc/hpl_cmcc.o \ atmel_start.o \ usb/device/usbdc.o \ @@ -101,12 +103,13 @@ "stdio_redirect/stdio_io.o" \ "stdio_redirect/gcc/write.o" \ "hpl/core/hpl_core_m4.o" \ +"hal/src/hal_cache.o" \ "usb/class/cdc/device/cdcdf_acm.o" \ "hal/utils/src/utils_syscalls.o" \ "stdio_redirect/gcc/read.o" \ -"usb_start.o" \ "gcc/system_same54.o" \ "hpl/usb/hpl_usb.o" \ +"dma_m2m/dma_memory.o" \ "hal/src/hal_delay.o" \ "hpl/pm/hpl_pm.o" \ "hpl/core/hpl_init.o" \ @@ -123,7 +126,6 @@ "hal/src/hal_init.o" \ "gcc/gcc/startup_same54.o" \ "hal/src/hal_usb_device.o" \ -"main.o" \ "i2c_bitbang.o" \ "octsim_i2c.o" \ "ncn8025.o" \ @@ -134,10 +136,11 @@ "hal/src/hal_usart_async.o" \ "hpl/sercom/hpl_sercom.o" \ "hal/utils/src/utils_ringbuffer.o" \ +"main.o" \ "hal/src/hal_gpio.o" \ "hal/utils/src/utils_event.o" \ "hal/src/hal_sleep.o" \ -"hal/src/hal_cache.o" \ +"usb_start.o" \ "hpl/cmcc/hpl_cmcc.o" \ "atmel_start.o" \ "usb/device/usbdc.o" \ @@ -147,6 +150,7 @@ DEPS := $(OBJS:%.o=%.d) DEPS_AS_ARGS += \ +"dma_m2m/dma_memory.d" \ "stdio_redirect/stdio_io.d" \ "hal/utils/src/utils_event.d" \ "hal/src/hal_io.d" \ @@ -157,6 +161,7 @@ "stdio_redirect/gcc/write.d" \ "gcc/gcc/startup_same54.d" \ "hpl/usb/hpl_usb.d" \ +"main.d" \ "hal/utils/src/utils_list.d" \ "hpl/cmcc/hpl_cmcc.d" \ "hpl/dmac/hpl_dmac.d" \ @@ -176,7 +181,6 @@ "stdio_redirect/gcc/read.d" \ "hal/src/hal_usart_async.d" \ "hpl/osc32kctrl/hpl_osc32kctrl.d" \ -"main.d" \ "i2c_bitbang.d" \ "octsim_i2c.d" \ "ncn8025.d" \ @@ -238,7 +242,7 @@ @echo ARM/GNU C Compiler $(QUOTE)arm-none-eabi-gcc$(QUOTE) -x c -mthumb -DDEBUG -Os -ffunction-sections -mlong-calls -g3 -Wall -c -std=gnu99 \ -D__SAME54N19A__ -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../CMSIS/Include" -I"../include" \ +-I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< @@ -247,7 +251,7 @@ @echo ARM/GNU Assembler $(QUOTE)arm-none-eabi-as$(QUOTE) -x c -mthumb -DDEBUG -Os -ffunction-sections -mlong-calls -g3 -Wall -c -std=gnu99 \ -D__SAME54N19A__ -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../CMSIS/Include" -I"../include" \ +-I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< @@ -256,7 +260,7 @@ @echo ARM/GNU Preprocessing Assembler $(QUOTE)arm-none-eabi-gcc$(QUOTE) -x c -mthumb -DDEBUG -Os -ffunction-sections -mlong-calls -g3 -Wall -c -std=gnu99 \ -D__SAME54N19A__ -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../CMSIS/Include" -I"../include" \ +-I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< @@ -276,4 +280,4 @@ rm -f $(DEPS_AS_ARGS) rm -f $(OUTPUT_FILE_NAME).a $(OUTPUT_FILE_NAME).hex $(OUTPUT_FILE_NAME).bin \ $(OUTPUT_FILE_NAME).lss $(OUTPUT_FILE_NAME).eep $(OUTPUT_FILE_NAME).map \ - $(OUTPUT_FILE_NAME).srec \ No newline at end of file + $(OUTPUT_FILE_NAME).srec -- To view, visit https://gerrit.osmocom.org/13675 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib07755b2c5974af70817f5460fb0f358c631452a Gerrit-Change-Number: 13675 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 23:29:21 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 16 Apr 2019 23:29:21 +0000 Subject: Change in osmo-ccid-firmware[master]: remove example code Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13676 Change subject: remove example code ...................................................................... remove example code as the code will use alternative libraries, the examples will not be able to compile anymore. plus they are not required for the firmware and the example code can be downloaded from atmel start. Change-Id: If53df47089de9eb8498734c19d6a0420c1e79031 --- D sysmoOCTSIM/examples/driver_examples.c D sysmoOCTSIM/examples/driver_examples.h M sysmoOCTSIM/gcc/Makefile 3 files changed, 3 insertions(+), 284 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/76/13676/1 diff --git a/sysmoOCTSIM/examples/driver_examples.c b/sysmoOCTSIM/examples/driver_examples.c deleted file mode 100644 index 14f1ae5..0000000 --- a/sysmoOCTSIM/examples/driver_examples.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Code generated from Atmel Start. - * - * This file will be overwritten when reconfiguring your Atmel Start project. - * Please copy examples or other code you want to keep to a separate file - * to avoid losing it when reconfiguring. - */ - -#include "driver_examples.h" -#include "driver_init.h" -#include "utils.h" - -/** - * Example of using SIM0 to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_SIM0[12] = "Hello World!"; - -static void tx_cb_SIM0(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void SIM0_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&SIM0, USART_ASYNC_TXC_CB, tx_cb_SIM0); - /*usart_async_register_callback(&SIM0, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&SIM0, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&SIM0, &io); - usart_async_enable(&SIM0); - - io_write(io, example_SIM0, 12); -} - -/** - * Example of using SIM1 to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_SIM1[12] = "Hello World!"; - -static void tx_cb_SIM1(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void SIM1_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&SIM1, USART_ASYNC_TXC_CB, tx_cb_SIM1); - /*usart_async_register_callback(&SIM1, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&SIM1, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&SIM1, &io); - usart_async_enable(&SIM1); - - io_write(io, example_SIM1, 12); -} - -/** - * Example of using SIM2 to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_SIM2[12] = "Hello World!"; - -static void tx_cb_SIM2(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void SIM2_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&SIM2, USART_ASYNC_TXC_CB, tx_cb_SIM2); - /*usart_async_register_callback(&SIM2, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&SIM2, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&SIM2, &io); - usart_async_enable(&SIM2); - - io_write(io, example_SIM2, 12); -} - -/** - * Example of using SIM3 to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_SIM3[12] = "Hello World!"; - -static void tx_cb_SIM3(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void SIM3_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&SIM3, USART_ASYNC_TXC_CB, tx_cb_SIM3); - /*usart_async_register_callback(&SIM3, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&SIM3, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&SIM3, &io); - usart_async_enable(&SIM3); - - io_write(io, example_SIM3, 12); -} - -/** - * Example of using SIM4 to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_SIM4[12] = "Hello World!"; - -static void tx_cb_SIM4(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void SIM4_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&SIM4, USART_ASYNC_TXC_CB, tx_cb_SIM4); - /*usart_async_register_callback(&SIM4, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&SIM4, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&SIM4, &io); - usart_async_enable(&SIM4); - - io_write(io, example_SIM4, 12); -} - -/** - * Example of using SIM5 to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_SIM5[12] = "Hello World!"; - -static void tx_cb_SIM5(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void SIM5_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&SIM5, USART_ASYNC_TXC_CB, tx_cb_SIM5); - /*usart_async_register_callback(&SIM5, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&SIM5, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&SIM5, &io); - usart_async_enable(&SIM5); - - io_write(io, example_SIM5, 12); -} - -/** - * Example of using SIM6 to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_SIM6[12] = "Hello World!"; - -static void tx_cb_SIM6(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void SIM6_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&SIM6, USART_ASYNC_TXC_CB, tx_cb_SIM6); - /*usart_async_register_callback(&SIM6, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&SIM6, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&SIM6, &io); - usart_async_enable(&SIM6); - - io_write(io, example_SIM6, 12); -} - -/** - * Example of using UART_debug to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_UART_debug[12] = "Hello World!"; - -static void tx_cb_UART_debug(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void UART_debug_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&UART_debug, USART_ASYNC_TXC_CB, tx_cb_UART_debug); - /*usart_async_register_callback(&UART_debug, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&UART_debug, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&UART_debug, &io); - usart_async_enable(&UART_debug); - - io_write(io, example_UART_debug, 12); -} diff --git a/sysmoOCTSIM/examples/driver_examples.h b/sysmoOCTSIM/examples/driver_examples.h deleted file mode 100644 index 4f2ce98..0000000 --- a/sysmoOCTSIM/examples/driver_examples.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Code generated from Atmel Start. - * - * This file will be overwritten when reconfiguring your Atmel Start project. - * Please copy examples or other code you want to keep to a separate file - * to avoid losing it when reconfiguring. - */ -#ifndef DRIVER_EXAMPLES_H_INCLUDED -#define DRIVER_EXAMPLES_H_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -void SIM0_example(void); - -void SIM1_example(void); - -void SIM2_example(void); - -void SIM3_example(void); - -void SIM4_example(void); - -void SIM5_example(void); - -void SIM6_example(void); - -void UART_debug_example(void); - -#ifdef __cplusplus -} -#endif -#endif // DRIVER_EXAMPLES_H_INCLUDED diff --git a/sysmoOCTSIM/gcc/Makefile b/sysmoOCTSIM/gcc/Makefile index 0191815..bd4bdb0 100644 --- a/sysmoOCTSIM/gcc/Makefile +++ b/sysmoOCTSIM/gcc/Makefile @@ -28,7 +28,6 @@ \ hal/src \ hpl/ramecc \ -examples \ hpl/oscctrl \ stdio_redirect/gcc \ gcc \ @@ -83,7 +82,6 @@ ncn8025.o \ command.o \ hpl/osc32kctrl/hpl_osc32kctrl.o \ -examples/driver_examples.o \ driver_init.o \ hal/src/hal_usart_async.o \ hpl/sercom/hpl_sercom.o \ @@ -131,7 +129,6 @@ "ncn8025.o" \ "command.o" \ "hpl/osc32kctrl/hpl_osc32kctrl.o" \ -"examples/driver_examples.o" \ "driver_init.o" \ "hal/src/hal_usart_async.o" \ "hpl/sercom/hpl_sercom.o" \ @@ -185,7 +182,6 @@ "octsim_i2c.d" \ "ncn8025.d" \ "command.d" \ -"examples/driver_examples.d" \ "hal/src/hal_cache.d" \ "hal/src/hal_sleep.d" \ "hal/utils/src/utils_ringbuffer.d" \ @@ -242,7 +238,7 @@ @echo ARM/GNU C Compiler $(QUOTE)arm-none-eabi-gcc$(QUOTE) -x c -mthumb -DDEBUG -Os -ffunction-sections -mlong-calls -g3 -Wall -c -std=gnu99 \ -D__SAME54N19A__ -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ +-I"../" -I"../config" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< @@ -251,7 +247,7 @@ @echo ARM/GNU Assembler $(QUOTE)arm-none-eabi-as$(QUOTE) -x c -mthumb -DDEBUG -Os -ffunction-sections -mlong-calls -g3 -Wall -c -std=gnu99 \ -D__SAME54N19A__ -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ +-I"../" -I"../config" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< @@ -260,7 +256,7 @@ @echo ARM/GNU Preprocessing Assembler $(QUOTE)arm-none-eabi-gcc$(QUOTE) -x c -mthumb -DDEBUG -Os -ffunction-sections -mlong-calls -g3 -Wall -c -std=gnu99 \ -D__SAME54N19A__ -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ +-I"../" -I"../config" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< -- To view, visit https://gerrit.osmocom.org/13676 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If53df47089de9eb8498734c19d6a0420c1e79031 Gerrit-Change-Number: 13676 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 23:29:21 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 16 Apr 2019 23:29:21 +0000 Subject: Change in osmo-ccid-firmware[master]: add async library with ring on TX Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13677 Change subject: add async library with ring on TX ...................................................................... add async library with ring on TX the standard async library expected the caller to wait until the transmission was complete (by counting using the transmit callback or checking using usart_async_get_status) before freeing/reusing the memory holding the data to be transmitted. this is not practical when using stdio on top of the peripheral since printf returns directly and reuses the memory. the new USART async library has a ring buffer for the data to be transmitted (similar to the data being received). WARNING: the ring buffer library overwrites old data when the buffer size is exceeded. We do not prevent this since don't want to block. To prevent this behaviour, provide a large enough buffer of check the buffer status yourself using usart_async_get_status. Change-Id: Iafd5295b90ef9f428f640314c24f6c31ee82c9d6 --- M sysmoOCTSIM/gcc/Makefile A sysmoOCTSIM/hal/include/hal_usart_async_rings.h A sysmoOCTSIM/hal/src/hal_usart_async_rings.c 3 files changed, 767 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/77/13677/1 diff --git a/sysmoOCTSIM/gcc/Makefile b/sysmoOCTSIM/gcc/Makefile index bd4bdb0..046970f 100644 --- a/sysmoOCTSIM/gcc/Makefile +++ b/sysmoOCTSIM/gcc/Makefile @@ -84,6 +84,7 @@ hpl/osc32kctrl/hpl_osc32kctrl.o \ driver_init.o \ hal/src/hal_usart_async.o \ +hal/src/hal_usart_async_rings.o \ hpl/sercom/hpl_sercom.o \ hal/utils/src/utils_ringbuffer.o \ main.o \ @@ -131,6 +132,7 @@ "hpl/osc32kctrl/hpl_osc32kctrl.o" \ "driver_init.o" \ "hal/src/hal_usart_async.o" \ +"hal/src/hal_usart_async_rings.o" \ "hpl/sercom/hpl_sercom.o" \ "hal/utils/src/utils_ringbuffer.o" \ "main.o" \ @@ -177,6 +179,7 @@ "driver_init.d" \ "stdio_redirect/gcc/read.d" \ "hal/src/hal_usart_async.d" \ +"hal/src/hal_usart_async_rings.d" \ "hpl/osc32kctrl/hpl_osc32kctrl.d" \ "i2c_bitbang.d" \ "octsim_i2c.d" \ diff --git a/sysmoOCTSIM/hal/include/hal_usart_async_rings.h b/sysmoOCTSIM/hal/include/hal_usart_async_rings.h new file mode 100644 index 0000000..c66e21c --- /dev/null +++ b/sysmoOCTSIM/hal/include/hal_usart_async_rings.h @@ -0,0 +1,341 @@ +/** + * \file + * + * \brief USART related functionality declaration. + * + * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. + * Copyright (C) 2019 sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * \asf_license_start + * + * \page License + * + * Subject to your compliance with these terms, you may use Microchip + * software and any derivatives exclusively with Microchip products. + * It is your responsibility to comply with third party license terms applicable + * to your use of third party software (including open source software) that + * may accompany Microchip software. + * + * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, + * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, + * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE + * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL + * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE + * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE + * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT + * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY + * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, + * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. + * + * \asf_license_stop + * + */ + +#ifndef _HAL_USART_ASYNC_RINGS_H_INCLUDED +#define _HAL_USART_ASYNC_RINGS_H_INCLUDED + +#include "hal_io.h" +#include +#include + +/** + * \addtogroup doc_driver_hal_usart_async + * + * @{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief USART descriptor + * + * The USART descriptor forward declaration. + */ +struct usart_async_rings_descriptor; + +/** + * \brief USART callback type + */ +typedef void (*usart_rings_cb_t)(const struct usart_async_rings_descriptor *const descr); + +/** + * \brief USART callback types + */ +enum usart_async_rings_callback_type { USART_ASYNC_RINGS_RXC_CB, USART_ASYNC_RINGS_TXC_CB, USART_ASYNC_RINGS_ERROR_CB }; + +/** + * \brief USART callbacks + */ +struct usart_async_rings_callbacks { + usart_rings_cb_t tx_done; + usart_rings_cb_t rx_done; + usart_rings_cb_t error; +}; + +/** \brief USART status + * Status descriptor holds the current status of transfer. + */ +struct usart_async_rings_status { + /** Status flags */ + uint32_t flags; + /** Number of characters transmitted */ + uint16_t txcnt; + /** Number of characters receviced */ + uint16_t rxcnt; +}; + +/** + * \brief Asynchronous USART descriptor structure + */ +struct usart_async_rings_descriptor { + struct io_descriptor io; + struct _usart_async_device device; + struct usart_async_rings_callbacks usart_cb; + uint32_t stat; + + struct ringbuffer rx; + struct ringbuffer tx; +}; + +/** USART write busy */ +#define USART_ASYNC_RINGS_STATUS_BUSY 0x0001 + +/** + * \brief Initialize USART interface + * + * This function initializes the given I/O descriptor to be used as USART + * interface descriptor. + * It checks if the given hardware is not initialized and if the given hardware + * is permitted to be initialized. + * + * \param[out] descr A USART descriptor which is used to communicate via the USART + * \param[in] hw The pointer to the hardware instance + * \param[in] rx_buffer An RX buffer + * \param[in] rx_buffer_length The length of the buffer above + * \param[in] tx_buffer An TX buffer + * \param[in] tx_buffer_length The length of the buffer above + * \param[in] func The pointer to a set of function pointers + * + * \return Initialization status. + * \retval -1 Passed parameters were invalid or the interface is already + * initialized + * \retval 0 The initialization is completed successfully + */ +int32_t usart_async_rings_init(struct usart_async_rings_descriptor *const descr, void *const hw, uint8_t *const rx_buffer, + const uint16_t rx_buffer_length, uint8_t *const tx_buffer, + const uint16_t tx_buffer_length, void *const func); + +/** + * \brief Deinitialize USART interface + * + * This function deinitializes the given I/O descriptor. + * It checks if the given hardware is initialized and if the given hardware + * is permitted to be deinitialized. + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * + * \return De-initialization status. + */ +int32_t usart_async_rings_deinit(struct usart_async_rings_descriptor *const descr); + +/** + * \brief Enable USART interface + * + * Enables the USART interface + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * + * \return Enabling status. + */ +int32_t usart_async_rings_enable(struct usart_async_rings_descriptor *const descr); + +/** + * \brief Disable USART interface + * + * Disables the USART interface + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * + * \return Disabling status. + */ +int32_t usart_async_rings_disable(struct usart_async_rings_descriptor *const descr); + +/** + * \brief Retrieve I/O descriptor + * + * This function retrieves the I/O descriptor of the given USART descriptor. + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * \param[out] io An I/O descriptor to retrieve + * + * \return The status of I/O descriptor retrieving. + */ +int32_t usart_async_rings_get_io_descriptor(struct usart_async_rings_descriptor *const descr, struct io_descriptor **io); + +/** + * \brief Register USART callback + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * \param[in] type Callback type + * \param[in] cb A callback function + * + * \return The status of callback assignment. + * \retval -1 Passed parameters were invalid or the interface is not initialized + * \retval 0 A callback is registered successfully + */ +int32_t usart_async_rings_register_callback(struct usart_async_rings_descriptor *const descr, + const enum usart_async_rings_callback_type type, usart_rings_cb_t cb); + +/** + * \brief Specify action for flow control pins + * + * This function sets action (or state) for flow control pins if + * the flow control is enabled. + * It sets state of flow control pins only if automatic support of + * the flow control is not supported by the hardware. + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * \param[in] state A state to set the flow control pins + * + * \return The status of flow control action setup. + */ +int32_t usart_async_rings_set_flow_control(struct usart_async_rings_descriptor *const descr, + const union usart_flow_control_state state); + +/** + * \brief Set USART baud rate + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * \param[in] baud_rate A baud rate to set + * + * \return The status of baud rate setting. + */ +int32_t usart_async_rings_set_baud_rate(struct usart_async_rings_descriptor *const descr, const uint32_t baud_rate); + +/** + * \brief Set USART data order + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * \param[in] data_order A data order to set + * + * \return The status of data order setting. + */ +int32_t usart_async_rings_set_data_order(struct usart_async_rings_descriptor *const descr, const enum usart_data_order data_order); + +/** + * \brief Set USART mode + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * \param[in] mode A mode to set + * + * \return The status of mode setting. + */ +int32_t usart_async_rings_set_mode(struct usart_async_rings_descriptor *const descr, const enum usart_mode mode); + +/** + * \brief Set USART parity + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * \param[in] parity A parity to set + * + * \return The status of parity setting. + */ +int32_t usart_async_rings_set_parity(struct usart_async_rings_descriptor *const descr, const enum usart_parity parity); + +/** + * \brief Set USART stop bits + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * \param[in] stop_bits Stop bits to set + * + * \return The status of stop bits setting. + */ +int32_t usart_async_rings_set_stopbits(struct usart_async_rings_descriptor *const descr, const enum usart_stop_bits stop_bits); + +/** + * \brief Set USART character size + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * \param[in] size A character size to set + * + * \return The status of character size setting. + */ +int32_t usart_async_rings_set_character_size(struct usart_async_rings_descriptor *const descr, + const enum usart_character_size size); + +/** + * \brief Retrieve the state of flow control pins + * + * This function retrieves the flow control pins + * if the flow control is enabled. + * + * The function can return USART_FLOW_CONTROL_STATE_UNAVAILABLE in case + * if the flow control is done by the hardware + * and the pins state cannot be read out. + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * \param[out] state The state of flow control pins + * + * \return The status of flow control state reading. + */ +int32_t usart_async_rings_flow_control_status(const struct usart_async_rings_descriptor *const descr, + union usart_flow_control_state *const state); + +/** + * \brief Check if the USART transmitter is empty + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * + * \return The status of USART TX empty checking. + * \retval 0 The USART transmitter is not empty + * \retval 1 The USART transmitter is empty + */ +int32_t usart_async_rings_is_tx_empty(const struct usart_async_rings_descriptor *const descr); + +/** + * \brief Check if the USART receiver is not empty + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * + * \return The status of the USART RX empty checking. + * \retval 1 The USART receiver is not empty + * \retval 0 The USART receiver is empty + */ +int32_t usart_async_rings_is_rx_not_empty(const struct usart_async_rings_descriptor *const descr); + +/** + * \brief Retrieve the current interface status + * + * \param[in] descr A USART descriptor which is used to communicate via USART + * \param[out] status The state of USART + * + * \return The status of USART status retrieving. + */ +int32_t usart_async_rings_get_status(struct usart_async_rings_descriptor *const descr, struct usart_async_rings_status *const status); + +/** + * \brief flush USART ringbuf + * + * This function flush USART RX ringbuf. + * + * \param[in] descr The pointer to USART descriptor + * + * \return ERR_NONE + */ +int32_t usart_async_rings_flush_rx_buffer(struct usart_async_rings_descriptor *const descr); + +/** + * \brief Retrieve the current driver version + * + * \return Current driver version. + */ +uint32_t usart_async_rings_get_version(void); + +#ifdef __cplusplus +} +#endif +/**@}*/ +#endif /* _HAL_USART_ASYNC_RINGS_H_INCLUDED */ diff --git a/sysmoOCTSIM/hal/src/hal_usart_async_rings.c b/sysmoOCTSIM/hal/src/hal_usart_async_rings.c new file mode 100644 index 0000000..578d945 --- /dev/null +++ b/sysmoOCTSIM/hal/src/hal_usart_async_rings.c @@ -0,0 +1,423 @@ +/** + * \file + * + * \brief I/O USART related functionality implementation. + * + * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. + * Copyright (C) 2019 sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * \asf_license_start + * + * \page License + * + * Subject to your compliance with these terms, you may use Microchip + * software and any derivatives exclusively with Microchip products. + * It is your responsibility to comply with third party license terms applicable + * to your use of third party software (including open source software) that + * may accompany Microchip software. + * + * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, + * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, + * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE + * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL + * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE + * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE + * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT + * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY + * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, + * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. + * + * \asf_license_stop + * + */ + +#include "hal_usart_async_rings.h" +#include +#include +#include + +/** + * \brief Driver version + */ +#define DRIVER_VERSION 0x00000001u + +static int32_t usart_async_rings_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length); +static int32_t usart_async_rings_read(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length); +static void usart_process_byte_sent(struct _usart_async_device *device); +static void usart_transmission_complete(struct _usart_async_device *device); +static void usart_error(struct _usart_async_device *device); +static void usart_fill_rx_buffer(struct _usart_async_device *device, uint8_t data); + +/** + * \brief Initialize usart interface + */ +int32_t usart_async_rings_init(struct usart_async_rings_descriptor *const descr, void *const hw, uint8_t *const rx_buffer, + const uint16_t rx_buffer_length, uint8_t *const tx_buffer, + const uint16_t tx_buffer_length, void *const func) +{ + int32_t init_status; + ASSERT(descr && hw && rx_buffer && rx_buffer_length && tx_buffer && tx_buffer_length); + + if (ERR_NONE != ringbuffer_init(&descr->rx, rx_buffer, rx_buffer_length)) { + return ERR_INVALID_ARG; + } + if (ERR_NONE != ringbuffer_init(&descr->tx, tx_buffer, tx_buffer_length)) { + return ERR_INVALID_ARG; + } + init_status = _usart_async_init(&descr->device, hw); + if (init_status) { + return init_status; + } + + descr->io.read = usart_async_rings_read; + descr->io.write = usart_async_rings_write; + + descr->device.usart_cb.tx_byte_sent = usart_process_byte_sent; + descr->device.usart_cb.rx_done_cb = usart_fill_rx_buffer; + descr->device.usart_cb.tx_done_cb = usart_transmission_complete; + descr->device.usart_cb.error_cb = usart_error; + + return ERR_NONE; +} + +/** + * \brief Deinitialize usart interface + */ +int32_t usart_async_rings_deinit(struct usart_async_rings_descriptor *const descr) +{ + ASSERT(descr); + _usart_async_deinit(&descr->device); + descr->io.read = NULL; + descr->io.write = NULL; + + return ERR_NONE; +} + +/** + * \brief Enable usart interface + */ +int32_t usart_async_rings_enable(struct usart_async_rings_descriptor *const descr) +{ + ASSERT(descr); + _usart_async_enable(&descr->device); + + return ERR_NONE; +} + +/** + * \brief Disable usart interface + */ +int32_t usart_async_rings_disable(struct usart_async_rings_descriptor *const descr) +{ + ASSERT(descr); + _usart_async_disable(&descr->device); + + return ERR_NONE; +} + +/** + * \brief Retrieve I/O descriptor + */ +int32_t usart_async_rings_get_io_descriptor(struct usart_async_rings_descriptor *const descr, struct io_descriptor **io) +{ + ASSERT(descr && io); + + *io = &descr->io; + return ERR_NONE; +} + +/** + * \brief Register usart callback + */ +int32_t usart_async_rings_register_callback(struct usart_async_rings_descriptor *const descr, + const enum usart_async_rings_callback_type type, usart_rings_cb_t cb) +{ + ASSERT(descr); + + switch (type) { + case USART_ASYNC_RINGS_RXC_CB: + descr->usart_cb.rx_done = cb; + _usart_async_set_irq_state(&descr->device, USART_ASYNC_RX_DONE, NULL != cb); + break; + case USART_ASYNC_RINGS_TXC_CB: + descr->usart_cb.tx_done = cb; + _usart_async_set_irq_state(&descr->device, USART_ASYNC_TX_DONE, NULL != cb); + break; + case USART_ASYNC_RINGS_ERROR_CB: + descr->usart_cb.error = cb; + _usart_async_set_irq_state(&descr->device, USART_ASYNC_ERROR, NULL != cb); + break; + default: + return ERR_INVALID_ARG; + } + + return ERR_NONE; +} + +/** + * \brief Specify action for flow control pins + */ +int32_t usart_async_rings_set_flow_control(struct usart_async_rings_descriptor *const descr, + const union usart_flow_control_state state) +{ + ASSERT(descr); + _usart_async_set_flow_control_state(&descr->device, state); + + return ERR_NONE; +} + +/** + * \brief Set usart baud rate + */ +int32_t usart_async_rings_set_baud_rate(struct usart_async_rings_descriptor *const descr, const uint32_t baud_rate) +{ + ASSERT(descr); + _usart_async_set_baud_rate(&descr->device, baud_rate); + + return ERR_NONE; +} + +/** + * \brief Set usart data order + */ +int32_t usart_async_rings_set_data_order(struct usart_async_rings_descriptor *const descr, const enum usart_data_order data_order) +{ + ASSERT(descr); + _usart_async_set_data_order(&descr->device, data_order); + + return ERR_NONE; +} + +/** + * \brief Set usart mode + */ +int32_t usart_async_rings_set_mode(struct usart_async_rings_descriptor *const descr, const enum usart_mode mode) +{ + ASSERT(descr); + _usart_async_set_mode(&descr->device, mode); + + return ERR_NONE; +} + +/** + * \brief Set usart parity + */ +int32_t usart_async_rings_set_parity(struct usart_async_rings_descriptor *const descr, const enum usart_parity parity) +{ + ASSERT(descr); + _usart_async_set_parity(&descr->device, parity); + + return ERR_NONE; +} + +/** + * \brief Set usart stop bits + */ +int32_t usart_async_rings_set_stopbits(struct usart_async_rings_descriptor *const descr, const enum usart_stop_bits stop_bits) +{ + ASSERT(descr); + _usart_async_set_stop_bits(&descr->device, stop_bits); + + return ERR_NONE; +} + +/** + * \brief Set usart character size + */ +int32_t usart_async_rings_set_character_size(struct usart_async_rings_descriptor *const descr, const enum usart_character_size size) +{ + ASSERT(descr); + _usart_async_set_character_size(&descr->device, size); + + return ERR_NONE; +} + +/** + * \brief Retrieve the state of flow control pins + */ +int32_t usart_async_rings_flow_control_status(const struct usart_async_rings_descriptor *const descr, + union usart_flow_control_state *const state) +{ + ASSERT(descr && state); + *state = _usart_async_get_flow_control_state(&descr->device); + + return ERR_NONE; +} + +/** + * \brief Check if the usart transmitter is empty + */ +int32_t usart_async_rings_is_tx_empty(const struct usart_async_rings_descriptor *const descr) +{ + ASSERT(descr); + return _usart_async_is_byte_sent(&descr->device); +} + +/** + * \brief Check if the usart receiver is not empty + */ +int32_t usart_async_rings_is_rx_not_empty(const struct usart_async_rings_descriptor *const descr) +{ + ASSERT(descr); + + return ringbuffer_num(&descr->rx) > 0; +} + +/** + * \brief Retrieve the current interface status + */ +int32_t usart_async_rings_get_status(struct usart_async_rings_descriptor *const descr, struct usart_async_rings_status *const status) +{ + ASSERT(descr); + + volatile uint32_t *tmp_stat = &(descr->stat); + + if (status) { + status->flags = *tmp_stat; + status->txcnt = ringbuffer_num(&descr->tx); + status->rxcnt = ringbuffer_num(&descr->rx); + } + if (*tmp_stat & USART_ASYNC_RINGS_STATUS_BUSY) { + return ERR_BUSY; + } + + return ERR_NONE; +} + +/** + * \brief flush usart rx ringbuf + */ +int32_t usart_async_rings_flush_rx_buffer(struct usart_async_rings_descriptor *const descr) +{ + ASSERT(descr); + + return ringbuffer_flush(&descr->rx); +} + +/** + * \brief Retrieve the current driver version + */ +uint32_t usart_async_rings_get_version(void) +{ + return DRIVER_VERSION; +} + +/* + * \internal Write the given data to usart interface + * + * \param[in] descr The pointer to an io descriptor + * \param[in] buf Data to write to usart + * \param[in] length The number of bytes to write + * + * \return The number of bytes written. + */ +static int32_t usart_async_rings_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length) +{ + struct usart_async_rings_descriptor *descr = CONTAINER_OF(io_descr, struct usart_async_rings_descriptor, io); + + ASSERT(descr && buf && length); + + for (uint16_t i = 0; i < length; i++) { + ringbuffer_put(&descr->tx, buf[i]); + } + descr->stat = USART_ASYNC_RINGS_STATUS_BUSY; + _usart_async_enable_byte_sent_irq(&descr->device); + + return (int32_t)length; +} + +/* + * \internal Read data from usart interface + * + * \param[in] descr The pointer to an io descriptor + * \param[in] buf A buffer to read data to + * \param[in] length The size of a buffer + * + * \return The number of bytes read. + */ +static int32_t usart_async_rings_read(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length) +{ + uint16_t was_read = 0; + uint32_t num; + struct usart_async_rings_descriptor *descr = CONTAINER_OF(io_descr, struct usart_async_rings_descriptor, io); + + ASSERT(descr && buf && length); + + CRITICAL_SECTION_ENTER() + num = ringbuffer_num(&descr->rx); + CRITICAL_SECTION_LEAVE() + + while ((was_read < num) && (was_read < length)) { + ringbuffer_get(&descr->rx, &buf[was_read++]); + } + + return (int32_t)was_read; +} + +/** + * \brief Process "byte is sent" interrupt + * + * \param[in] device The pointer to device structure + */ +static void usart_process_byte_sent(struct _usart_async_device *device) +{ + struct usart_async_rings_descriptor *descr = CONTAINER_OF(device, struct usart_async_rings_descriptor, device); + if (ringbuffer_num(&descr->tx)) { + uint8_t byte; + ringbuffer_get(&descr->tx, &byte); + _usart_async_write_byte(&descr->device, byte); + _usart_async_enable_byte_sent_irq(&descr->device); + } else { + _usart_async_enable_tx_done_irq(&descr->device); + } +} + +/** + * \brief Process completion of data sending + * + * \param[in] device The pointer to device structure + */ +static void usart_transmission_complete(struct _usart_async_device *device) +{ + struct usart_async_rings_descriptor *descr = CONTAINER_OF(device, struct usart_async_rings_descriptor, device); + + descr->stat = 0; + if (descr->usart_cb.tx_done) { + descr->usart_cb.tx_done(descr); + } +} + +/** + * \brief Process byte reception + * + * \param[in] device The pointer to device structure + * \param[in] data Data read + */ +static void usart_fill_rx_buffer(struct _usart_async_device *device, uint8_t data) +{ + struct usart_async_rings_descriptor *descr = CONTAINER_OF(device, struct usart_async_rings_descriptor, device); + + ringbuffer_put(&descr->rx, data); + + if (descr->usart_cb.rx_done) { + descr->usart_cb.rx_done(descr); + } +} + +/** + * \brief Process error interrupt + * + * \param[in] device The pointer to device structure + */ +static void usart_error(struct _usart_async_device *device) +{ + struct usart_async_rings_descriptor *descr = CONTAINER_OF(device, struct usart_async_rings_descriptor, device); + + descr->stat = 0; + if (descr->usart_cb.error) { + descr->usart_cb.error(descr); + } +} + +//@} -- To view, visit https://gerrit.osmocom.org/13677 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iafd5295b90ef9f428f640314c24f6c31ee82c9d6 Gerrit-Change-Number: 13677 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 23:29:22 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 16 Apr 2019 23:29:22 +0000 Subject: Change in osmo-ccid-firmware[master]: UART_debug now uses the async library with tx ring Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13678 Change subject: UART_debug now uses the async library with tx ring ...................................................................... UART_debug now uses the async library with tx ring Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc --- M sysmoOCTSIM/command.c M sysmoOCTSIM/driver_init.c M sysmoOCTSIM/driver_init.h M sysmoOCTSIM/stdio_start.c 4 files changed, 12 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/78/13678/1 diff --git a/sysmoOCTSIM/command.c b/sysmoOCTSIM/command.c index 7ac5662..327a1a0 100644 --- a/sysmoOCTSIM/command.c +++ b/sysmoOCTSIM/command.c @@ -76,7 +76,7 @@ unsigned int i = 0; /* yield CPU after maximum of 10 received characters */ - while (usart_async_is_rx_not_empty(&UART_debug) && (i < 10)) { + while (usart_async_rings_is_rx_not_empty(&UART_debug) && (i < 10)) { gpio_toggle_pin_level(USER_LED); // toggle LED to show we received something int c = getchar(); if (c < 0) diff --git a/sysmoOCTSIM/driver_init.c b/sysmoOCTSIM/driver_init.c index 8a50925..0b6b190 100644 --- a/sysmoOCTSIM/driver_init.c +++ b/sysmoOCTSIM/driver_init.c @@ -33,7 +33,7 @@ #define SIM6_BUFFER_SIZE 16 /*! The buffer size for USART */ -#define UART_DEBUG_BUFFER_SIZE 32 +#define UART_DEBUG_BUFFER_SIZE 256 struct usart_async_descriptor SIM0; struct usart_async_descriptor SIM1; @@ -51,9 +51,10 @@ static uint8_t SIM5_buffer[SIM5_BUFFER_SIZE]; static uint8_t SIM6_buffer[SIM6_BUFFER_SIZE]; -struct usart_async_descriptor UART_debug; +struct usart_async_rings_descriptor UART_debug; -static uint8_t UART_DEBUG_buffer[UART_DEBUG_BUFFER_SIZE]; +static uint8_t UART_DEBUG_buffer_rx[UART_DEBUG_BUFFER_SIZE]; +static uint8_t UART_DEBUG_buffer_tx[UART_DEBUG_BUFFER_SIZE]; /** * \brief USART Clock initialization function @@ -349,7 +350,7 @@ void UART_debug_init(void) { UART_debug_CLOCK_init(); - usart_async_init(&UART_debug, SERCOM7, UART_DEBUG_buffer, UART_DEBUG_BUFFER_SIZE, (void *)NULL); + usart_async_rings_init(&UART_debug, SERCOM7, UART_DEBUG_buffer_rx, UART_DEBUG_BUFFER_SIZE, UART_DEBUG_buffer_tx, UART_DEBUG_BUFFER_SIZE, (void *)NULL); UART_debug_PORT_init(); } diff --git a/sysmoOCTSIM/driver_init.h b/sysmoOCTSIM/driver_init.h index 9d009b9..6c4f3a1 100644 --- a/sysmoOCTSIM/driver_init.h +++ b/sysmoOCTSIM/driver_init.h @@ -21,15 +21,9 @@ #include #include -#include -#include -#include -#include -#include -#include -#include - #include +#include +#include #include "hal_usb_device.h" @@ -40,7 +34,7 @@ extern struct usart_async_descriptor SIM4; extern struct usart_async_descriptor SIM5; extern struct usart_async_descriptor SIM6; -extern struct usart_async_descriptor UART_debug; +extern struct usart_async_rings_descriptor UART_debug; void SIM0_PORT_init(void); void SIM0_CLOCK_init(void); diff --git a/sysmoOCTSIM/stdio_start.c b/sysmoOCTSIM/stdio_start.c index e2fb0c2..8a15c88 100644 --- a/sysmoOCTSIM/stdio_start.c +++ b/sysmoOCTSIM/stdio_start.c @@ -9,13 +9,13 @@ #include "atmel_start.h" #include "stdio_start.h" -static void UART_debug_rx_cb(const struct usart_async_descriptor *const io_descr) +static void UART_debug_rx_cb(const struct usart_async_rings_descriptor *const io_descr) { } void stdio_redirect_init(void) { - usart_async_register_callback(&UART_debug, USART_ASYNC_RXC_CB, UART_debug_rx_cb); // if no callback function is registered receive won't work, even if the callback does nothing - usart_async_enable(&UART_debug); + usart_async_rings_register_callback(&UART_debug, USART_ASYNC_RXC_CB, UART_debug_rx_cb); // if no callback function is registered receive won't work, even if the callback does nothing + usart_async_rings_enable(&UART_debug); stdio_io_init(&UART_debug.io); } -- To view, visit https://gerrit.osmocom.org/13678 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc Gerrit-Change-Number: 13678 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 23:29:22 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 16 Apr 2019 23:29:22 +0000 Subject: Change in osmo-ccid-firmware[master]: change ISO baud rate default to 6720 bps Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13679 Change subject: change ISO baud rate default to 6720 bps ...................................................................... change ISO baud rate default to 6720 bps the ISO7816 I/O baud rate is f / (Fd / Dd), with Fd 372, Dd = 1. f_max is 4 MHz, but we will use the minimum 20 / 8 = 2.5 MHz, thus the baud rate after reset will be 6720 bps. Change-Id: I9165575404f070c7429daaa3593838d08a5c5e10 --- M sysmoOCTSIM/config/hpl_sercom_config.h 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/79/13679/1 diff --git a/sysmoOCTSIM/config/hpl_sercom_config.h b/sysmoOCTSIM/config/hpl_sercom_config.h index 735fdc2..beac040 100644 --- a/sysmoOCTSIM/config/hpl_sercom_config.h +++ b/sysmoOCTSIM/config/hpl_sercom_config.h @@ -59,7 +59,7 @@ // USART baud rate setting // usart_baud_rate #ifndef CONF_SERCOM_0_USART_BAUD -#define CONF_SERCOM_0_USART_BAUD 9600 +#define CONF_SERCOM_0_USART_BAUD 6720 #endif // @@ -331,7 +331,7 @@ // USART baud rate setting // usart_baud_rate #ifndef CONF_SERCOM_1_USART_BAUD -#define CONF_SERCOM_1_USART_BAUD 9600 +#define CONF_SERCOM_1_USART_BAUD 6720 #endif // @@ -603,7 +603,7 @@ // USART baud rate setting // usart_baud_rate #ifndef CONF_SERCOM_2_USART_BAUD -#define CONF_SERCOM_2_USART_BAUD 9600 +#define CONF_SERCOM_2_USART_BAUD 6720 #endif // @@ -875,7 +875,7 @@ // USART baud rate setting // usart_baud_rate #ifndef CONF_SERCOM_3_USART_BAUD -#define CONF_SERCOM_3_USART_BAUD 9600 +#define CONF_SERCOM_3_USART_BAUD 6720 #endif // @@ -1147,7 +1147,7 @@ // USART baud rate setting // usart_baud_rate #ifndef CONF_SERCOM_4_USART_BAUD -#define CONF_SERCOM_4_USART_BAUD 9600 +#define CONF_SERCOM_4_USART_BAUD 6720 #endif // @@ -1419,7 +1419,7 @@ // USART baud rate setting // usart_baud_rate #ifndef CONF_SERCOM_5_USART_BAUD -#define CONF_SERCOM_5_USART_BAUD 9600 +#define CONF_SERCOM_5_USART_BAUD 6720 #endif // @@ -1691,7 +1691,7 @@ // USART baud rate setting // usart_baud_rate #ifndef CONF_SERCOM_6_USART_BAUD -#define CONF_SERCOM_6_USART_BAUD 9600 +#define CONF_SERCOM_6_USART_BAUD 6720 #endif // -- To view, visit https://gerrit.osmocom.org/13679 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9165575404f070c7429daaa3593838d08a5c5e10 Gerrit-Change-Number: 13679 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 23:29:22 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 16 Apr 2019 23:29:22 +0000 Subject: Change in osmo-ccid-firmware[master]: change SERCOM clock to 3.3 MHz Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13680 Change subject: change SERCOM clock to 3.3 MHz ...................................................................... change SERCOM clock to 3.3 MHz we use the SERCOM peripheral for USART (in 7816 mode SIM card communication) in synchronous mode (TX and RX clock are the same). in this mode only the 8 least significant bits of the BAUD register are used (see TRM 33.6.2.3 Clock Generation ? Baud-Rate Generator). When the SERCOM is clocked at 100 MHz the minimum resulting baud rate would be 100E6 / (2 * 255 + 1) = 195694 bps. clocking SERCOM at 3.33 MHz also to have a baud rate of 6720 bps (~ 3.33E6 / (2 * 247 + 1)), used after reset to read the ATR. Change-Id: Id60322e092a6652a89821fc737d5336d79a1420c --- M sysmoOCTSIM/config/hpl_gclk_config.h M sysmoOCTSIM/config/peripheral_clk_config.h 2 files changed, 12 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/80/13680/1 diff --git a/sysmoOCTSIM/config/hpl_gclk_config.h b/sysmoOCTSIM/config/hpl_gclk_config.h index 6b7586c..71c26e1 100644 --- a/sysmoOCTSIM/config/hpl_gclk_config.h +++ b/sysmoOCTSIM/config/hpl_gclk_config.h @@ -226,7 +226,7 @@ // Generic clock generator 2 division <0x0000-0xFFFF> // gclk_gen_2_div #ifndef CONF_GCLK_GEN_2_DIV -#define CONF_GCLK_GEN_2_DIV 1 +#define CONF_GCLK_GEN_2_DIV 30 #endif // // @@ -311,7 +311,7 @@ // Indicates whether generic clock 4 configuration is enabled or not // enable_gclk_gen_4 #ifndef CONF_GCLK_GENERATOR_4_CONFIG -#define CONF_GCLK_GENERATOR_4_CONFIG 0 +#define CONF_GCLK_GENERATOR_4_CONFIG 1 #endif // Generic Clock Generator Control @@ -328,7 +328,7 @@ // This defines the clock source for generic clock generator 4 // gclk_gen_4_oscillator #ifndef CONF_GCLK_GEN_4_SOURCE -#define CONF_GCLK_GEN_4_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#define CONF_GCLK_GEN_4_SOURCE GCLK_GENCTRL_SRC_DPLL1 #endif // Run in Standby @@ -370,7 +370,7 @@ // Indicates whether Generic Clock Generator Enable is enabled or not // gclk_arch_gen_4_enable #ifndef CONF_GCLK_GEN_4_GENEN -#define CONF_GCLK_GEN_4_GENEN 0 +#define CONF_GCLK_GEN_4_GENEN 1 #endif // diff --git a/sysmoOCTSIM/config/peripheral_clk_config.h b/sysmoOCTSIM/config/peripheral_clk_config.h index 91c5c86..4bff6ff 100644 --- a/sysmoOCTSIM/config/peripheral_clk_config.h +++ b/sysmoOCTSIM/config/peripheral_clk_config.h @@ -81,7 +81,7 @@ * \brief SERCOM0's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM0_CORE_FREQUENCY -#define CONF_GCLK_SERCOM0_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM0_CORE_FREQUENCY 3333333 #endif /** @@ -161,7 +161,7 @@ * \brief SERCOM1's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM1_CORE_FREQUENCY -#define CONF_GCLK_SERCOM1_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM1_CORE_FREQUENCY 3333333 #endif /** @@ -241,7 +241,7 @@ * \brief SERCOM2's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM2_CORE_FREQUENCY -#define CONF_GCLK_SERCOM2_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM2_CORE_FREQUENCY 3333333 #endif /** @@ -321,7 +321,7 @@ * \brief SERCOM3's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM3_CORE_FREQUENCY -#define CONF_GCLK_SERCOM3_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM3_CORE_FREQUENCY 3333333 #endif /** @@ -401,7 +401,7 @@ * \brief SERCOM4's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM4_CORE_FREQUENCY -#define CONF_GCLK_SERCOM4_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM4_CORE_FREQUENCY 3333333 #endif /** @@ -481,7 +481,7 @@ * \brief SERCOM5's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM5_CORE_FREQUENCY -#define CONF_GCLK_SERCOM5_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM5_CORE_FREQUENCY 3333333 #endif /** @@ -561,7 +561,7 @@ * \brief SERCOM6's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM6_CORE_FREQUENCY -#define CONF_GCLK_SERCOM6_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM6_CORE_FREQUENCY 3333333 #endif /** @@ -601,7 +601,7 @@ // Select the clock source for CORE. #ifndef CONF_GCLK_SERCOM7_CORE_SRC -#define CONF_GCLK_SERCOM7_CORE_SRC GCLK_PCHCTRL_GEN_GCLK2_Val +#define CONF_GCLK_SERCOM7_CORE_SRC GCLK_PCHCTRL_GEN_GCLK4_Val #endif // Slow Clock Source -- To view, visit https://gerrit.osmocom.org/13680 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id60322e092a6652a89821fc737d5336d79a1420c Gerrit-Change-Number: 13680 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 23:29:23 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 16 Apr 2019 23:29:23 +0000 Subject: Change in osmo-ccid-firmware[master]: add sim-atr command Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13681 Change subject: add sim-atr command ...................................................................... add sim-atr command the sim-atr command resets the card and read the resulting answer to reset. Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee --- M sysmoOCTSIM/main.c 1 file changed, 90 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/81/13681/1 diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index afd7bf2..788343e 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "atmel_start.h" #include "atmel_start_pins.h" @@ -31,6 +32,13 @@ #include "command.h" +// TODO put declaration in more global file +// TODO for now SIM7 is not present because used for debug +static struct usart_async_descriptor* SIM_peripheral_descriptors[] = {&SIM0, &SIM1, &SIM2, &SIM3, &SIM4, &SIM5, &SIM6, NULL}; + +static void SIM_rx_cb(const struct usart_async_descriptor *const io_descr) +{ +} static void board_init() { @@ -49,6 +57,15 @@ /* increase drive strength of 20Mhz SIM clock output to 8mA * (there are 8 inputs + traces to drive!) */ hri_port_set_PINCFG_DRVSTR_bit(PORT, 0, 11); + + // enable SIM interfaces + for (uint8_t i = 0; i < ARRAY_SIZE(SIM_peripheral_descriptors); i++) { + if (NULL == SIM_peripheral_descriptors[i]) { + continue; + } + usart_async_register_callback(SIM_peripheral_descriptors[i], USART_ASYNC_RXC_CB, SIM_rx_cb); // required for RX to work, even if the callback does nothing + usart_async_enable(SIM_peripheral_descriptors[i]); + } } DEFUN(hello_fn, cmd_hello, @@ -210,6 +227,78 @@ ncn8025_set(slotnr, &settings); } +DEFUN(sim_atr, cmd_sim_atr, "sim-atr", "Read ATR from SIM card") +{ + struct ncn8025_settings settings; + int slotnr = validate_slotnr(argc, argv, 1); + + if (slotnr < 0 || slotnr >= ARRAY_SIZE(SIM_peripheral_descriptors) || NULL == SIM_peripheral_descriptors[slotnr]) { + return; + } + + // check if card is present (and read current settings) + ncn8025_get(slotnr, &settings); + if (!settings.simpres) { + printf("no card present in slot %d\r\n", slotnr); + return; + } + + // switch card off (assert reset and disable power) + // note: ISO/IEC 7816-3:2006 section 6.4 provides the deactivation sequence, but not the minimum corresponding times + settings.rstin = false; + settings.cmdvcc = false; + ncn8025_set(slotnr, &settings); + // TODO wait some time for card to be completely deactivated + usart_async_flush_rx_buffer(SIM_peripheral_descriptors[slotnr]); // flush RX buffer to start from scratch + //usart_async_set_baud_rate(SIM_peripheral_descriptors[slotnr], 2500000 / (372 / 1)); // set USART baud rate to match the interface (f = 2.5 MHz) and card default settings (Fd = 372, Dd = 1) + // set clock to lowest frequency (20 MHz / 8 = 2.5 MHz) + // note: according to ISO/IEC 7816-3:2006 section 5.2.3 the minimum value is 1 MHz, and maximum is 5 MHz during activation + settings.clkdiv = SIM_CLKDIV_8; + ncn8025_set(slotnr, &settings); + // set card voltage to 3.0 V (the most supported) + // note: according to ISO/IEC 7816-3:2006 no voltage should damage the card, and you should cycle from low to high + settings.vsel = SIM_VOLT_3V0; + ncn8025_set(slotnr, &settings); + // provide power (the NCN8025 should perform the activation according to spec) + // note: activation sequence is documented in ISO/IEC 7816-3:2006 section 6.2 + settings.cmdvcc = true; + ncn8025_set(slotnr, &settings); + // wait for Tb=400 cycles before re-asserting reset + delay_us(400 * 10000 / 2500); // 400 cycles * 1000 for us, 2.5 MHz / 1000 for us + // de-assert reset to switch card back on + settings.rstin = true; + ncn8025_set(slotnr, &settings); + // wait for Tc=40000 cycles for transmission to start + uint32_t cycles = 40000; + while (cycles && !usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) { + delay_us(10); + cycles -= 25; // 10 us = 25 cycles at 2.5 MHz + } + if (!usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) { + delay_us(12 * 372 / 1 / 2); // wait more than one byte (approximate freq down to 2 MHz) + } + // verify if one byte has been received + if (!usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) { + printf("card in slot %d is not responding\r\n", slotnr); + return; + } + // read ATR (just do it until there is no traffic anymore) + // TODO the ATR should be parsed to read the right number of bytes + printf("ATR: "); + uint8_t atr_byte; + while (usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) { + if (1 == io_read(&SIM_peripheral_descriptors[slotnr]->io, &atr_byte, 1)) { + printf("%02x ", atr_byte); + } + uint16_t wt = 9600; // waiting time in ETU + while (wt && !usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) { + delay_us(149); // wait for 1 ETU (372 / 1 / 2.5 MHz = 148.8 us) + wt--; + } + } + printf("\r\n"); +} + int main(void) { atmel_start_init(); @@ -226,6 +315,7 @@ command_register(&cmd_sim_clkdiv); command_register(&cmd_sim_voltage); command_register(&cmd_sim_led); + command_register(&cmd_sim_atr); printf("\r\n\r\nsysmocom sysmoOCTSIM\r\n"); while (true) { // main loop -- To view, visit https://gerrit.osmocom.org/13681 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee Gerrit-Change-Number: 13681 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 23:29:23 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 16 Apr 2019 23:29:23 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: fix typo Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13682 Change subject: minor: fix typo ...................................................................... minor: fix typo Change-Id: I57c743250af19713e7438606bc1c737cfe0c383c --- M sysmoOCTSIM/hal/include/hal_usart_async.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/82/13682/1 diff --git a/sysmoOCTSIM/hal/include/hal_usart_async.h b/sysmoOCTSIM/hal/include/hal_usart_async.h index 3a6de39..c883823 100644 --- a/sysmoOCTSIM/hal/include/hal_usart_async.h +++ b/sysmoOCTSIM/hal/include/hal_usart_async.h @@ -82,7 +82,7 @@ uint32_t flags; /** Number of characters transmitted */ uint16_t txcnt; - /** Number of characters receviced */ + /** Number of characters received */ uint16_t rxcnt; }; -- To view, visit https://gerrit.osmocom.org/13682 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I57c743250af19713e7438606bc1c737cfe0c383c Gerrit-Change-Number: 13682 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 23:29:23 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 16 Apr 2019 23:29:23 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: improve documentation Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13683 Change subject: minor: improve documentation ...................................................................... minor: improve documentation Change-Id: I250209d45a57c5ad7d1265a68aa71fc31ec06f69 --- M sysmoOCTSIM/ncn8025.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/83/13683/1 diff --git a/sysmoOCTSIM/ncn8025.h b/sysmoOCTSIM/ncn8025.h index 89b7f86..48d2a58 100644 --- a/sysmoOCTSIM/ncn8025.h +++ b/sysmoOCTSIM/ncn8025.h @@ -15,8 +15,8 @@ }; struct ncn8025_settings { - bool rstin; /* high: active */ - bool cmdvcc; /* high: active */ + bool rstin; /* Reset signal (true: de-asserted high) */ + bool cmdvcc; /* Command VCC pin. Activation sequence Enable (true: active low) */ bool simpres; /* high: active */ bool led; /* high: active */ bool interrupt; /* high: active */ -- To view, visit https://gerrit.osmocom.org/13683 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I250209d45a57c5ad7d1265a68aa71fc31ec06f69 Gerrit-Change-Number: 13683 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 23:29:23 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 16 Apr 2019 23:29:23 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: change variable type to remove compiler warning Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13684 Change subject: minor: change variable type to remove compiler warning ...................................................................... minor: change variable type to remove compiler warning Change-Id: I8f537d6cbec820ad0406ec2ff0c9735759169fc0 --- M sysmoOCTSIM/command.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/84/13684/1 diff --git a/sysmoOCTSIM/command.c b/sysmoOCTSIM/command.c index 327a1a0..8fbaec4 100644 --- a/sysmoOCTSIM/command.c +++ b/sysmoOCTSIM/command.c @@ -78,7 +78,7 @@ /* yield CPU after maximum of 10 received characters */ while (usart_async_rings_is_rx_not_empty(&UART_debug) && (i < 10)) { gpio_toggle_pin_level(USER_LED); // toggle LED to show we received something - int c = getchar(); + char c = getchar(); if (c < 0) return; putchar(c); -- To view, visit https://gerrit.osmocom.org/13684 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8f537d6cbec820ad0406ec2ff0c9735759169fc0 Gerrit-Change-Number: 13684 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 16 23:29:24 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 16 Apr 2019 23:29:24 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: remove unnecessary hellow world command Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13685 Change subject: minor: remove unnecessary hellow world command ...................................................................... minor: remove unnecessary hellow world command Change-Id: I414b2ddd0bacff692316fe212b9d3b506100a7ba --- M sysmoOCTSIM/main.c 1 file changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/85/13685/1 diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index 788343e..8d51161 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -68,12 +68,6 @@ } } -DEFUN(hello_fn, cmd_hello, - "hello", "Hello World example command") -{ - printf("Hello World!\r\n"); -} - static int validate_slotnr(int argc, char **argv, int idx) { int slotnr; @@ -308,7 +302,6 @@ board_init(); command_init("sysmoOCTSIM> "); - command_register(&cmd_hello); command_register(&cmd_sim_status); command_register(&cmd_sim_power); command_register(&cmd_sim_reset); -- To view, visit https://gerrit.osmocom.org/13685 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I414b2ddd0bacff692316fe212b9d3b506100a7ba Gerrit-Change-Number: 13685 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 00:30:01 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 17 Apr 2019 00:30:01 +0000 Subject: Change in osmo-ccid-firmware[master]: add sim-atr command In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13681 to look at the new patch set (#2). Change subject: add sim-atr command ...................................................................... add sim-atr command the sim-atr command resets the card and read the resulting answer to reset. Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee --- M sysmoOCTSIM/main.c 1 file changed, 89 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/81/13681/2 -- To view, visit https://gerrit.osmocom.org/13681 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee Gerrit-Change-Number: 13681 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 00:30:01 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 17 Apr 2019 00:30:01 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: update atmel start project configuration Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13686 Change subject: minor: update atmel start project configuration ...................................................................... minor: update atmel start project configuration Change-Id: I8e719f1687befb9a3657a2e582165dec3cd00094 --- M sysmoOCTSIM/atmel_start_config.atstart 1 file changed, 13 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/86/13686/1 diff --git a/sysmoOCTSIM/atmel_start_config.atstart b/sysmoOCTSIM/atmel_start_config.atstart index 51ec4f4..f40c43a 100644 --- a/sysmoOCTSIM/atmel_start_config.atstart +++ b/sysmoOCTSIM/atmel_start_config.atstart @@ -664,7 +664,7 @@ enable_gclk_gen_11: true enable_gclk_gen_2: true enable_gclk_gen_3: true - enable_gclk_gen_4: false + enable_gclk_gen_4: true enable_gclk_gen_5: true enable_gclk_gen_6: false enable_gclk_gen_7: false @@ -700,7 +700,7 @@ gclk_arch_gen_3_oe: false gclk_arch_gen_3_oov: false gclk_arch_gen_3_runstdby: false - gclk_arch_gen_4_enable: false + gclk_arch_gen_4_enable: true gclk_arch_gen_4_idc: false gclk_arch_gen_4_oe: false gclk_arch_gen_4_oov: false @@ -742,7 +742,7 @@ gclk_gen_1_div: 1 gclk_gen_1_div_sel: false gclk_gen_1_oscillator: Digital Frequency Locked Loop (DFLL48M) - gclk_gen_2_div: 1 + gclk_gen_2_div: 30 gclk_gen_2_div_sel: false gclk_gen_2_oscillator: Digital Phase Locked Loop (DPLL1) gclk_gen_3_div: 1 @@ -750,7 +750,7 @@ gclk_gen_3_oscillator: 32kHz External Crystal Oscillator (XOSC32K) gclk_gen_4_div: 1 gclk_gen_4_div_sel: false - gclk_gen_4_oscillator: External Crystal Oscillator 8-48MHz (XOSC1) + gclk_gen_4_oscillator: Digital Phase Locked Loop (DPLL1) gclk_gen_5_div: 5 gclk_gen_5_div_sel: false gclk_gen_5_oscillator: Digital Phase Locked Loop (DPLL1) @@ -976,7 +976,7 @@ usart_arch_ibon: false usart_arch_runstdby: false usart_arch_sfde: false - usart_baud_rate: 9600 + usart_baud_rate: 6720 usart_character_size: 8 bits usart_dsnack: The successive receive NACK is disable. usart_gtime: 2-bit times @@ -1023,7 +1023,7 @@ usart_arch_ibon: false usart_arch_runstdby: false usart_arch_sfde: false - usart_baud_rate: 9600 + usart_baud_rate: 6720 usart_character_size: 8 bits usart_dsnack: The successive receive NACK is disable. usart_gtime: 2-bit times @@ -1070,7 +1070,7 @@ usart_arch_ibon: false usart_arch_runstdby: false usart_arch_sfde: false - usart_baud_rate: 9600 + usart_baud_rate: 6720 usart_character_size: 8 bits usart_dsnack: The successive receive NACK is disable. usart_gtime: 2-bit times @@ -1117,7 +1117,7 @@ usart_arch_ibon: false usart_arch_runstdby: false usart_arch_sfde: false - usart_baud_rate: 9600 + usart_baud_rate: 6720 usart_character_size: 8 bits usart_dsnack: The successive receive NACK is disable. usart_gtime: 2-bit times @@ -1164,7 +1164,7 @@ usart_arch_ibon: false usart_arch_runstdby: false usart_arch_sfde: false - usart_baud_rate: 9600 + usart_baud_rate: 6720 usart_character_size: 8 bits usart_dsnack: The successive receive NACK is disable. usart_gtime: 2-bit times @@ -1211,7 +1211,7 @@ usart_arch_ibon: false usart_arch_runstdby: false usart_arch_sfde: false - usart_baud_rate: 9600 + usart_baud_rate: 6720 usart_character_size: 8 bits usart_dsnack: The successive receive NACK is disable. usart_gtime: 2-bit times @@ -1258,7 +1258,7 @@ usart_arch_ibon: false usart_arch_runstdby: false usart_arch_sfde: false - usart_baud_rate: 9600 + usart_baud_rate: 6720 usart_character_size: 8 bits usart_dsnack: The successive receive NACK is disable. usart_gtime: 2-bit times @@ -1330,7 +1330,7 @@ domain_group: nodes: - name: Core - input: Generic clock generator 2 + input: Generic clock generator 4 external: false external_frequency: 0 - name: Slow @@ -1338,7 +1338,7 @@ external: false external_frequency: 0 configuration: - core_gclk_selection: Generic clock generator 2 + core_gclk_selection: Generic clock generator 4 slow_gclk_selection: Generic clock generator 3 USB_DEVICE_INSTANCE: user_label: USB_DEVICE_INSTANCE -- To view, visit https://gerrit.osmocom.org/13686 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8e719f1687befb9a3657a2e582165dec3cd00094 Gerrit-Change-Number: 13686 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 00:30:02 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 17 Apr 2019 00:30:02 +0000 Subject: Change in osmo-ccid-firmware[master]: update CMSIS to 5.1.2 Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13687 Change subject: update CMSIS to 5.1.2 ...................................................................... update CMSIS to 5.1.2 this changes comes from Atmel START Change-Id: Ib9b00107836c1604c7169d69ba607fead8c55355 --- M sysmoOCTSIM/AtmelStart.gpdsc R sysmoOCTSIM/CMSIS/Core/Include/cmsis_armcc.h R sysmoOCTSIM/CMSIS/Core/Include/cmsis_armclang.h A sysmoOCTSIM/CMSIS/Core/Include/cmsis_compiler.h R sysmoOCTSIM/CMSIS/Core/Include/cmsis_gcc.h A sysmoOCTSIM/CMSIS/Core/Include/cmsis_iccarm.h A sysmoOCTSIM/CMSIS/Core/Include/cmsis_version.h R sysmoOCTSIM/CMSIS/Core/Include/core_armv8mbl.h R sysmoOCTSIM/CMSIS/Core/Include/core_armv8mml.h R sysmoOCTSIM/CMSIS/Core/Include/core_cm0.h R sysmoOCTSIM/CMSIS/Core/Include/core_cm0plus.h C sysmoOCTSIM/CMSIS/Core/Include/core_cm1.h R sysmoOCTSIM/CMSIS/Core/Include/core_cm23.h R sysmoOCTSIM/CMSIS/Core/Include/core_cm3.h R sysmoOCTSIM/CMSIS/Core/Include/core_cm33.h R sysmoOCTSIM/CMSIS/Core/Include/core_cm4.h R sysmoOCTSIM/CMSIS/Core/Include/core_cm7.h R sysmoOCTSIM/CMSIS/Core/Include/core_sc000.h R sysmoOCTSIM/CMSIS/Core/Include/core_sc300.h A sysmoOCTSIM/CMSIS/Core/Include/mpu_armv7.h A sysmoOCTSIM/CMSIS/Core/Include/mpu_armv8.h R sysmoOCTSIM/CMSIS/Core/Include/tz_context.h M sysmoOCTSIM/CMSIS/Documentation/Core/html/index.html D sysmoOCTSIM/CMSIS/Include/arm_common_tables.h D sysmoOCTSIM/CMSIS/Include/arm_const_structs.h D sysmoOCTSIM/CMSIS/Include/arm_math.h D sysmoOCTSIM/CMSIS/Include/cmsis_compiler.h M sysmoOCTSIM/gcc/Makefile 28 files changed, 29,295 insertions(+), 33,968 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/87/13687/1 -- To view, visit https://gerrit.osmocom.org/13687 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9b00107836c1604c7169d69ba607fead8c55355 Gerrit-Change-Number: 13687 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 00:30:03 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 17 Apr 2019 00:30:03 +0000 Subject: Change in osmo-ccid-firmware[master]: update ASFv4 library to 1.0.1465 Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13688 Change subject: update ASFv4 library to 1.0.1465 ...................................................................... update ASFv4 library to 1.0.1465 Change-Id: I828e87c7ededbb50a999d672cf0b738eef9a093a --- M sysmoOCTSIM/atmel_start_config.atstart M sysmoOCTSIM/hpl/dmac/hpl_dmac.c 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/88/13688/1 diff --git a/sysmoOCTSIM/atmel_start_config.atstart b/sysmoOCTSIM/atmel_start_config.atstart index f40c43a..4fda2f8 100644 --- a/sysmoOCTSIM/atmel_start_config.atstart +++ b/sysmoOCTSIM/atmel_start_config.atstart @@ -4,7 +4,7 @@ api: '1.0' backend: 1.5.122 commit: 820baecf7dd115d94b0d42ee3b0b9d6ba2da7113 - content: 1.0.1405 + content: 1.0.1465 content_pack_name: acme-packs-all format: '2' frontend: 1.5.1826 diff --git a/sysmoOCTSIM/hpl/dmac/hpl_dmac.c b/sysmoOCTSIM/hpl/dmac/hpl_dmac.c index 27021dd..b08448b 100644 --- a/sysmoOCTSIM/hpl/dmac/hpl_dmac.c +++ b/sysmoOCTSIM/hpl/dmac/hpl_dmac.c @@ -108,6 +108,7 @@ hri_dmac_write_CHPRILVL_reg(DMAC, i, _cfgs[i].prilvl); hri_dmac_write_CHEVCTRL_reg(DMAC, i, _cfgs[i].evctrl); hri_dmacdescriptor_write_BTCTRL_reg(&_descriptor_section[i], _cfgs[i].btctrl); + hri_dmacdescriptor_write_DESCADDR_reg(&_descriptor_section[i], 0x0); } for (i = 0; i < 5; i++) { -- To view, visit https://gerrit.osmocom.org/13688 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I828e87c7ededbb50a999d672cf0b738eef9a093a Gerrit-Change-Number: 13688 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 07:11:43 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 07:11:43 +0000 Subject: Change in docker-playground[master]: Use ftp.debian.org as a "blind workaround" for trouble with ftp.de Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13689 Change subject: Use ftp.debian.org as a "blind workaround" for trouble with ftp.de ...................................................................... Use ftp.debian.org as a "blind workaround" for trouble with ftp.de We get a lot of build failures recently like this: Step 3/4 : ADD http://ftp.de.debian.org/debian/dists/stretch/Release /tmp/Release ADD failed: Get http://ftp.de.debian.org/debian/dists/stretch/Release: dial tcp 141.76.2.4:80: i/o timeout ../make/Makefile:44: recipe for target 'docker-build' failed make: *** [docker-build] Error 1 make: Leaving directory ' + exit 1 Let's hope that this works around the connectivity problems with ftp.de.debian.org Change-Id: I5a0eb058d95372c44fce042de90c4127a3021a93 --- M debian-jessie-build/Dockerfile M debian-stretch-build/Dockerfile 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/89/13689/1 diff --git a/debian-jessie-build/Dockerfile b/debian-jessie-build/Dockerfile index 39653d2..29daff6 100644 --- a/debian-jessie-build/Dockerfile +++ b/debian-jessie-build/Dockerfile @@ -2,7 +2,7 @@ MAINTAINER Harald Welte -ADD http://ftp.de.debian.org/debian/dists/jessie/Release /tmp/Release +ADD http://ftp.debian.org/debian/dists/jessie/Release /tmp/Release RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y --no-install-recommends \ diff --git a/debian-stretch-build/Dockerfile b/debian-stretch-build/Dockerfile index d4dcc39..e262d86 100644 --- a/debian-stretch-build/Dockerfile +++ b/debian-stretch-build/Dockerfile @@ -2,7 +2,7 @@ MAINTAINER Harald Welte -ADD http://ftp.de.debian.org/debian/dists/stretch/Release /tmp/Release +ADD http://ftp.debian.org/debian/dists/stretch/Release /tmp/Release RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y --no-install-recommends \ -- To view, visit https://gerrit.osmocom.org/13689 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5a0eb058d95372c44fce042de90c4127a3021a93 Gerrit-Change-Number: 13689 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 07:12:01 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 07:12:01 +0000 Subject: Change in docker-playground[master]: Use ftp.debian.org as a "blind workaround" for trouble with ftp.de In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13689 ) Change subject: Use ftp.debian.org as a "blind workaround" for trouble with ftp.de ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13689 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5a0eb058d95372c44fce042de90c4127a3021a93 Gerrit-Change-Number: 13689 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Wed, 17 Apr 2019 07:12:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 07:12:02 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 07:12:02 +0000 Subject: Change in docker-playground[master]: Use ftp.debian.org as a "blind workaround" for trouble with ftp.de In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13689 ) Change subject: Use ftp.debian.org as a "blind workaround" for trouble with ftp.de ...................................................................... Use ftp.debian.org as a "blind workaround" for trouble with ftp.de We get a lot of build failures recently like this: Step 3/4 : ADD http://ftp.de.debian.org/debian/dists/stretch/Release /tmp/Release ADD failed: Get http://ftp.de.debian.org/debian/dists/stretch/Release: dial tcp 141.76.2.4:80: i/o timeout ../make/Makefile:44: recipe for target 'docker-build' failed make: *** [docker-build] Error 1 make: Leaving directory ' + exit 1 Let's hope that this works around the connectivity problems with ftp.de.debian.org Change-Id: I5a0eb058d95372c44fce042de90c4127a3021a93 --- M debian-jessie-build/Dockerfile M debian-stretch-build/Dockerfile 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/debian-jessie-build/Dockerfile b/debian-jessie-build/Dockerfile index 39653d2..29daff6 100644 --- a/debian-jessie-build/Dockerfile +++ b/debian-jessie-build/Dockerfile @@ -2,7 +2,7 @@ MAINTAINER Harald Welte -ADD http://ftp.de.debian.org/debian/dists/jessie/Release /tmp/Release +ADD http://ftp.debian.org/debian/dists/jessie/Release /tmp/Release RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y --no-install-recommends \ diff --git a/debian-stretch-build/Dockerfile b/debian-stretch-build/Dockerfile index d4dcc39..e262d86 100644 --- a/debian-stretch-build/Dockerfile +++ b/debian-stretch-build/Dockerfile @@ -2,7 +2,7 @@ MAINTAINER Harald Welte -ADD http://ftp.de.debian.org/debian/dists/stretch/Release /tmp/Release +ADD http://ftp.debian.org/debian/dists/stretch/Release /tmp/Release RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y --no-install-recommends \ -- To view, visit https://gerrit.osmocom.org/13689 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5a0eb058d95372c44fce042de90c4127a3021a93 Gerrit-Change-Number: 13689 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:09:07 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:09:07 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: improve documentation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13683 ) Change subject: minor: improve documentation ...................................................................... Patch Set 2: Code-Review-1 this is no longer the case in master -- To view, visit https://gerrit.osmocom.org/13683 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I250209d45a57c5ad7d1265a68aa71fc31ec06f69 Gerrit-Change-Number: 13683 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 08:09:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:10:00 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:10:00 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: change variable type to remove compiler warning In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13684 ) Change subject: minor: change variable type to remove compiler warning ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13684/2/sysmoOCTSIM/command.c File sysmoOCTSIM/command.c: https://gerrit.osmocom.org/#/c/13684/2/sysmoOCTSIM/command.c at 81 PS2, Line 81: char c = getchar() this is odd, as in POSIX, getchar() is defined as returning an "int", not a "char". -- To view, visit https://gerrit.osmocom.org/13684 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8f537d6cbec820ad0406ec2ff0c9735759169fc0 Gerrit-Change-Number: 13684 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 17 Apr 2019 08:10:00 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:13:24 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 17 Apr 2019 08:13:24 +0000 Subject: Change in osmo-msc[master]: vlr_sgs_fsm: make sure vsub is marked used when LA is present Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13690 Change subject: vlr_sgs_fsm: make sure vsub is marked used when LA is present ...................................................................... vlr_sgs_fsm: make sure vsub is marked used when LA is present When the LU is accepted and the subscriber (vsub) is not claimed as "in use" in the ref counting system. - Make sure vlr_subscr_get() is called when the LU is accepted. Change-Id: Iba90be095569cc5212c61ab8e8a9bfd4ae51fd44 Related OS#3934 --- M src/libvlr/vlr_sgs_fsm.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/90/13690/1 diff --git a/src/libvlr/vlr_sgs_fsm.c b/src/libvlr/vlr_sgs_fsm.c index ee1d748..36e22b9 100644 --- a/src/libvlr/vlr_sgs_fsm.c +++ b/src/libvlr/vlr_sgs_fsm.c @@ -129,6 +129,7 @@ vsub->la_allowed = true; vsub->imsi_detached_flag = false; vsub->lu_complete = true; + vlr_subscr_get(vsub, VSUB_USE_ATTACHED); vlr_sgs_fsm_update_id(vsub); vsub->cs.attached_via_ran = OSMO_RAT_EUTRAN_SGS; -- To view, visit https://gerrit.osmocom.org/13690 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iba90be095569cc5212c61ab8e8a9bfd4ae51fd44 Gerrit-Change-Number: 13690 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:21:15 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:21:15 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: remove unnecessary hello world command In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#3) to the change originally created by K?vin Redon. ( https://gerrit.osmocom.org/13685 ) Change subject: minor: remove unnecessary hello world command ...................................................................... minor: remove unnecessary hello world command Change-Id: I414b2ddd0bacff692316fe212b9d3b506100a7ba --- M sysmoOCTSIM/main.c 1 file changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/85/13685/3 -- To view, visit https://gerrit.osmocom.org/13685 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I414b2ddd0bacff692316fe212b9d3b506100a7ba Gerrit-Change-Number: 13685 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:21:15 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:21:15 +0000 Subject: Change in osmo-ccid-firmware[master]: add ASFv4 M2M (memory-to-memory DMA) middleware In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#2) to the change originally created by K?vin Redon. ( https://gerrit.osmocom.org/13675 ) Change subject: add ASFv4 M2M (memory-to-memory DMA) middleware ...................................................................... add ASFv4 M2M (memory-to-memory DMA) middleware This is form Atmel Start and provides functionality for hardware-based DMA copies from memory to memory. Change-Id: Ib07755b2c5974af70817f5460fb0f358c631452a --- M sysmoOCTSIM/AtmelStart.gpdsc M sysmoOCTSIM/atmel_start.c M sysmoOCTSIM/atmel_start.h M sysmoOCTSIM/atmel_start_config.atstart M sysmoOCTSIM/config/hpl_dmac_config.h A sysmoOCTSIM/dma_m2m/dma_memory.c A sysmoOCTSIM/dma_m2m/dma_memory.h A sysmoOCTSIM/dma_m2m/dma_memory_config.h A sysmoOCTSIM/documentation/dma_m2m.rst M sysmoOCTSIM/gcc/Makefile 10 files changed, 359 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/75/13675/2 -- To view, visit https://gerrit.osmocom.org/13675 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib07755b2c5974af70817f5460fb0f358c631452a Gerrit-Change-Number: 13675 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:26:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:26:54 +0000 Subject: Change in osmo-ccid-firmware[master]: add ASFv4 M2M (memory-to-memory DMA) middleware In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#3) to the change originally created by K?vin Redon. ( https://gerrit.osmocom.org/13675 ) Change subject: add ASFv4 M2M (memory-to-memory DMA) middleware ...................................................................... add ASFv4 M2M (memory-to-memory DMA) middleware This is form Atmel Start and provides functionality for hardware-based DMA copies from memory to memory. Change-Id: Ib07755b2c5974af70817f5460fb0f358c631452a --- M sysmoOCTSIM/AtmelStart.gpdsc M sysmoOCTSIM/atmel_start.c M sysmoOCTSIM/atmel_start.h M sysmoOCTSIM/atmel_start_config.atstart M sysmoOCTSIM/config/hpl_dmac_config.h A sysmoOCTSIM/dma_m2m/dma_memory.c A sysmoOCTSIM/dma_m2m/dma_memory.h A sysmoOCTSIM/dma_m2m/dma_memory_config.h A sysmoOCTSIM/documentation/dma_m2m.rst M sysmoOCTSIM/gcc/Makefile 10 files changed, 356 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/75/13675/3 -- To view, visit https://gerrit.osmocom.org/13675 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib07755b2c5974af70817f5460fb0f358c631452a Gerrit-Change-Number: 13675 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:26:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:26:54 +0000 Subject: Change in osmo-ccid-firmware[master]: switch UART_debug to ASYNC In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#3) to the change originally created by K?vin Redon. ( https://gerrit.osmocom.org/13673 ) Change subject: switch UART_debug to ASYNC ...................................................................... switch UART_debug to ASYNC using the synchronous HAL library causes RX overflow after 5 bytes on bulk incoming data (e.g. pasted). this mainly due to printing synchronously the character, but to further prevent congestion we switch to asynchronous (e.g. interrupt driven) communication. The RX part works great now (no overflow), but the TX part is malfunctioning because the HAL Async library does not buffer the data to be transmitted and expects it to be in memory until the transmission is complete (which printf does not do). This change will not be reflected in Atmel START since it does not allow to set the underlying STDIO redirect peripheral to async. Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7 --- M sysmoOCTSIM/command.c M sysmoOCTSIM/driver_init.c M sysmoOCTSIM/driver_init.h M sysmoOCTSIM/examples/driver_examples.c M sysmoOCTSIM/hpl/sercom/hpl_sercom.c M sysmoOCTSIM/main.c M sysmoOCTSIM/stdio_start.c 7 files changed, 94 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/73/13673/3 -- To view, visit https://gerrit.osmocom.org/13673 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7 Gerrit-Change-Number: 13673 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:26:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:26:54 +0000 Subject: Change in osmo-ccid-firmware[master]: add sim-atr command In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#4) to the change originally created by K?vin Redon. ( https://gerrit.osmocom.org/13681 ) Change subject: add sim-atr command ...................................................................... add sim-atr command the sim-atr command resets the card and read the resulting answer to reset. Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee --- M sysmoOCTSIM/main.c 1 file changed, 88 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/81/13681/4 -- To view, visit https://gerrit.osmocom.org/13681 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee Gerrit-Change-Number: 13681 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:27:09 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:27:09 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: fix typo In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13682 ) Change subject: minor: fix typo ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13682 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I57c743250af19713e7438606bc1c737cfe0c383c Gerrit-Change-Number: 13682 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 08:27:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:27:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:27:12 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: remove unnecessary hello world command In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13685 ) Change subject: minor: remove unnecessary hello world command ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13685 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I414b2ddd0bacff692316fe212b9d3b506100a7ba Gerrit-Change-Number: 13685 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 08:27:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:28:22 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:28:22 +0000 Subject: Change in osmo-ccid-firmware[master]: add ASFv4 M2M (memory-to-memory DMA) middleware In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13675 ) Change subject: add ASFv4 M2M (memory-to-memory DMA) middleware ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13675 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib07755b2c5974af70817f5460fb0f358c631452a Gerrit-Change-Number: 13675 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 08:28:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:28:41 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:28:41 +0000 Subject: Change in osmo-ccid-firmware[master]: remove SWO pin initialisation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13674 ) Change subject: remove SWO pin initialisation ...................................................................... Patch Set 3: requires explanation in commitlog. -- To view, visit https://gerrit.osmocom.org/13674 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I199d6e356129526e65d5d1075a264eb35904d099 Gerrit-Change-Number: 13674 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 17 Apr 2019 08:28:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:31:19 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:31:19 +0000 Subject: Change in osmo-ccid-firmware[master]: add sim-atr command In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13681 ) Change subject: add sim-atr command ...................................................................... Patch Set 4: (3 comments) https://gerrit.osmocom.org/#/c/13681/4/sysmoOCTSIM/main.c File sysmoOCTSIM/main.c: https://gerrit.osmocom.org/#/c/13681/4/sysmoOCTSIM/main.c at 248 PS4, Line 248: settings.clkdiv = SIM_CLKDIV_8; : ncn8025_set(slotnr, &settings); : // set card voltage to 3.0 V (the most supported) : // note: according to ISO/IEC 7816-3:2006 no voltage should damage the card, and you should cycle from low to high : settings.vsel = SIM_VOLT_3V0; : ncn8025_set(slotnr, &settings); : // provide power (the NCN8025 should perform the activation according to spec) : // note: activation sequence is documented in ISO/IEC 7816-3:2006 section 6.2 : settings.cmdvcc = true; : ncn8025_set(slotnr, &settings); those could all be part of one ncn8025_set. I will test and update. https://gerrit.osmocom.org/#/c/13681/4/sysmoOCTSIM/main.c at 259 PS4, Line 259: 400 * 10000 / 2500 can that really safely be expressed in uint16_t arithmetic? delay_us uses a 16bit argument :/ https://gerrit.osmocom.org/#/c/13681/4/sysmoOCTSIM/main.c at 261 PS4, Line 261: settings.rstin = true; the logic of rstin has changed in master yesterday, I will update + test -- To view, visit https://gerrit.osmocom.org/13681 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee Gerrit-Change-Number: 13681 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 17 Apr 2019 08:31:19 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:39:25 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:39:25 +0000 Subject: Change in osmo-ccid-firmware[master]: add sim-atr command In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#5) to the change originally created by K?vin Redon. ( https://gerrit.osmocom.org/13681 ) Change subject: add sim-atr command ...................................................................... add sim-atr command the sim-atr command resets the card and read the resulting answer to reset. Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee --- M sysmoOCTSIM/main.c 1 file changed, 88 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/81/13681/5 -- To view, visit https://gerrit.osmocom.org/13681 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee Gerrit-Change-Number: 13681 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:40:14 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:40:14 +0000 Subject: Change in osmo-ccid-firmware[master]: add sim-atr command In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13681 ) Change subject: add sim-atr command ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13681 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee Gerrit-Change-Number: 13681 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 08:40:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:40:34 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:40:34 +0000 Subject: Change in osmo-ccid-firmware[master]: add sim-atr command In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13681 ) Change subject: add sim-atr command ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/13681/4/sysmoOCTSIM/main.c File sysmoOCTSIM/main.c: https://gerrit.osmocom.org/#/c/13681/4/sysmoOCTSIM/main.c at 261 PS4, Line 261: settings.rstin = true; > the logic of rstin has changed in master yesterday, I will update + test Done -- To view, visit https://gerrit.osmocom.org/13681 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee Gerrit-Change-Number: 13681 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 08:40:34 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:45:10 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:45:10 +0000 Subject: Change in osmo-ccid-firmware[master]: jenkins.sh: use PARALLEL_MAKE to accelerate build speed Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13691 Change subject: jenkins.sh: use PARALLEL_MAKE to accelerate build speed ...................................................................... jenkins.sh: use PARALLEL_MAKE to accelerate build speed Change-Id: Idb75e028d52803e3f8685d42c584f8f96613ec3c --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/91/13691/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 35edd37..b4ee280 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -9,5 +9,5 @@ cd $TOPDIR/sysmoOCTSIM cd gcc make clean -make +make $PARALLEL_MAKE make clean -- To view, visit https://gerrit.osmocom.org/13691 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Idb75e028d52803e3f8685d42c584f8f96613ec3c Gerrit-Change-Number: 13691 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:53:34 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:53:34 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: fix typo In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13682 ) Change subject: minor: fix typo ...................................................................... minor: fix typo Change-Id: I57c743250af19713e7438606bc1c737cfe0c383c --- M sysmoOCTSIM/hal/include/hal_usart_async.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sysmoOCTSIM/hal/include/hal_usart_async.h b/sysmoOCTSIM/hal/include/hal_usart_async.h index 3a6de39..c883823 100644 --- a/sysmoOCTSIM/hal/include/hal_usart_async.h +++ b/sysmoOCTSIM/hal/include/hal_usart_async.h @@ -82,7 +82,7 @@ uint32_t flags; /** Number of characters transmitted */ uint16_t txcnt; - /** Number of characters receviced */ + /** Number of characters received */ uint16_t rxcnt; }; -- To view, visit https://gerrit.osmocom.org/13682 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I57c743250af19713e7438606bc1c737cfe0c383c Gerrit-Change-Number: 13682 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:53:35 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:53:35 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: remove unnecessary hello world command In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13685 ) Change subject: minor: remove unnecessary hello world command ...................................................................... minor: remove unnecessary hello world command Change-Id: I414b2ddd0bacff692316fe212b9d3b506100a7ba --- M sysmoOCTSIM/main.c 1 file changed, 0 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index 6c4e9e6..369e3ef 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -50,12 +50,6 @@ hri_port_set_PINCFG_DRVSTR_bit(PORT, 0, 11); } -DEFUN(hello_fn, cmd_hello, - "hello", "Hello World example command") -{ - printf("Hello World!\r\n"); -} - static int validate_slotnr(int argc, char **argv, int idx) { int slotnr; @@ -223,7 +217,6 @@ board_init(); command_init("sysmoOCTSIM> "); - command_register(&cmd_hello); command_register(&cmd_sim_status); command_register(&cmd_sim_power); command_register(&cmd_sim_reset); -- To view, visit https://gerrit.osmocom.org/13685 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I414b2ddd0bacff692316fe212b9d3b506100a7ba Gerrit-Change-Number: 13685 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:53:35 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:53:35 +0000 Subject: Change in osmo-ccid-firmware[master]: add ASFv4 M2M (memory-to-memory DMA) middleware In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13675 ) Change subject: add ASFv4 M2M (memory-to-memory DMA) middleware ...................................................................... add ASFv4 M2M (memory-to-memory DMA) middleware This is form Atmel Start and provides functionality for hardware-based DMA copies from memory to memory. Change-Id: Ib07755b2c5974af70817f5460fb0f358c631452a --- M sysmoOCTSIM/AtmelStart.gpdsc M sysmoOCTSIM/atmel_start.c M sysmoOCTSIM/atmel_start.h M sysmoOCTSIM/atmel_start_config.atstart M sysmoOCTSIM/config/hpl_dmac_config.h A sysmoOCTSIM/dma_m2m/dma_memory.c A sysmoOCTSIM/dma_m2m/dma_memory.h A sysmoOCTSIM/dma_m2m/dma_memory_config.h A sysmoOCTSIM/documentation/dma_m2m.rst M sysmoOCTSIM/gcc/Makefile 10 files changed, 356 insertions(+), 16 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sysmoOCTSIM/AtmelStart.gpdsc b/sysmoOCTSIM/AtmelStart.gpdsc index 5d35944..05dcb15 100644 --- a/sysmoOCTSIM/AtmelStart.gpdsc +++ b/sysmoOCTSIM/AtmelStart.gpdsc @@ -164,6 +164,9 @@ + + + @@ -210,6 +213,8 @@ + + @@ -225,6 +230,7 @@ + @@ -251,6 +257,8 @@ + + diff --git a/sysmoOCTSIM/atmel_start.c b/sysmoOCTSIM/atmel_start.c index fc6016a..fd566dd 100644 --- a/sysmoOCTSIM/atmel_start.c +++ b/sysmoOCTSIM/atmel_start.c @@ -1,5 +1,11 @@ #include +/** Memory to memory DMA callback */ +static void M2M_DMA_complete_cb(void) +{ + dma_m2m_complete_flag = true; +} + /** * Initializes MCU, drivers and middleware in the project **/ @@ -7,5 +13,7 @@ { system_init(); usb_init(); + dma_memory_init(); + dma_memory_register_callback(DMA_MEMORY_COMPLETE_CB, M2M_DMA_complete_cb); stdio_redirect_init(); } diff --git a/sysmoOCTSIM/atmel_start.h b/sysmoOCTSIM/atmel_start.h index 92afa47..4892cbd 100644 --- a/sysmoOCTSIM/atmel_start.h +++ b/sysmoOCTSIM/atmel_start.h @@ -5,10 +5,15 @@ extern "C" { #endif +#include + #include "driver_init.h" #include "usb_start.h" #include "stdio_start.h" +/** flag set when the memory to memory DMA is complete */ +volatile bool dma_m2m_complete_flag; + /** * Initializes MCU, drivers and middleware in the project **/ diff --git a/sysmoOCTSIM/atmel_start_config.atstart b/sysmoOCTSIM/atmel_start_config.atstart index 290fa89..51ec4f4 100644 --- a/sysmoOCTSIM/atmel_start_config.atstart +++ b/sysmoOCTSIM/atmel_start_config.atstart @@ -82,6 +82,15 @@ dependencies: USB Device Stack Core Instance: USB_DEVICE_STACK_CORE_INSTANCE USB Class CDC: USB_CLASS_CDC + M2M_DMA_0: + user_label: M2M_DMA_0 + configuration: + conf_channel: 0 + definition: Atmel:MEMORY_DMA:0.0.1::M2M_DMA + functionality: M2M_DMA + api: DMA:M2M:Core + dependencies: + DMAC: DMAC STDIO_REDIRECT_0: user_label: STDIO_REDIRECT_0 configuration: {} @@ -209,7 +218,7 @@ the transaction dmac_blockact_9: Channel will be disabled if it is the last block transfer in the transaction - dmac_channel_0_settings: false + dmac_channel_0_settings: true dmac_channel_10_settings: false dmac_channel_11_settings: false dmac_channel_12_settings: false @@ -242,7 +251,7 @@ dmac_channel_8_settings: false dmac_channel_9_settings: false dmac_dbgrun: false - dmac_dstinc_0: false + dmac_dstinc_0: true dmac_dstinc_1: false dmac_dstinc_10: false dmac_dstinc_11: false @@ -274,7 +283,7 @@ dmac_dstinc_7: false dmac_dstinc_8: false dmac_dstinc_9: false - dmac_enable: false + dmac_enable: true dmac_evact_0: No action dmac_evact_1: No action dmac_evact_10: No action @@ -479,7 +488,7 @@ dmac_runstdby_7: false dmac_runstdby_8: false dmac_runstdby_9: false - dmac_srcinc_0: false + dmac_srcinc_0: true dmac_srcinc_1: false dmac_srcinc_10: false dmac_srcinc_11: false diff --git a/sysmoOCTSIM/config/hpl_dmac_config.h b/sysmoOCTSIM/config/hpl_dmac_config.h index 90499fc..c736778 100644 --- a/sysmoOCTSIM/config/hpl_dmac_config.h +++ b/sysmoOCTSIM/config/hpl_dmac_config.h @@ -8,7 +8,7 @@ // Indicates whether dmac is enabled or not // dmac_enable #ifndef CONF_DMAC_ENABLE -#define CONF_DMAC_ENABLE 0 +#define CONF_DMAC_ENABLE 1 #endif // Priority Level 0 @@ -105,7 +105,7 @@ // Channel 0 settings // dmac_channel_0_settings #ifndef CONF_DMAC_CHANNEL_0_SETTINGS -#define CONF_DMAC_CHANNEL_0_SETTINGS 0 +#define CONF_DMAC_CHANNEL_0_SETTINGS 1 #endif // Channel Run in Standby @@ -284,14 +284,14 @@ // Indicates whether the source address incrementation is enabled or not // dmac_srcinc_0 #ifndef CONF_DMAC_SRCINC_0 -#define CONF_DMAC_SRCINC_0 0 +#define CONF_DMAC_SRCINC_0 1 #endif // Destination Address Increment // Indicates whether the destination address incrementation is enabled or not // dmac_dstinc_0 #ifndef CONF_DMAC_DSTINC_0 -#define CONF_DMAC_DSTINC_0 0 +#define CONF_DMAC_DSTINC_0 1 #endif // Beat Size diff --git a/sysmoOCTSIM/dma_m2m/dma_memory.c b/sysmoOCTSIM/dma_m2m/dma_memory.c new file mode 100644 index 0000000..f395114 --- /dev/null +++ b/sysmoOCTSIM/dma_m2m/dma_memory.c @@ -0,0 +1,143 @@ +/** + * \file + * + * \brief Memory with DMA functionality implementation. + * + * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries. + * + * \asf_license_start + * + * \page License + * + * Subject to your compliance with these terms, you may use Microchip + * software and any derivatives exclusively with Microchip products. + * It is your responsibility to comply with third party license terms applicable + * to your use of third party software (including open source software) that + * may accompany Microchip software. + * + * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, + * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, + * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE + * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL + * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE + * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE + * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT + * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY + * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, + * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. + * + * \asf_license_stop + * + */ + +#include "dma_memory.h" +#include "dma_memory_config.h" +#include +#include +#include + +/** + * \brief Driver version + */ +#define DRIVER_VERSION 0x00000001u + +/** + * \brief memory with dma descriptor instance + */ +static struct dma_memory_descriptor descr; + +/** + * \internal Process transfer done interrupts + * + * \param[in] resource The pointer to memory resource + */ +static void dma_transfer_done(struct _dma_resource *resource) +{ + (void)resource; + if (descr.memory_cb.complete) { + descr.memory_cb.complete(); + } +} + +/** + * \internal Process transfer error interrupts + * + * \param[in] resource The pointer to memory resource + */ +static void dma_memory_error(struct _dma_resource *resource) +{ + (void)resource; + if (descr.memory_cb.error) { + descr.memory_cb.error(); + } +} + +/** + * \brief Initialize DMA + */ +int32_t dma_memory_init(void) +{ + _dma_get_channel_resource(&descr.resource, CONF_DMA_MEMORY_CHANNEL); + descr.resource->dma_cb.transfer_done = dma_transfer_done; + descr.resource->dma_cb.error = dma_memory_error; + + return ERR_NONE; +} + +/** + * \brief Register DMA callback + */ +int32_t dma_memory_register_callback(const enum dma_memory_callback_type type, dma_memory_cb_t cb) +{ + switch (type) { + case DMA_MEMORY_COMPLETE_CB: + descr.memory_cb.complete = cb; + break; + + case DMA_MEMORY_ERROR_CB: + descr.memory_cb.error = cb; + break; + + default: + return ERR_INVALID_ARG; + } + + _dma_set_irq_state(CONF_DMA_MEMORY_CHANNEL, (enum _dma_callback_type)type, (cb != NULL)); + + return ERR_NONE; +} + +/** + * \brief Memory copy with dma + */ +int32_t dma_memcpy(void *dst, void *src, uint32_t size) +{ + _dma_srcinc_enable(CONF_DMA_MEMORY_CHANNEL, true); + _dma_dstinc_enable(CONF_DMA_MEMORY_CHANNEL, true); + _dma_set_destination_address(CONF_DMA_MEMORY_CHANNEL, dst); + _dma_set_source_address(CONF_DMA_MEMORY_CHANNEL, src); + _dma_set_data_amount(CONF_DMA_MEMORY_CHANNEL, size); + _dma_enable_transaction(CONF_DMA_MEMORY_CHANNEL, true); + + return ERR_NONE; +} + +/** + * \brief Memory set with dma + */ +int32_t dma_memset(void *dst, int32_t ch, uint32_t size) +{ + static int32_t tmp_ch; + + tmp_ch = ch; + + _dma_set_source_address(CONF_DMA_MEMORY_CHANNEL, &tmp_ch); + _dma_srcinc_enable(CONF_DMA_MEMORY_CHANNEL, false); + _dma_dstinc_enable(CONF_DMA_MEMORY_CHANNEL, true); + _dma_set_destination_address(CONF_DMA_MEMORY_CHANNEL, dst); + _dma_set_data_amount(CONF_DMA_MEMORY_CHANNEL, size); + _dma_enable_transaction(CONF_DMA_MEMORY_CHANNEL, true); + + return ERR_NONE; +} diff --git a/sysmoOCTSIM/dma_m2m/dma_memory.h b/sysmoOCTSIM/dma_m2m/dma_memory.h new file mode 100644 index 0000000..3bd6dc9 --- /dev/null +++ b/sysmoOCTSIM/dma_m2m/dma_memory.h @@ -0,0 +1,132 @@ +/** + * \file + * + * \brief Memory with DMA functionality declaration. + * + * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries. + * + * \asf_license_start + * + * \page License + * + * Subject to your compliance with these terms, you may use Microchip + * software and any derivatives exclusively with Microchip products. + * It is your responsibility to comply with third party license terms applicable + * to your use of third party software (including open source software) that + * may accompany Microchip software. + * + * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, + * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, + * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE + * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL + * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE + * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE + * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT + * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY + * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, + * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. + * + * \asf_license_stop + * + */ + +#ifndef DMA_MEMORY_H_INCLUDED +#define DMA_MEMORY_H_INCLUDED + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \addtogroup dma_memory + * + * \section dma_rev Revision History + * - v0.0.0.1 Initial Commit + * + *@{ + */ + +/** + * \brief Memory with DMA descriptor + * + * The Memory with DMA descriptor forward declaration. + */ +struct dma_memory_descriptor; + +/** + * \brief memory with dma callback type + */ +typedef void (*dma_memory_cb_t)(void); + +/** + * \brief Memory with DMA callback types + */ +enum dma_memory_callback_type { DMA_MEMORY_COMPLETE_CB, DMA_MEMORY_ERROR_CB }; + +/** + * \brief Memory with DMA callbacks + */ +struct dma_memory_callbacks { + dma_memory_cb_t complete; + dma_memory_cb_t error; +}; + +/** + * \brief Memory with DMA descriptor + */ +struct dma_memory_descriptor { + struct _dma_resource * resource; + struct dma_memory_callbacks memory_cb; +}; + +/** + * \brief Initialize Memory with DMA + * + * \return Initialization status. + */ +int32_t dma_memory_init(void); + +/** + * \brief Register Memory with DMA callback + * + * \param[in] type Callback type + * \param[in] cb A callback function, passing NULL de-registers callback + * + * \return The status of callback assignment. + * \retval ERR_INVALID_ARG Passed parameters were invalid + * \retval ERR_NONE A callback is registered successfully + */ +int32_t dma_memory_register_callback(const enum dma_memory_callback_type type, dma_memory_cb_t cb); + +/** + * \brief dma memory copy + * + * \param[in] dst The pointer to destination address for transfer + * \param[in] src The pointer to source address for transfer + * \param[in] size The transfer size + * + * \return the status of operation` + */ +int32_t dma_memcpy(void *dst, void *src, uint32_t size); + +/** + * \brief dma memory set + * + * \param[in] dst The pointer to address to fill + * \param[in] ch The value to be filled + * \param[in] size Number of bytes to set to the value + * + * \return the status of operation + */ +int32_t dma_memset(void *dst, int32_t ch, uint32_t size); + +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* DMA_MEMORY_H_INCLUDED */ diff --git a/sysmoOCTSIM/dma_m2m/dma_memory_config.h b/sysmoOCTSIM/dma_m2m/dma_memory_config.h new file mode 100644 index 0000000..a5dba3c --- /dev/null +++ b/sysmoOCTSIM/dma_m2m/dma_memory_config.h @@ -0,0 +1,16 @@ +/* Auto-generated config file dma_memory_config.h */ +#ifndef DMA_MEMORY_CONFIG_H +#define DMA_MEMORY_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Channel <0-15> +// This defines DMA channel to be used +// conf_channel +#ifndef CONF_DMA_MEMORY_CHANNEL +#define CONF_DMA_MEMORY_CHANNEL 0 +#endif + +// <<< end of configuration section >>> + +#endif // DMA_MEMORY_CONFIG_H diff --git a/sysmoOCTSIM/documentation/dma_m2m.rst b/sysmoOCTSIM/documentation/dma_m2m.rst new file mode 100644 index 0000000..22bffcf --- /dev/null +++ b/sysmoOCTSIM/documentation/dma_m2m.rst @@ -0,0 +1,15 @@ +Memory DMA +========== + +Memory DMA is middleware which provides DMA-based versions of memcpy and memset +functions. + +Architecture and provided functionality +--------------------------------------- + +Memory DMA uses system DMA driver which varies depending on MCU. User must configure +system DMA driver before using Memory DMA middleware. + +DMA-based versions of memcpy and memset functions work asynchronously. Application +can be notifications about completion of copy or set operation via callbacks. +A callback can be registered via dma_memory_register_callback function. \ No newline at end of file diff --git a/sysmoOCTSIM/gcc/Makefile b/sysmoOCTSIM/gcc/Makefile index 376ddaf..1a473b9 100644 --- a/sysmoOCTSIM/gcc/Makefile +++ b/sysmoOCTSIM/gcc/Makefile @@ -39,6 +39,7 @@ stdio_redirect \ hal/utils/src \ hpl/usb \ +dma_m2m \ hpl/pm \ hpl/cmcc \ hpl/gclk \ @@ -54,12 +55,13 @@ stdio_redirect/stdio_io.o \ stdio_redirect/gcc/write.o \ hpl/core/hpl_core_m4.o \ +hal/src/hal_cache.o \ usb/class/cdc/device/cdcdf_acm.o \ hal/utils/src/utils_syscalls.o \ stdio_redirect/gcc/read.o \ -usb_start.o \ gcc/system_same54.o \ hpl/usb/hpl_usb.o \ +dma_m2m/dma_memory.o \ hal/src/hal_delay.o \ hpl/pm/hpl_pm.o \ hpl/core/hpl_init.o \ @@ -91,7 +93,7 @@ hal/src/hal_gpio.o \ hal/utils/src/utils_event.o \ hal/src/hal_sleep.o \ -hal/src/hal_cache.o \ +usb_start.o \ hpl/cmcc/hpl_cmcc.o \ atmel_start.o \ usb/device/usbdc.o \ @@ -102,12 +104,13 @@ "stdio_redirect/stdio_io.o" \ "stdio_redirect/gcc/write.o" \ "hpl/core/hpl_core_m4.o" \ +"hal/src/hal_cache.o" \ "usb/class/cdc/device/cdcdf_acm.o" \ "hal/utils/src/utils_syscalls.o" \ "stdio_redirect/gcc/read.o" \ -"usb_start.o" \ "gcc/system_same54.o" \ "hpl/usb/hpl_usb.o" \ +"dma_m2m/dma_memory.o" \ "hal/src/hal_delay.o" \ "hpl/pm/hpl_pm.o" \ "hpl/core/hpl_init.o" \ @@ -139,7 +142,7 @@ "hal/src/hal_gpio.o" \ "hal/utils/src/utils_event.o" \ "hal/src/hal_sleep.o" \ -"hal/src/hal_cache.o" \ +"usb_start.o" \ "hpl/cmcc/hpl_cmcc.o" \ "atmel_start.o" \ "usb/device/usbdc.o" \ @@ -149,6 +152,7 @@ DEPS := $(OBJS:%.o=%.d) DEPS_AS_ARGS += \ +"dma_m2m/dma_memory.d" \ "stdio_redirect/stdio_io.d" \ "hal/utils/src/utils_event.d" \ "hal/src/hal_io.d" \ @@ -241,7 +245,7 @@ @echo ARM/GNU C Compiler $(QUOTE)arm-none-eabi-gcc$(QUOTE) -x c -mthumb -DDEBUG -Os -ffunction-sections -mlong-calls -g3 -Wall -c -std=gnu99 \ -D__SAME54N19A__ -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../CMSIS/Include" -I"../include" \ +-I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< @@ -250,7 +254,7 @@ @echo ARM/GNU Assembler $(QUOTE)arm-none-eabi-as$(QUOTE) -x c -mthumb -DDEBUG -Os -ffunction-sections -mlong-calls -g3 -Wall -c -std=gnu99 \ -D__SAME54N19A__ -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../CMSIS/Include" -I"../include" \ +-I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< @@ -259,7 +263,7 @@ @echo ARM/GNU Preprocessing Assembler $(QUOTE)arm-none-eabi-gcc$(QUOTE) -x c -mthumb -DDEBUG -Os -ffunction-sections -mlong-calls -g3 -Wall -c -std=gnu99 \ -D__SAME54N19A__ -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../CMSIS/Include" -I"../include" \ +-I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< @@ -279,4 +283,4 @@ rm -f $(DEPS_AS_ARGS) rm -f $(OUTPUT_FILE_NAME).a $(OUTPUT_FILE_NAME).hex $(OUTPUT_FILE_NAME).bin \ $(OUTPUT_FILE_NAME).lss $(OUTPUT_FILE_NAME).eep $(OUTPUT_FILE_NAME).map \ - $(OUTPUT_FILE_NAME).srec \ No newline at end of file + $(OUTPUT_FILE_NAME).srec -- To view, visit https://gerrit.osmocom.org/13675 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib07755b2c5974af70817f5460fb0f358c631452a Gerrit-Change-Number: 13675 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:54:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:54:13 +0000 Subject: Change in osmo-ccid-firmware[master]: update ASFv4 library to 1.0.1465 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13688 ) Change subject: update ASFv4 library to 1.0.1465 ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13688 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I828e87c7ededbb50a999d672cf0b738eef9a093a Gerrit-Change-Number: 13688 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 08:54:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:54:14 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:54:14 +0000 Subject: Change in osmo-ccid-firmware[master]: update CMSIS to 5.1.2 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13687 ) Change subject: update CMSIS to 5.1.2 ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13687 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib9b00107836c1604c7169d69ba607fead8c55355 Gerrit-Change-Number: 13687 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 08:54:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:54:17 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:54:17 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: update atmel start project configuration In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13686 ) Change subject: minor: update atmel start project configuration ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13686 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8e719f1687befb9a3657a2e582165dec3cd00094 Gerrit-Change-Number: 13686 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 08:54:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:55:05 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:55:05 +0000 Subject: Change in osmo-msc[master]: vlr_sgs_fsm: make sure vsub is marked used when LA is present In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13690 ) Change subject: vlr_sgs_fsm: make sure vsub is marked used when LA is present ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13690 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iba90be095569cc5212c61ab8e8a9bfd4ae51fd44 Gerrit-Change-Number: 13690 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Assignee: Pau Espin Pedrol Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 17 Apr 2019 08:55:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:55:44 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:55:44 +0000 Subject: Change in osmo-mgw[master]: mgcp-client: whitespace cleanup in mgcp_client.c In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13664 ) Change subject: mgcp-client: whitespace cleanup in mgcp_client.c ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13664 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic3495d70cb9c4e12552c6d97481cc0cf04b79f94 Gerrit-Change-Number: 13664 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 17 Apr 2019 08:55:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:55:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:55:45 +0000 Subject: Change in osmo-mgw[master]: mgcp-client: whitespace cleanup in mgcp_client.c In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13664 ) Change subject: mgcp-client: whitespace cleanup in mgcp_client.c ...................................................................... mgcp-client: whitespace cleanup in mgcp_client.c Change-Id: Ic3495d70cb9c4e12552c6d97481cc0cf04b79f94 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 10 insertions(+), 10 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, approved Harald Welte: Looks good to me, approved diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 88e5dab..17f40b9 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -323,8 +323,8 @@ unsigned int pt; char codec_resp[64]; unsigned int codec; - - + + if (strstr(line, "ptime")) { if (sscanf(line, "a=ptime:%u", &r->ptime) != 1) goto response_parse_failure_ptime; @@ -353,17 +353,17 @@ } else goto response_parse_failure_rtpmap; } - + return 0; response_parse_failure_ptime: LOGP(DLMGCP, LOGL_ERROR, "Failed to parse SDP parameter, invalid ptime (%s)\n", line); - return -EINVAL; + return -EINVAL; response_parse_failure_rtpmap: LOGP(DLMGCP, LOGL_ERROR, "Failed to parse SDP parameter, invalid rtpmap (%s)\n", line); - return -EINVAL; + return -EINVAL; } /* Parse a line like "c=IN IP4 10.11.12.13" */ @@ -533,7 +533,7 @@ /* If there is an SDP body attached, prevent for_each_non_empty_line() * into running in there, we are not yet interested in the parameters * stored there. */ - data_end = mgcp_find_section_end(data); + data_end = mgcp_find_section_end(data); if (data_end) *data_end = '\0'; @@ -979,7 +979,7 @@ for (i = 0; i < mgcp_msg->codecs_len; i++) { pt = mgcp_msg->codecs[i]; codec = get_value_string_or_null(osmo_mgcpc_codec_names, pt); - + /* Note: Use codec descriptors from enum mgcp_codecs * in mgcp_client only! */ OSMO_ASSERT(codec); @@ -1067,7 +1067,7 @@ for (i = 0; i < mgcp_msg->codecs_len; i++) { pt = map_codec_to_pt(mgcp_msg->ptmap, mgcp_msg->ptmap_len, mgcp_msg->codecs[i]); - + /* Note: Only dynamic payload type from the range 96-127 * require to be explained further via rtpmap. All others * are implcitly definedby the number in m=audio */ @@ -1077,11 +1077,11 @@ /* Note: Use codec descriptors from enum mgcp_codecs * in mgcp_client only! */ OSMO_ASSERT(codec); - + rc += msgb_printf(msg, "a=rtpmap:%u %s\r\n", pt, codec); } } - + if (mgcp_msg->ptime) rc += msgb_printf(msg, "a=ptime:%u\r\n", mgcp_msg->ptime); -- To view, visit https://gerrit.osmocom.org/13664 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic3495d70cb9c4e12552c6d97481cc0cf04b79f94 Gerrit-Change-Number: 13664 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:56:32 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:56:32 +0000 Subject: Change in osmo-mgw[master]: mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13665 ) Change subject: mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13665 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I46e05a7a3432733976760bbf1c5deb4f7610db11 Gerrit-Change-Number: 13665 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 17 Apr 2019 08:56:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:56:46 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:56:46 +0000 Subject: Change in osmo-trx[master]: use BSC_FD_READ and not OSMO_FD_READ In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13659 ) Change subject: use BSC_FD_READ and not OSMO_FD_READ ...................................................................... use BSC_FD_READ and not OSMO_FD_READ We haven't even released any tagged version of libosmocore yet which includes support for the renamed OSMO_FD_READ constant. Let's avoid any breakage and use the new constants only with considerable delay, at the very least only when released libosmocore versions provide it. Change-Id: Idb57077b2a4b2a71dd5d75a24ded8bb5887da188 --- M Transceiver52M/osmo-trx.cpp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 7489e7c..8c592aa 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -236,7 +236,7 @@ exit(EXIT_FAILURE); } - osmo_fd_setup(&signal_ofd, sfd, OSMO_FD_READ, signalfd_callback, NULL, 0); + osmo_fd_setup(&signal_ofd, sfd, BSC_FD_READ, signalfd_callback, NULL, 0); if (osmo_fd_register(&signal_ofd) < 0) { fprintf(stderr, "osmo_fd_register() failed.\n"); exit(EXIT_FAILURE); -- To view, visit https://gerrit.osmocom.org/13659 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Idb57077b2a4b2a71dd5d75a24ded8bb5887da188 Gerrit-Change-Number: 13659 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:56:52 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:56:52 +0000 Subject: Change in osmo-trx[master]: use BSC_FD_READ and not OSMO_FD_READ In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13659 ) Change subject: use BSC_FD_READ and not OSMO_FD_READ ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13659 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idb57077b2a4b2a71dd5d75a24ded8bb5887da188 Gerrit-Change-Number: 13659 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 17 Apr 2019 08:56:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:57:34 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:57:34 +0000 Subject: Change in osmo-bts[master]: pcu_sock: use %zu conversion specifier for printing sizeof() result In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13267 ) Change subject: pcu_sock: use %zu conversion specifier for printing sizeof() result ...................................................................... pcu_sock: use %zu conversion specifier for printing sizeof() result When using %lu and sizeof() for printing the compiler may throw a warning. Lets prevent this by using %zu instead of %lu as conversion specifier. Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709 --- M src/common/pcu_sock.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Vadim Yanitskiy: Looks good to me, approved Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index d496a49..31097ba 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -799,7 +799,7 @@ if (rc < sizeof(*pcu_prim)) { LOGP(DPCU, LOGL_ERROR, "Received %d bytes on PCU Socket, but primitive size " - "is %lu, discarding\n", rc, sizeof(*pcu_prim)); + "is %zu, discarding\n", rc, sizeof(*pcu_prim)); msgb_free(msg); return 0; } -- To view, visit https://gerrit.osmocom.org/13267 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709 Gerrit-Change-Number: 13267 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:57:33 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:57:33 +0000 Subject: Change in osmo-bts[master]: pcu_sock: use %zu conversion specifier for printing sizeof() result In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13267 ) Change subject: pcu_sock: use %zu conversion specifier for printing sizeof() result ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13267 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709 Gerrit-Change-Number: 13267 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-Comment-Date: Wed, 17 Apr 2019 08:57:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:58:18 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:58:18 +0000 Subject: Change in osmo-ccid-firmware[master]: jenkins.sh: use PARALLEL_MAKE to accelerate build speed In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13691 ) Change subject: jenkins.sh: use PARALLEL_MAKE to accelerate build speed ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13691 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idb75e028d52803e3f8685d42c584f8f96613ec3c Gerrit-Change-Number: 13691 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 08:58:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 08:58:42 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 08:58:42 +0000 Subject: Change in osmo-ccid-firmware[master]: jenkins.sh: use PARALLEL_MAKE to accelerate build speed In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13691 ) Change subject: jenkins.sh: use PARALLEL_MAKE to accelerate build speed ...................................................................... Patch Set 1: fyi, gerrit build verification time is now 10s (from at least 30s before). -- To view, visit https://gerrit.osmocom.org/13691 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idb75e028d52803e3f8685d42c584f8f96613ec3c Gerrit-Change-Number: 13691 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 08:58:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:06:07 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 09:06:07 +0000 Subject: Change in osmo-ccid-firmware[master]: jenkins.sh: use PARALLEL_MAKE to accelerate build speed In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13691 ) Change subject: jenkins.sh: use PARALLEL_MAKE to accelerate build speed ...................................................................... jenkins.sh: use PARALLEL_MAKE to accelerate build speed Change-Id: Idb75e028d52803e3f8685d42c584f8f96613ec3c --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 35edd37..b4ee280 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -9,5 +9,5 @@ cd $TOPDIR/sysmoOCTSIM cd gcc make clean -make +make $PARALLEL_MAKE make clean -- To view, visit https://gerrit.osmocom.org/13691 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Idb75e028d52803e3f8685d42c584f8f96613ec3c Gerrit-Change-Number: 13691 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:06:27 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 09:06:27 +0000 Subject: Change in osmo-ccid-firmware[master]: remove example code In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#4) to the change originally created by K?vin Redon. ( https://gerrit.osmocom.org/13676 ) Change subject: remove example code ...................................................................... remove example code as the code will use alternative libraries, the examples will not be able to compile anymore. plus they are not required for the firmware and the example code can be downloaded from Atmel start. Change-Id: If53df47089de9eb8498734c19d6a0420c1e79031 --- D sysmoOCTSIM/examples/driver_examples.c D sysmoOCTSIM/examples/driver_examples.h M sysmoOCTSIM/gcc/Makefile 3 files changed, 3 insertions(+), 267 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/76/13676/4 -- To view, visit https://gerrit.osmocom.org/13676 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If53df47089de9eb8498734c19d6a0420c1e79031 Gerrit-Change-Number: 13676 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:06:27 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 09:06:27 +0000 Subject: Change in osmo-ccid-firmware[master]: switch UART_debug to ASYNC In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#4) to the change originally created by K?vin Redon. ( https://gerrit.osmocom.org/13673 ) Change subject: switch UART_debug to ASYNC ...................................................................... switch UART_debug to ASYNC using the synchronous HAL library causes RX overflow after 5 bytes on bulk incoming data (e.g. pasted). this mainly due to printing synchronously the character, but to further prevent congestion we switch to asynchronous (e.g. interrupt driven) communication. The RX part works great now (no overflow), but the TX part is malfunctioning because the HAL Async library does not buffer the data to be transmitted and expects it to be in memory until the transmission is complete (which printf does not do). This change will not be reflected in Atmel START since it does not allow to set the underlying STDIO redirect peripheral to async. Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7 --- M sysmoOCTSIM/command.c M sysmoOCTSIM/driver_init.c M sysmoOCTSIM/driver_init.h M sysmoOCTSIM/hpl/sercom/hpl_sercom.c M sysmoOCTSIM/main.c M sysmoOCTSIM/manual_test.c M sysmoOCTSIM/stdio_start.c 7 files changed, 75 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/73/13673/4 -- To view, visit https://gerrit.osmocom.org/13673 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7 Gerrit-Change-Number: 13673 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:06:27 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 09:06:27 +0000 Subject: Change in osmo-ccid-firmware[master]: UART_debug now uses the async library with tx ring In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#4) to the change originally created by K?vin Redon. ( https://gerrit.osmocom.org/13678 ) Change subject: UART_debug now uses the async library with tx ring ...................................................................... UART_debug now uses the async library with tx ring Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc --- M sysmoOCTSIM/command.c M sysmoOCTSIM/driver_init.c M sysmoOCTSIM/driver_init.h M sysmoOCTSIM/manual_test.c M sysmoOCTSIM/stdio_start.c 5 files changed, 13 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/78/13678/4 -- To view, visit https://gerrit.osmocom.org/13678 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc Gerrit-Change-Number: 13678 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:06:42 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 09:06:42 +0000 Subject: Change in osmo-ccid-firmware[master]: remove example code In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13676 ) Change subject: remove example code ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13676 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If53df47089de9eb8498734c19d6a0420c1e79031 Gerrit-Change-Number: 13676 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 09:06:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:08:37 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 09:08:37 +0000 Subject: Change in osmo-ccid-firmware[master]: remove example code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13676 ) Change subject: remove example code ...................................................................... remove example code as the code will use alternative libraries, the examples will not be able to compile anymore. plus they are not required for the firmware and the example code can be downloaded from Atmel start. Change-Id: If53df47089de9eb8498734c19d6a0420c1e79031 --- D sysmoOCTSIM/examples/driver_examples.c D sysmoOCTSIM/examples/driver_examples.h M sysmoOCTSIM/gcc/Makefile 3 files changed, 3 insertions(+), 267 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sysmoOCTSIM/examples/driver_examples.c b/sysmoOCTSIM/examples/driver_examples.c deleted file mode 100644 index 4ab0ef4..0000000 --- a/sysmoOCTSIM/examples/driver_examples.c +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Code generated from Atmel Start. - * - * This file will be overwritten when reconfiguring your Atmel Start project. - * Please copy examples or other code you want to keep to a separate file - * to avoid losing it when reconfiguring. - */ - -#include "driver_examples.h" -#include "driver_init.h" -#include "utils.h" - -/** - * Example of using SIM0 to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_SIM0[12] = "Hello World!"; - -static void tx_cb_SIM0(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void SIM0_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&SIM0, USART_ASYNC_TXC_CB, tx_cb_SIM0); - /*usart_async_register_callback(&SIM0, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&SIM0, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&SIM0, &io); - usart_async_enable(&SIM0); - - io_write(io, example_SIM0, 12); -} - -/** - * Example of using SIM1 to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_SIM1[12] = "Hello World!"; - -static void tx_cb_SIM1(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void SIM1_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&SIM1, USART_ASYNC_TXC_CB, tx_cb_SIM1); - /*usart_async_register_callback(&SIM1, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&SIM1, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&SIM1, &io); - usart_async_enable(&SIM1); - - io_write(io, example_SIM1, 12); -} - -/** - * Example of using SIM2 to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_SIM2[12] = "Hello World!"; - -static void tx_cb_SIM2(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void SIM2_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&SIM2, USART_ASYNC_TXC_CB, tx_cb_SIM2); - /*usart_async_register_callback(&SIM2, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&SIM2, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&SIM2, &io); - usart_async_enable(&SIM2); - - io_write(io, example_SIM2, 12); -} - -/** - * Example of using SIM3 to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_SIM3[12] = "Hello World!"; - -static void tx_cb_SIM3(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void SIM3_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&SIM3, USART_ASYNC_TXC_CB, tx_cb_SIM3); - /*usart_async_register_callback(&SIM3, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&SIM3, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&SIM3, &io); - usart_async_enable(&SIM3); - - io_write(io, example_SIM3, 12); -} - -/** - * Example of using SIM4 to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_SIM4[12] = "Hello World!"; - -static void tx_cb_SIM4(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void SIM4_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&SIM4, USART_ASYNC_TXC_CB, tx_cb_SIM4); - /*usart_async_register_callback(&SIM4, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&SIM4, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&SIM4, &io); - usart_async_enable(&SIM4); - - io_write(io, example_SIM4, 12); -} - -/** - * Example of using SIM5 to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_SIM5[12] = "Hello World!"; - -static void tx_cb_SIM5(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void SIM5_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&SIM5, USART_ASYNC_TXC_CB, tx_cb_SIM5); - /*usart_async_register_callback(&SIM5, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&SIM5, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&SIM5, &io); - usart_async_enable(&SIM5); - - io_write(io, example_SIM5, 12); -} - -/** - * Example of using SIM6 to write "Hello World" using the IO abstraction. - * - * Since the driver is asynchronous we need to use statically allocated memory for string - * because driver initiates transfer and then returns before the transmission is completed. - * - * Once transfer has been completed the tx_cb function will be called. - */ - -static uint8_t example_SIM6[12] = "Hello World!"; - -static void tx_cb_SIM6(const struct usart_async_descriptor *const io_descr) -{ - /* Transfer completed */ -} - -void SIM6_example(void) -{ - struct io_descriptor *io; - - usart_async_register_callback(&SIM6, USART_ASYNC_TXC_CB, tx_cb_SIM6); - /*usart_async_register_callback(&SIM6, USART_ASYNC_RXC_CB, rx_cb); - usart_async_register_callback(&SIM6, USART_ASYNC_ERROR_CB, err_cb);*/ - usart_async_get_io_descriptor(&SIM6, &io); - usart_async_enable(&SIM6); - - io_write(io, example_SIM6, 12); -} - -/** - * Example of using UART_debug to write "Hello World" using the IO abstraction. - */ -void UART_debug_example(void) -{ - struct io_descriptor *io; - usart_sync_get_io_descriptor(&UART_debug, &io); - usart_sync_enable(&UART_debug); - - io_write(io, (uint8_t *)"Hello World!", 12); -} diff --git a/sysmoOCTSIM/examples/driver_examples.h b/sysmoOCTSIM/examples/driver_examples.h deleted file mode 100644 index 4f2ce98..0000000 --- a/sysmoOCTSIM/examples/driver_examples.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Code generated from Atmel Start. - * - * This file will be overwritten when reconfiguring your Atmel Start project. - * Please copy examples or other code you want to keep to a separate file - * to avoid losing it when reconfiguring. - */ -#ifndef DRIVER_EXAMPLES_H_INCLUDED -#define DRIVER_EXAMPLES_H_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -void SIM0_example(void); - -void SIM1_example(void); - -void SIM2_example(void); - -void SIM3_example(void); - -void SIM4_example(void); - -void SIM5_example(void); - -void SIM6_example(void); - -void UART_debug_example(void); - -#ifdef __cplusplus -} -#endif -#endif // DRIVER_EXAMPLES_H_INCLUDED diff --git a/sysmoOCTSIM/gcc/Makefile b/sysmoOCTSIM/gcc/Makefile index 1a473b9..2b132f4 100644 --- a/sysmoOCTSIM/gcc/Makefile +++ b/sysmoOCTSIM/gcc/Makefile @@ -28,7 +28,6 @@ \ hal/src \ hpl/ramecc \ -examples \ hpl/oscctrl \ stdio_redirect/gcc \ gcc \ @@ -85,7 +84,6 @@ ncn8025.o \ command.o \ hpl/osc32kctrl/hpl_osc32kctrl.o \ -examples/driver_examples.o \ driver_init.o \ hal/src/hal_usart_async.o \ hpl/sercom/hpl_sercom.o \ @@ -134,7 +132,6 @@ "ncn8025.o" \ "command.o" \ "hpl/osc32kctrl/hpl_osc32kctrl.o" \ -"examples/driver_examples.o" \ "driver_init.o" \ "hal/src/hal_usart_async.o" \ "hpl/sercom/hpl_sercom.o" \ @@ -188,7 +185,6 @@ "octsim_i2c.d" \ "ncn8025.d" \ "command.d" \ -"examples/driver_examples.d" \ "hal/src/hal_cache.d" \ "hal/src/hal_sleep.d" \ "hal/utils/src/utils_ringbuffer.d" \ @@ -245,7 +241,7 @@ @echo ARM/GNU C Compiler $(QUOTE)arm-none-eabi-gcc$(QUOTE) -x c -mthumb -DDEBUG -Os -ffunction-sections -mlong-calls -g3 -Wall -c -std=gnu99 \ -D__SAME54N19A__ -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ +-I"../" -I"../config" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< @@ -254,7 +250,7 @@ @echo ARM/GNU Assembler $(QUOTE)arm-none-eabi-as$(QUOTE) -x c -mthumb -DDEBUG -Os -ffunction-sections -mlong-calls -g3 -Wall -c -std=gnu99 \ -D__SAME54N19A__ -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ +-I"../" -I"../config" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< @@ -263,7 +259,7 @@ @echo ARM/GNU Preprocessing Assembler $(QUOTE)arm-none-eabi-gcc$(QUOTE) -x c -mthumb -DDEBUG -Os -ffunction-sections -mlong-calls -g3 -Wall -c -std=gnu99 \ -D__SAME54N19A__ -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ +-I"../" -I"../config" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../config" -I"../stdio_redirect" -I"../" -I"../dma_m2m" -I"../" -I"../CMSIS/Include" -I"../include" \ -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" @echo Finished building: $< -- To view, visit https://gerrit.osmocom.org/13676 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If53df47089de9eb8498734c19d6a0420c1e79031 Gerrit-Change-Number: 13676 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:34:06 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 17 Apr 2019 09:34:06 +0000 Subject: Change in osmo-ccid-firmware[master]: switch UART_debug to ASYNC In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13673 to look at the new patch set (#5). Change subject: switch UART_debug to ASYNC ...................................................................... switch UART_debug to ASYNC using the synchronous HAL library causes RX overflow after 5 bytes on bulk incoming data (e.g. pasted). this mainly due to printing synchronously the character, but to further prevent congestion we switch to asynchronous (e.g. interrupt driven) communication. The RX part works great now (no overflow), but the TX part is malfunctioning because the HAL Async library does not buffer the data to be transmitted and expects it to be in memory until the transmission is complete (which printf does not do). This change will not be reflected in Atmel START since it does not allow to set the underlying STDIO redirect peripheral to async. Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7 --- M sysmoOCTSIM/command.c M sysmoOCTSIM/driver_init.c M sysmoOCTSIM/driver_init.h M sysmoOCTSIM/hpl/sercom/hpl_sercom.c M sysmoOCTSIM/main.c M sysmoOCTSIM/manual_test.c M sysmoOCTSIM/stdio_start.c 7 files changed, 75 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/73/13673/5 -- To view, visit https://gerrit.osmocom.org/13673 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7 Gerrit-Change-Number: 13673 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:34:06 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 17 Apr 2019 09:34:06 +0000 Subject: Change in osmo-ccid-firmware[master]: remove SWO pin initialisation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13674 to look at the new patch set (#5). Change subject: remove SWO pin initialisation ...................................................................... remove SWO pin initialisation using the SWO signal on TX has the advantage of being able to have printf debug while still using SERCOM7 in ISO7816 mode for the SIM card, but it has two drawbacks: - SWO outputs data only if a debug session is ongoing (e.g. a SWD debugger is connected). this saves output processing when no SWD is connected, but it is not possible to force output without having an SWD debugger connect (confirmed by Microchip help), which is not convenient for simple UART debugging. - no input is possible (SWO can only output). Thus instead we will still use SERCOM7 for UART debug, allowing commands to be input. SERCOM7 should only be used for UART debug when no card in present in SIM7. This check in not yet implemented. Change-Id: I199d6e356129526e65d5d1075a264eb35904d099 --- M sysmoOCTSIM/driver_init.c 1 file changed, 0 insertions(+), 47 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/74/13674/5 -- To view, visit https://gerrit.osmocom.org/13674 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I199d6e356129526e65d5d1075a264eb35904d099 Gerrit-Change-Number: 13674 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:34:06 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 17 Apr 2019 09:34:06 +0000 Subject: Change in osmo-ccid-firmware[master]: add sim-atr 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/13681 to look at the new patch set (#7). Change subject: add sim-atr command ...................................................................... add sim-atr command the sim-atr command resets the card and read the resulting answer to reset. Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee --- M sysmoOCTSIM/main.c 1 file changed, 89 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/81/13681/7 -- To view, visit https://gerrit.osmocom.org/13681 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee Gerrit-Change-Number: 13681 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:34:06 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 17 Apr 2019 09:34:06 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: improve documentation 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/13683 to look at the new patch set (#7). Change subject: minor: improve documentation ...................................................................... minor: improve documentation Change-Id: I250209d45a57c5ad7d1265a68aa71fc31ec06f69 --- M sysmoOCTSIM/ncn8025.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/83/13683/7 -- To view, visit https://gerrit.osmocom.org/13683 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I250209d45a57c5ad7d1265a68aa71fc31ec06f69 Gerrit-Change-Number: 13683 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:36:34 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 17 Apr 2019 09:36:34 +0000 Subject: Change in osmo-trx[master]: lms: move LMS_EnableChannel from Start/Stop to Open/Close device In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13661 ) Change subject: lms: move LMS_EnableChannel from Start/Stop to Open/Close device ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13661 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9 Gerrit-Change-Number: 13661 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 17 Apr 2019 09:36:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:36:37 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 17 Apr 2019 09:36:37 +0000 Subject: Change in osmo-trx[master]: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13662 ) Change subject: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13662 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37 Gerrit-Change-Number: 13662 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: roh Gerrit-Comment-Date: Wed, 17 Apr 2019 09:36:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:45:56 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 17 Apr 2019 09:45:56 +0000 Subject: Change in osmo-mgw[master]: mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13665 ) Change subject: mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard ...................................................................... mgcp-client: Sanitize implementation of mgcp_client_rtpbridge_wildcard * Get rid of string define containing printf statements * Split name from rest of checks to easily add new names later Change-Id: I46e05a7a3432733976760bbf1c5deb4f7610db11 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 9 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 17f40b9..2dcab62 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -828,16 +828,15 @@ return mgcp->actual.endpoint_domain_name[0] ? mgcp->actual.endpoint_domain_name : "mgw"; } -const char *mgcp_client_rtpbridge_wildcard(const struct mgcp_client *mgcp) +static const char *_mgcp_client_name_append_domain(const struct mgcp_client *mgcp, char *name) { static char endpoint[MGCP_ENDPOINT_MAXLEN]; int rc; -#define RTPBRIDGE_WILDCARD_FMT "rtpbridge/*@%s" - rc = snprintf(endpoint, sizeof(endpoint), RTPBRIDGE_WILDCARD_FMT, mgcp_client_endpoint_domain(mgcp)); + rc = snprintf(endpoint, sizeof(endpoint), "%s@%s", name, mgcp_client_endpoint_domain(mgcp)); if (rc > sizeof(endpoint) - 1) { - LOGP(DLMGCP, LOGL_ERROR, "MGCP endpoint exceeds maximum length of %zu: '" RTPBRIDGE_WILDCARD_FMT "'\n", - sizeof(endpoint) - 1, mgcp_client_endpoint_domain(mgcp)); + LOGP(DLMGCP, LOGL_ERROR, "MGCP endpoint exceeds maximum length of %zu: '%s@%s'\n", + sizeof(endpoint) - 1, name, mgcp_client_endpoint_domain(mgcp)); return NULL; } if (rc < 1) { @@ -847,6 +846,11 @@ return endpoint; } +const char *mgcp_client_rtpbridge_wildcard(const struct mgcp_client *mgcp) +{ + return _mgcp_client_name_append_domain(mgcp, "rtpbridge/*"); +} + struct mgcp_response_pending * mgcp_client_pending_add( struct mgcp_client *mgcp, mgcp_trans_id_t trans_id, -- To view, visit https://gerrit.osmocom.org/13665 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I46e05a7a3432733976760bbf1c5deb4f7610db11 Gerrit-Change-Number: 13665 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:50:16 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 09:50:16 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: improve documentation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13683 ) Change subject: minor: improve documentation ...................................................................... Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13683 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I250209d45a57c5ad7d1265a68aa71fc31ec06f69 Gerrit-Change-Number: 13683 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 09:50:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:55:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 09:55:51 +0000 Subject: Change in osmo-ccid-firmware[master]: add sim-atr command In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#8) to the change originally created by K?vin Redon. ( https://gerrit.osmocom.org/13681 ) Change subject: add sim-atr command ...................................................................... add sim-atr command the sim-atr command resets the card and read the resulting answer to reset. Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee --- M sysmoOCTSIM/main.c 1 file changed, 87 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/81/13681/8 -- To view, visit https://gerrit.osmocom.org/13681 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee Gerrit-Change-Number: 13681 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:55:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 09:55:51 +0000 Subject: Change in osmo-ccid-firmware[master]: switch UART_debug to ASYNC In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#6) to the change originally created by K?vin Redon. ( https://gerrit.osmocom.org/13673 ) Change subject: switch UART_debug to ASYNC ...................................................................... switch UART_debug to ASYNC using the synchronous HAL library causes RX overflow after 5 bytes on bulk incoming data (e.g. pasted). this mainly due to printing synchronously the character, but to further prevent congestion we switch to asynchronous (e.g. interrupt driven) communication. The RX part works great now (no overflow), but the TX part is malfunctioning because the HAL Async library does not buffer the data to be transmitted and expects it to be in memory until the transmission is complete (which printf does not do). This change will not be reflected in Atmel START since it does not allow to set the underlying STDIO redirect peripheral to async. Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7 --- M sysmoOCTSIM/command.c M sysmoOCTSIM/driver_init.c M sysmoOCTSIM/driver_init.h M sysmoOCTSIM/hpl/sercom/hpl_sercom.c M sysmoOCTSIM/main.c M sysmoOCTSIM/manual_test.c M sysmoOCTSIM/stdio_start.c 7 files changed, 75 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/73/13673/6 -- To view, visit https://gerrit.osmocom.org/13673 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7 Gerrit-Change-Number: 13673 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:56:00 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 09:56:00 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: improve documentation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13683 ) Change subject: minor: improve documentation ...................................................................... Patch Set 8: Verified+1 -- To view, visit https://gerrit.osmocom.org/13683 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I250209d45a57c5ad7d1265a68aa71fc31ec06f69 Gerrit-Change-Number: 13683 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 09:56:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:56:07 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 09:56:07 +0000 Subject: Change in osmo-ccid-firmware[master]: change ISO baud rate default to 6720 bps In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13679 ) Change subject: change ISO baud rate default to 6720 bps ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13679 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9165575404f070c7429daaa3593838d08a5c5e10 Gerrit-Change-Number: 13679 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 09:56:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:56:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 09:56:12 +0000 Subject: Change in osmo-ccid-firmware[master]: change SERCOM clock to 3.3 MHz In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13680 ) Change subject: change SERCOM clock to 3.3 MHz ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13680 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id60322e092a6652a89821fc737d5336d79a1420c Gerrit-Change-Number: 13680 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 09:56:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:56:19 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 09:56:19 +0000 Subject: Change in osmo-ccid-firmware[master]: add sim-atr command In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13681 ) Change subject: add sim-atr command ...................................................................... Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13681 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee Gerrit-Change-Number: 13681 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 09:56:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 09:56:29 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 09:56:29 +0000 Subject: Change in osmo-ccid-firmware[master]: remove SWO pin initialisation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13674 ) Change subject: remove SWO pin initialisation ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13674 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I199d6e356129526e65d5d1075a264eb35904d099 Gerrit-Change-Number: 13674 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 09:56:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:06:19 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 10:06:19 +0000 Subject: Change in osmo-ccid-firmware[master]: add sim-atr command In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#9) to the change originally created by K?vin Redon. ( https://gerrit.osmocom.org/13681 ) Change subject: add sim-atr command ...................................................................... add sim-atr command the sim-atr command resets the card and read the resulting answer to reset. Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee --- M sysmoOCTSIM/main.c 1 file changed, 91 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/81/13681/9 -- To view, visit https://gerrit.osmocom.org/13681 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee Gerrit-Change-Number: 13681 Gerrit-PatchSet: 9 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:06:20 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 10:06:20 +0000 Subject: Change in osmo-ccid-firmware[master]: command.c: don't print "unknown command" for empty commands Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13692 Change subject: command.c: don't print "unknown command" for empty commands ...................................................................... command.c: don't print "unknown command" for empty commands Change-Id: If8512a705e464a9cae949e6278a8d69eb7833737 --- M sysmoOCTSIM/command.c 1 file changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/92/13692/1 diff --git a/sysmoOCTSIM/command.c b/sysmoOCTSIM/command.c index 3210b27..b0949f3 100644 --- a/sysmoOCTSIM/command.c +++ b/sysmoOCTSIM/command.c @@ -85,15 +85,19 @@ int c = getchar(); if (c < 0) return; - putchar(c); if (c == '\r' || c == '\n' || g_cmds.buf_idx >= sizeof(g_cmds.buf)-1) { + /* skip empty commands */ + if (g_cmds.buf_idx == 0) + return; cmd_execute(); cmd_buf_reset(); printf(g_cmds.prompt); return; + } else { + /* print + append character */ + putchar(c); + cmd_buf_append(c); } - /* append character */ - cmd_buf_append(c); i++; } -- To view, visit https://gerrit.osmocom.org/13692 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If8512a705e464a9cae949e6278a8d69eb7833737 Gerrit-Change-Number: 13692 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:06:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 10:06:30 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: improve documentation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13683 ) Change subject: minor: improve documentation ...................................................................... minor: improve documentation Change-Id: I250209d45a57c5ad7d1265a68aa71fc31ec06f69 --- M sysmoOCTSIM/ncn8025.h 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified Jenkins Builder: Verified diff --git a/sysmoOCTSIM/ncn8025.h b/sysmoOCTSIM/ncn8025.h index 89b7f86..a2a6459 100644 --- a/sysmoOCTSIM/ncn8025.h +++ b/sysmoOCTSIM/ncn8025.h @@ -15,8 +15,8 @@ }; struct ncn8025_settings { - bool rstin; /* high: active */ - bool cmdvcc; /* high: active */ + bool rstin; /* Reset signal (true: asserted low) */ + bool cmdvcc; /* Command VCC pin. Activation sequence Enable (true: active low) */ bool simpres; /* high: active */ bool led; /* high: active */ bool interrupt; /* high: active */ -- To view, visit https://gerrit.osmocom.org/13683 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I250209d45a57c5ad7d1265a68aa71fc31ec06f69 Gerrit-Change-Number: 13683 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:06:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 10:06:30 +0000 Subject: Change in osmo-ccid-firmware[master]: change ISO baud rate default to 6720 bps In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13679 ) Change subject: change ISO baud rate default to 6720 bps ...................................................................... change ISO baud rate default to 6720 bps the ISO7816 I/O baud rate is f / (Fd / Dd), with Fd 372, Dd = 1. f_max is 4 MHz, but we will use the minimum 20 / 8 = 2.5 MHz, thus the baud rate after reset will be 6720 bps. Change-Id: I9165575404f070c7429daaa3593838d08a5c5e10 --- M sysmoOCTSIM/config/hpl_sercom_config.h 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sysmoOCTSIM/config/hpl_sercom_config.h b/sysmoOCTSIM/config/hpl_sercom_config.h index 735fdc2..beac040 100644 --- a/sysmoOCTSIM/config/hpl_sercom_config.h +++ b/sysmoOCTSIM/config/hpl_sercom_config.h @@ -59,7 +59,7 @@ // USART baud rate setting // usart_baud_rate #ifndef CONF_SERCOM_0_USART_BAUD -#define CONF_SERCOM_0_USART_BAUD 9600 +#define CONF_SERCOM_0_USART_BAUD 6720 #endif // @@ -331,7 +331,7 @@ // USART baud rate setting // usart_baud_rate #ifndef CONF_SERCOM_1_USART_BAUD -#define CONF_SERCOM_1_USART_BAUD 9600 +#define CONF_SERCOM_1_USART_BAUD 6720 #endif // @@ -603,7 +603,7 @@ // USART baud rate setting // usart_baud_rate #ifndef CONF_SERCOM_2_USART_BAUD -#define CONF_SERCOM_2_USART_BAUD 9600 +#define CONF_SERCOM_2_USART_BAUD 6720 #endif // @@ -875,7 +875,7 @@ // USART baud rate setting // usart_baud_rate #ifndef CONF_SERCOM_3_USART_BAUD -#define CONF_SERCOM_3_USART_BAUD 9600 +#define CONF_SERCOM_3_USART_BAUD 6720 #endif // @@ -1147,7 +1147,7 @@ // USART baud rate setting // usart_baud_rate #ifndef CONF_SERCOM_4_USART_BAUD -#define CONF_SERCOM_4_USART_BAUD 9600 +#define CONF_SERCOM_4_USART_BAUD 6720 #endif // @@ -1419,7 +1419,7 @@ // USART baud rate setting // usart_baud_rate #ifndef CONF_SERCOM_5_USART_BAUD -#define CONF_SERCOM_5_USART_BAUD 9600 +#define CONF_SERCOM_5_USART_BAUD 6720 #endif // @@ -1691,7 +1691,7 @@ // USART baud rate setting // usart_baud_rate #ifndef CONF_SERCOM_6_USART_BAUD -#define CONF_SERCOM_6_USART_BAUD 9600 +#define CONF_SERCOM_6_USART_BAUD 6720 #endif // -- To view, visit https://gerrit.osmocom.org/13679 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9165575404f070c7429daaa3593838d08a5c5e10 Gerrit-Change-Number: 13679 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:06:31 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 10:06:31 +0000 Subject: Change in osmo-ccid-firmware[master]: change SERCOM clock to 3.3 MHz In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13680 ) Change subject: change SERCOM clock to 3.3 MHz ...................................................................... change SERCOM clock to 3.3 MHz we use the SERCOM peripheral for USART (in 7816 mode SIM card communication) in synchronous mode (TX and RX clock are the same). in this mode only the 8 least significant bits of the BAUD register are used (see TRM 33.6.2.3 Clock Generation ? Baud-Rate Generator). When the SERCOM is clocked at 100 MHz the minimum resulting baud rate would be 100E6 / (2 * 255 + 1) = 195694 bps. clocking SERCOM at 3.33 MHz also to have a baud rate of 6720 bps (~ 3.33E6 / (2 * 247 + 1)), used after reset to read the ATR. Change-Id: Id60322e092a6652a89821fc737d5336d79a1420c --- M sysmoOCTSIM/config/hpl_gclk_config.h M sysmoOCTSIM/config/peripheral_clk_config.h 2 files changed, 12 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sysmoOCTSIM/config/hpl_gclk_config.h b/sysmoOCTSIM/config/hpl_gclk_config.h index 6b7586c..71c26e1 100644 --- a/sysmoOCTSIM/config/hpl_gclk_config.h +++ b/sysmoOCTSIM/config/hpl_gclk_config.h @@ -226,7 +226,7 @@ // Generic clock generator 2 division <0x0000-0xFFFF> // gclk_gen_2_div #ifndef CONF_GCLK_GEN_2_DIV -#define CONF_GCLK_GEN_2_DIV 1 +#define CONF_GCLK_GEN_2_DIV 30 #endif // // @@ -311,7 +311,7 @@ // Indicates whether generic clock 4 configuration is enabled or not // enable_gclk_gen_4 #ifndef CONF_GCLK_GENERATOR_4_CONFIG -#define CONF_GCLK_GENERATOR_4_CONFIG 0 +#define CONF_GCLK_GENERATOR_4_CONFIG 1 #endif // Generic Clock Generator Control @@ -328,7 +328,7 @@ // This defines the clock source for generic clock generator 4 // gclk_gen_4_oscillator #ifndef CONF_GCLK_GEN_4_SOURCE -#define CONF_GCLK_GEN_4_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#define CONF_GCLK_GEN_4_SOURCE GCLK_GENCTRL_SRC_DPLL1 #endif // Run in Standby @@ -370,7 +370,7 @@ // Indicates whether Generic Clock Generator Enable is enabled or not // gclk_arch_gen_4_enable #ifndef CONF_GCLK_GEN_4_GENEN -#define CONF_GCLK_GEN_4_GENEN 0 +#define CONF_GCLK_GEN_4_GENEN 1 #endif // diff --git a/sysmoOCTSIM/config/peripheral_clk_config.h b/sysmoOCTSIM/config/peripheral_clk_config.h index 91c5c86..4bff6ff 100644 --- a/sysmoOCTSIM/config/peripheral_clk_config.h +++ b/sysmoOCTSIM/config/peripheral_clk_config.h @@ -81,7 +81,7 @@ * \brief SERCOM0's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM0_CORE_FREQUENCY -#define CONF_GCLK_SERCOM0_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM0_CORE_FREQUENCY 3333333 #endif /** @@ -161,7 +161,7 @@ * \brief SERCOM1's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM1_CORE_FREQUENCY -#define CONF_GCLK_SERCOM1_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM1_CORE_FREQUENCY 3333333 #endif /** @@ -241,7 +241,7 @@ * \brief SERCOM2's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM2_CORE_FREQUENCY -#define CONF_GCLK_SERCOM2_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM2_CORE_FREQUENCY 3333333 #endif /** @@ -321,7 +321,7 @@ * \brief SERCOM3's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM3_CORE_FREQUENCY -#define CONF_GCLK_SERCOM3_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM3_CORE_FREQUENCY 3333333 #endif /** @@ -401,7 +401,7 @@ * \brief SERCOM4's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM4_CORE_FREQUENCY -#define CONF_GCLK_SERCOM4_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM4_CORE_FREQUENCY 3333333 #endif /** @@ -481,7 +481,7 @@ * \brief SERCOM5's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM5_CORE_FREQUENCY -#define CONF_GCLK_SERCOM5_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM5_CORE_FREQUENCY 3333333 #endif /** @@ -561,7 +561,7 @@ * \brief SERCOM6's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM6_CORE_FREQUENCY -#define CONF_GCLK_SERCOM6_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM6_CORE_FREQUENCY 3333333 #endif /** @@ -601,7 +601,7 @@ // Select the clock source for CORE. #ifndef CONF_GCLK_SERCOM7_CORE_SRC -#define CONF_GCLK_SERCOM7_CORE_SRC GCLK_PCHCTRL_GEN_GCLK2_Val +#define CONF_GCLK_SERCOM7_CORE_SRC GCLK_PCHCTRL_GEN_GCLK4_Val #endif // Slow Clock Source -- To view, visit https://gerrit.osmocom.org/13680 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id60322e092a6652a89821fc737d5336d79a1420c Gerrit-Change-Number: 13680 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:06:34 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 10:06:34 +0000 Subject: Change in osmo-ccid-firmware[master]: add sim-atr command In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13681 ) Change subject: add sim-atr command ...................................................................... Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13681 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee Gerrit-Change-Number: 13681 Gerrit-PatchSet: 9 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 10:06:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:06:38 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 10:06:38 +0000 Subject: Change in osmo-ccid-firmware[master]: command.c: don't print "unknown command" for empty commands In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13692 ) Change subject: command.c: don't print "unknown command" for empty commands ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13692 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If8512a705e464a9cae949e6278a8d69eb7833737 Gerrit-Change-Number: 13692 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Wed, 17 Apr 2019 10:06:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:10:20 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 10:10:20 +0000 Subject: Change in osmo-ccid-firmware[master]: add sim-atr command In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13681 ) Change subject: add sim-atr command ...................................................................... add sim-atr command the sim-atr command resets the card and read the resulting answer to reset. Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee --- M sysmoOCTSIM/main.c 1 file changed, 91 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index 369e3ef..5b10c5f 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -31,6 +31,13 @@ #include "command.h" +// TODO put declaration in more global file +// TODO for now SIM7 is not present because used for debug +static struct usart_async_descriptor* SIM_peripheral_descriptors[] = {&SIM0, &SIM1, &SIM2, &SIM3, &SIM4, &SIM5, &SIM6, NULL}; + +static void SIM_rx_cb(const struct usart_async_descriptor *const io_descr) +{ +} static void board_init() { @@ -48,6 +55,15 @@ /* increase drive strength of 20Mhz SIM clock output to 8mA * (there are 8 inputs + traces to drive!) */ hri_port_set_PINCFG_DRVSTR_bit(PORT, 0, 11); + + // enable SIM interfaces + for (uint8_t i = 0; i < ARRAY_SIZE(SIM_peripheral_descriptors); i++) { + if (NULL == SIM_peripheral_descriptors[i]) { + continue; + } + usart_async_register_callback(SIM_peripheral_descriptors[i], USART_ASYNC_RXC_CB, SIM_rx_cb); // required for RX to work, even if the callback does nothing + usart_async_enable(SIM_peripheral_descriptors[i]); + } } static int validate_slotnr(int argc, char **argv, int idx) @@ -203,7 +219,81 @@ ncn8025_set(slotnr, &settings); } +DEFUN(sim_atr, cmd_sim_atr, "sim-atr", "Read ATR from SIM card") +{ + struct ncn8025_settings settings; + int slotnr = validate_slotnr(argc, argv, 1); + if (slotnr < 0 || slotnr >= ARRAY_SIZE(SIM_peripheral_descriptors) || NULL == SIM_peripheral_descriptors[slotnr]) { + return; + } + + // check if card is present (and read current settings) + ncn8025_get(slotnr, &settings); + if (!settings.simpres) { + printf("no card present in slot %d, aborting\r\n", slotnr); + return; + } + + // switch card off (assert reset and disable power) + // note: ISO/IEC 7816-3:2006 section 6.4 provides the deactivation sequence, but not the minimum corresponding times + settings.rstin = true; + settings.cmdvcc = false; + ncn8025_set(slotnr, &settings); + + // TODO wait some time for card to be completely deactivated + usart_async_flush_rx_buffer(SIM_peripheral_descriptors[slotnr]); // flush RX buffer to start from scratch + + //usart_async_set_baud_rate(SIM_peripheral_descriptors[slotnr], 2500000 / (372 / 1)); // set USART baud rate to match the interface (f = 2.5 MHz) and card default settings (Fd = 372, Dd = 1) + // set clock to lowest frequency (20 MHz / 8 = 2.5 MHz) + // note: according to ISO/IEC 7816-3:2006 section 5.2.3 the minimum value is 1 MHz, and maximum is 5 MHz during activation + settings.clkdiv = SIM_CLKDIV_8; + // set card voltage to 3.0 V (the most supported) + // note: according to ISO/IEC 7816-3:2006 no voltage should damage the card, and you should cycle from low to high + settings.vsel = SIM_VOLT_3V0; + // provide power (the NCN8025 should perform the activation according to spec) + // note: activation sequence is documented in ISO/IEC 7816-3:2006 section 6.2 + settings.cmdvcc = true; + ncn8025_set(slotnr, &settings); + + // wait for Tb=400 cycles before re-asserting reset + delay_us(400 * 10000 / 2500); // 400 cycles * 1000 for us, 2.5 MHz / 1000 for us + + // de-assert reset to switch card back on + settings.rstin = false; + ncn8025_set(slotnr, &settings); + + // wait for Tc=40000 cycles for transmission to start + uint32_t cycles = 40000; + while (cycles && !usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) { + delay_us(10); + cycles -= 25; // 10 us = 25 cycles at 2.5 MHz + } + if (!usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) { + delay_us(12 * 372 / 1 / 2); // wait more than one byte (approximate freq down to 2 MHz) + } + // verify if one byte has been received + if (!usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) { + printf("card in slot %d is not responding, aborting\r\n", slotnr); + return; + } + + // read ATR (just do it until there is no traffic anymore) + // TODO the ATR should be parsed to read the right number of bytes + printf("ATR: "); + uint8_t atr_byte; + while (usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) { + if (1 == io_read(&SIM_peripheral_descriptors[slotnr]->io, &atr_byte, 1)) { + printf("%02x ", atr_byte); + } + uint16_t wt = 9600; // waiting time in ETU + while (wt && !usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) { + delay_us(149); // wait for 1 ETU (372 / 1 / 2.5 MHz = 148.8 us) + wt--; + } + } + printf("\r\n"); +} extern void testmode_init(void); @@ -223,6 +313,7 @@ command_register(&cmd_sim_clkdiv); command_register(&cmd_sim_voltage); command_register(&cmd_sim_led); + command_register(&cmd_sim_atr); testmode_init(); printf("\r\n\r\nsysmocom sysmoOCTSIM\r\n"); -- To view, visit https://gerrit.osmocom.org/13681 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I30b284cab60a50d4cd3080f46f4d332193bbf1ee Gerrit-Change-Number: 13681 Gerrit-PatchSet: 9 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:10:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 10:10:21 +0000 Subject: Change in osmo-ccid-firmware[master]: command.c: don't print "unknown command" for empty commands In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13692 ) Change subject: command.c: don't print "unknown command" for empty commands ...................................................................... command.c: don't print "unknown command" for empty commands Change-Id: If8512a705e464a9cae949e6278a8d69eb7833737 --- M sysmoOCTSIM/command.c 1 file changed, 7 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sysmoOCTSIM/command.c b/sysmoOCTSIM/command.c index 3210b27..b0949f3 100644 --- a/sysmoOCTSIM/command.c +++ b/sysmoOCTSIM/command.c @@ -85,15 +85,19 @@ int c = getchar(); if (c < 0) return; - putchar(c); if (c == '\r' || c == '\n' || g_cmds.buf_idx >= sizeof(g_cmds.buf)-1) { + /* skip empty commands */ + if (g_cmds.buf_idx == 0) + return; cmd_execute(); cmd_buf_reset(); printf(g_cmds.prompt); return; + } else { + /* print + append character */ + putchar(c); + cmd_buf_append(c); } - /* append character */ - cmd_buf_append(c); i++; } -- To view, visit https://gerrit.osmocom.org/13692 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If8512a705e464a9cae949e6278a8d69eb7833737 Gerrit-Change-Number: 13692 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:10:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 10:10:21 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: update atmel start project configuration In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13686 ) Change subject: minor: update atmel start project configuration ...................................................................... minor: update atmel start project configuration Change-Id: I8e719f1687befb9a3657a2e582165dec3cd00094 --- M sysmoOCTSIM/atmel_start_config.atstart 1 file changed, 13 insertions(+), 13 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/sysmoOCTSIM/atmel_start_config.atstart b/sysmoOCTSIM/atmel_start_config.atstart index 51ec4f4..f40c43a 100644 --- a/sysmoOCTSIM/atmel_start_config.atstart +++ b/sysmoOCTSIM/atmel_start_config.atstart @@ -664,7 +664,7 @@ enable_gclk_gen_11: true enable_gclk_gen_2: true enable_gclk_gen_3: true - enable_gclk_gen_4: false + enable_gclk_gen_4: true enable_gclk_gen_5: true enable_gclk_gen_6: false enable_gclk_gen_7: false @@ -700,7 +700,7 @@ gclk_arch_gen_3_oe: false gclk_arch_gen_3_oov: false gclk_arch_gen_3_runstdby: false - gclk_arch_gen_4_enable: false + gclk_arch_gen_4_enable: true gclk_arch_gen_4_idc: false gclk_arch_gen_4_oe: false gclk_arch_gen_4_oov: false @@ -742,7 +742,7 @@ gclk_gen_1_div: 1 gclk_gen_1_div_sel: false gclk_gen_1_oscillator: Digital Frequency Locked Loop (DFLL48M) - gclk_gen_2_div: 1 + gclk_gen_2_div: 30 gclk_gen_2_div_sel: false gclk_gen_2_oscillator: Digital Phase Locked Loop (DPLL1) gclk_gen_3_div: 1 @@ -750,7 +750,7 @@ gclk_gen_3_oscillator: 32kHz External Crystal Oscillator (XOSC32K) gclk_gen_4_div: 1 gclk_gen_4_div_sel: false - gclk_gen_4_oscillator: External Crystal Oscillator 8-48MHz (XOSC1) + gclk_gen_4_oscillator: Digital Phase Locked Loop (DPLL1) gclk_gen_5_div: 5 gclk_gen_5_div_sel: false gclk_gen_5_oscillator: Digital Phase Locked Loop (DPLL1) @@ -976,7 +976,7 @@ usart_arch_ibon: false usart_arch_runstdby: false usart_arch_sfde: false - usart_baud_rate: 9600 + usart_baud_rate: 6720 usart_character_size: 8 bits usart_dsnack: The successive receive NACK is disable. usart_gtime: 2-bit times @@ -1023,7 +1023,7 @@ usart_arch_ibon: false usart_arch_runstdby: false usart_arch_sfde: false - usart_baud_rate: 9600 + usart_baud_rate: 6720 usart_character_size: 8 bits usart_dsnack: The successive receive NACK is disable. usart_gtime: 2-bit times @@ -1070,7 +1070,7 @@ usart_arch_ibon: false usart_arch_runstdby: false usart_arch_sfde: false - usart_baud_rate: 9600 + usart_baud_rate: 6720 usart_character_size: 8 bits usart_dsnack: The successive receive NACK is disable. usart_gtime: 2-bit times @@ -1117,7 +1117,7 @@ usart_arch_ibon: false usart_arch_runstdby: false usart_arch_sfde: false - usart_baud_rate: 9600 + usart_baud_rate: 6720 usart_character_size: 8 bits usart_dsnack: The successive receive NACK is disable. usart_gtime: 2-bit times @@ -1164,7 +1164,7 @@ usart_arch_ibon: false usart_arch_runstdby: false usart_arch_sfde: false - usart_baud_rate: 9600 + usart_baud_rate: 6720 usart_character_size: 8 bits usart_dsnack: The successive receive NACK is disable. usart_gtime: 2-bit times @@ -1211,7 +1211,7 @@ usart_arch_ibon: false usart_arch_runstdby: false usart_arch_sfde: false - usart_baud_rate: 9600 + usart_baud_rate: 6720 usart_character_size: 8 bits usart_dsnack: The successive receive NACK is disable. usart_gtime: 2-bit times @@ -1258,7 +1258,7 @@ usart_arch_ibon: false usart_arch_runstdby: false usart_arch_sfde: false - usart_baud_rate: 9600 + usart_baud_rate: 6720 usart_character_size: 8 bits usart_dsnack: The successive receive NACK is disable. usart_gtime: 2-bit times @@ -1330,7 +1330,7 @@ domain_group: nodes: - name: Core - input: Generic clock generator 2 + input: Generic clock generator 4 external: false external_frequency: 0 - name: Slow @@ -1338,7 +1338,7 @@ external: false external_frequency: 0 configuration: - core_gclk_selection: Generic clock generator 2 + core_gclk_selection: Generic clock generator 4 slow_gclk_selection: Generic clock generator 3 USB_DEVICE_INSTANCE: user_label: USB_DEVICE_INSTANCE -- To view, visit https://gerrit.osmocom.org/13686 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8e719f1687befb9a3657a2e582165dec3cd00094 Gerrit-Change-Number: 13686 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:10:23 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 10:10:23 +0000 Subject: Change in osmo-ccid-firmware[master]: update CMSIS to 5.1.2 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13687 ) Change subject: update CMSIS to 5.1.2 ...................................................................... update CMSIS to 5.1.2 this changes comes from Atmel START Change-Id: Ib9b00107836c1604c7169d69ba607fead8c55355 --- M sysmoOCTSIM/AtmelStart.gpdsc R sysmoOCTSIM/CMSIS/Core/Include/cmsis_armcc.h R sysmoOCTSIM/CMSIS/Core/Include/cmsis_armclang.h A sysmoOCTSIM/CMSIS/Core/Include/cmsis_compiler.h R sysmoOCTSIM/CMSIS/Core/Include/cmsis_gcc.h A sysmoOCTSIM/CMSIS/Core/Include/cmsis_iccarm.h A sysmoOCTSIM/CMSIS/Core/Include/cmsis_version.h R sysmoOCTSIM/CMSIS/Core/Include/core_armv8mbl.h R sysmoOCTSIM/CMSIS/Core/Include/core_armv8mml.h R sysmoOCTSIM/CMSIS/Core/Include/core_cm0.h R sysmoOCTSIM/CMSIS/Core/Include/core_cm0plus.h C sysmoOCTSIM/CMSIS/Core/Include/core_cm1.h R sysmoOCTSIM/CMSIS/Core/Include/core_cm23.h R sysmoOCTSIM/CMSIS/Core/Include/core_cm3.h R sysmoOCTSIM/CMSIS/Core/Include/core_cm33.h R sysmoOCTSIM/CMSIS/Core/Include/core_cm4.h R sysmoOCTSIM/CMSIS/Core/Include/core_cm7.h R sysmoOCTSIM/CMSIS/Core/Include/core_sc000.h R sysmoOCTSIM/CMSIS/Core/Include/core_sc300.h A sysmoOCTSIM/CMSIS/Core/Include/mpu_armv7.h A sysmoOCTSIM/CMSIS/Core/Include/mpu_armv8.h R sysmoOCTSIM/CMSIS/Core/Include/tz_context.h M sysmoOCTSIM/CMSIS/Documentation/Core/html/index.html D sysmoOCTSIM/CMSIS/Include/arm_common_tables.h D sysmoOCTSIM/CMSIS/Include/arm_const_structs.h D sysmoOCTSIM/CMSIS/Include/arm_math.h D sysmoOCTSIM/CMSIS/Include/cmsis_compiler.h M sysmoOCTSIM/gcc/Makefile 28 files changed, 29,295 insertions(+), 33,968 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved -- To view, visit https://gerrit.osmocom.org/13687 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib9b00107836c1604c7169d69ba607fead8c55355 Gerrit-Change-Number: 13687 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:10:24 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 10:10:24 +0000 Subject: Change in osmo-ccid-firmware[master]: update ASFv4 library to 1.0.1465 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13688 ) Change subject: update ASFv4 library to 1.0.1465 ...................................................................... update ASFv4 library to 1.0.1465 Change-Id: I828e87c7ededbb50a999d672cf0b738eef9a093a --- M sysmoOCTSIM/atmel_start_config.atstart M sysmoOCTSIM/hpl/dmac/hpl_dmac.c 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/sysmoOCTSIM/atmel_start_config.atstart b/sysmoOCTSIM/atmel_start_config.atstart index f40c43a..4fda2f8 100644 --- a/sysmoOCTSIM/atmel_start_config.atstart +++ b/sysmoOCTSIM/atmel_start_config.atstart @@ -4,7 +4,7 @@ api: '1.0' backend: 1.5.122 commit: 820baecf7dd115d94b0d42ee3b0b9d6ba2da7113 - content: 1.0.1405 + content: 1.0.1465 content_pack_name: acme-packs-all format: '2' frontend: 1.5.1826 diff --git a/sysmoOCTSIM/hpl/dmac/hpl_dmac.c b/sysmoOCTSIM/hpl/dmac/hpl_dmac.c index 27021dd..b08448b 100644 --- a/sysmoOCTSIM/hpl/dmac/hpl_dmac.c +++ b/sysmoOCTSIM/hpl/dmac/hpl_dmac.c @@ -108,6 +108,7 @@ hri_dmac_write_CHPRILVL_reg(DMAC, i, _cfgs[i].prilvl); hri_dmac_write_CHEVCTRL_reg(DMAC, i, _cfgs[i].evctrl); hri_dmacdescriptor_write_BTCTRL_reg(&_descriptor_section[i], _cfgs[i].btctrl); + hri_dmacdescriptor_write_DESCADDR_reg(&_descriptor_section[i], 0x0); } for (i = 0; i < 5; i++) { -- To view, visit https://gerrit.osmocom.org/13688 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I828e87c7ededbb50a999d672cf0b738eef9a093a Gerrit-Change-Number: 13688 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:10:25 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 10:10:25 +0000 Subject: Change in osmo-ccid-firmware[master]: remove SWO pin initialisation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13674 ) Change subject: remove SWO pin initialisation ...................................................................... remove SWO pin initialisation using the SWO signal on TX has the advantage of being able to have printf debug while still using SERCOM7 in ISO7816 mode for the SIM card, but it has two drawbacks: - SWO outputs data only if a debug session is ongoing (e.g. a SWD debugger is connected). this saves output processing when no SWD is connected, but it is not possible to force output without having an SWD debugger connect (confirmed by Microchip help), which is not convenient for simple UART debugging. - no input is possible (SWO can only output). Thus instead we will still use SERCOM7 for UART debug, allowing commands to be input. SERCOM7 should only be used for UART debug when no card in present in SIM7. This check in not yet implemented. Change-Id: I199d6e356129526e65d5d1075a264eb35904d099 --- M sysmoOCTSIM/driver_init.c 1 file changed, 0 insertions(+), 47 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/sysmoOCTSIM/driver_init.c b/sysmoOCTSIM/driver_init.c index 06184ee..726129d 100644 --- a/sysmoOCTSIM/driver_init.c +++ b/sysmoOCTSIM/driver_init.c @@ -702,53 +702,6 @@ gpio_set_pin_function(SDA1, GPIO_PIN_FUNCTION_OFF); - // GPIO on PB30 - - gpio_set_pin_direction(UART_TX, - // Pin direction - // pad_direction - // Off - // In - // Out - GPIO_DIRECTION_OUT); - - gpio_set_pin_level(UART_TX, - // Initial level - // pad_initial_level - // Low - // High - false); - - gpio_set_pin_pull_mode(UART_TX, - // Pull configuration - // pad_pull_config - // Off - // Pull-up - // Pull-down - GPIO_PULL_OFF); - - gpio_set_pin_function(UART_TX, - // Pin function - // pad_function - // Auto : use driver pinmux if signal is imported by driver, else turn off function - // Auto - // Off - // A - // B - // C - // D - // E - // F - // G - // H - // I - // J - // K - // L - // M - // N - GPIO_PIN_FUNCTION_H); - // GPIO on PC00 // Set pin direction to input -- To view, visit https://gerrit.osmocom.org/13674 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I199d6e356129526e65d5d1075a264eb35904d099 Gerrit-Change-Number: 13674 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:31:08 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Wed, 17 Apr 2019 10:31:08 +0000 Subject: Change in osmo-ci[master]: nightly-packages: add osmo-gsm-manuals-debian8-jessie In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13658 ) Change subject: nightly-packages: add osmo-gsm-manuals-debian8-jessie ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13658 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3570599ede51b974d350064f44f77e360fafd8b0 Gerrit-Change-Number: 13658 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: osmith Gerrit-Comment-Date: Wed, 17 Apr 2019 10:31:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:32:23 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Wed, 17 Apr 2019 10:32:23 +0000 Subject: Change in osmo-ci[master]: nightly-packages: add osmo-gsm-manuals-debian8-jessie In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13658 ) Change subject: nightly-packages: add osmo-gsm-manuals-debian8-jessie ...................................................................... Patch Set 1: Tested again, with the updated osmo-gsm-manuals.git patch, and the workflow I've described here: https://osmocom.org/projects/cellular-infrastructure/wiki/OBS_Maintenance#Workflow-for-modifying-packages and it is working as expected. -- To view, visit https://gerrit.osmocom.org/13658 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3570599ede51b974d350064f44f77e360fafd8b0 Gerrit-Change-Number: 13658 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: osmith Gerrit-Comment-Date: Wed, 17 Apr 2019 10:32:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:34:50 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Wed, 17 Apr 2019 10:34:50 +0000 Subject: Change in osmo-gsm-manuals[master]: debian: add patch for debian 8 In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13657 ) Change subject: debian: add patch for debian 8 ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13657 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5b9575ceb1141961e570643a5755a2bd6b6a4254 Gerrit-Change-Number: 13657 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 10:34:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 10:59:25 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 17 Apr 2019 10:59:25 +0000 Subject: Change in osmo-msc[master]: vlr_sgs_fsm: make sure vsub is marked used when LA is present In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/13690 ) Change subject: vlr_sgs_fsm: make sure vsub is marked used when LA is present ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13690 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iba90be095569cc5212c61ab8e8a9bfd4ae51fd44 Gerrit-Change-Number: 13690 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Assignee: Pau Espin Pedrol Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 17 Apr 2019 10:59:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 12:04:12 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Wed, 17 Apr 2019 12:04:12 +0000 Subject: Change in osmo-ci[master]: OBS: add links to job description Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13693 Change subject: OBS: add links to job description ...................................................................... OBS: add links to job description Add the links that the obsolete Osmocom_nightly_packages job has, before we remove it. Also link to the binary packages wiki page. Change-Id: Idbc7ccd0156d9c3eb6d30059384686849a36f49f --- M jobs/osmocom-obs.yml 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/93/13693/1 diff --git a/jobs/osmocom-obs.yml b/jobs/osmocom-obs.yml index 3682d0b..84a4710 100644 --- a/jobs/osmocom-obs.yml +++ b/jobs/osmocom-obs.yml @@ -11,7 +11,13 @@ name: 'Osmocom_OBS_{type}' project-type: freestyle defaults: global - description: 'Generated by job-builder' + description: | + + (Generated by job-builder) node: obs builders: - shell: -- To view, visit https://gerrit.osmocom.org/13693 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Idbc7ccd0156d9c3eb6d30059384686849a36f49f Gerrit-Change-Number: 13693 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 14:22:14 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Wed, 17 Apr 2019 14:22:14 +0000 Subject: Change in osmo-ci[master]: jobs: use "cmd: |", not "# keep first line ..." In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13634 ) Change subject: jobs: use "cmd: |", not "# keep first line ..." ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13634 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I65a06acb76e5d693aa187f9ac38970b73e7fead6 Gerrit-Change-Number: 13634 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: osmith Gerrit-Comment-Date: Wed, 17 Apr 2019 14:22:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 15:33:31 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 15:33:31 +0000 Subject: Change in osmo-ccid-firmware[master]: sim-atr command: enable the LED when the command is active. Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13694 Change subject: sim-atr command: enable the LED when the command is active. ...................................................................... sim-atr command: enable the LED when the command is active. Change-Id: I50c125d46233e86003cc14ec9b5bac47127e8776 --- M sysmoOCTSIM/main.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/94/13694/1 diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index 5b10c5f..ea07683 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -239,6 +239,7 @@ // note: ISO/IEC 7816-3:2006 section 6.4 provides the deactivation sequence, but not the minimum corresponding times settings.rstin = true; settings.cmdvcc = false; + settings.led = true; ncn8025_set(slotnr, &settings); // TODO wait some time for card to be completely deactivated @@ -293,6 +294,12 @@ } } printf("\r\n"); + + /* disable VCC and LED, re-enable RST */ + settings.cmdvcc = false; + settings.rstin = true; + settings.led = false; + ncn8025_set(slotnr, &settings); } extern void testmode_init(void); -- To view, visit https://gerrit.osmocom.org/13694 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I50c125d46233e86003cc14ec9b5bac47127e8776 Gerrit-Change-Number: 13694 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 15:33:31 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 15:33:31 +0000 Subject: Change in osmo-ccid-firmware[master]: sim-atr: Print slot number when printing ATR Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13695 Change subject: sim-atr: Print slot number when printing ATR ...................................................................... sim-atr: Print slot number when printing ATR Change-Id: Iafb957f551de1239f63360854fabeecfeb62b530 --- M sysmoOCTSIM/main.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/95/13695/1 diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index ea07683..843652b 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -281,7 +281,7 @@ // read ATR (just do it until there is no traffic anymore) // TODO the ATR should be parsed to read the right number of bytes - printf("ATR: "); + printf("(%d) ATR: ", slotnr); uint8_t atr_byte; while (usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) { if (1 == io_read(&SIM_peripheral_descriptors[slotnr]->io, &atr_byte, 1)) { -- To view, visit https://gerrit.osmocom.org/13695 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iafb957f551de1239f63360854fabeecfeb62b530 Gerrit-Change-Number: 13695 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 15:34:42 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 15:34:42 +0000 Subject: Change in osmo-ccid-firmware[master]: sim-atr command: enable the LED when the command is active. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13694 ) Change subject: sim-atr command: enable the LED when the command is active. ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13694 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I50c125d46233e86003cc14ec9b5bac47127e8776 Gerrit-Change-Number: 13694 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 15:34:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 15:34:55 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 15:34:55 +0000 Subject: Change in osmo-ccid-firmware[master]: sim-atr: Print slot number when printing ATR In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13695 ) Change subject: sim-atr: Print slot number when printing ATR ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13695 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iafb957f551de1239f63360854fabeecfeb62b530 Gerrit-Change-Number: 13695 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 15:34:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 15:34:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 15:34:57 +0000 Subject: Change in osmo-ccid-firmware[master]: sim-atr command: enable the LED when the command is active. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13694 ) Change subject: sim-atr command: enable the LED when the command is active. ...................................................................... sim-atr command: enable the LED when the command is active. Change-Id: I50c125d46233e86003cc14ec9b5bac47127e8776 --- M sysmoOCTSIM/main.c 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index 5b10c5f..ea07683 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -239,6 +239,7 @@ // note: ISO/IEC 7816-3:2006 section 6.4 provides the deactivation sequence, but not the minimum corresponding times settings.rstin = true; settings.cmdvcc = false; + settings.led = true; ncn8025_set(slotnr, &settings); // TODO wait some time for card to be completely deactivated @@ -293,6 +294,12 @@ } } printf("\r\n"); + + /* disable VCC and LED, re-enable RST */ + settings.cmdvcc = false; + settings.rstin = true; + settings.led = false; + ncn8025_set(slotnr, &settings); } extern void testmode_init(void); -- To view, visit https://gerrit.osmocom.org/13694 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I50c125d46233e86003cc14ec9b5bac47127e8776 Gerrit-Change-Number: 13694 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 15:34:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 15:34:57 +0000 Subject: Change in osmo-ccid-firmware[master]: sim-atr: Print slot number when printing ATR In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13695 ) Change subject: sim-atr: Print slot number when printing ATR ...................................................................... sim-atr: Print slot number when printing ATR Change-Id: Iafb957f551de1239f63360854fabeecfeb62b530 --- M sysmoOCTSIM/main.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index ea07683..843652b 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -281,7 +281,7 @@ // read ATR (just do it until there is no traffic anymore) // TODO the ATR should be parsed to read the right number of bytes - printf("ATR: "); + printf("(%d) ATR: ", slotnr); uint8_t atr_byte; while (usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) { if (1 == io_read(&SIM_peripheral_descriptors[slotnr]->io, &atr_byte, 1)) { -- To view, visit https://gerrit.osmocom.org/13695 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iafb957f551de1239f63360854fabeecfeb62b530 Gerrit-Change-Number: 13695 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 15:35:26 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 15:35:26 +0000 Subject: Change in osmo-ci[master]: jobs: use "cmd: |", not "# keep first line ..." In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13634 ) Change subject: jobs: use "cmd: |", not "# keep first line ..." ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13634 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I65a06acb76e5d693aa187f9ac38970b73e7fead6 Gerrit-Change-Number: 13634 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: osmith Gerrit-Comment-Date: Wed, 17 Apr 2019 15:35:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 15:35:27 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 15:35:27 +0000 Subject: Change in osmo-ci[master]: jobs: use "cmd: |", not "# keep first line ..." In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13634 ) Change subject: jobs: use "cmd: |", not "# keep first line ..." ...................................................................... jobs: use "cmd: |", not "# keep first line ..." Adjust README.adoc to mention "cmd: |" instead of the workaround and replace this: cmd: > # keep first line with less indent to preserve newlines docker run ... With that: cmd: | docker run ... Change-Id: I65a06acb76e5d693aa187f9ac38970b73e7fead6 --- M jobs/README.adoc M jobs/gerrit-verifications.yml M jobs/master-builds.yml 3 files changed, 23 insertions(+), 41 deletions(-) Approvals: Harald Welte: Looks good to me, approved Daniel Willmann: Looks good to me, approved Pau Espin Pedrol: Looks good to me, but someone else must approve osmith: Verified diff --git a/jobs/README.adoc b/jobs/README.adoc index 1d4d405..bea1d9f 100644 --- a/jobs/README.adoc +++ b/jobs/README.adoc @@ -58,17 +58,14 @@ - newlines: -The build commands may be multiline, but especially in the -gerrit-verifications.yml, where the commands are first stored in 'cmd' and -later inserted in a 'shell' section, the newlines between individual shell -lines don't all survive. Interestingly enough, only a line that has more -indenting than the first line also receives an actual newline in the resulting -jenkins Execute Shell section; take a look at the job's config page on jenkins. -Hence we often have a '# keep first line with less indent' comment. Note that -issuing backslashes to span a shell command across several lines will break the -command if the newlines are not preserved, so we need a '# keep...' comment -where there are more than one shell command, and where there are backslashes -'\' to join multiple lines. +Use 'key: |' to keep new lines in multiline values, e.g.: + - shell: | + echo hello + echo world + +See also: +* https://yaml-multiline.info/ +* https://stackoverflow.com/a/21699210 - jobs named on cmdline are not updated: diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 6128dc5..b2cc1dd 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -30,8 +30,7 @@ - cellmgr-ng: concurrent: true - cmd: > - # keep first line with less indent to preserve newlines + cmd: | docker run --rm=true \ -e HOME=/build \ -e MAKE=make \ @@ -66,8 +65,7 @@ a3_name: IU a3: !!python/tuple [--disable-iu] concurrent: true - cmd: > - # keep first line with less indent to preserve newlines + cmd: | ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" mkdir -p "$ARTIFACT_STORE" docker run --rm=true \ @@ -95,8 +93,7 @@ - osmo-bsc: concurrent: true - cmd: > - # keep first line with less indent to preserve newlines + cmd: | docker run --rm=true \ -e HOME=/build \ -e MAKE=make \ @@ -147,8 +144,7 @@ - osmo-mgw: concurrent: true - cmd: > - # keep first line with less indent to preserve newlines + cmd: | docker run --rm=true \ -e HOME=/build \ -e MAKE=make \ @@ -169,8 +165,7 @@ combination_filter: > (IU == "--enable-iu" && WITH_MANUALS == "0") || (IU == "--disable-iu" && WITH_MANUALS == "1") - cmd: > - # keep first line with less indent to preserve newlines + cmd: | ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" mkdir -p "$ARTIFACT_STORE" docker run --rm=true -i \ @@ -221,8 +216,7 @@ combination_filter: > (IU == "--enable-iu" && WITH_MANUALS == "0") || (IU == "--disable-iu" && WITH_MANUALS == "1") - cmd: > - # keep first line with less indent to preserve newlines + cmd: | docker run --rm=true \ -e HOME=/build \ -e MAKE=make \ @@ -265,8 +259,7 @@ - osmo-ttcn3-hacks: repos_url: 'https://gerrit.osmocom.org/{repos}' slave_axis: !!python/tuple [ttcn3] - cmd: > - # keep first line with less indent to preserve newlines + cmd: | set -e make deps; make clean; make compile diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 3bac7b6..373e975 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -50,8 +50,7 @@ master-libosmo-netif, master-osmo-bts - libosmo-dsp: - cmd: > - # keep first line with less indent to preserve newlines + cmd: | autoreconf --install --force ./configure $MAKE $PARALLEL_MAKE @@ -144,8 +143,7 @@ a3_name: IU a3: !!python/tuple [--disable-iu] concurrent: true - cmd: > - # keep first line with less indent to preserve newlines + cmd: | ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" mkdir -p "$ARTIFACT_STORE" docker run --rm=true \ @@ -170,8 +168,7 @@ - osmo-bsc: concurrent: true - cmd: > - # keep first line with less indent to preserve newlines + cmd: | docker run --rm=true \ -e HOME=/build \ -e MAKE=make \ @@ -220,8 +217,7 @@ - osmo-gsm-manuals: node: 'osmocom-master-debian9' - cmd: > - # keep first line with less indent to preserve newlines + cmd: | ./contrib/jenkins.sh - osmo-gsm-tester: @@ -241,8 +237,7 @@ - osmo-mgw: concurrent: true - cmd: > - # keep first line with less indent to preserve newlines + cmd: | docker run --rm=true \ -e HOME=/build \ -e MAKE=make \ @@ -266,8 +261,7 @@ combination_filter: > (IU == "--enable-iu" && WITH_MANUALS == "0") || (IU == "--disable-iu" && WITH_MANUALS == "1") - cmd: > - # keep first line with less indent to preserve newlines + cmd: | ARTIFACT_STORE="$HOME/jenkins_build_artifact_store" mkdir -p "$ARTIFACT_STORE" docker run --rm=true -i \ @@ -321,8 +315,7 @@ combination_filter: > (IU == "--enable-iu" && WITH_MANUALS == "0") || (IU == "--disable-iu" && WITH_MANUALS == "1") - cmd: > - # keep first line with less indent to preserve newlines + cmd: | docker run --rm=true \ -e HOME=/build \ -e MAKE=make \ @@ -363,8 +356,7 @@ - osmo-remsim - osmo-asf4-dfu - simtrace2: - cmd: > - # keep first line with less indent to preserve newlines + cmd: | ./contrib/jenkins.sh --publish email: gerrit-log at lists.osmocom.org laforge at gnumonks.org kredon at sysmocom.de -- To view, visit https://gerrit.osmocom.org/13634 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I65a06acb76e5d693aa187f9ac38970b73e7fead6 Gerrit-Change-Number: 13634 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 15:35:53 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 15:35:53 +0000 Subject: Change in osmo-ci[master]: OBS: add links to job description In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13693 ) Change subject: OBS: add links to job description ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13693 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idbc7ccd0156d9c3eb6d30059384686849a36f49f Gerrit-Change-Number: 13693 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 17 Apr 2019 15:35:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 15:36:50 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 15:36:50 +0000 Subject: Change in osmo-gsm-manuals[master]: debian: add patch for debian 8 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13657 ) Change subject: debian: add patch for debian 8 ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13657 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5b9575ceb1141961e570643a5755a2bd6b6a4254 Gerrit-Change-Number: 13657 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 17 Apr 2019 15:36:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 15:37:26 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 15:37:26 +0000 Subject: Change in osmo-ci[master]: nightly-packages: add osmo-gsm-manuals-debian8-jessie In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13658 ) Change subject: nightly-packages: add osmo-gsm-manuals-debian8-jessie ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13658 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3570599ede51b974d350064f44f77e360fafd8b0 Gerrit-Change-Number: 13658 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: osmith Gerrit-Comment-Date: Wed, 17 Apr 2019 15:37:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 15:58:49 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Wed, 17 Apr 2019 15:58:49 +0000 Subject: Change in osmo-msc[master]: vlr_sgs_fsm: make sure vsub is marked used when LA is present In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13690 ) Change subject: vlr_sgs_fsm: make sure vsub is marked used when LA is present ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13690 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iba90be095569cc5212c61ab8e8a9bfd4ae51fd44 Gerrit-Change-Number: 13690 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Assignee: Pau Espin Pedrol Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 17 Apr 2019 15:58:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 16:00:44 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 17 Apr 2019 16:00:44 +0000 Subject: Change in osmo-ccid-firmware[master]: switch UART_debug to ASYNC In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13673 to look at the new patch set (#8). Change subject: switch UART_debug to ASYNC ...................................................................... switch UART_debug to ASYNC using the synchronous HAL library causes RX overflow after 5 bytes on bulk incoming data (e.g. pasted). this mainly due to printing synchronously the character, but to further prevent congestion we switch to asynchronous (e.g. interrupt driven) communication. The RX part works great now (no overflow), but the TX part is malfunctioning because the HAL Async library does not buffer the data to be transmitted and expects it to be in memory until the transmission is complete (which printf does not do). This change will not be reflected in Atmel START since it does not allow to set the underlying STDIO redirect peripheral to async. Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7 --- M sysmoOCTSIM/command.c M sysmoOCTSIM/driver_init.c M sysmoOCTSIM/driver_init.h M sysmoOCTSIM/hpl/sercom/hpl_sercom.c M sysmoOCTSIM/main.c M sysmoOCTSIM/manual_test.c M sysmoOCTSIM/stdio_start.c 7 files changed, 75 insertions(+), 106 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/73/13673/8 -- To view, visit https://gerrit.osmocom.org/13673 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7 Gerrit-Change-Number: 13673 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 16:01:12 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Wed, 17 Apr 2019 16:01:12 +0000 Subject: Change in osmo-bsc[master]: doc: Add generic counter chapter in manual In-Reply-To: References: Message-ID: Daniel Willmann has submitted this change and it was merged. ( https://gerrit.osmocom.org/13644 ) Change subject: doc: Add generic counter chapter in manual ...................................................................... doc: Add generic counter chapter in manual Depends: I01b8529136450cb50e48b0fb5c17cb2daa5e24c3 (osmo-gsm-manuals) Change-Id: Ida53d79787aedc5b37a68e6795a863cb0b4a343a --- M doc/manuals/chapters/counters.adoc M doc/manuals/osmobsc-usermanual.adoc 2 files changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/manuals/chapters/counters.adoc b/doc/manuals/chapters/counters.adoc index 7fbb10c..be92369 100644 --- a/doc/manuals/chapters/counters.adoc +++ b/doc/manuals/chapters/counters.adoc @@ -1,4 +1,4 @@ [[counters]] -== Counters +== Implemented Counters include::./counters_generated.adoc[] diff --git a/doc/manuals/osmobsc-usermanual.adoc b/doc/manuals/osmobsc-usermanual.adoc index 275c436..3515aaa 100644 --- a/doc/manuals/osmobsc-usermanual.adoc +++ b/doc/manuals/osmobsc-usermanual.adoc @@ -23,6 +23,8 @@ include::{srcdir}/chapters/handover.adoc[] +include::./common/chapters/counters-overview.adoc[] + include::{srcdir}/chapters/counters.adoc[] include::./common/chapters/abis.adoc[] -- To view, visit https://gerrit.osmocom.org/13644 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ida53d79787aedc5b37a68e6795a863cb0b4a343a Gerrit-Change-Number: 13644 Gerrit-PatchSet: 2 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 16:01:13 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Wed, 17 Apr 2019 16:01:13 +0000 Subject: Change in osmo-bsc[master]: manuals: Fix example config to reflect OsmoBSC commands In-Reply-To: References: Message-ID: Daniel Willmann has submitted this change and it was merged. ( https://gerrit.osmocom.org/13645 ) Change subject: manuals: Fix example config to reflect OsmoBSC commands ...................................................................... manuals: Fix example config to reflect OsmoBSC commands Change-Id: Ic38eec67a2cbbef57d1d6349f08249ec20ff7e8c Related: OS#2299 --- M doc/manuals/chapters/bts-examples.adoc 1 file changed, 1 insertion(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/manuals/chapters/bts-examples.adoc b/doc/manuals/chapters/bts-examples.adoc index e404989..2dd8b37 100644 --- a/doc/manuals/chapters/bts-examples.adoc +++ b/doc/manuals/chapters/bts-examples.adoc @@ -19,14 +19,8 @@ network network country code 1 mobile network code 1 - short name OpenBSC - long name OpenBSC - auth policy closed - location updating reject cause 13 encryption a5 0 neci 1 - rrlp mode none - mm info 1 handover 0 bts 0 type nanobts <2> @@ -103,14 +97,8 @@ network network country code 1 mobile network code 1 - short name OpenBSC - long name OpenBSC - auth policy closed - location updating reject cause 13 encryption a5 0 neci 1 - rrlp mode none - mm info 0 handover 0 bts 0 type nanobts @@ -179,7 +167,7 @@ first nanoBTS unit (`trx 0`) needs to be configured to 1800/0/0 and the second nanoBTS unit (`trx 1`) needs to be configured to 1800/0/1. You can configure the BTS unit IDs using the `ipaccess-config` - utility included in OpenBSC. + utility included in OsmoBSC. [NOTE] ==== -- To view, visit https://gerrit.osmocom.org/13645 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic38eec67a2cbbef57d1d6349f08249ec20ff7e8c Gerrit-Change-Number: 13645 Gerrit-PatchSet: 2 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 16:01:14 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Wed, 17 Apr 2019 16:01:14 +0000 Subject: Change in osmo-bsc[master]: Change comments/strings from OpenBSC to OsmoBSC In-Reply-To: References: Message-ID: Daniel Willmann has submitted this change and it was merged. ( https://gerrit.osmocom.org/13646 ) Change subject: Change comments/strings from OpenBSC to OsmoBSC ...................................................................... Change comments/strings from OpenBSC to OsmoBSC Change-Id: I785278df411b13a701c8441fde798d4bfe79ffd1 --- M src/osmo-bsc/bsc_vty.c M src/utils/meas_vis.c 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 9413d36..767d565 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -1,4 +1,4 @@ -/* OpenBSC interface to quagga VTY */ +/* OsmoBSC interface to quagga VTY */ /* (C) 2009-2017 by Harald Welte * All Rights Reserved * @@ -3170,7 +3170,7 @@ DEFUN(cfg_bts_neigh_mode, cfg_bts_neigh_mode_cmd, "neighbor-list mode (automatic|manual|manual-si5)", "Neighbor List\n" "Mode of Neighbor List generation\n" - "Automatically from all BTS in this OpenBSC\n" "Manual\n" + "Automatically from all BTS in this BSC\n" "Manual\n" "Manual with different lists for SI2 and SI5\n") { struct gsm_bts *bts = vty->index; diff --git a/src/utils/meas_vis.c b/src/utils/meas_vis.c index 851aa03..cba08f5 100644 --- a/src/utils/meas_vis.c +++ b/src/utils/meas_vis.c @@ -274,7 +274,7 @@ g_st.cdkscreen = initCDKScreen(g_st.curses_win); initCDKColor(); - g_st.title = "OpenBSC link quality monitor"; + g_st.title = "OsmoBSC link quality monitor"; title[0] = g_st.title; g_st.cdk_title = newCDKLabel(g_st.cdkscreen, CENTER, 0, title, 1, FALSE, FALSE); -- To view, visit https://gerrit.osmocom.org/13646 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I785278df411b13a701c8441fde798d4bfe79ffd1 Gerrit-Change-Number: 13646 Gerrit-PatchSet: 2 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 16:01:16 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Wed, 17 Apr 2019 16:01:16 +0000 Subject: Change in osmo-bsc[master]: gsm_data.h: Remove unused variable from OpenBSC times In-Reply-To: References: Message-ID: Daniel Willmann has submitted this change and it was merged. ( https://gerrit.osmocom.org/13647 ) Change subject: gsm_data.h: Remove unused variable from OpenBSC times ...................................................................... gsm_data.h: Remove unused variable from OpenBSC times This variable does not seem to be used anywere in OsmoBSC, seems to be a remnant from OpenBSC times. Change-Id: I5e4aa352fa5f16f6ff64738f25afd1a844fa4fcb --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/gsm_04_08_rr.c 2 files changed, 0 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: 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 131a53e..dc133e1 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1566,7 +1566,6 @@ struct gsm_bts *start_bts); 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) diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c index 349bfea..7ff94ad 100644 --- a/src/osmo-bsc/gsm_04_08_rr.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -45,10 +45,6 @@ #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) ? */ -int ipacc_rtp_direct = 1; - int gsm48_sendmsg(struct msgb *msg) { if (msg->lchan) -- To view, visit https://gerrit.osmocom.org/13647 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5e4aa352fa5f16f6ff64738f25afd1a844fa4fcb Gerrit-Change-Number: 13647 Gerrit-PatchSet: 2 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 16:01:55 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Wed, 17 Apr 2019 16:01:55 +0000 Subject: Change in osmo-gsm-manuals[master]: Change VTY samples from OsmoNITB to OsmoMSC In-Reply-To: References: Message-ID: Daniel Willmann has submitted this change and it was merged. ( https://gerrit.osmocom.org/13642 ) Change subject: Change VTY samples from OsmoNITB to OsmoMSC ...................................................................... Change VTY samples from OsmoNITB to OsmoMSC Change-Id: I9fb3c43ea56087900eee4427f1ae50a7c9e84698 Related: OS#2299 --- M common/chapters/vty.adoc 1 file changed, 92 insertions(+), 67 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/common/chapters/vty.adoc b/common/chapters/vty.adoc index c9e3d59..3aed41a 100644 --- a/common/chapters/vty.adoc +++ b/common/chapters/vty.adoc @@ -133,7 +133,7 @@ NOTE: The VTY is present on most Osmocom GSM/UMTS/GPRS software, thus this chapter is present in all the relevant manuals. The detailed examples -below assume you are executing them on the OsmoNITB VTY. They will work +below assume you are executing them on the OsmoMSC VTY. They will work in similar fashion on the other VTY interfaces, while the node structure will differ in each program. @@ -147,9 +147,9 @@ even only a partial command), you will get a list of the first word of all possible commands available at this node: -.Example: Typing `?` at start of OsmoNITB prompt +.Example: Typing `?` at start of OsmoMSC prompt ---- -OpenBSC> <1> +OsmoMSC> <1> show Show running system information list Print command list exit Exit current mode and down to previous mode @@ -157,7 +157,8 @@ enable Turn on privileged mode command terminal Set terminal line parameters who Display who is on vty - logging Configure log message to this terminal + logging Configure logging + no Negate a command or set its defaults sms SMS related commands subscriber Operations on a Subscriber ---- @@ -171,35 +172,35 @@ .Example: Typing `?` after a partial command ---- -OpenBSC> show <1> - version Displays program version - online-help Online help - history Display the session command history - network Display information about a GSM NETWORK - bts Display information about a BTS - trx Display information about a TRX - timeslot Display information about a TS - lchan Display information about a logical channel - paging Display information about paging requests of a BTS - paging-group Display the paging group - logging Show current logging configuration - alarms Show current logging configuration - stats Show statistical values - e1_driver Display information about available E1 drivers - e1_line Display information about a E1 line - e1_timeslot Display information about a E1 timeslot - subscriber Operations on a Subscriber - statistics Display network statistics - sms-queue Display SMSqueue statistics +OsmoMSC> show <1> + version Displays program version + online-help Online help + history Display the session command history + cs7 ITU-T Signaling System 7 + logging Show current logging configuration + alarms Show current logging configuration + talloc-context Show talloc memory hierarchy + stats Show statistical values + asciidoc Asciidoc generation + rate-counters Show all rate counters + fsm Show information about finite state machines + fsm-instances Show information about finite state machine instances + sgs-connections Show SGs interface connections / MMEs + subscriber Operations on a Subscriber + bsc BSC + connection Subscriber Connections + transaction Transactions + statistics Display network statistics + sms-queue Display SMSqueue statistics smpp SMPP Interface ---- <1> Type `?` after the `show` command, the `?` itself will not be printed. -You may pick the `network` object and type `?` again: +You may pick the `bsc` object and type `?` again: -.Example: Typing `?` after `show network` +.Example: Typing `?` after `show bsc` ---- -OpenBSC> show network +OsmoMSC> show bsc ---- @@ -216,7 +217,7 @@ .Example: Use of `` pressed after typing only `s` as command ---- -OpenBSC> s<1> +OsmoMSC> s<1> show sms subscriber ---- <1> Type `` here. @@ -225,11 +226,11 @@ .Example: Use of `` pressed after typing `show` command ---- -OpenBSC> show <1> -version online-help history network bts trx -timeslot lchan paging paging-group logging alarms -stats e1_driver e1_line e1_timeslot subscriber statistics -sms-queue smpp +OsmoMSC> show <1> +version online-help history cs7 logging alarms +talloc-context stats asciidoc rate-counters fsm fsm-instances +sgs-connections subscriber bsc connection transaction statistics +sms-queue smpp ---- <1> Type `` here. @@ -239,9 +240,9 @@ The `list` command will give you a full list of all commands and their arguments available at the current node: -.Example: Typing `list` at start of OsmoNITB 'VIEW' node prompt +.Example: Typing `list` at start of OsmoMSC 'VIEW' node prompt ---- -OpenBSC> list +OsmoMSC> list show version show online-help list @@ -252,14 +253,15 @@ terminal no length who show history - show network - show bts [<0-255>] - show trx [<0-255>] [<0-255>] - show timeslot [<0-255>] [<0-255>] [<0-7>] - show lchan [<0-255>] [<0-255>] [<0-7>] [lchan_nr] - show lchan summary [<0-255>] [<0-255>] [<0-7>] [lchan_nr] - show paging [<0-255>] - show paging-group <0-255> IMSI + show cs7 instance <0-15> users + show cs7 (sua|m3ua|ipa) [<0-65534>] + show cs7 instance <0-15> asp + show cs7 instance <0-15> as (active|all|m3ua|sua) + show cs7 instance <0-15> sccp addressbook + show cs7 instance <0-15> sccp users + show cs7 instance <0-15> sccp ssn <0-65535> + show cs7 instance <0-15> sccp connections + show cs7 instance <0-15> sccp timers logging enable logging disable logging filter all (0|1) @@ -267,25 +269,44 @@ logging timestamp (0|1) logging print extended-timestamp (0|1) logging print category (0|1) + logging print category-hex (0|1) + logging print level (0|1) + logging print file (0|1|basename) [last] logging set-log-mask MASK - logging level (all|rll|cc|mm|rr|rsl|nm|mncc|pag|meas|sccp|msc|mgcp|ho|db|ref|gprs|ns|bssgp|llc|sndcp|nat|ctrl|smpp|filter|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats) (debug|info|notice|error|fatal) + logging level (rll|cc|mm|rr|mncc|pag|msc|mgcp|ho|db|ref|ctrl|smpp|ranap|vlr|iucs|bssap|sgs|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro) (debug|info|notice|error|fatal) + logging level set-all (debug|info|notice|error|fatal) + logging level force-all (debug|info|notice|error|fatal) + no logging level force-all show logging vty show alarms + show talloc-context (application|all) (full|brief|DEPTH) + show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS + show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP show stats show stats level (global|peer|subscriber) - show e1_driver - show e1_line [line_nr] [stats] - show e1_timeslot [line_nr] [ts_nr] - show subscriber (extension|imsi|tmsi|id) ID + show asciidoc counters + show rate-counters + show fsm NAME + show fsm all + show fsm-instances NAME + show fsm-instances all + show sgs-connections + show subscriber (msisdn|extension|imsi|tmsi|id) ID show subscriber cache + show bsc + show connection + show transaction sms send pending + sms delete expired subscriber create imsi ID - subscriber (extension|imsi|tmsi|id) ID sms sender (extension|imsi|tmsi|id) SENDER_ID send .LINE - subscriber (extension|imsi|tmsi|id) ID silent-sms sender (extension|imsi|tmsi|id) SENDER_ID send .LINE - subscriber (extension|imsi|tmsi|id) ID silent-call start (any|tch/f|tch/any|sdcch) - subscriber (extension|imsi|tmsi|id) ID silent-call stop - subscriber (extension|imsi|tmsi|id) ID ussd-notify (0|1|2) .TEXT - subscriber (extension|imsi|tmsi|id) ID update + subscriber (msisdn|extension|imsi|tmsi|id) ID sms sender (msisdn|extension|imsi|tmsi|id) SENDER_ID send .LINE + subscriber (msisdn|extension|imsi|tmsi|id) ID silent-sms sender (msisdn|extension|imsi|tmsi|id) SENDER_ID send .LINE + subscriber (msisdn|extension|imsi|tmsi|id) ID silent-call start (any|tch/f|tch/any|sdcch) + subscriber (msisdn|extension|imsi|tmsi|id) ID silent-call stop + subscriber (msisdn|extension|imsi|tmsi|id) ID ussd-notify (0|1|2) .TEXT + subscriber (msisdn|extension|imsi|tmsi|id) ID ms-test close-loop (a|b|c|d|e|f|i) + subscriber (msisdn|extension|imsi|tmsi|id) ID ms-test open-loop + subscriber (msisdn|extension|imsi|tmsi|id) ID paging show statistics show sms-queue logging filter imsi IMSI @@ -294,12 +315,12 @@ TIP: Remember, the list of available commands will change significantly depending on the Osmocom program you are accessing, its software version and -the current node you're at. Compare the above example of the OsmoNITB 'VIEW' -node with the list of the OsmoNITB 'TRX' config node: +the current node you're at. Compare the above example of the OsmoMSC 'VIEW' +node with the list of the OsmoMSC 'NETWORK' config node: -.Example: Typing `list` at start of OsmoNITB 'TRX' config node prompt +.Example: Typing `list` at start of OsmoMSC 'NETWORK' config node prompt ---- -OpenBSC(config-net-bts-trx)# list +OsmoMSC(config-net)# list help list write terminal @@ -309,13 +330,17 @@ show running-config exit end - arfcn <0-1023> - description .TEXT - no description - nominal power <0-100> - max_power_red <0-100> - rsl e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full) - rsl e1 tei <0-63> - rf_locked (0|1) - timeslot <0-7> + network country code <1-999> + mobile network code <0-999> + short name NAME + long name NAME + encryption a5 <0-3> [<0-3>] [<0-3>] [<0-3>] + authentication (optional|required) + rrlp mode (none|ms-based|ms-preferred|ass-preferred) + mm info (0|1) + timezone <-19-19> (0|15|30|45) + timezone <-19-19> (0|15|30|45) <0-2> + no timezone + periodic location update <6-1530> + no periodic location update ---- -- To view, visit https://gerrit.osmocom.org/13642 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9fb3c43ea56087900eee4427f1ae50a7c9e84698 Gerrit-Change-Number: 13642 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 16:02:51 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 17 Apr 2019 16:02:51 +0000 Subject: Change in osmo-ccid-firmware[master]: minor: change variable type to remove compiler warning In-Reply-To: References: Message-ID: K?vin Redon has abandoned this change. ( https://gerrit.osmocom.org/13684 ) Change subject: minor: change variable type to remove compiler warning ...................................................................... Abandoned compiler warning was related to other debug code not present in the commit -- To view, visit https://gerrit.osmocom.org/13684 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I8f537d6cbec820ad0406ec2ff0c9735759169fc0 Gerrit-Change-Number: 13684 Gerrit-PatchSet: 9 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 18:21:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 18:21:54 +0000 Subject: Change in osmo-trx[master]: lms: Remove wrong unused code copied from -uhd In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13660 ) Change subject: lms: Remove wrong unused code copied from -uhd ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13660 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d Gerrit-Change-Number: 13660 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 17 Apr 2019 18:21:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 18:23:10 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 18:23:10 +0000 Subject: Change in osmo-trx[master]: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13662 ) Change subject: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start ...................................................................... Patch Set 2: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/13662/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13662/1//COMMIT_MSG at 7 PS1, Line 7: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start watch your line length + provide more explanation as to *why* that change was made. -- To view, visit https://gerrit.osmocom.org/13662 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37 Gerrit-Change-Number: 13662 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: roh Gerrit-Comment-Date: Wed, 17 Apr 2019 18:23:10 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 18:23:58 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 18:23:58 +0000 Subject: Change in osmo-trx[master]: lms: add device type detection and device specific gains In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13663 ) Change subject: lms: add device type detection and device specific gains ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13663 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181 Gerrit-Change-Number: 13663 Gerrit-PatchSet: 3 Gerrit-Owner: roh Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 17 Apr 2019 18:23:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 18:24:10 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 18:24:10 +0000 Subject: Change in osmo-trx[master]: lms: properly call close if set_antennas() fails, add some comments In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13667 ) Change subject: lms: properly call close if set_antennas() fails, add some comments ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13667 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9ebe986ee3a15842a15853424ee98e9a2fa6a5df Gerrit-Change-Number: 13667 Gerrit-PatchSet: 2 Gerrit-Owner: roh Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 17 Apr 2019 18:24:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 18:24:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 18:24:12 +0000 Subject: Change in osmo-trx[master]: lms: Remove wrong unused code copied from -uhd In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13660 ) Change subject: lms: Remove wrong unused code copied from -uhd ...................................................................... lms: Remove wrong unused code copied from -uhd Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 2 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index b004308..33e3cbd 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -548,11 +548,8 @@ } GSM::Time LMSDevice::minLatency() { - /* Empirical data from a handful of - relatively recent machines shows that the B100 will underrun when - the transmit threshold is reduced to a time of 6 and a half frames, - so we set a minimum 7 frame threshold. */ - return GSM::Time(6,7); + /* UNUSED on limesdr (only used on usrp1/2) */ + return GSM::Time(0,0); } void LMSDevice::update_stream_stats(size_t chan, bool * underrun, bool * overrun) -- To view, visit https://gerrit.osmocom.org/13660 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d Gerrit-Change-Number: 13660 Gerrit-PatchSet: 3 Gerrit-Owner: roh Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 18:24:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 18:24:12 +0000 Subject: Change in osmo-trx[master]: lms: move LMS_EnableChannel from Start/Stop to Open/Close device In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13661 ) Change subject: lms: move LMS_EnableChannel from Start/Stop to Open/Close device ...................................................................... lms: move LMS_EnableChannel from Start/Stop to Open/Close device move enable: it is important that channels are actually enabled before applying any configuration (besides external clock) move disable: move to close, so channels are not disabled and not enabled again while osmotrx is active. Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9 --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 14 insertions(+), 8 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 33e3cbd..45427cf 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -78,8 +78,14 @@ LMSDevice::~LMSDevice() { + unsigned int i; LOGC(DDEV, INFO) << "Closing LMS device"; if (m_lms_dev) { + /* disable all channels */ + for (i=0; i Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 18:24:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 18:24:12 +0000 Subject: Change in osmo-trx[master]: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13662 ) Change subject: lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start ...................................................................... lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to start bandwidth, freqency, gain stages need to be set before calibration can be successful Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37 --- M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/lms/LMSDevice.h 2 files changed, 50 insertions(+), 27 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 45427cf..083b88e 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -153,8 +153,8 @@ { //lms_info_str_t dev_str; lms_info_str_t* info_list; - lms_range_t range_lpfbw_rx, range_lpfbw_tx, range_sr; - float_type sr_host, sr_rf, lpfbw_rx, lpfbw_tx; + lms_range_t range_sr; + float_type sr_host, sr_rf; uint16_t dac_val; unsigned int i, n; int rc, dev_id; @@ -244,36 +244,11 @@ goto out_close; } - if (LMS_GetLPFBWRange(m_lms_dev, LMS_CH_RX, &range_lpfbw_rx)) - goto out_close; - print_range("LPFBWRange Rx", &range_lpfbw_rx); - if (LMS_GetLPFBWRange(m_lms_dev, LMS_CH_RX, &range_lpfbw_tx)) - goto out_close; - print_range("LPFBWRange Tx", &range_lpfbw_tx); - lpfbw_rx = OSMO_MIN(OSMO_MAX(1.4001e6, range_lpfbw_rx.min), range_lpfbw_rx.max); - lpfbw_tx = OSMO_MIN(OSMO_MAX(5.2e6, range_lpfbw_tx.min), range_lpfbw_tx.max); - - LOGC(DDEV, INFO) << "LPFBW: Rx=" << lpfbw_rx << " Tx=" << lpfbw_tx; - if (!set_antennas()) { LOGC(DDEV, ALERT) << "LMS antenna setting failed"; return -1; } - /* Perform Rx and Tx calibration */ - for (i=0; i Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: roh -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 18:24:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 18:24:13 +0000 Subject: Change in osmo-trx[master]: lms: add device type detection and device specific gains In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13663 ) Change subject: lms: add device type detection and device specific gains ...................................................................... lms: add device type detection and device specific gains add device dependant max gain setup - limesdr mini and limenet micro need slightly reduced maximum gains to get a PASS on phase error measurements rework clock reference setup - external clock needs to be selected before calling LMS_Init(), internal can only be set after. remove now unused compat_LMS_VCTCXO* functions - we do not set the VCTXCO directly anymore Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181 --- M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/lms/LMSDevice.h M configure.ac 3 files changed, 40 insertions(+), 58 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 083b88e..34ad6e8 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -41,24 +41,6 @@ #define LMS_MIN_BW_SUPPORTED 2.5e6 /* 2.5mHz, minimum supported by LMS */ #define LMS_CALIBRATE_BW_HZ OSMO_MAX(GSM_CARRIER_BW, LMS_MIN_BW_SUPPORTED) -static int compat_LMS_VCTCXORead(lms_device_t *dev, uint16_t *val, bool memory) -{ -#if HAVE_LMS_VCTCXO_EEPROM_SAVING - return LMS_VCTCXORead(dev, val, memory); -#else - return LMS_VCTCXORead(dev, val); -#endif -} - -static int compat_LMS_VCTCXOWrite(lms_device_t *dev, uint16_t val, bool memory) -{ -#if HAVE_LMS_VCTCXO_EEPROM_SAVING - return LMS_VCTCXOWrite(dev, val, memory); -#else - return LMS_VCTCXOWrite(dev, val); -#endif -} - LMSDevice::LMSDevice(size_t tx_sps, size_t rx_sps, InterfaceType iface, size_t chans, double lo_offset, const std::vector& tx_paths, const std::vector& rx_paths): @@ -151,11 +133,10 @@ int LMSDevice::open(const std::string &args, int ref, bool swap_channels) { - //lms_info_str_t dev_str; lms_info_str_t* info_list; + const lms_dev_info_t* device_info; lms_range_t range_sr; float_type sr_host, sr_rf; - uint16_t dac_val; unsigned int i, n; int rc, dev_id; @@ -194,12 +175,45 @@ delete [] info_list; + device_info = LMS_GetDeviceInfo(m_lms_dev); + + if ((ref != REF_EXTERNAL) && (ref != REF_INTERNAL)){ + LOGC(DDEV, ERROR) << "Invalid reference type"; + goto out_close; + } + + /* if reference clock is external setup must happen _before_ calling LMS_Init */ + /* FIXME make external reference frequency configurable */ + if (ref == REF_EXTERNAL) { + LOGC(DDEV, INFO) << "Setting External clock reference to 10MHz"; + /* Assume an external 10 MHz reference clock */ + if (LMS_SetClockFreq(m_lms_dev, LMS_CLOCK_EXTREF, 10000000.0) < 0) + goto out_close; + } + LOGC(DDEV, INFO) << "Init LMS device"; if (LMS_Init(m_lms_dev) != 0) { LOGC(DDEV, ERROR) << "LMS_Init() failed"; goto out_close; } + /* LimeSDR-Mini does not have switches but needs soldering to select external/internal clock */ + /* LimeNET-Micro also does not like selecting internal clock*/ + /* also set device specific maximum tx levels selected by phasenoise measurements*/ + if (strncmp(device_info->deviceName,"LimeSDR-USB",11) == 0){ + /* if reference clock is internal setup must happen _after_ calling LMS_Init */ + /* according to lms using LMS_CLOCK_EXTREF with a frequency <= 0 is the correct way to set clock to internal reference*/ + if (ref == REF_INTERNAL) { + LOGC(DDEV, INFO) << "Setting Internal clock reference"; + if (LMS_SetClockFreq(m_lms_dev, LMS_CLOCK_EXTREF, -1) < 0) + goto out_close; + } + maxTxGainClamp = 73.0; + } else if (strncmp(device_info->deviceName,"LimeSDR-Mini",12) == 0) + maxTxGainClamp = 66.0; + else + maxTxGainClamp = 71.0; /* "LimeNET-Micro", etc FIXME pciE based LMS boards?*/ + /* enable all used channels */ for (i=0; i(8.9e-5 * GSMRATE * tx_sps); /* time * sample_rate */ - switch (ref) { - case REF_INTERNAL: - LOGC(DDEV, INFO) << "Setting Internal clock reference"; - /* Ugly API: Selecting clock source implicit by writing to VCTCXO DAC ?!? */ - if (compat_LMS_VCTCXORead(m_lms_dev, &dac_val, false) < 0) - goto out_close; - LOGC(DDEV, INFO) << "Setting VCTCXO to " << dac_val; - if (compat_LMS_VCTCXOWrite(m_lms_dev, dac_val, false) < 0) - goto out_close; - break; - case REF_EXTERNAL: - LOGC(DDEV, INFO) << "Setting External clock reference to " << 10000000.0; - /* Assume an external 10 MHz reference clock */ - if (LMS_SetClockFreq(m_lms_dev, LMS_CLOCK_EXTREF, 10000000.0) < 0) - goto out_close; - break; - default: - LOGC(DDEV, ALERT) << "Invalid reference type"; - goto out_close; - } - if (!set_antennas()) { LOGC(DDEV, ALERT) << "LMS antenna setting failed"; return -1; @@ -275,8 +268,10 @@ /* configure the channels/streams */ for (i=0; i 18.10 broke API compatibility: - _cflags_save=$CFLAGS - CFLAGS="$CFLAGS $LMS_CFLAGS" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[LMS_VCTCXOWrite(NULL, 0, false); LMS_VCTCXORead(NULL, 0, false);]] - )], - [AC_DEFINE([HAVE_LMS_VCTCXO_EEPROM_SAVING], [1], - [LMS_VCTCXO* requires memory parameter])], - [AC_DEFINE([HAVE_LMS_VCTCXO_EEPROM_SAVING], [0], - [LMS_VCTCXO* has no memory parameter])]) - CFLAGS=$_cflags_save ]) AS_IF([test "x$with_uhd" != "xno"],[ -- To view, visit https://gerrit.osmocom.org/13663 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181 Gerrit-Change-Number: 13663 Gerrit-PatchSet: 4 Gerrit-Owner: roh Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 17 18:24:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Apr 2019 18:24:13 +0000 Subject: Change in osmo-trx[master]: lms: properly call close if set_antennas() fails, add some comments In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13667 ) Change subject: lms: properly call close if set_antennas() fails, add some comments ...................................................................... lms: properly call close if set_antennas() fails, add some comments Change-Id: I9ebe986ee3a15842a15853424ee98e9a2fa6a5df --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 34ad6e8..05904e8 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -222,6 +222,7 @@ goto out_close; } + /* set samplerate */ if (LMS_GetSampleRateRange(m_lms_dev, LMS_CH_RX, &range_sr)) goto out_close; print_range("Sample Rate", &range_sr); @@ -237,9 +238,10 @@ /* FIXME: make this device/model dependent, like UHDDevice:dev_param_map! */ ts_offset = static_cast(8.9e-5 * GSMRATE * tx_sps); /* time * sample_rate */ + /* configure antennas */ if (!set_antennas()) { LOGC(DDEV, ALERT) << "LMS antenna setting failed"; - return -1; + goto out_close; } samplesRead = 0; @@ -281,6 +283,7 @@ if (!do_calib(i)) return false; + /* configure Streams */ m_lms_stream_rx[i] = {}; m_lms_stream_rx[i].isTx = false; m_lms_stream_rx[i].channel = i; -- To view, visit https://gerrit.osmocom.org/13667 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9ebe986ee3a15842a15853424ee98e9a2fa6a5df Gerrit-Change-Number: 13667 Gerrit-PatchSet: 3 Gerrit-Owner: roh Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 11:02:39 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Apr 2019 11:02:39 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Update limesuite hash to support LimeNet-Micro Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13696 Change subject: nightly-packages: Update limesuite hash to support LimeNet-Micro ...................................................................... nightly-packages: Update limesuite hash to support LimeNet-Micro Newer LimeSuite (at least 7557e291209fc66a78ffa74dd8314e75841f7c96) is required to have LimeNet-Micro working properly with osmo-trx. We update to current newest master since other fixes related to sample rate are applied after the commit mentioned above. Related: OS#3861 Change-Id: I62779f3bdbc4a459363a1d660d96d5f02f7763c1 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/96/13696/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 61cb250..0d4db2d 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -143,7 +143,7 @@ checkout_limesuite() { cd "$REPO" git clone https://github.com/myriadrf/LimeSuite limesuite - TAG="$(get_last_tag limesuite)" + TAG="357ad5dd0d71304179d476b38e67240527d917df" cd limesuite git checkout "$TAG" } @@ -203,7 +203,7 @@ create_osmo_trx_debian8_jessie - build limesuite no_commit --git-upstream-tree="$(get_last_tag limesuite)" + build limesuite no_commit --git-upstream-tree="357ad5dd0d71304179d476b38e67240527d917df" build osmo-gsm-manuals build libosmocore build libosmo-sccp -- To view, visit https://gerrit.osmocom.org/13696 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I62779f3bdbc4a459363a1d660d96d5f02f7763c1 Gerrit-Change-Number: 13696 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 11:57:52 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Thu, 18 Apr 2019 11:57:52 +0000 Subject: Change in osmo-sgsn[master]: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13628 ) Change subject: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13628/1/src/gprs/gprs_gb_parse.c File src/gprs/gprs_gb_parse.c: https://gerrit.osmocom.org/#/c/13628/1/src/gprs/gprs_gb_parse.c at 390 PS1, Line 390: case GSM48_MT_GSM_DEACT_PDP_ACK: Since GSM48_MT_GSM_ACT_PDP_REQ extracts the apn to parse_ctx->apn_ie we could set parse_ctx->apn_ie{,_len} back to 0 here. I don't think it really matters, though. We shouldn't get any meaningful packets with apn set after a PDP deact ACK anyway. -- To view, visit https://gerrit.osmocom.org/13628 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I20bf4db8da746e0b994bfe3f8178188831b67ed3 Gerrit-Change-Number: 13628 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Thu, 18 Apr 2019 11:57:52 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 13:10:30 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Apr 2019 13:10:30 +0000 Subject: Change in libosmo-sccp[master]: add caller-owns-msgb variant osmo_sccp_user_sap_down_nofree() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13277 ) Change subject: add caller-owns-msgb variant osmo_sccp_user_sap_down_nofree() ...................................................................... add caller-owns-msgb variant osmo_sccp_user_sap_down_nofree() Add osmo_sccp_user_sap_down_nofree(), which is identical to osmo_sccp_user_sap_down(), but doesn't imply a msgb_free(). To implement that, sccp_sclc_user_sap_down_nofree() with the same msgb semantics is required. Rationale: Avoiding msgb leaks is easiest if the caller retains ownership of the msgb. Take this hypothetical chain where leaks are obviously avoided: void send() { msg = msgb_alloc(); dispatch(msg); msgb_free(msg); } void dispatch(msg) { osmo_fsm_inst_dispatch(fi, msg); } void fi_on_event(fi, data) { if (socket_is_ok) socket_write((struct msgb*)data); } void socket_write(msgb) { if (!ok1) return; if (ok2) { if (!ok3) return; write(sock, msg->data); } } However, if the caller passes ownership down to the msgb consumer, things become nightmarishly complex: void send() { msg = msgb_alloc(); rc = dispatch(msg); /* dispatching event failed? */ if (rc) msgb_free(msg); } int dispatch(msg) { if (osmo_fsm_inst_dispatch(fi, msg)) return -1; if (something_else()) return -1; // <-- double free! } void fi_on_event(fi, data) { if (socket_is_ok) { socket_write((struct msgb*)data); else /* socket didn't consume? */ msgb_free(data); } int socket_write(msgb) { if (!ok1) return -1; // <-- leak! if (ok2) { if (!ok3) goto out; write(sock, msg->data); } out: msgb_free(msg); return -2; } If any link in this call chain fails to be aware of the importance to return a failed RC or to free a msgb if the chain is broken, or to not return a failed RC if the msgb is consumed, we have a hidden msgb leak or double free. This is the case with osmo_sccp_user_sap_down(). In new osmo-msc, passing data through various FSM instances, there is high potential for leak/double-free bugs. A very large brain is required to track down every msgb path. osmo_sccp_user_sap_down_nofree() makes this problem trivial to solve even for humans. Change-Id: Ic818efa78b90f727e1a94c18b60d9a306644f340 --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_internal.h M src/sccp_sclc.c M src/sccp_scoc.c 4 files changed, 38 insertions(+), 23 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 84d762c..f64b7aa 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -263,6 +263,7 @@ osmo_prim_cb prim_cb, uint16_t ssn); int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); +int osmo_sccp_user_sap_down_nofree(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); struct osmo_ss7_instance * osmo_sccp_addr_by_name(struct osmo_sccp_addr *dest_addr, diff --git a/src/sccp_internal.h b/src/sccp_internal.h index ad8a6fd..8df6c9b 100644 --- a/src/sccp_internal.h +++ b/src/sccp_internal.h @@ -116,6 +116,7 @@ /* SCU -> SCLC */ int sccp_sclc_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); +int sccp_sclc_user_sap_down_nofree(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph); struct msgb *sccp_msgb_alloc(const char *name); diff --git a/src/sccp_sclc.c b/src/sccp_sclc.c index db67660..218fb56 100644 --- a/src/sccp_sclc.c +++ b/src/sccp_sclc.c @@ -115,15 +115,14 @@ return rc; } -/*! \brief Main entrance function for primitives from SCCP User +/*! Main entrance function for primitives from SCCP User. + * The caller is required to free oph->msg, otherwise the same as sccp_sclc_user_sap_down(). * \param[in] scu SCCP User who is sending the primitive * \param[on] oph Osmocom primitive header of the primitive * \returns 0 on success; negtive in case of error */ -int sccp_sclc_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph) +int sccp_sclc_user_sap_down_nofree(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph) { struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; - struct msgb *msg = prim->oph.msg; - int rc = 0; /* we get called from osmo_sccp_user_sap_down() which already * has debug-logged the primitive */ @@ -131,20 +130,26 @@ switch (OSMO_PRIM_HDR(&prim->oph)) { case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_REQUEST): /* Connectionless by-passes this altogether */ - rc = xua_gen_encode_and_send(scu, -1, prim, SUA_CL_CLDT); - goto out; + return xua_gen_encode_and_send(scu, -1, prim, SUA_CL_CLDT); default: LOGP(DLSCCP, LOGL_ERROR, "Received unknown SCCP User " "primitive %s from user\n", osmo_scu_prim_name(&prim->oph)); - rc = -1; - goto out; + return -1; } +} -out: - /* the SAP is supposed to consume the primitive/msgb */ +/*! Main entrance function for primitives from SCCP User. + * Implies a msgb_free(oph->msg), otherwise the same as sccp_sclc_user_sap_down_nofree(). + * \param[in] scu SCCP User who is sending the primitive + * \param[on] oph Osmocom primitive header of the primitive + * \returns 0 on success; negtive in case of error */ +int sccp_sclc_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph) +{ + struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; + struct msgb *msg = prim->oph.msg; + int rc = sccp_sclc_user_sap_down_nofree(scu, oph); msgb_free(msg); - return rc; } diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index 91a1ab7..7570764 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1694,15 +1694,15 @@ } } -/*! \brief Main entrance function for primitives from SCCP User +/*! Main entrance function for primitives from SCCP User. + * The caller is required to free oph->msg, otherwise the same as osmo_sccp_user_sap_down(). * \param[in] scu SCCP User sending us the primitive * \param[in] oph Osmocom primitive sent by the user * \returns 0 on success; negative on error */ -int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph) +int osmo_sccp_user_sap_down_nofree(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph) { struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; struct osmo_sccp_instance *inst = scu->inst; - struct msgb *msg = prim->oph.msg; struct sccp_connection *conn; int rc = 0; int event; @@ -1714,7 +1714,7 @@ case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_REQUEST): /* other CL primitives? */ /* Connectionless by-passes this altogether */ - return sccp_sclc_user_sap_down(scu, oph); + return sccp_sclc_user_sap_down_nofree(scu, oph); case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_REQUEST): /* Allocate new connection structure */ conn = conn_create_id(scu, prim->u.connect.conn_id); @@ -1722,7 +1722,7 @@ /* FIXME: inform SCCP user with proper reply */ LOGP(DLSCCP, LOGL_ERROR, "Cannot create conn-id for primitive %s\n", osmo_scu_prim_name(&prim->oph)); - goto out; + return rc; } break; case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_RESPONSE): @@ -1735,25 +1735,33 @@ /* FIXME: inform SCCP user with proper reply */ LOGP(DLSCCP, LOGL_ERROR, "Received unknown conn-id %u for primitive %s\n", scu_prim_conn_id(prim), osmo_scu_prim_name(&prim->oph)); - goto out; + return rc; } break; default: LOGP(DLSCCP, LOGL_ERROR, "Received unknown primitive %s\n", osmo_scu_prim_name(&prim->oph)); - rc = -1; - goto out; + return -1; } /* Map from primitive to event */ event = osmo_event_for_prim(oph, scu_scoc_event_map); /* Dispatch event into connection */ - rc = osmo_fsm_inst_dispatch(conn->fi, event, prim); -out: - /* the SAP is supposed to consume the primitive/msgb */ - msgb_free(msg); + return osmo_fsm_inst_dispatch(conn->fi, event, prim); +} +/*! Main entrance function for primitives from SCCP User. + * Implies a msgb_free(oph->msg), otherwise the same as osmo_sccp_user_sap(). + * \param[in] scu SCCP User sending us the primitive + * \param[in] oph Osmocom primitive sent by the user + * \returns 0 on success; negative on error */ +int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph) +{ + struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; + struct msgb *msg = prim->oph.msg; + int rc = osmo_sccp_user_sap_down_nofree(scu, oph); + msgb_free(msg); return rc; } -- To view, visit https://gerrit.osmocom.org/13277 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic818efa78b90f727e1a94c18b60d9a306644f340 Gerrit-Change-Number: 13277 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 13:10:31 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Apr 2019 13:10:31 +0000 Subject: Change in libosmo-sccp[master]: add osmo_sccp_addr_cmp(), osmo_sccp_addr_ri_cmp() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13118 ) Change subject: add osmo_sccp_addr_cmp(), osmo_sccp_addr_ri_cmp() ...................................................................... add osmo_sccp_addr_cmp(), osmo_sccp_addr_ri_cmp() osmo-msc identifies its BSC and RNC peers by SCCP address, and compares those by memcmp(), which is not really accurate. Rather provide a meaningful osmo_sccp_addr_cmp() API to determine whether SCCP addresses are identical. Go for a full cmp that would also allow sorting. Change-Id: Ie9e2add7bbfae651c04e230d62e37cebeb91b0f5 --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_user.c M tests/xua/xua_test.c M tests/xua/xua_test.ok 4 files changed, 392 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index f64b7aa..9d285eb 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -276,5 +276,8 @@ uint32_t ssn); bool osmo_sccp_check_addr(struct osmo_sccp_addr *addr, uint32_t presence); +int osmo_sccp_addr_cmp(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b, uint32_t presence_criteria); +int osmo_sccp_addr_ri_cmp(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b); +int osmo_sccp_gt_cmp(const struct osmo_sccp_gt *a, const struct osmo_sccp_gt *b); const char *osmo_sccp_user_name(struct osmo_sccp_user *scu); diff --git a/src/sccp_user.c b/src/sccp_user.c index 8a98e46..63eba2a 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -293,6 +293,124 @@ return true; } +/*! Compare two SCCP Global Titles. + * \param[in] a left side. + * \param[in] b right side. + * \return -1 if a < b, 1 if a > b, and 0 if a == b. + */ +int osmo_sccp_gt_cmp(const struct osmo_sccp_gt *a, const struct osmo_sccp_gt *b) +{ + if (a == b) + return 0; + if (!a) + return -1; + if (!b) + return 1; + return memcmp(a, b, sizeof(*a)); +} + +/*! Compare two SCCP addresses by given presence criteria. + * Any OSMO_SCCP_ADDR_T_* type not set in presence_criteria is ignored. + * In case all bits are set in presence_criteria, the comparison is in the order of: + * OSMO_SCCP_ADDR_T_GT, OSMO_SCCP_ADDR_T_PC, OSMO_SCCP_ADDR_T_IPv4, OSMO_SCCP_ADDR_T_IPv6, OSMO_SCCP_ADDR_T_SSN. + * The SCCP addresses' Routing Indicator is not compared, see osmo_sccp_addr_ri_cmp(). + * \param[in] a left side. + * \param[in] b right side. + * \param[in] presence_criteria A bitmask of OSMO_SCCP_ADDR_T_* values, or 0xffffffff to compare all parts, except the + * routing indicator. + * \return -1 if a < b, 1 if a > b, and 0 if all checked values match. + */ +int osmo_sccp_addr_cmp(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b, uint32_t presence_criteria) +{ + int rc; + if (a == b) + return 0; + if (!a) + return -1; + if (!b) + return 1; + + if (presence_criteria & OSMO_SCCP_ADDR_T_GT) { + if ((a->presence & OSMO_SCCP_ADDR_T_GT) != (b->presence & OSMO_SCCP_ADDR_T_GT)) + return (b->presence & OSMO_SCCP_ADDR_T_GT) ? -1 : 1; + rc = osmo_sccp_gt_cmp(&a->gt, &b->gt); + if (rc) + return rc; + } + + if (presence_criteria & OSMO_SCCP_ADDR_T_PC) { + if ((a->presence & OSMO_SCCP_ADDR_T_PC) != (b->presence & OSMO_SCCP_ADDR_T_PC)) + return (b->presence & OSMO_SCCP_ADDR_T_PC) ? -1 : 1; + + if ((a->presence & OSMO_SCCP_ADDR_T_PC) + && a->pc != b->pc) + return (a->pc < b->pc)? -1 : 1; + } + + if (presence_criteria & OSMO_SCCP_ADDR_T_IPv4) { + if ((a->presence & OSMO_SCCP_ADDR_T_IPv4) != (b->presence & OSMO_SCCP_ADDR_T_IPv4)) + return (b->presence & OSMO_SCCP_ADDR_T_IPv4) ? -1 : 1; + rc = memcmp(&a->ip.v4, &b->ip.v4, sizeof(a->ip.v4)); + if (rc) + return rc; + } + + if (presence_criteria & OSMO_SCCP_ADDR_T_IPv6) { + if ((a->presence & OSMO_SCCP_ADDR_T_IPv6) != (b->presence & OSMO_SCCP_ADDR_T_IPv6)) + return (b->presence & OSMO_SCCP_ADDR_T_IPv6) ? -1 : 1; + rc = memcmp(&a->ip.v6, &b->ip.v6, sizeof(a->ip.v6)); + if (rc) + return rc; + } + + if (presence_criteria & OSMO_SCCP_ADDR_T_SSN) { + if ((a->presence & OSMO_SCCP_ADDR_T_SSN) != (b->presence & OSMO_SCCP_ADDR_T_SSN)) + return (b->presence & OSMO_SCCP_ADDR_T_SSN) ? -1 : 1; + if (a->ssn != b->ssn) + return (a->ssn < b->ssn) ? -1 : 1; + } + + return 0; +} + +/*! Compare the routing information of two SCCP addresses. + * Compare the ri of a and b, and, if equal, return osmo_sccp_addr_cmp() with presence criteria selected according to + * ri. + * \param[in] a left side. + * \param[in] b right side. + * \return -1 if a < b, 1 if a > b, and 0 if a == b. + */ +int osmo_sccp_addr_ri_cmp(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b) +{ + uint32_t presence_criteria; + if (a == b) + return 0; + if (!a) + return -1; + if (!b) + return 1; + if (a->ri != b->ri) + return (a->ri < b->ri) ? -1 : 1; + switch (a->ri) { + case OSMO_SCCP_RI_NONE: + return 0; + case OSMO_SCCP_RI_GT: + presence_criteria = OSMO_SCCP_ADDR_T_GT; + break; + case OSMO_SCCP_RI_SSN_PC: + presence_criteria = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC; + break; + case OSMO_SCCP_RI_SSN_IP: + /* Pick IPv4 or v6 depending on what a->presence indicates. */ + presence_criteria = OSMO_SCCP_ADDR_T_SSN | (a->presence & (OSMO_SCCP_ADDR_T_IPv4 | OSMO_SCCP_ADDR_T_IPv6)); + break; + default: + return 0; + } + + return osmo_sccp_addr_cmp(a, b, presence_criteria); +} + /*! Compose a human readable string to describe the SCCP user's connection. * The output follows ['':], e.g. "'OsmoHNBW':RI=SSN_PC,PC=0.23.5,SSN=RANAP", * or just "RI=SSN_PC,PC=0.23.5,SSN=RANAP" if no scu->name is set. diff --git a/tests/xua/xua_test.c b/tests/xua/xua_test.c index 37ba645..77daa56 100644 --- a/tests/xua/xua_test.c +++ b/tests/xua/xua_test.c @@ -569,6 +569,32 @@ talloc_free(xua); } +void test_sccp_addr_cmp() +{ + int ai; + int bi; + int rc; + + printf("\n%s()\n", __func__); + + for (ai = 0; ai < ARRAY_SIZE(enc_cases); ai++) { + for (bi = 0; bi < ARRAY_SIZE(enc_cases); bi++) { + struct osmo_sccp_addr a = enc_cases[ai].addr_in; + struct osmo_sccp_addr b = enc_cases[bi].addr_in; + + rc = osmo_sccp_addr_cmp(&a, &b, a.presence); + rc = OSMO_MIN(1, OSMO_MAX(-1, rc)); + printf(" [%2d] vs. [%2d]: %2d = osmo_sccp_addr_cmp( %s ,", ai, bi, rc, osmo_sccp_addr_dump(&a)); + printf(" %s, 0x%x )\n", osmo_sccp_addr_dump(&b), a.presence); + + rc = osmo_sccp_addr_ri_cmp(&a, &b); + rc = OSMO_MIN(1, OSMO_MAX(-1, rc)); + printf(" %2d = osmo_sccp_addr_ri_cmp( %s ,", rc, osmo_sccp_addr_dump(&a)); + printf(" %s )\n", osmo_sccp_addr_dump(&b)); + } + } +}; + static const struct log_info_cat default_categories[] = { [0] = { @@ -598,6 +624,7 @@ test_sccp2sua(); test_rkm(); test_sccp_addr_encdec(); + test_sccp_addr_cmp(); printf("All tests passed.\n"); return 0; diff --git a/tests/xua/xua_test.ok b/tests/xua/xua_test.ok index 83b8b8d..f93b41e 100644 --- a/tests/xua/xua_test.ok +++ b/tests/xua/xua_test.ok @@ -205,4 +205,248 @@ expected addr: 10031204a1fb decod addr: RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) + +test_sccp_addr_cmp() + [ 0] vs. [ 0]: 0 = osmo_sccp_addr_cmp( RI=2,PC=1024 , RI=2,PC=1024, 0x2 ) + 0 = osmo_sccp_addr_ri_cmp( RI=2,PC=1024 , RI=2,PC=1024 ) + [ 0] vs. [ 1]: -1 = osmo_sccp_addr_cmp( RI=2,PC=1024 , RI=2,PC=16383, 0x2 ) + -1 = osmo_sccp_addr_ri_cmp( RI=2,PC=1024 , RI=2,PC=16383 ) + [ 0] vs. [ 2]: -1 = osmo_sccp_addr_cmp( RI=2,PC=1024 , RI=2,PC=16383,SSN=90, 0x2 ) + -1 = osmo_sccp_addr_ri_cmp( RI=2,PC=1024 , RI=2,PC=16383,SSN=90 ) + [ 0] vs. [ 3]: -1 = osmo_sccp_addr_cmp( RI=2,PC=1024 , RI=2,PC=16383,GTI=1,GT=(), 0x2 ) + -1 = osmo_sccp_addr_ri_cmp( RI=2,PC=1024 , RI=2,PC=16383,GTI=1,GT=() ) + [ 0] vs. [ 4]: 1 = osmo_sccp_addr_cmp( RI=2,PC=1024 , RI=1,GTI=1,GT=(), 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=1024 , RI=1,GTI=1,GT=() ) + [ 0] vs. [ 5]: 1 = osmo_sccp_addr_cmp( RI=2,PC=1024 , RI=1,GTI=2,GT=(TT=3,DIG=), 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=1024 , RI=1,GTI=2,GT=(TT=3,DIG=) ) + [ 0] vs. [ 6]: 1 = osmo_sccp_addr_cmp( RI=2,PC=1024 , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123), 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=1024 , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) ) + [ 0] vs. [ 7]: 1 = osmo_sccp_addr_cmp( RI=2,PC=1024 , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234), 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=1024 , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) ) + [ 0] vs. [ 8]: 1 = osmo_sccp_addr_cmp( RI=2,PC=1024 , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234), 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=1024 , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) ) + [ 0] vs. [ 9]: 1 = osmo_sccp_addr_cmp( RI=2,PC=1024 , RI=1,GTI=23,GT=(DIG=1234), 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=1024 , RI=1,GTI=23,GT=(DIG=1234) ) + [ 0] vs. [10]: 1 = osmo_sccp_addr_cmp( RI=2,PC=1024 , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF), 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=1024 , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) ) + [ 1] vs. [ 0]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383 , RI=2,PC=1024, 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383 , RI=2,PC=1024 ) + [ 1] vs. [ 1]: 0 = osmo_sccp_addr_cmp( RI=2,PC=16383 , RI=2,PC=16383, 0x2 ) + 0 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383 , RI=2,PC=16383 ) + [ 1] vs. [ 2]: 0 = osmo_sccp_addr_cmp( RI=2,PC=16383 , RI=2,PC=16383,SSN=90, 0x2 ) + -1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383 , RI=2,PC=16383,SSN=90 ) + [ 1] vs. [ 3]: 0 = osmo_sccp_addr_cmp( RI=2,PC=16383 , RI=2,PC=16383,GTI=1,GT=(), 0x2 ) + 0 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383 , RI=2,PC=16383,GTI=1,GT=() ) + [ 1] vs. [ 4]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383 , RI=1,GTI=1,GT=(), 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383 , RI=1,GTI=1,GT=() ) + [ 1] vs. [ 5]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383 , RI=1,GTI=2,GT=(TT=3,DIG=), 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383 , RI=1,GTI=2,GT=(TT=3,DIG=) ) + [ 1] vs. [ 6]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383 , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123), 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383 , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) ) + [ 1] vs. [ 7]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383 , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234), 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383 , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) ) + [ 1] vs. [ 8]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383 , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234), 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383 , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) ) + [ 1] vs. [ 9]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383 , RI=1,GTI=23,GT=(DIG=1234), 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383 , RI=1,GTI=23,GT=(DIG=1234) ) + [ 1] vs. [10]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383 , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF), 0x2 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383 , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) ) + [ 2] vs. [ 0]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383,SSN=90 , RI=2,PC=1024, 0x6 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,SSN=90 , RI=2,PC=1024 ) + [ 2] vs. [ 1]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383,SSN=90 , RI=2,PC=16383, 0x6 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,SSN=90 , RI=2,PC=16383 ) + [ 2] vs. [ 2]: 0 = osmo_sccp_addr_cmp( RI=2,PC=16383,SSN=90 , RI=2,PC=16383,SSN=90, 0x6 ) + 0 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,SSN=90 , RI=2,PC=16383,SSN=90 ) + [ 2] vs. [ 3]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383,SSN=90 , RI=2,PC=16383,GTI=1,GT=(), 0x6 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,SSN=90 , RI=2,PC=16383,GTI=1,GT=() ) + [ 2] vs. [ 4]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383,SSN=90 , RI=1,GTI=1,GT=(), 0x6 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,SSN=90 , RI=1,GTI=1,GT=() ) + [ 2] vs. [ 5]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383,SSN=90 , RI=1,GTI=2,GT=(TT=3,DIG=), 0x6 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,SSN=90 , RI=1,GTI=2,GT=(TT=3,DIG=) ) + [ 2] vs. [ 6]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383,SSN=90 , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123), 0x6 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,SSN=90 , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) ) + [ 2] vs. [ 7]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383,SSN=90 , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234), 0x6 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,SSN=90 , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) ) + [ 2] vs. [ 8]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383,SSN=90 , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234), 0x6 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,SSN=90 , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) ) + [ 2] vs. [ 9]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383,SSN=90 , RI=1,GTI=23,GT=(DIG=1234), 0x6 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,SSN=90 , RI=1,GTI=23,GT=(DIG=1234) ) + [ 2] vs. [10]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383,SSN=90 , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF), 0x6 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,SSN=90 , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) ) + [ 3] vs. [ 0]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=2,PC=1024, 0x3 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=2,PC=1024 ) + [ 3] vs. [ 1]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=2,PC=16383, 0x3 ) + 0 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=2,PC=16383 ) + [ 3] vs. [ 2]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=2,PC=16383,SSN=90, 0x3 ) + -1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=2,PC=16383,SSN=90 ) + [ 3] vs. [ 3]: 0 = osmo_sccp_addr_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=2,PC=16383,GTI=1,GT=(), 0x3 ) + 0 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=2,PC=16383,GTI=1,GT=() ) + [ 3] vs. [ 4]: 1 = osmo_sccp_addr_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=1,GTI=1,GT=(), 0x3 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=1,GTI=1,GT=() ) + [ 3] vs. [ 5]: -1 = osmo_sccp_addr_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=1,GTI=2,GT=(TT=3,DIG=), 0x3 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=1,GTI=2,GT=(TT=3,DIG=) ) + [ 3] vs. [ 6]: -1 = osmo_sccp_addr_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123), 0x3 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) ) + [ 3] vs. [ 7]: -1 = osmo_sccp_addr_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234), 0x3 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) ) + [ 3] vs. [ 8]: -1 = osmo_sccp_addr_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234), 0x3 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) ) + [ 3] vs. [ 9]: -1 = osmo_sccp_addr_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=1,GTI=23,GT=(DIG=1234), 0x3 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=1,GTI=23,GT=(DIG=1234) ) + [ 3] vs. [10]: -1 = osmo_sccp_addr_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF), 0x3 ) + 1 = osmo_sccp_addr_ri_cmp( RI=2,PC=16383,GTI=1,GT=() , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) ) + [ 4] vs. [ 0]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=1,GT=() , RI=2,PC=1024, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=1,GT=() , RI=2,PC=1024 ) + [ 4] vs. [ 1]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=1,GT=() , RI=2,PC=16383, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=1,GT=() , RI=2,PC=16383 ) + [ 4] vs. [ 2]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=1,GT=() , RI=2,PC=16383,SSN=90, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=1,GT=() , RI=2,PC=16383,SSN=90 ) + [ 4] vs. [ 3]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=1,GT=() , RI=2,PC=16383,GTI=1,GT=(), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=1,GT=() , RI=2,PC=16383,GTI=1,GT=() ) + [ 4] vs. [ 4]: 0 = osmo_sccp_addr_cmp( RI=1,GTI=1,GT=() , RI=1,GTI=1,GT=(), 0x1 ) + 0 = osmo_sccp_addr_ri_cmp( RI=1,GTI=1,GT=() , RI=1,GTI=1,GT=() ) + [ 4] vs. [ 5]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=1,GT=() , RI=1,GTI=2,GT=(TT=3,DIG=), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=1,GT=() , RI=1,GTI=2,GT=(TT=3,DIG=) ) + [ 4] vs. [ 6]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=1,GT=() , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=1,GT=() , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) ) + [ 4] vs. [ 7]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=1,GT=() , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=1,GT=() , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) ) + [ 4] vs. [ 8]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=1,GT=() , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=1,GT=() , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) ) + [ 4] vs. [ 9]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=1,GT=() , RI=1,GTI=23,GT=(DIG=1234), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=1,GT=() , RI=1,GTI=23,GT=(DIG=1234) ) + [ 4] vs. [10]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=1,GT=() , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=1,GT=() , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) ) + [ 5] vs. [ 0]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=2,PC=1024, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=2,PC=1024 ) + [ 5] vs. [ 1]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=2,PC=16383, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=2,PC=16383 ) + [ 5] vs. [ 2]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=2,PC=16383,SSN=90, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=2,PC=16383,SSN=90 ) + [ 5] vs. [ 3]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=2,PC=16383,GTI=1,GT=(), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=2,PC=16383,GTI=1,GT=() ) + [ 5] vs. [ 4]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=1,GTI=1,GT=(), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=1,GTI=1,GT=() ) + [ 5] vs. [ 5]: 0 = osmo_sccp_addr_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=1,GTI=2,GT=(TT=3,DIG=), 0x1 ) + 0 = osmo_sccp_addr_ri_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=1,GTI=2,GT=(TT=3,DIG=) ) + [ 5] vs. [ 6]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) ) + [ 5] vs. [ 7]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) ) + [ 5] vs. [ 8]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) ) + [ 5] vs. [ 9]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=1,GTI=23,GT=(DIG=1234), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=1,GTI=23,GT=(DIG=1234) ) + [ 5] vs. [10]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=2,GT=(TT=3,DIG=) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) ) + [ 6] vs. [ 0]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=2,PC=1024, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=2,PC=1024 ) + [ 6] vs. [ 1]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=2,PC=16383, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=2,PC=16383 ) + [ 6] vs. [ 2]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=2,PC=16383,SSN=90, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=2,PC=16383,SSN=90 ) + [ 6] vs. [ 3]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=2,PC=16383,GTI=1,GT=(), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=2,PC=16383,GTI=1,GT=() ) + [ 6] vs. [ 4]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=1,GTI=1,GT=(), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=1,GTI=1,GT=() ) + [ 6] vs. [ 5]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=1,GTI=2,GT=(TT=3,DIG=), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=1,GTI=2,GT=(TT=3,DIG=) ) + [ 6] vs. [ 6]: 0 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123), 0x1 ) + 0 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) ) + [ 6] vs. [ 7]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) ) + [ 6] vs. [ 8]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) ) + [ 6] vs. [ 9]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=1,GTI=23,GT=(DIG=1234), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=1,GTI=23,GT=(DIG=1234) ) + [ 6] vs. [10]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) ) + [ 7] vs. [ 0]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=2,PC=1024, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=2,PC=1024 ) + [ 7] vs. [ 1]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=2,PC=16383, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=2,PC=16383 ) + [ 7] vs. [ 2]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=2,PC=16383,SSN=90, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=2,PC=16383,SSN=90 ) + [ 7] vs. [ 3]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=2,PC=16383,GTI=1,GT=(), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=2,PC=16383,GTI=1,GT=() ) + [ 7] vs. [ 4]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=1,GTI=1,GT=(), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=1,GTI=1,GT=() ) + [ 7] vs. [ 5]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=1,GTI=2,GT=(TT=3,DIG=), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=1,GTI=2,GT=(TT=3,DIG=) ) + [ 7] vs. [ 6]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) ) + [ 7] vs. [ 7]: 0 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234), 0x1 ) + 0 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) ) + [ 7] vs. [ 8]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) ) + [ 7] vs. [ 9]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=1,GTI=23,GT=(DIG=1234), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=1,GTI=23,GT=(DIG=1234) ) + [ 7] vs. [10]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) ) + [ 8] vs. [ 0]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=2,PC=1024, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=2,PC=1024 ) + [ 8] vs. [ 1]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=2,PC=16383, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=2,PC=16383 ) + [ 8] vs. [ 2]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=2,PC=16383,SSN=90, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=2,PC=16383,SSN=90 ) + [ 8] vs. [ 3]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=2,PC=16383,GTI=1,GT=(), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=2,PC=16383,GTI=1,GT=() ) + [ 8] vs. [ 4]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=1,GTI=1,GT=(), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=1,GTI=1,GT=() ) + [ 8] vs. [ 5]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=1,GTI=2,GT=(TT=3,DIG=), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=1,GTI=2,GT=(TT=3,DIG=) ) + [ 8] vs. [ 6]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) ) + [ 8] vs. [ 7]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) ) + [ 8] vs. [ 8]: 0 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234), 0x1 ) + 0 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) ) + [ 8] vs. [ 9]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=1,GTI=23,GT=(DIG=1234), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=1,GTI=23,GT=(DIG=1234) ) + [ 8] vs. [10]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) ) + [ 9] vs. [ 0]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=2,PC=1024, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=2,PC=1024 ) + [ 9] vs. [ 1]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=2,PC=16383, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=2,PC=16383 ) + [ 9] vs. [ 2]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=2,PC=16383,SSN=90, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=2,PC=16383,SSN=90 ) + [ 9] vs. [ 3]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=2,PC=16383,GTI=1,GT=(), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=2,PC=16383,GTI=1,GT=() ) + [ 9] vs. [ 4]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=1,GTI=1,GT=(), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=1,GTI=1,GT=() ) + [ 9] vs. [ 5]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=1,GTI=2,GT=(TT=3,DIG=), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=1,GTI=2,GT=(TT=3,DIG=) ) + [ 9] vs. [ 6]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) ) + [ 9] vs. [ 7]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) ) + [ 9] vs. [ 8]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) ) + [ 9] vs. [ 9]: 0 = osmo_sccp_addr_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=1,GTI=23,GT=(DIG=1234), 0x1 ) + 0 = osmo_sccp_addr_ri_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=1,GTI=23,GT=(DIG=1234) ) + [ 9] vs. [10]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=23,GT=(DIG=1234) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) ) + [10] vs. [ 0]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=2,PC=1024, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=2,PC=1024 ) + [10] vs. [ 1]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=2,PC=16383, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=2,PC=16383 ) + [10] vs. [ 2]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=2,PC=16383,SSN=90, 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=2,PC=16383,SSN=90 ) + [10] vs. [ 3]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=2,PC=16383,GTI=1,GT=(), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=2,PC=16383,GTI=1,GT=() ) + [10] vs. [ 4]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=1,GTI=1,GT=(), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=1,GTI=1,GT=() ) + [10] vs. [ 5]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=1,GTI=2,GT=(TT=3,DIG=), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=1,GTI=2,GT=(TT=3,DIG=) ) + [10] vs. [ 6]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=123) ) + [10] vs. [ 7]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=1,GTI=3,GT=(TT=3,NPL=1,DIG=1234) ) + [10] vs. [ 8]: 1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234), 0x1 ) + 1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1234) ) + [10] vs. [ 9]: -1 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=1,GTI=23,GT=(DIG=1234), 0x1 ) + -1 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=1,GTI=23,GT=(DIG=1234) ) + [10] vs. [10]: 0 = osmo_sccp_addr_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF), 0x1 ) + 0 = osmo_sccp_addr_ri_cmp( RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) , RI=1,GTI=4,GT=(TT=3,NPL=1,NAI=4,DIG=1ABF) ) All tests passed. -- To view, visit https://gerrit.osmocom.org/13118 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie9e2add7bbfae651c04e230d62e37cebeb91b0f5 Gerrit-Change-Number: 13118 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 13:14:37 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Apr 2019 13:14:37 +0000 Subject: Change in libosmocore[master]: GSUP: add inter-MSC handover related msgs and IEs In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/12860 ) Change subject: GSUP: add inter-MSC handover related msgs and IEs ...................................................................... Patch Set 9: > enum gsm0808_cause *cause_bssap; could do for that uint8_t value. But enum pointer won't work, because enum has a different size than uint8_t so can't point into the msgb. I would prefer using the "decoded" enum value instead of uint8_t there. Is this important to you or can we leave it as it is? -- To view, visit https://gerrit.osmocom.org/12860 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic00b0601eacff6d72927cea51767801142ee75db Gerrit-Change-Number: 12860 Gerrit-PatchSet: 9 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Thu, 18 Apr 2019 13:14:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 13:21:25 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Apr 2019 13:21:25 +0000 Subject: Change in osmo-mgw[master]: move MGW endpoint FSM from osmo-bsc to here In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13590 to look at the new patch set (#3). Change subject: move MGW endpoint FSM from osmo-bsc to here ...................................................................... move MGW endpoint FSM from osmo-bsc to here Move mgw_endpoint_fsm from osmo-bsc here as osmo_mgcpc_ep_fsm. Apply various renames for consistency. Use osmo_tdef from libosmocore instead of osmo-bsc's (so far) local T_defs API. Change T23042 to T2427001, which is a slightly less arbitrary number and slightly more extendable in the future (2427 corresponds to the default MGCP port at osmo-mgw, 001 is the first MGCP timer and so far the only one). Change-Id: I9a3effd38e72841529df6c135c077116981dea36 --- M include/Makefile.am A include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h M include/osmocom/mgcp_client/mgcp_client_fsm.h M src/libosmo-mgcp-client/Makefile.am A src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c M src/libosmo-mgcp-client/mgcp_client_fsm.c 6 files changed, 808 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/90/13590/3 -- To view, visit https://gerrit.osmocom.org/13590 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9a3effd38e72841529df6c135c077116981dea36 Gerrit-Change-Number: 13590 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 13:25:01 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Apr 2019 13:25:01 +0000 Subject: Change in osmo-gsm-tester[master]: resources.conf.prod: Update config to use new smart socket HW setup Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13697 Change subject: resources.conf.prod: Update config to use new smart socket HW setup ...................................................................... resources.conf.prod: Update config to use new smart socket HW setup Change-Id: I5cfce927569b6a2d8ca57d3394116bbcff3eee56 --- M example/resources.conf.prod 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/97/13697/1 diff --git a/example/resources.conf.prod b/example/resources.conf.prod index a65add0..49c33c7 100644 --- a/example/resources.conf.prod +++ b/example/resources.conf.prod @@ -90,8 +90,8 @@ trx_list: - addr: 10.42.42.120 power_supply: - type: 'sispm' - device: '01:01:4d:98:24' + type: 'intellinet' + device: '10.9.25.250' port: '1' - label: NanoBTS-ONW-900 @@ -102,13 +102,13 @@ trx_list: - addr: 10.42.42.121 power_supply: - type: 'sispm' - device: '01:01:4d:98:24' + type: 'intellinet' + device: '10.9.25.250' port: '2' - addr: 10.42.42.122 power_supply: - type: 'sispm' - device: '01:01:4d:98:24' + type: 'intellinet' + device: '10.9.25.250' port: '3' - label: OsmoBTS Virtual -- To view, visit https://gerrit.osmocom.org/13697 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5cfce927569b6a2d8ca57d3394116bbcff3eee56 Gerrit-Change-Number: 13697 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 13:41:28 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Apr 2019 13:41:28 +0000 Subject: Change in osmo-hlr[master]: hlr.c: forward GSUP messages between clients In-Reply-To: References: Message-ID: Neels Hofmeyr has uploaded a new patch set (#13) to the change originally created by osmith. ( https://gerrit.osmocom.org/13006 ) Change subject: hlr.c: forward GSUP messages between clients ...................................................................... hlr.c: forward GSUP messages between clients Allow clients to forward any GSUP message between clients. Determine the sender and receiver from the new {source,dest}_name{,_len} IEs. Reject messages with a forged source name. This will be used for the inter-MSC handover. Depends: Ic00b0601eacff6d72927cea51767801142ee75db (libosmocore.git) Related: OS#3793 Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 --- M src/hlr.c 1 file changed, 79 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/06/13006/13 -- To view, visit https://gerrit.osmocom.org/13006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 Gerrit-Change-Number: 13006 Gerrit-PatchSet: 13 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 13:42:19 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Apr 2019 13:42:19 +0000 Subject: Change in osmo-hlr[master]: hlr.c: forward GSUP messages between clients In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13006 ) Change subject: hlr.c: forward GSUP messages between clients ...................................................................... Patch Set 13: few more fixes for this patch in new patch set: - logging tweaks - use "message_class", not "kind" -- To view, visit https://gerrit.osmocom.org/13006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 Gerrit-Change-Number: 13006 Gerrit-PatchSet: 13 Gerrit-Owner: osmith Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: osmith Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 18 Apr 2019 13:42:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 13:42:47 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Apr 2019 13:42:47 +0000 Subject: Change in osmo-hlr[master]: GSUP routing: use Message Class IE In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. ( https://gerrit.osmocom.org/13588 ) Change subject: GSUP routing: use Message Class IE ...................................................................... Abandoned squashed into 13006 -- To view, visit https://gerrit.osmocom.org/13588 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I8dc3967d9372d63e9d57ca2608dd3316edb234a4 Gerrit-Change-Number: 13588 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy Gerrit-CC: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 15:30:33 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Thu, 18 Apr 2019 15:30:33 +0000 Subject: Change in osmo-ccid-firmware[master]: switch UART_debug to ASYNC In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13673 to look at the new patch set (#9). Change subject: switch UART_debug to ASYNC ...................................................................... switch UART_debug to ASYNC using the synchronous HAL library causes RX overflow after 5 bytes on bulk incoming data (e.g. pasted). this mainly due to printing synchronously the character, but to further prevent congestion we switch to asynchronous (e.g. interrupt driven) communication. The RX part works great now (no overflow), but the TX part is malfunctioning because the HAL Async library does not buffer the data to be transmitted and expects it to be in memory until the transmission is complete (which printf does not do). This change will not be reflected in Atmel START since it does not allow to set the underlying STDIO redirect peripheral to async. Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7 --- M sysmoOCTSIM/command.c M sysmoOCTSIM/driver_init.c M sysmoOCTSIM/driver_init.h M sysmoOCTSIM/hpl/sercom/hpl_sercom.c M sysmoOCTSIM/main.c M sysmoOCTSIM/manual_test.c M sysmoOCTSIM/stdio_start.c 7 files changed, 73 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/73/13673/9 -- To view, visit https://gerrit.osmocom.org/13673 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If18883e96f336aa9f6b11607859260da5e1503c7 Gerrit-Change-Number: 13673 Gerrit-PatchSet: 9 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 15:30:33 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Thu, 18 Apr 2019 15:30:33 +0000 Subject: Change in osmo-ccid-firmware[master]: UART_debug now uses the async library with tx ring In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13678 to look at the new patch set (#9). Change subject: UART_debug now uses the async library with tx ring ...................................................................... UART_debug now uses the async library with tx ring Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc --- M sysmoOCTSIM/command.c M sysmoOCTSIM/driver_init.c M sysmoOCTSIM/driver_init.h M sysmoOCTSIM/manual_test.c M sysmoOCTSIM/stdio_start.c 5 files changed, 13 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/78/13678/9 -- To view, visit https://gerrit.osmocom.org/13678 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4cf689a8d3dc292201f1e2ce6c013aa1686ad6bc Gerrit-Change-Number: 13678 Gerrit-PatchSet: 9 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 16:02:21 2019 From: gerrit-no-reply at lists.osmocom.org (roh) Date: Thu, 18 Apr 2019 16:02:21 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Update limesuite hash to support LimeNet-Micro In-Reply-To: References: Message-ID: roh has posted comments on this change. ( https://gerrit.osmocom.org/13696 ) Change subject: nightly-packages: Update limesuite hash to support LimeNet-Micro ...................................................................... Patch Set 1: seems fine to me. -- To view, visit https://gerrit.osmocom.org/13696 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I62779f3bdbc4a459363a1d660d96d5f02f7763c1 Gerrit-Change-Number: 13696 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: roh Gerrit-Comment-Date: Thu, 18 Apr 2019 16:02:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 16:02:45 2019 From: gerrit-no-reply at lists.osmocom.org (roh) Date: Thu, 18 Apr 2019 16:02:45 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Update limesuite hash to support LimeNet-Micro In-Reply-To: References: Message-ID: roh has posted comments on this change. ( https://gerrit.osmocom.org/13696 ) Change subject: nightly-packages: Update limesuite hash to support LimeNet-Micro ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13696 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I62779f3bdbc4a459363a1d660d96d5f02f7763c1 Gerrit-Change-Number: 13696 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: roh Gerrit-Comment-Date: Thu, 18 Apr 2019 16:02:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 18:14:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 18 Apr 2019 18:14:13 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Update limesuite hash to support LimeNet-Micro In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13696 ) Change subject: nightly-packages: Update limesuite hash to support LimeNet-Micro ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13696 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I62779f3bdbc4a459363a1d660d96d5f02f7763c1 Gerrit-Change-Number: 13696 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: roh Gerrit-Comment-Date: Thu, 18 Apr 2019 18:14:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 19:07:18 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 18 Apr 2019 19:07:18 +0000 Subject: Change in osmo-bts[master]: common/oml.c: refactor OML msgb allocation in oml_tx_attr_resp() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13698 Change subject: common/oml.c: refactor OML msgb allocation in oml_tx_attr_resp() ...................................................................... common/oml.c: refactor OML msgb allocation in oml_tx_attr_resp() There is no need to allocate a new OML message buffer before handing the list of requested attributes. Change-Id: Ib8c1f77aad784b6f5cbe888a5139d7afb456924d --- M src/common/oml.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/98/13698/1 diff --git a/src/common/oml.c b/src/common/oml.c index 80d424f..df85fbe 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -255,16 +255,13 @@ static int oml_tx_attr_resp(struct gsm_bts *bts, const struct abis_om_fom_hdr *foh, const uint8_t *attr, uint16_t attr_len) { - struct msgb *nmsg = oml_msgb_alloc(); + struct msgb *nmsg; uint8_t resp[MAX_VERSION_LENGTH * attr_len * 2]; /* heuristic for Attribute Response Info space requirements */ int len; LOGP(DOML, LOGL_INFO, "%s Tx Get Attribute Response\n", get_value_string(abis_nm_obj_class_names, foh->obj_class)); - if (!nmsg) - return -NM_NACK_CANT_PERFORM; - switch (foh->obj_class) { case NM_OC_BTS: len = handle_attrs_bts(resp, bts, attr, attr_len); @@ -280,10 +277,13 @@ if (len < 0) { LOGP(DOML, LOGL_ERROR, "Tx Get Attribute Response FAILED with %d\n", len); - msgb_free(nmsg); return len; } + nmsg = oml_msgb_alloc(); + if (!nmsg) + return -NM_NACK_CANT_PERFORM; + /* ?9.4.64 Get Attribute Response Info */ msgb_tl16v_put(nmsg, NM_ATT_GET_ARI, len, resp); -- To view, visit https://gerrit.osmocom.org/13698 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8c1f77aad784b6f5cbe888a5139d7afb456924d Gerrit-Change-Number: 13698 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 19:07:19 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 18 Apr 2019 19:07:19 +0000 Subject: Change in osmo-bts[master]: common/oml.c: constify argument 'trx' of handle_attrs_trx() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13699 Change subject: common/oml.c: constify argument 'trx' of handle_attrs_trx() ...................................................................... common/oml.c: constify argument 'trx' of handle_attrs_trx() Change-Id: Id476d492b3c1d0c728fca9eb0fb2254512bdef72 --- M include/osmo-bts/phy_link.h M src/common/oml.c 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/99/13699/1 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 2472c05..812f186 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -166,7 +166,7 @@ void phy_user_statechg_notif(struct phy_instance *pinst, enum phy_link_state link_state); -static inline struct phy_instance *trx_phy_instance(struct gsm_bts_trx *trx) +static inline struct phy_instance *trx_phy_instance(const struct gsm_bts_trx *trx) { OSMO_ASSERT(trx); return trx->role_bts.l1h; diff --git a/src/common/oml.c b/src/common/oml.c index df85fbe..83b8f29 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -155,7 +155,7 @@ msgb_tl16v_put(msg, NM_ATT_MANUF_ID, _NUM_BTS_FEAT/8 + 1, bts->_features_data); } -static inline void add_trx_attr(struct msgb *msg, struct gsm_bts_trx *trx) +static inline void add_trx_attr(struct msgb *msg, const struct gsm_bts_trx *trx) { const struct phy_instance *pinst = trx_phy_instance(trx); @@ -191,7 +191,7 @@ return len + out_offset + 1; } -static inline int handle_attrs_trx(uint8_t *out, struct gsm_bts_trx *trx, const uint8_t *attr, uint16_t attr_len) +static inline int handle_attrs_trx(uint8_t *out, const struct gsm_bts_trx *trx, const uint8_t *attr, uint16_t attr_len) { uint16_t i, attr_out_index = 1; /* byte 0 is reserved for unsupported attributes counter */ struct msgb *attr_buf = oml_msgb_alloc(); -- To view, visit https://gerrit.osmocom.org/13699 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id476d492b3c1d0c728fca9eb0fb2254512bdef72 Gerrit-Change-Number: 13699 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 19:07:19 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 18 Apr 2019 19:07:19 +0000 Subject: Change in osmo-bts[master]: common/oml.c: use proper NACK reason in oml_tx_attr_resp() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13700 Change subject: common/oml.c: use proper NACK reason in oml_tx_attr_resp() ...................................................................... common/oml.c: use proper NACK reason in oml_tx_attr_resp() Change-Id: I482caa0747f81da2979bfbdbd22bd6962af728cd --- M src/common/oml.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/00/13700/1 diff --git a/src/common/oml.c b/src/common/oml.c index 83b8f29..f5e50c0 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -272,7 +272,7 @@ default: LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute Response\n", get_value_string(abis_nm_obj_class_names, foh->obj_class)); - len = -NM_NACK_RES_NOTIMPL; + len = -NM_NACK_OBJCLASS_NOTSUPP; } if (len < 0) { -- To view, visit https://gerrit.osmocom.org/13700 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I482caa0747f81da2979bfbdbd22bd6962af728cd Gerrit-Change-Number: 13700 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 19:07:20 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 18 Apr 2019 19:07:20 +0000 Subject: Change in osmo-bts[master]: common/oml.c: use proper OML object for Get Attribute Response Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13701 Change subject: common/oml.c: use proper OML object for Get Attribute Response ...................................................................... common/oml.c: use proper OML object for Get Attribute Response Change-Id: Icb1ee75d4bf680deb6365288d8c2053816a12217 --- M src/common/oml.c 1 file changed, 25 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/13701/1 diff --git a/src/common/oml.c b/src/common/oml.c index f5e50c0..cb1766b 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -252,26 +252,31 @@ } /* send 3GPP TS 52.021 ?8.11.2 Get Attribute Response */ -static int oml_tx_attr_resp(struct gsm_bts *bts, const struct abis_om_fom_hdr *foh, const uint8_t *attr, - uint16_t attr_len) +static int oml_tx_attr_resp(const struct gsm_abis_mo *mo, + const uint8_t *attr, uint16_t attr_len) { struct msgb *nmsg; uint8_t resp[MAX_VERSION_LENGTH * attr_len * 2]; /* heuristic for Attribute Response Info space requirements */ + void *obj; int len; LOGP(DOML, LOGL_INFO, "%s Tx Get Attribute Response\n", - get_value_string(abis_nm_obj_class_names, foh->obj_class)); + get_value_string(abis_nm_obj_class_names, mo->obj_class)); - switch (foh->obj_class) { + OSMO_ASSERT(mo->bts != NULL); + obj = gsm_objclass2obj(mo->bts, mo->obj_class, &mo->obj_inst); + OSMO_ASSERT(obj != NULL); + + switch (mo->obj_class) { case NM_OC_BTS: - len = handle_attrs_bts(resp, bts, attr, attr_len); + len = handle_attrs_bts(resp, (const struct gsm_bts *) obj, attr, attr_len); break; case NM_OC_BASEB_TRANSC: - len = handle_attrs_trx(resp, gsm_bts_trx_num(bts, foh->obj_inst.trx_nr), attr, attr_len); + len = handle_attrs_trx(resp, (const struct gsm_bts_trx *) obj, attr, attr_len); break; default: LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute Response\n", - get_value_string(abis_nm_obj_class_names, foh->obj_class)); + get_value_string(abis_nm_obj_class_names, mo->obj_class)); len = -NM_NACK_OBJCLASS_NOTSUPP; } @@ -287,7 +292,7 @@ /* ?9.4.64 Get Attribute Response Info */ msgb_tl16v_put(nmsg, NM_ATT_GET_ARI, len, resp); - len = oml_mo_send_msg(&bts->mo, nmsg, NM_MT_GET_ATTR_RESP); + len = oml_mo_send_msg(mo, nmsg, NM_MT_GET_ATTR_RESP); return (len < 0) ? -NM_NACK_CANT_PERFORM : len; } @@ -527,6 +532,7 @@ static int oml_rx_get_attr(struct gsm_bts *bts, struct msgb *msg) { struct abis_om_fom_hdr *foh = msgb_l3(msg); + const struct gsm_abis_mo *mo; struct tlv_parsed tp; int rc; @@ -536,18 +542,26 @@ abis_nm_debugp_foh(DOML, foh); DEBUGPC(DOML, "Rx GET ATTR\n"); + /* Determine which OML object is addressed */ + mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); + if (!mo) { + LOGP(DOML, LOGL_ERROR, "%s Get Attributes for unknown Object Instance\n", + abis_nm_dump_foh(foh)); + return oml_fom_ack_nack(msg, NM_NACK_OBJINST_UNKN); + } + rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); if (rc < 0) { - oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UNSUP_ATTR, "Get Attribute parsing failure"); + oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UNSUP_ATTR, "Get Attribute parsing failure"); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } if (!TLVP_PRES_LEN(&tp, NM_ATT_LIST_REQ_ATTR, 1)) { - oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UNSUP_ATTR, "Get Attribute without Attribute List"); + oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UNSUP_ATTR, "Get Attribute without Attribute List"); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } - rc = oml_tx_attr_resp(bts, foh, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); + rc = oml_tx_attr_resp(mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); if (rc < 0) { LOGP(DOML, LOGL_ERROR, "responding to O&M Get Attributes message with NACK 0%x\n", -rc); return oml_fom_ack_nack(msg, -rc); -- To view, visit https://gerrit.osmocom.org/13701 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Icb1ee75d4bf680deb6365288d8c2053816a12217 Gerrit-Change-Number: 13701 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 19:58:56 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 18 Apr 2019 19:58:56 +0000 Subject: Change in osmo-bts[master]: common/oml.c: refactor OML msgb allocation in oml_tx_attr_resp() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13698 ) Change subject: common/oml.c: refactor OML msgb allocation in oml_tx_attr_resp() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13698 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib8c1f77aad784b6f5cbe888a5139d7afb456924d Gerrit-Change-Number: 13698 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 18 Apr 2019 19:58:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 19:59:11 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 18 Apr 2019 19:59:11 +0000 Subject: Change in osmo-bts[master]: common/oml.c: constify argument 'trx' of handle_attrs_trx() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13699 ) Change subject: common/oml.c: constify argument 'trx' of handle_attrs_trx() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13699 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id476d492b3c1d0c728fca9eb0fb2254512bdef72 Gerrit-Change-Number: 13699 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 18 Apr 2019 19:59:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 19:59:34 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 18 Apr 2019 19:59:34 +0000 Subject: Change in osmo-bts[master]: common/oml.c: use proper NACK reason in oml_tx_attr_resp() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13700 ) Change subject: common/oml.c: use proper NACK reason in oml_tx_attr_resp() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13700 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I482caa0747f81da2979bfbdbd22bd6962af728cd Gerrit-Change-Number: 13700 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 18 Apr 2019 19:59:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 20:26:01 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 18 Apr 2019 20:26:01 +0000 Subject: Change in libosmocore[master]: gsm/abis_nm.c: account \0 in abis_nm_put_sw_desc() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13702 Change subject: gsm/abis_nm.c: account \0 in abis_nm_put_sw_desc() ...................................................................... gsm/abis_nm.c: account \0 in abis_nm_put_sw_desc() Change-Id: Id10b1bcb39ef0af296cd3f4d5e7ebe210b7a3a27 --- M src/gsm/abis_nm.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/02/13702/1 diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c index a4c0e41..ac4e6e7 100644 --- a/src/gsm/abis_nm.c +++ b/src/gsm/abis_nm.c @@ -791,8 +791,9 @@ uint16_t abis_nm_put_sw_file(struct msgb *msg, const char *id, const char *ver, bool put_sw_desc) { struct abis_nm_sw_desc sw = { - .file_id_len = strlen(id), - .file_version_len = strlen(ver), + /* We should also account \0 */ + .file_id_len = strlen(id) + 1, + .file_version_len = strlen(ver) + 1, }; memcpy(sw.file_id, id, sw.file_id_len); -- To view, visit https://gerrit.osmocom.org/13702 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id10b1bcb39ef0af296cd3f4d5e7ebe210b7a3a27 Gerrit-Change-Number: 13702 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 21:17:26 2019 From: gerrit-no-reply at lists.osmocom.org (Rafael Diniz) Date: Thu, 18 Apr 2019 21:17:26 +0000 Subject: Change in openbsc[master]: Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. Message-ID: Rafael Diniz has uploaded this change for review. ( https://gerrit.osmocom.org/13703 Change subject: Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. ...................................................................... Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. Change-Id: I3690acebf882d3a8abbeabe0e3aefdfcd066a052 --- M openbsc/src/libmsc/gsm_04_08.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/03/13703/1 diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 09e35cc..ca98d35 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -3787,6 +3787,9 @@ return rc; } + if(msg_type == MNCC_REL_REQ && conn->mncc_rtp_create_pending) + conn->mncc_rtp_create_pending = 0; + DEBUGP(DCC, "(bts %d trx %d ts %d ti %02x sub %s) " "Received '%s' from MNCC in state %d (%s)\n", conn->bts->nr, conn->lchan->ts->trx->nr, conn->lchan->ts->nr, -- To view, visit https://gerrit.osmocom.org/13703 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3690acebf882d3a8abbeabe0e3aefdfcd066a052 Gerrit-Change-Number: 13703 Gerrit-PatchSet: 1 Gerrit-Owner: Rafael Diniz -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 21:49:36 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Apr 2019 21:49:36 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Update limesuite hash to support LimeNet-Micro In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13696 ) Change subject: nightly-packages: Update limesuite hash to support LimeNet-Micro ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13696 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I62779f3bdbc4a459363a1d660d96d5f02f7763c1 Gerrit-Change-Number: 13696 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: roh Gerrit-Comment-Date: Thu, 18 Apr 2019 21:49:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 21:49:42 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Apr 2019 21:49:42 +0000 Subject: Change in osmo-ci[master]: nightly-packages: Update limesuite hash to support LimeNet-Micro In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13696 ) Change subject: nightly-packages: Update limesuite hash to support LimeNet-Micro ...................................................................... nightly-packages: Update limesuite hash to support LimeNet-Micro Newer LimeSuite (at least 7557e291209fc66a78ffa74dd8314e75841f7c96) is required to have LimeNet-Micro working properly with osmo-trx. We update to current newest master since other fixes related to sample rate are applied after the commit mentioned above. Related: OS#3861 Change-Id: I62779f3bdbc4a459363a1d660d96d5f02f7763c1 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: roh: Looks good to me, approved Harald Welte: Looks good to me, approved Pau Espin Pedrol: Verified diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index 61cb250..0d4db2d 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -143,7 +143,7 @@ checkout_limesuite() { cd "$REPO" git clone https://github.com/myriadrf/LimeSuite limesuite - TAG="$(get_last_tag limesuite)" + TAG="357ad5dd0d71304179d476b38e67240527d917df" cd limesuite git checkout "$TAG" } @@ -203,7 +203,7 @@ create_osmo_trx_debian8_jessie - build limesuite no_commit --git-upstream-tree="$(get_last_tag limesuite)" + build limesuite no_commit --git-upstream-tree="357ad5dd0d71304179d476b38e67240527d917df" build osmo-gsm-manuals build libosmocore build libosmo-sccp -- To view, visit https://gerrit.osmocom.org/13696 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I62779f3bdbc4a459363a1d660d96d5f02f7763c1 Gerrit-Change-Number: 13696 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: roh -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 22:00:42 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Apr 2019 22:00:42 +0000 Subject: Change in osmo-gsm-tester[master]: resources.conf.prod: Update config to use new smart socket HW setup In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13697 ) Change subject: resources.conf.prod: Update config to use new smart socket HW setup ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13697 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5cfce927569b6a2d8ca57d3394116bbcff3eee56 Gerrit-Change-Number: 13697 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: roh Gerrit-Comment-Date: Thu, 18 Apr 2019 22:00:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 22:22:28 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Apr 2019 22:22:28 +0000 Subject: Change in osmo-gsm-tester[master]: resources.conf.prod: Update config to use new smart socket HW setup In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13697 ) Change subject: resources.conf.prod: Update config to use new smart socket HW setup ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13697 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5cfce927569b6a2d8ca57d3394116bbcff3eee56 Gerrit-Change-Number: 13697 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: roh Gerrit-Comment-Date: Thu, 18 Apr 2019 22:22:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 22:23:10 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Apr 2019 22:23:10 +0000 Subject: Change in osmo-gsm-tester[master]: resources.conf.prod: Update config to use new smart socket HW setup In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13697 ) Change subject: resources.conf.prod: Update config to use new smart socket HW setup ...................................................................... resources.conf.prod: Update config to use new smart socket HW setup Change-Id: I5cfce927569b6a2d8ca57d3394116bbcff3eee56 --- M example/resources.conf.prod 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/example/resources.conf.prod b/example/resources.conf.prod index a65add0..f4e9fe4 100644 --- a/example/resources.conf.prod +++ b/example/resources.conf.prod @@ -90,8 +90,8 @@ trx_list: - addr: 10.42.42.120 power_supply: - type: 'sispm' - device: '01:01:4d:98:24' + type: 'intellinet' + device: '10.42.42.250' port: '1' - label: NanoBTS-ONW-900 @@ -102,13 +102,13 @@ trx_list: - addr: 10.42.42.121 power_supply: - type: 'sispm' - device: '01:01:4d:98:24' + type: 'intellinet' + device: '10.42.42.250' port: '2' - addr: 10.42.42.122 power_supply: - type: 'sispm' - device: '01:01:4d:98:24' + type: 'intellinet' + device: '10.42.42.250' port: '3' - label: OsmoBTS Virtual -- To view, visit https://gerrit.osmocom.org/13697 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5cfce927569b6a2d8ca57d3394116bbcff3eee56 Gerrit-Change-Number: 13697 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: roh -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 22:48:57 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Apr 2019 22:48:57 +0000 Subject: Change in osmo-bts[master]: common/oml.c: use proper OML object for Get Attribute Response In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13701 ) Change subject: common/oml.c: use proper OML object for Get Attribute Response ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/13701/1/src/common/oml.c File src/common/oml.c: https://gerrit.osmocom.org/#/c/13701/1/src/common/oml.c at 272 PS1, Line 272: len = handle_attrs_bts(resp, (const struct gsm_bts *) obj, attr, attr_len); If you know it's going to be BTS, then just pass mo->bts and avoid nasty castings. https://gerrit.osmocom.org/#/c/13701/1/src/common/oml.c at 275 PS1, Line 275: len = handle_attrs_trx(resp, (const struct gsm_bts_trx *) obj, attr, attr_len); Are yousure this is correct? gsm_objclass2obj returns &trx->bb_transc here, not trx. -- To view, visit https://gerrit.osmocom.org/13701 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icb1ee75d4bf680deb6365288d8c2053816a12217 Gerrit-Change-Number: 13701 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 18 Apr 2019 22:48:57 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 18 23:31:45 2019 From: gerrit-no-reply at lists.osmocom.org (Rafael Diniz) Date: Thu, 18 Apr 2019 23:31:45 +0000 Subject: Change in osmo-sip-connector[master]: Added daemonize feature to osmo-sip-connector Message-ID: Rafael Diniz has uploaded this change for review. ( https://gerrit.osmocom.org/13704 Change subject: Added daemonize feature to osmo-sip-connector ...................................................................... Added daemonize feature to osmo-sip-connector Change-Id: I400fb5a2619f348cc60e8c9016154afa60424e66 --- M src/main.c 1 file changed, 16 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/04/13704/1 diff --git a/src/main.c b/src/main.c index 0661498..ab58a52 100644 --- a/src/main.c +++ b/src/main.c @@ -46,6 +46,7 @@ void *tall_mncc_ctx; +static bool daemonize = false; static char *config_file = "osmo-sip-connector.cfg"; static struct log_info_cat mncc_sip_categories[] = { @@ -79,8 +80,9 @@ static void print_help(void) { printf("OsmoSIPcon: MNCC to SIP bridge\n"); - printf(" -h --help\tthis text\n"); + printf(" -h --help\tThis text\n"); printf(" -c --config-file NAME\tThe config file to use [%s]\n", config_file); + printf(" -D --daemonize\tFork the process into a background daemon\n"); printf(" -V --version\tPrint the version number\n"); } @@ -91,11 +93,12 @@ static struct option long_options[] = { {"help", 0, 0, 'h'}, {"config-file", 1, 0, 'c'}, + {"daemonize", 0, 0, 'D'}, {"version", 0, 0, 'V' }, {NULL, 0, 0, 0} }; - c = getopt_long(argc, argv, "hc:V", + c = getopt_long(argc, argv, "hc:DV", long_options, &option_index); if (c == -1) break; @@ -107,6 +110,9 @@ case 'c': config_file = optarg; break; + case 'D': + daemonize = true; + break; case 'V': print_version(1); exit(EXIT_SUCCESS); @@ -159,6 +165,14 @@ calls_init(); app_setup(&g_app); + if (daemonize) { + rc = osmo_daemonize(); + if (rc < 0) { + perror("Error during daemonize"); + exit(1); + } + } + /* marry sofia-sip to glib and glib to libosmocore */ loop = g_main_loop_new(NULL, FALSE); g_source_attach(su_glib_root_gsource(g_app.sip.agent.root), -- To view, visit https://gerrit.osmocom.org/13704 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I400fb5a2619f348cc60e8c9016154afa60424e66 Gerrit-Change-Number: 13704 Gerrit-PatchSet: 1 Gerrit-Owner: Rafael Diniz -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 06:31:41 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 06:31:41 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/11194 ) Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/11194/1/src/mncc.c File src/mncc.c: https://gerrit.osmocom.org/#/c/11194/1/src/mncc.c at 383 PS1, Line 383: mncc_leg_release(leg); > This is kind of a workaround. [?] I don't think it's a work-around but a fix. We shouldn't accept any messages that don't make sense in the current state. Still, there's also a bug on the sender side (MSC) if it sends those kind of messages after a DISC_IND. The proper use of FSMs on both sides would prevent any of this, IMHO. -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Comment-Date: Fri, 19 Apr 2019 06:31:41 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 07:40:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 07:40:45 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sip: Add TC_mo_setup_disc_late_rtp for OS#3518 Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13705 Change subject: sip: Add TC_mo_setup_disc_late_rtp for OS#3518 ...................................................................... sip: Add TC_mo_setup_disc_late_rtp for OS#3518 Related: OS#3518 Change-Id: I9d5752e01d6995eff67463c51deaacedc5dcabe7 --- M sip/SIP_Tests.ttcn 1 file changed, 48 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/13705/1 diff --git a/sip/SIP_Tests.ttcn b/sip/SIP_Tests.ttcn index 24b3622..67650c8 100644 --- a/sip/SIP_Tests.ttcn +++ b/sip/SIP_Tests.ttcn @@ -381,12 +381,60 @@ vc_conn.done; } +/* SETUP followed by DISC results in lingering B-leg (OS#3518)*/ +private function f_TC_mo_setup_disc_late_rtp(charstring id) runs on ConnHdlr { + var CallPars cp := valueof(t_CallPars(true)); + f_CallPars_compute(cp); + cp.comp.sip_body := "v=0\r\no=Osmocom 0 0 IN IP4 0.0.0.0\r\ns=GSM Call\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\nm=audio 0 RTP/AVP 0\r\na=rtpmap:0 GSM/8000\r\n"; + f_sleep(3.0); + + var MNCC_number dst := valueof(ts_MNCC_number(cp.called, GSM48_TON_UNKNOWN)); + var MNCC_number src := valueof(ts_MNCC_number(cp.calling, GSM48_TON_UNKNOWN)); + var template SipAddr sip_addr_gsm := tr_SipAddr_from_val(cp.comp.sip_url_gsm); + var template SipAddr sip_addr_ext := tr_SipAddr_from_val(cp.comp.sip_url_ext); + + f_create_sip_expect(cp.comp.sip_url_ext.addr.nameAddr.addrSpec); + + /* MSC -> OSC: MSC sends SETUP.ind after CC SETUP was received from MS */ + MNCC.send(ts_MNCC_SETUP_ind(cp.mncc_call_id, dst, src, "262420123456789")); + + /* MSC -> OSC: Simulate a CC DISCONNET from the MT user *before* responding to the RTP_CREATE */ + MNCC.send(ts_MNCC_DISC_ind(cp.mncc_call_id, ts_MNCC_cause(0))); + + /* MSC <- OSC: Create GSM side RTP socket (too late) */ + MNCC.receive(tr_MNCC_RTP_CREATE(cp.mncc_call_id)) { + var MNCC_PDU mncc := valueof(ts_MNCC_RTP_CREATE(cp.mncc_call_id)); + mncc.u.rtp.payload_msg_type := oct2int('0300'O); + MNCC.send(mncc); /* FIXME: port/ip */ + } + + /* OSC -> SIP: We should never receive INVITE */ + timer T := 10.0; + T.start; + alt { + [] SIP.receive(tr_SIP_INVITE(?, sip_addr_gsm, sip_addr_ext, ?, ?)) { + setverdict(fail, "Received unexpected INVITE"); + } + [] T.timeout { + setverdict(pass); + } + } +} +testcase TC_mo_setup_disc_late_rtp() runs on test_CT { + var ConnHdlrPars pars; + var ConnHdlr vc_conn; + f_init(); + pars := valueof(t_Pars); + vc_conn := f_start_handler(refers(f_TC_mo_setup_disc_late_rtp), pars); + vc_conn.done; +} control { execute( TC_mt_success_rel_gsm() ); execute( TC_mt_success_rel_sip() ); execute( TC_mo_success_rel_gsm() ); execute( TC_mo_success_rel_sip() ); + execute( TC_mo_setup_disc_late_rtp() ); } -- To view, visit https://gerrit.osmocom.org/13705 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9d5752e01d6995eff67463c51deaacedc5dcabe7 Gerrit-Change-Number: 13705 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 08:23:35 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 08:23:35 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Harald Welte has removed a vote on this change. Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... Removed Code-Review+2 by Harald Welte -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: deleteVote Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 08:23:55 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 08:23:55 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#2) to the change originally created by Keith Whyte. ( https://gerrit.osmocom.org/11194 ) Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... MNCC: Do not continue with B leg if A leg is cancelled. In case we receive MNCC_RTP_CREATE after MNCC_DISC_IND, check if the call is already marked in_release in check_rtp_create() and if so, release instead of proceeding with the B leg. Related: OS#3518 Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 --- M src/mncc.c 1 file changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/94/11194/2 -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 2 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 08:30:13 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Fri, 19 Apr 2019 08:30:13 +0000 Subject: Change in osmo-bsc[master]: Revert "fix inter-BSC-HO-incoming for AoIP (1/2)" Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13706 Change subject: Revert "fix inter-BSC-HO-incoming for AoIP (1/2)" ...................................................................... Revert "fix inter-BSC-HO-incoming for AoIP (1/2)" This reverts commit 94c9324fe07cd0ba1277278270c8979d949e49ec. Multiple ttcn3 handover tests were broken due to this commit. Let's merge this once all the other commits pertaining to that fix can be merged as well. Change-Id: I01d93778fb19c601c21f99ec4d2a3ab8a4a48f67 --- M include/osmocom/bsc/handover_fsm.h M src/osmo-bsc/handover_fsm.c 2 files changed, 85 insertions(+), 106 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/06/13706/1 diff --git a/include/osmocom/bsc/handover_fsm.h b/include/osmocom/bsc/handover_fsm.h index 7c2145e..4db0890 100644 --- a/include/osmocom/bsc/handover_fsm.h +++ b/include/osmocom/bsc/handover_fsm.h @@ -28,10 +28,10 @@ HO_ST_NOT_STARTED, HO_ST_WAIT_LCHAN_ACTIVE, - HO_ST_WAIT_MGW_ENDPOINT_TO_MSC, HO_ST_WAIT_RR_HO_DETECT, HO_ST_WAIT_RR_HO_COMPLETE, HO_ST_WAIT_LCHAN_ESTABLISHED, + HO_ST_WAIT_MGW_ENDPOINT_TO_MSC, /* The inter-BSC Outgoing Handover FSM has completely separate states, but since it makes sense for it * to also live in conn->ho.fi, it should share the same event enum. From there it is merely @@ -46,11 +46,11 @@ HO_EV_LCHAN_ACTIVE, HO_EV_LCHAN_ESTABLISHED, HO_EV_LCHAN_ERROR, - HO_EV_MSC_MGW_OK, - HO_EV_MSC_MGW_FAIL, HO_EV_RR_HO_DETECT, HO_EV_RR_HO_COMPLETE, HO_EV_RR_HO_FAIL, + HO_EV_MSC_MGW_OK, + HO_EV_MSC_MGW_FAIL, HO_EV_CONN_RELEASING, HO_OUT_EV_BSSMAP_HO_COMMAND, diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 3b5a660..421c32e 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -161,10 +161,10 @@ static const struct state_timeout ho_fsm_timeouts[32] = { [HO_ST_WAIT_LCHAN_ACTIVE] = { .T = 23042 }, - [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { .T = 23042 }, [HO_ST_WAIT_RR_HO_DETECT] = { .T = 23042 }, [HO_ST_WAIT_RR_HO_COMPLETE] = { .T = 23042 }, [HO_ST_WAIT_LCHAN_ESTABLISHED] = { .T = 23042 }, + [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { .T = 23042 }, [HO_OUT_ST_WAIT_HO_COMMAND] = { .T = 7 }, [HO_OUT_ST_WAIT_CLEAR] = { .T = 8 }, }; @@ -876,24 +876,10 @@ static void ho_fsm_wait_lchan_active(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - struct handover *ho = &conn->ho; switch (event) { case HO_EV_LCHAN_ACTIVE: - /* - If the lchan is voiceless, no need to even think about the MGW. - * - If this is an intra-BSC Handover, we already have an RTP stream towards the MSC and aren't - * touching it. - * - If we're on SCCPlite, the MSC manages the MGW endpoint, all we do is the BTS side CI, so we can - * skip the part that would CRCX towards the MSC. - * So create an MSC side endpoint CI only if a voice lchan is established for an incoming inter-BSC - * handover on AoIP. Otherwise go on to send a Handover Command and wait for the Detect. - */ - if (ho->new_lchan->activate.info.requires_voice_stream - && (ho->scope & HO_INTER_BSC_IN) - && gscon_is_aoip(conn)) - ho_fsm_state_chg(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC); - else - ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); + ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); return; case HO_EV_LCHAN_ERROR: @@ -906,76 +892,6 @@ } } -/* Only for voice, only for inter-BSC Handover into this BSC, and only for AoIP: - * - * Establish the MGW endpoint CI that points towards the MSC. This needs to happen after the lchan (lchan_rtp_fsm) has - * created an MGW endpoint with the first CRCX, so that an endpoint is available, and before sending the Handover - * Request Acknowledge, so that the RTP address and port established towards the MSC can be included in the Handover - * Request Acknowledge message. - * (For SCCPlite, the MSC manages the CN side endpoint CI itself, and we don't need to send any RTP address in the - * Handover Request Acknowledge.) - * - * Actually, it should be possible to kick this off even above in handover_start_inter_bsc_in(), to do the CRCX towards - * the MSC at the same time as establishing the lchan. The gscon_ensure_mgw_endpoint() doesn't care which one of - * lchan_rtp_fsm or handover_start_inter_bsc_in() calls it first. The benefit would be that we'd send out the Handover - * Command ever so slightly sooner -- which isn't critical really, because a) how long does a CRCX take, milliseconds? - * and b) the time critical part is *after* the Handover Command was kicked off to keep the transition between cells as - * short as possible. The drawback of doing this earlier is code complexity: receiving the HO_EV_MSC_MGW_OK / - * HO_EV_MSC_MGW_FAIL events would need to be juggled in between the HO_EV_LCHAN_ACTIVE / HO_EV_LCHAN_ERROR. So the - * decision for now is to leave it here. - */ -static void ho_fsm_wait_mgw_endpoint_to_msc_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - struct handover *ho = &conn->ho; - - if (!gscon_connect_mgw_to_msc(conn, - ho->new_lchan, - ho->inter_bsc_in.msc_assigned_rtp_addr, - ho->inter_bsc_in.msc_assigned_rtp_port, - fi, - HO_EV_MSC_MGW_OK, - HO_EV_MSC_MGW_FAIL, - NULL, - &ho->created_ci_for_msc)) { - ho_fail(HO_RESULT_ERROR, - "Unable to connect MGW endpoint to the MSC side"); - } -} - -static void ho_fsm_wait_mgw_endpoint_to_msc(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - const struct mgcp_conn_peer *mgw_info; - - switch (event) { - - case HO_EV_MSC_MGW_OK: - /* Ensure the endpoint is really there, and log it. This state is only entered for AoIP connections, see - * ho_fsm_wait_lchan_active() above. */ - mgw_info = mgwep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); - if (!mgw_info) { - ho_fail(HO_RESULT_ERROR, - "Unable to retrieve RTP port info allocated by MGW for" - " the MSC side."); - return; - } - LOG_HO(conn, LOGL_DEBUG, "MGW's MSC side CI: %s:%u\n", - mgw_info->addr, mgw_info->port); - ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); - return; - - case HO_EV_MSC_MGW_FAIL: - ho_fail(HO_RESULT_ERROR, - "Unable to connect MGW endpoint to the MSC side"); - return; - - default: - OSMO_ASSERT(false); - } -} - - static void ho_fsm_wait_rr_ho_detect_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { int rc; @@ -1093,24 +1009,24 @@ } } +static void ho_fsm_post_lchan_established(struct osmo_fsm_inst *fi); + static void ho_fsm_wait_lchan_established_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { struct gsm_subscriber_connection *conn = ho_fi_conn(fi); if (conn->ho.fi && lchan_state_is(conn->ho.new_lchan, LCHAN_ST_ESTABLISHED)) { LOG_HO(conn, LOGL_DEBUG, "lchan already established earlier\n"); - ho_success(); + ho_fsm_post_lchan_established(fi); } } static void ho_fsm_wait_lchan_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) { - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - switch (event) { case HO_EV_LCHAN_ESTABLISHED: - ho_success(); + ho_fsm_post_lchan_established(fi); break; default: @@ -1118,6 +1034,69 @@ } } +static void ho_fsm_post_lchan_established(struct osmo_fsm_inst *fi) +{ + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + struct handover *ho = &conn->ho; + + if (ho->new_lchan->activate.info.requires_voice_stream + && (ho->scope & HO_INTER_BSC_IN)) + ho_fsm_state_chg(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC); + else + ho_success(); +} + +static void ho_fsm_wait_mgw_endpoint_to_msc_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + struct handover *ho = &conn->ho; + + if (!gscon_connect_mgw_to_msc(conn, + ho->new_lchan, + ho->inter_bsc_in.msc_assigned_rtp_addr, + ho->inter_bsc_in.msc_assigned_rtp_port, + fi, + HO_EV_MSC_MGW_OK, + HO_EV_MSC_MGW_FAIL, + NULL, + &ho->created_ci_for_msc)) { + ho_fail(HO_RESULT_ERROR, + "Unable to connect MGW endpoint to the MSC side"); + } +} + +static void ho_fsm_wait_mgw_endpoint_to_msc(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + switch (event) { + + case HO_EV_MSC_MGW_OK: + /* For AoIP, we created the MGW endpoint. Ensure it is really there, and log it. */ + if (gscon_is_aoip(conn)) { + const struct mgcp_conn_peer *mgw_info; + mgw_info = mgwep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); + if (!mgw_info) { + ho_fail(HO_RESULT_ERROR, + "Unable to retrieve RTP port info allocated by MGW for" + " the MSC side."); + return; + } + LOG_HO(conn, LOGL_DEBUG, "MGW's MSC side CI: %s:%u\n", + mgw_info->addr, mgw_info->port); + } + ho_success(); + return; + + case HO_EV_MSC_MGW_FAIL: + ho_fail(HO_RESULT_ERROR, + "Unable to connect MGW endpoint to the MSC side"); + return; + + default: + OSMO_ASSERT(false); + } +} + /* Inter-BSC OUT */ static void handover_start_inter_bsc_out(struct gsm_subscriber_connection *conn, @@ -1206,19 +1185,6 @@ , .out_state_mask = 0 | S(HO_ST_WAIT_LCHAN_ACTIVE) - | S(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC) - | S(HO_ST_WAIT_RR_HO_DETECT) - , - }, - [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { - .name = "WAIT_MGW_ENDPOINT_TO_MSC", - .onenter = ho_fsm_wait_mgw_endpoint_to_msc_onenter, - .action = ho_fsm_wait_mgw_endpoint_to_msc, - .in_event_mask = 0 - | S(HO_EV_MSC_MGW_OK) - | S(HO_EV_MSC_MGW_FAIL) - , - .out_state_mask = 0 | S(HO_ST_WAIT_RR_HO_DETECT) , }, @@ -1256,7 +1222,20 @@ .in_event_mask = 0 | S(HO_EV_LCHAN_ESTABLISHED) , + .out_state_mask = 0 + | S(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC) + , }, + [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { + .name = "WAIT_MGW_ENDPOINT_TO_MSC", + .onenter = ho_fsm_wait_mgw_endpoint_to_msc_onenter, + .action = ho_fsm_wait_mgw_endpoint_to_msc, + .in_event_mask = 0 + | S(HO_EV_MSC_MGW_OK) + | S(HO_EV_MSC_MGW_FAIL) + , + }, + [HO_OUT_ST_WAIT_HO_COMMAND] = { .name = "inter-BSC-OUT:WAIT_HO_COMMAND", .action = ho_out_fsm_wait_ho_command, -- To view, visit https://gerrit.osmocom.org/13706 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I01d93778fb19c601c21f99ec4d2a3ab8a4a48f67 Gerrit-Change-Number: 13706 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 08:31:34 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Fri, 19 Apr 2019 08:31:34 +0000 Subject: Change in osmo-bsc[master]: Revert "fix inter-BSC-HO-incoming for AoIP (1/2)" In-Reply-To: References: Message-ID: Hello lynxis lazus, Harald Welte, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13706 to look at the new patch set (#2). Change subject: Revert "fix inter-BSC-HO-incoming for AoIP (1/2)" ...................................................................... Revert "fix inter-BSC-HO-incoming for AoIP (1/2)" This reverts commit 94c9324fe07cd0ba1277278270c8979d949e49ec. Multiple ttcn3 handover tests were broken due to this commit. Let's merge this once all the other commits pertaining to that fix can be merged as well. Fixes: OS#3942 Change-Id: I01d93778fb19c601c21f99ec4d2a3ab8a4a48f67 --- M include/osmocom/bsc/handover_fsm.h M src/osmo-bsc/handover_fsm.c 2 files changed, 85 insertions(+), 106 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/06/13706/2 -- To view, visit https://gerrit.osmocom.org/13706 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I01d93778fb19c601c21f99ec4d2a3ab8a4a48f67 Gerrit-Change-Number: 13706 Gerrit-PatchSet: 2 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-CC: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 10:24:50 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Apr 2019 10:24:50 +0000 Subject: Change in osmo-bts[master]: common/oml.c: use proper OML object for Get Attribute Response In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13701 to look at the new patch set (#2). Change subject: common/oml.c: use proper OML object for Get Attribute Response ...................................................................... common/oml.c: use proper OML object for Get Attribute Response It was noticed that the Get Attribute Response message always indicates BTS(00,ff,ff) as the addressed OML entity, even if e.g. Baseband Transceiver(00,00,ff) was requested by the BSC. Despite neither OsmoBSC nor OpenBSC does complain about this, such behaviour violates 3GPP TS 52.021. Let's fix this. Change-Id: Icb1ee75d4bf680deb6365288d8c2053816a12217 Related: OS#3938 --- M src/common/oml.c 1 file changed, 20 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/13701/2 -- To view, visit https://gerrit.osmocom.org/13701 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icb1ee75d4bf680deb6365288d8c2053816a12217 Gerrit-Change-Number: 13701 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 10:24:50 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Apr 2019 10:24:50 +0000 Subject: Change in osmo-bts[master]: common/oml.c: fix total length calculation in cleanup_attr_msg() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13707 Change subject: common/oml.c: fix total length calculation in cleanup_attr_msg() ...................................................................... common/oml.c: fix total length calculation in cleanup_attr_msg() Both callers of cleanup_attr_msg(), i.e. handle_attrs_trx() and handle_attrs_bts(), always pass out_offset >= 1, so the length of the unsupported attributes counter is already accounted. Otherwise, both callers would copy an additional garbage byte from uninitialized memory. Discovered using Valgrind: DOML DEBUG oml.c:539 OC=BTS(01) INST=(ff,ff,ff) Rx GET ATTR DOML INFO oml.c:265 BTS Tx Get Attribute Response ==25467== Syscall param socketcall.sendto(msg) points to uninitialised byte(s) ==25467== at 0x623E0BD: send (send.c:27) ==25467== by 0x5685846: __handle_ts1_write (ipaccess.c:358) ==25467== by 0x5683F8B: ipa_client_write (ipa.c:79) ==25467== by 0x5683F8B: ipa_client_fd_cb (ipa.c:140) ==25467== by 0x5F1DC23: osmo_fd_disp_fds (select.c:223) ==25467== by 0x5F1DC23: osmo_select_main (select.c:263) ==25467== by 0x42980B: bts_main (main.c:354) ==25467== by 0x6160F44: (below main) (libc-start.c:287) ==25467== Address 0x7d83895 is 23,669 bytes inside a block of size 102,528 alloc'd ==25467== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==25467== by 0x589A6B4: talloc_pool (in /usr/lib/x86_64-linux-gnu/libtalloc.so.2.1.5) ==25467== by 0x5F1E28B: msgb_talloc_ctx_init (msgb.c:316) ==25467== by 0x4293D0: bts_main (main.c:234) ==25467== by 0x6160F44: (below main) (libc-start.c:287) ==25467== Uninitialised value was created by a stack allocation ==25467== at 0x415FE5: oml_tx_attr_resp (oml.c:259) ==25467== by 0x415FE5: oml_rx_get_attr (oml.c:561) ==25467== Change-Id: Ic7c2c4e54e9f99b60aaf70604044933978be945c Related: OS#3938 --- M src/common/oml.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/07/13707/1 diff --git a/src/common/oml.c b/src/common/oml.c index 6bf418f..ba7a06a 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -188,7 +188,7 @@ msgb_free(msg); } - return len + out_offset + 1; + return len + out_offset; } static inline int handle_attrs_trx(uint8_t *out, const struct gsm_bts_trx *trx, const uint8_t *attr, uint16_t attr_len) -- To view, visit https://gerrit.osmocom.org/13707 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic7c2c4e54e9f99b60aaf70604044933978be945c Gerrit-Change-Number: 13707 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 12:24:44 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Apr 2019 12:24:44 +0000 Subject: Change in osmo-bts[master]: common/oml.c: use proper OML object for Get Attribute Response In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13701 ) Change subject: common/oml.c: use proper OML object for Get Attribute Response ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/13701/1/src/common/oml.c File src/common/oml.c: https://gerrit.osmocom.org/#/c/13701/1/src/common/oml.c at 272 PS1, Line 272: len = handle_attrs_bts(resp, (const struct gsm_bts *) obj, attr, attr_len); > If you know it's going to be BTS, then just pass mo->bts and avoid nasty castings. Done. https://gerrit.osmocom.org/#/c/13701/1/src/common/oml.c at 275 PS1, Line 275: len = handle_attrs_trx(resp, (const struct gsm_bts_trx *) obj, attr, attr_len); > Are yousure this is correct? gsm_objclass2obj returns &trx->bb_transc here, not trx. You're right, thanks! Fixed. -- To view, visit https://gerrit.osmocom.org/13701 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icb1ee75d4bf680deb6365288d8c2053816a12217 Gerrit-Change-Number: 13701 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 19 Apr 2019 12:24:44 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 12:32:18 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Apr 2019 12:32:18 +0000 Subject: Change in libosmocore[master]: GSUP: add inter-MSC handover related msgs and IEs In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/12860 ) Change subject: GSUP: add inter-MSC handover related msgs and IEs ...................................................................... Patch Set 9: Hi Neels, > Is this important to you or can we leave it as it is? not important, just an idea. Feel free to proceed as is. This is a side-effect of having such 'monster' structure for all kinds of messages :/ I hope some day we will introduce the new API, where each message type is represented by a separate structure... -- To view, visit https://gerrit.osmocom.org/12860 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic00b0601eacff6d72927cea51767801142ee75db Gerrit-Change-Number: 12860 Gerrit-PatchSet: 9 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Fri, 19 Apr 2019 12:32:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 13:53:22 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Fri, 19 Apr 2019 13:53:22 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/11194 ) Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... Patch Set 2: Code-Review+1 > Uploaded patch set 2. I haven't tested this, but it looks like the right logic to me. Anyway, I trust Harald.. if it's proposed for merge as is, I'm fine with that. -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 2 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Comment-Date: Fri, 19 Apr 2019 13:53:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 14:01:36 2019 From: gerrit-no-reply at lists.osmocom.org (Rafael Diniz) Date: Fri, 19 Apr 2019 14:01:36 +0000 Subject: Change in osmo-sip-connector[master]: Added daemonize feature to osmo-sip-connector In-Reply-To: References: Message-ID: Rafael Diniz has posted comments on this change. ( https://gerrit.osmocom.org/13704 ) Change subject: Added daemonize feature to osmo-sip-connector ...................................................................... Patch Set 1: Code-Review+1 Just cosmetic. -- To view, visit https://gerrit.osmocom.org/13704 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I400fb5a2619f348cc60e8c9016154afa60424e66 Gerrit-Change-Number: 13704 Gerrit-PatchSet: 1 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Rafael Diniz Gerrit-Comment-Date: Fri, 19 Apr 2019 14:01:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 14:04:28 2019 From: gerrit-no-reply at lists.osmocom.org (Rafael Diniz) Date: Fri, 19 Apr 2019 14:04:28 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Rafael Diniz has posted comments on this change. ( https://gerrit.osmocom.org/11194 ) Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... Patch Set 2: I commit to deprecated upstream a fix: https://gerrit.osmocom.org/#/c/openbsc/+/13703/ -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 2 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-CC: Rafael Diniz Gerrit-Comment-Date: Fri, 19 Apr 2019 14:04:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 14:17:40 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 14:17:40 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/11194 ) Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... Patch Set 2: I only tested it against my new TTCN3 unit test very briefly. @Keith: If you would have time to test it with your manual test case, we could be 100% sure. -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 2 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-CC: Rafael Diniz Gerrit-Comment-Date: Fri, 19 Apr 2019 14:17:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 14:18:37 2019 From: gerrit-no-reply at lists.osmocom.org (Rafael Diniz) Date: Fri, 19 Apr 2019 14:18:37 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Rafael Diniz has posted comments on this change. ( https://gerrit.osmocom.org/11194 ) Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... Patch Set 2: Code-Review+1 I think this code prevents an undesired behavior of the MSC (which still needs to be fixed), so for me, it's good to go, as there is a need for such fix in the field. -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 2 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Rafael Diniz Gerrit-Comment-Date: Fri, 19 Apr 2019 14:18:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 14:23:53 2019 From: gerrit-no-reply at lists.osmocom.org (Rafael Diniz) Date: Fri, 19 Apr 2019 14:23:53 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Rafael Diniz has posted comments on this change. ( https://gerrit.osmocom.org/11194 ) Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... Patch Set 2: -Code-Review > I only tested it against my new TTCN3 unit test very briefly. > @Keith: If you would have time to test it with your manual test > case, we could be 100% sure. Harald, I wrote a simple automated test to reproduce the issue with a calypso board by issuing the ATD command and the ATH after 0.5s. I can test here too. -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 2 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Rafael Diniz Gerrit-Comment-Date: Fri, 19 Apr 2019 14:23:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 14:29:39 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Apr 2019 14:29:39 +0000 Subject: Change in osmo-bts[master]: common/oml.c: refactor OML msgb allocation in oml_tx_attr_resp() In-Reply-To: References: Message-ID: Vadim Yanitskiy has abandoned this change. ( https://gerrit.osmocom.org/13698 ) Change subject: common/oml.c: refactor OML msgb allocation in oml_tx_attr_resp() ...................................................................... Abandoned This message buffer can and actually going to be used in the follow-up changes. -- To view, visit https://gerrit.osmocom.org/13698 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Ib8c1f77aad784b6f5cbe888a5139d7afb456924d Gerrit-Change-Number: 13698 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 14:36:37 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Apr 2019 14:36:37 +0000 Subject: Change in osmo-bts[master]: common/oml.c: use proper OML object for Get Attribute Response 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/13701 to look at the new patch set (#3). Change subject: common/oml.c: use proper OML object for Get Attribute Response ...................................................................... common/oml.c: use proper OML object for Get Attribute Response It was noticed that the Get Attribute Response message always indicates BTS(00,ff,ff) as the addressed OML entity, even if e.g. Baseband Transceiver(00,00,ff) was requested by the BSC. Despite neither OsmoBSC nor OpenBSC does complain about this, such behaviour violates 3GPP TS 52.021. Let's fix this. Change-Id: Icb1ee75d4bf680deb6365288d8c2053816a12217 Related: OS#3938 --- M src/common/oml.c 1 file changed, 20 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/13701/3 -- To view, visit https://gerrit.osmocom.org/13701 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icb1ee75d4bf680deb6365288d8c2053816a12217 Gerrit-Change-Number: 13701 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 14:36:38 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Apr 2019 14:36:38 +0000 Subject: Change in osmo-bts[master]: common/oml.c: refactor Get Attribute Response message generation Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13708 Change subject: common/oml.c: refactor Get Attribute Response message generation ...................................................................... common/oml.c: refactor Get Attribute Response message generation Instead of allocating two transitional buffers (one static, another dynamic), we can use the existing message buffer. Both handle_attrs_bts() and handle_attrs_trx() can put (append) the reported attributes, and push (prepend) unreported ones as per 3GPP TS 52.021, 9.4.64 "Get Attribute Response Info". Change-Id: I349447a43bce360f59e0c6b435906c65167d158b --- M src/common/oml.c 1 file changed, 50 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/13708/1 diff --git a/src/common/oml.c b/src/common/oml.c index de7a0e7..caff595 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -191,64 +191,75 @@ return len + out_offset; } -static inline int handle_attrs_trx(uint8_t *out, const struct gsm_bts_trx *trx, const uint8_t *attr, uint16_t attr_len) +static inline int handle_attrs_trx(struct msgb *msg, const struct gsm_bts_trx *trx, + const uint8_t *attr, uint16_t attr_len) { - uint16_t i, attr_out_index = 1; /* byte 0 is reserved for unsupported attributes counter */ - struct msgb *attr_buf = oml_msgb_alloc(); + uint8_t num_unreported = 0; + uint8_t *buf; + int i; - if (!attr_buf) - return -NM_NACK_CANT_PERFORM; + if (!trx) { + LOGP(DOML, LOGL_ERROR, "O&M Get Attributes for unknown TRX\n"); + return -NM_NACK_TRXNR_UNKN; + } for (i = 0; i < attr_len; i++) { - bool processed = false; switch (attr[i]) { case NM_ATT_SW_CONFIG: - if (trx) { - add_trx_attr(attr_buf, trx); - processed = true; - } else - LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unhandled due to missing TRX.\n", - i, get_value_string(abis_nm_att_names, attr[i])); + add_trx_attr(msg, trx); break; default: LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported by TRX.\n", i, get_value_string(abis_nm_att_names, attr[i])); - } - /* assemble values of supported attributes and list of unsupported ones */ - if (!processed) { - out[attr_out_index] = attr[i]; - attr_out_index++; + /* Push this tag to the list of unreported attributes */ + buf = msgb_push(msg, 1); + *buf = attr[i]; + num_unreported++; } } - return cleanup_attr_msg(out, attr_out_index, attr_buf); + /* Push the amount of unreported attributes */ + buf = msgb_push(msg, 1); + *buf = num_unreported; + + return 0; } -static inline int handle_attrs_bts(uint8_t *out, const struct gsm_bts *bts, const uint8_t *attr, uint16_t attr_len) +static inline int handle_attrs_bts(struct msgb *msg, const struct gsm_bts *bts, + const uint8_t *attr, uint16_t attr_len) { - uint16_t i, attr_out_index = 1; /* byte 0 is reserved for unsupported attributes counter */ - struct msgb *attr_buf = oml_msgb_alloc(); + uint8_t num_unreported = 0; + uint8_t *buf; + int i; - if (!attr_buf) - return -NM_NACK_CANT_PERFORM; + if (!bts) { + LOGP(DOML, LOGL_ERROR, "O&M Get Attributes for unknown BTS\n"); + return -NM_NACK_BTSNR_UNKN; + } for (i = 0; i < attr_len; i++) { switch (attr[i]) { case NM_ATT_SW_CONFIG: - add_bts_attrs(attr_buf, bts); + add_bts_attrs(msg, bts); break; case NM_ATT_MANUF_ID: - add_bts_feat(attr_buf, bts); + add_bts_feat(msg, bts); break; default: LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported by BTS.\n", i, get_value_string(abis_nm_att_names, attr[i])); - out[attr_out_index] = attr[i]; /* assemble values of supported attributes and list of unsupported ones */ - attr_out_index++; + /* Push this tag to the list of unreported attributes */ + buf = msgb_push(msg, 1); + *buf = attr[i]; + num_unreported++; } } - return cleanup_attr_msg(out, attr_out_index, attr_buf); + /* Push the amount of unreported attributes */ + buf = msgb_push(msg, 1); + *buf = num_unreported; + + return 0; } /* send 3GPP TS 52.021 ?8.11.2 Get Attribute Response */ @@ -256,8 +267,7 @@ const uint8_t *attr, uint16_t attr_len) { struct msgb *nmsg = oml_msgb_alloc(); - uint8_t resp[MAX_VERSION_LENGTH * attr_len * 2]; /* heuristic for Attribute Response Info space requirements */ - int len; + int rc; LOGP(DOML, LOGL_INFO, "%s Tx Get Attribute Response\n", get_value_string(abis_nm_obj_class_names, mo->obj_class)); @@ -267,28 +277,28 @@ switch (mo->obj_class) { case NM_OC_BTS: - len = handle_attrs_bts(resp, mo->bts, attr, attr_len); + rc = handle_attrs_bts(nmsg, mo->bts, attr, attr_len); break; case NM_OC_BASEB_TRANSC: - len = handle_attrs_trx(resp, gsm_bts_trx_num(mo->bts, mo->obj_inst.trx_nr), attr, attr_len); + rc = handle_attrs_trx(nmsg, gsm_bts_trx_num(mo->bts, mo->obj_inst.trx_nr), attr, attr_len); break; default: LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute Response\n", get_value_string(abis_nm_obj_class_names, mo->obj_class)); - len = -NM_NACK_OBJCLASS_NOTSUPP; + rc = -NM_NACK_OBJCLASS_NOTSUPP; } - if (len < 0) { - LOGP(DOML, LOGL_ERROR, "Tx Get Attribute Response FAILED with %d\n", len); + if (rc < 0) { + LOGP(DOML, LOGL_ERROR, "Tx Get Attribute Response FAILED with rc=%d\n", rc); msgb_free(nmsg); - return len; + return rc; } - /* ?9.4.64 Get Attribute Response Info */ - msgb_tl16v_put(nmsg, NM_ATT_GET_ARI, len, resp); + /* Push Get Attribute Response Info TL (actually TV where V is L) */ + msgb_tv16_push(nmsg, NM_ATT_GET_ARI, msgb_length(nmsg)); - len = oml_mo_send_msg(mo, nmsg, NM_MT_GET_ATTR_RESP); - return (len < 0) ? -NM_NACK_CANT_PERFORM : len; + rc = oml_mo_send_msg(mo, nmsg, NM_MT_GET_ATTR_RESP); + return (rc < 0) ? -NM_NACK_CANT_PERFORM : rc; } /* 8.8.1 sending State Changed Event Report */ -- To view, visit https://gerrit.osmocom.org/13708 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I349447a43bce360f59e0c6b435906c65167d158b Gerrit-Change-Number: 13708 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 14:36:39 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Apr 2019 14:36:39 +0000 Subject: Change in osmo-bts[master]: common/oml.c: fix: properly encode NM_ATT_SW_CONFIG Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13709 Change subject: common/oml.c: fix: properly encode NM_ATT_SW_CONFIG ...................................................................... common/oml.c: fix: properly encode NM_ATT_SW_CONFIG According to 3GPP TS 52.021, sections 9.4.61-62, 'SW Configuration' shall contain a list of 'SW Descriptions' related to the MO. In other words, all 'NM_ATT_SW_DESCR' blobs shall be encapsulated into a single NM_ATT_SW_CONFIG attribute. For some reason, they were not encapsulated properly, so OsmoBSC were unable to parse the 'SW Descriptions'. However, unlike OsmoBSC the old OpenBSC does not expect this encapsulation, thus after this change it will be unable to parse the 'SW Descriptions'. Change-Id: Id26104719891944f3e2151df362bd45bb057a9c5 Related: OS#3938 --- M src/common/oml.c 1 file changed, 33 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/09/13709/1 diff --git a/src/common/oml.c b/src/common/oml.c index caff595..d8859db 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -142,11 +142,26 @@ static inline void add_bts_attrs(struct msgb *msg, const struct gsm_bts *bts) { - abis_nm_put_sw_file(msg, "osmobts", PACKAGE_VERSION, true); - abis_nm_put_sw_file(msg, btsatttr2str(BTS_TYPE_VARIANT), btsvariant2str(bts->variant), true); + uint16_t total_len = 0; + uint16_t *len; - if (strlen(bts->sub_model)) - abis_nm_put_sw_file(msg, btsatttr2str(BTS_SUB_MODEL), bts->sub_model, true); + /* Put NM_ATT_SW_CONFIG as per 9.4.61 "SW Configuration". */ + msgb_v_put(msg, NM_ATT_SW_CONFIG); + + /* We don't know the length yet, so we update it later. */ + len = (uint16_t *) msgb_put(msg, 2); + + total_len += abis_nm_put_sw_file(msg, "osmobts", PACKAGE_VERSION, true); + total_len += abis_nm_put_sw_file(msg, btsatttr2str(BTS_TYPE_VARIANT), + btsvariant2str(bts->variant), true); + + if (strlen(bts->sub_model)) { + total_len += abis_nm_put_sw_file(msg, btsatttr2str(BTS_SUB_MODEL), + bts->sub_model, true); + } + + /* Finally, update the length */ + *len = htons(total_len); } /* Add BTS features as 3GPP TS 52.021 ?9.4.30 Manufacturer Id */ @@ -158,9 +173,21 @@ static inline void add_trx_attr(struct msgb *msg, const struct gsm_bts_trx *trx) { const struct phy_instance *pinst = trx_phy_instance(trx); + const char *phy_version; + uint16_t total_len; + uint16_t *len; - abis_nm_put_sw_file(msg, btsatttr2str(TRX_PHY_VERSION), pinst && strlen(pinst->version) ? pinst->version : "Unknown", - true); + /* Put NM_ATT_SW_CONFIG as per 9.4.61 "SW Configuration". */ + msgb_v_put(msg, NM_ATT_SW_CONFIG); + + /* We don't know the length yet, so we update it later. */ + len = (uint16_t *) msgb_put(msg, 2); + + phy_version = pinst && strlen(pinst->version) ? pinst->version : "Unknown"; + total_len = abis_nm_put_sw_file(msg, btsatttr2str(TRX_PHY_VERSION), phy_version, true); + + /* Finally, update the length */ + *len = htons(total_len); } /* The number of attributes in ?9.4.26 List of Required Attributes is 2 bytes, -- To view, visit https://gerrit.osmocom.org/13709 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id26104719891944f3e2151df362bd45bb057a9c5 Gerrit-Change-Number: 13709 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 15:53:31 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 15:53:31 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sip: Add TC_mo_setup_disc_late_rtp for OS#3518 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13705 ) Change subject: sip: Add TC_mo_setup_disc_late_rtp for OS#3518 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13705 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9d5752e01d6995eff67463c51deaacedc5dcabe7 Gerrit-Change-Number: 13705 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Rafael Diniz Gerrit-Comment-Date: Fri, 19 Apr 2019 15:53:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 15:53:33 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 15:53:33 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sip: Add TC_mo_setup_disc_late_rtp for OS#3518 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13705 ) Change subject: sip: Add TC_mo_setup_disc_late_rtp for OS#3518 ...................................................................... sip: Add TC_mo_setup_disc_late_rtp for OS#3518 Related: OS#3518 Change-Id: I9d5752e01d6995eff67463c51deaacedc5dcabe7 --- M sip/SIP_Tests.ttcn 1 file changed, 48 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sip/SIP_Tests.ttcn b/sip/SIP_Tests.ttcn index 24b3622..67650c8 100644 --- a/sip/SIP_Tests.ttcn +++ b/sip/SIP_Tests.ttcn @@ -381,12 +381,60 @@ vc_conn.done; } +/* SETUP followed by DISC results in lingering B-leg (OS#3518)*/ +private function f_TC_mo_setup_disc_late_rtp(charstring id) runs on ConnHdlr { + var CallPars cp := valueof(t_CallPars(true)); + f_CallPars_compute(cp); + cp.comp.sip_body := "v=0\r\no=Osmocom 0 0 IN IP4 0.0.0.0\r\ns=GSM Call\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\nm=audio 0 RTP/AVP 0\r\na=rtpmap:0 GSM/8000\r\n"; + f_sleep(3.0); + + var MNCC_number dst := valueof(ts_MNCC_number(cp.called, GSM48_TON_UNKNOWN)); + var MNCC_number src := valueof(ts_MNCC_number(cp.calling, GSM48_TON_UNKNOWN)); + var template SipAddr sip_addr_gsm := tr_SipAddr_from_val(cp.comp.sip_url_gsm); + var template SipAddr sip_addr_ext := tr_SipAddr_from_val(cp.comp.sip_url_ext); + + f_create_sip_expect(cp.comp.sip_url_ext.addr.nameAddr.addrSpec); + + /* MSC -> OSC: MSC sends SETUP.ind after CC SETUP was received from MS */ + MNCC.send(ts_MNCC_SETUP_ind(cp.mncc_call_id, dst, src, "262420123456789")); + + /* MSC -> OSC: Simulate a CC DISCONNET from the MT user *before* responding to the RTP_CREATE */ + MNCC.send(ts_MNCC_DISC_ind(cp.mncc_call_id, ts_MNCC_cause(0))); + + /* MSC <- OSC: Create GSM side RTP socket (too late) */ + MNCC.receive(tr_MNCC_RTP_CREATE(cp.mncc_call_id)) { + var MNCC_PDU mncc := valueof(ts_MNCC_RTP_CREATE(cp.mncc_call_id)); + mncc.u.rtp.payload_msg_type := oct2int('0300'O); + MNCC.send(mncc); /* FIXME: port/ip */ + } + + /* OSC -> SIP: We should never receive INVITE */ + timer T := 10.0; + T.start; + alt { + [] SIP.receive(tr_SIP_INVITE(?, sip_addr_gsm, sip_addr_ext, ?, ?)) { + setverdict(fail, "Received unexpected INVITE"); + } + [] T.timeout { + setverdict(pass); + } + } +} +testcase TC_mo_setup_disc_late_rtp() runs on test_CT { + var ConnHdlrPars pars; + var ConnHdlr vc_conn; + f_init(); + pars := valueof(t_Pars); + vc_conn := f_start_handler(refers(f_TC_mo_setup_disc_late_rtp), pars); + vc_conn.done; +} control { execute( TC_mt_success_rel_gsm() ); execute( TC_mt_success_rel_sip() ); execute( TC_mo_success_rel_gsm() ); execute( TC_mo_success_rel_sip() ); + execute( TC_mo_setup_disc_late_rtp() ); } -- To view, visit https://gerrit.osmocom.org/13705 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9d5752e01d6995eff67463c51deaacedc5dcabe7 Gerrit-Change-Number: 13705 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Rafael Diniz -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 15:55:05 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 15:55:05 +0000 Subject: Change in osmo-bts[master]: common/oml.c: use proper OML object for Get Attribute Response In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13701 ) Change subject: common/oml.c: use proper OML object for Get Attribute Response ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13701 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icb1ee75d4bf680deb6365288d8c2053816a12217 Gerrit-Change-Number: 13701 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 19 Apr 2019 15:55:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 15:55:34 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 15:55:34 +0000 Subject: Change in osmo-bts[master]: common/oml.c: fix total length calculation in cleanup_attr_msg() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13707 ) Change subject: common/oml.c: fix total length calculation in cleanup_attr_msg() ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13707 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic7c2c4e54e9f99b60aaf70604044933978be945c Gerrit-Change-Number: 13707 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Fri, 19 Apr 2019 15:55:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 15:58:39 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 15:58:39 +0000 Subject: Change in osmo-bts[master]: common/oml.c: refactor Get Attribute Response message generation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13708 ) Change subject: common/oml.c: refactor Get Attribute Response message generation ...................................................................... Patch Set 1: Code-Review+1 (2 comments) I like the change in principle, but I think variable naming of the old code was more obvious than with the new code. https://gerrit.osmocom.org/#/c/13708/1/src/common/oml.c File src/common/oml.c: https://gerrit.osmocom.org/#/c/13708/1/src/common/oml.c at 194 PS1, Line 194: static inline int handle_attrs_trx(struct msgb *msg, const struct gsm_bts_trx *trx, in terms of naming, this could be 'out' or 'msg_out' or 'resp' to indicate clearly that it's the output/response message, and not the input message. Alternatively, put a comment on top of the funciton to make it clear. https://gerrit.osmocom.org/#/c/13708/1/src/common/oml.c at 214 PS1, Line 214: /* Push this tag to the list of unreported attributes */ what are "unreported" attributes? I think you can report somethng, but how can you un-report it again? -- To view, visit https://gerrit.osmocom.org/13708 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I349447a43bce360f59e0c6b435906c65167d158b Gerrit-Change-Number: 13708 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Fri, 19 Apr 2019 15:58:39 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 16:00:07 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 16:00:07 +0000 Subject: Change in osmo-bts[master]: common/oml.c: fix: properly encode NM_ATT_SW_CONFIG In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13709 ) Change subject: common/oml.c: fix: properly encode NM_ATT_SW_CONFIG ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13709/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13709/1//COMMIT_MSG at 17 PS1, Line 17: However, unlike OsmoBSC the old OpenBSC does not expect this : encapsulation, thus after this change it will be unable to : parse the 'SW Descriptions'. did you check how this is with a nanoBTS? I think it's best to align with how they implement this. Also, the big question is what we do in terms of compatibility. Maybe add it twice: both in the correct and in the incorrect form? -- To view, visit https://gerrit.osmocom.org/13709 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id26104719891944f3e2151df362bd45bb057a9c5 Gerrit-Change-Number: 13709 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 19 Apr 2019 16:00:07 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 16:01:20 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 16:01:20 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/11194 ) Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... Patch Set 2: > > I only tested it against my new TTCN3 unit test very briefly. > > @Keith: If you would have time to test it with your manual test > > case, we could be 100% sure. > > Harald, I wrote a simple automated test to reproduce the issue with > a calypso board by issuing the ATD command and the ATH after 0.5s. > I can test here too. Thanks. Whichever way, for sure it's good to have it tested somehow beyond the TTCN-3 test which I wrote (but I've not seen the real issue in the real world, so my test might be wrong). -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 2 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Rafael Diniz Gerrit-Comment-Date: Fri, 19 Apr 2019 16:01:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 16:03:06 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 16:03:06 +0000 Subject: Change in osmo-mgw[master]: fix: multiple initial CRCX In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13591 ) Change subject: fix: multiple initial CRCX ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13591 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I92a9944acc96398acd6649f9c3c5badec5dd6dcc Gerrit-Change-Number: 13591 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Fri, 19 Apr 2019 16:03:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 16:05:52 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 16:05:52 +0000 Subject: Change in osmo-mgw[master]: move MGW endpoint FSM from osmo-bsc to here In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13590 ) Change subject: move MGW endpoint FSM from osmo-bsc to here ...................................................................... Patch Set 3: I like this move (both literally and in abstract sense). However, no matter how much pressure we have in terms of getting features complete, I think it's not a good way to merge new library code without doxygen documentation. Or at least some API documentation on top of the function declearations/definitions at all. This is not some code that is internal to a given sub-system, but it's a "public" API that programs (and hence programmers) are supposed to use, and hence it deserves API docs, IMHO. -- To view, visit https://gerrit.osmocom.org/13590 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9a3effd38e72841529df6c135c077116981dea36 Gerrit-Change-Number: 13590 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 19 Apr 2019 16:05:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 16:06:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 16:06:30 +0000 Subject: Change in osmo-sip-connector[master]: Added daemonize feature to osmo-sip-connector In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13704 ) Change subject: Added daemonize feature to osmo-sip-connector ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13704 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I400fb5a2619f348cc60e8c9016154afa60424e66 Gerrit-Change-Number: 13704 Gerrit-PatchSet: 1 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Rafael Diniz Gerrit-Comment-Date: Fri, 19 Apr 2019 16:06:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 16:06:33 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 16:06:33 +0000 Subject: Change in osmo-sip-connector[master]: Added daemonize feature to osmo-sip-connector In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13704 ) Change subject: Added daemonize feature to osmo-sip-connector ...................................................................... Added daemonize feature to osmo-sip-connector Change-Id: I400fb5a2619f348cc60e8c9016154afa60424e66 --- M src/main.c 1 file changed, 16 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Rafael Diniz: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/main.c b/src/main.c index 0661498..ab58a52 100644 --- a/src/main.c +++ b/src/main.c @@ -46,6 +46,7 @@ void *tall_mncc_ctx; +static bool daemonize = false; static char *config_file = "osmo-sip-connector.cfg"; static struct log_info_cat mncc_sip_categories[] = { @@ -79,8 +80,9 @@ static void print_help(void) { printf("OsmoSIPcon: MNCC to SIP bridge\n"); - printf(" -h --help\tthis text\n"); + printf(" -h --help\tThis text\n"); printf(" -c --config-file NAME\tThe config file to use [%s]\n", config_file); + printf(" -D --daemonize\tFork the process into a background daemon\n"); printf(" -V --version\tPrint the version number\n"); } @@ -91,11 +93,12 @@ static struct option long_options[] = { {"help", 0, 0, 'h'}, {"config-file", 1, 0, 'c'}, + {"daemonize", 0, 0, 'D'}, {"version", 0, 0, 'V' }, {NULL, 0, 0, 0} }; - c = getopt_long(argc, argv, "hc:V", + c = getopt_long(argc, argv, "hc:DV", long_options, &option_index); if (c == -1) break; @@ -107,6 +110,9 @@ case 'c': config_file = optarg; break; + case 'D': + daemonize = true; + break; case 'V': print_version(1); exit(EXIT_SUCCESS); @@ -159,6 +165,14 @@ calls_init(); app_setup(&g_app); + if (daemonize) { + rc = osmo_daemonize(); + if (rc < 0) { + perror("Error during daemonize"); + exit(1); + } + } + /* marry sofia-sip to glib and glib to libosmocore */ loop = g_main_loop_new(NULL, FALSE); g_source_attach(su_glib_root_gsource(g_app.sip.agent.root), -- To view, visit https://gerrit.osmocom.org/13704 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I400fb5a2619f348cc60e8c9016154afa60424e66 Gerrit-Change-Number: 13704 Gerrit-PatchSet: 1 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Rafael Diniz -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 19:07:39 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Apr 2019 19:07:39 +0000 Subject: Change in osmo-bts[master]: common/oml.c: refactor Get Attribute Response message generation In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13708 ) Change subject: common/oml.c: refactor Get Attribute Response message generation ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/13708/1/src/common/oml.c File src/common/oml.c: https://gerrit.osmocom.org/#/c/13708/1/src/common/oml.c at 194 PS1, Line 194: static inline int handle_attrs_trx(struct msgb *msg, const struct gsm_bts_trx *trx, > in terms of naming, this could be 'out' or 'msg_out' or 'resp' to indicate clearly that it's the out [?] Good point. I think it makes more sense to rename the symbol itself, as we don't actually 'handle' any attributes on the BTS. A proper self-explaining symbol name would be 'encode_attrs_trx' or 'put_attrs_trx'. https://gerrit.osmocom.org/#/c/13708/1/src/common/oml.c at 214 PS1, Line 214: /* Push this tag to the list of unreported attributes */ > what are "unreported" attributes? I think you can report somethng, but how can you un-report it aga [?] It's my poor English ;) Though this word can be seen in the existing code of both OsmoBSC and OsmoBTS. The specs. are using 'non-reported' term. This is about OML attributes that are not supported by the MO. As per 3GPP TS 52.021, if an attribute is not supported, it shall be included in the Get Attribute response anyway, as a part of 'non-reported' attribute list. -- To view, visit https://gerrit.osmocom.org/13708 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I349447a43bce360f59e0c6b435906c65167d158b Gerrit-Change-Number: 13708 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 19 Apr 2019 19:07:39 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 19:46:26 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 19:46:26 +0000 Subject: Change in osmo-bsc[master]: Revert "fix inter-BSC-HO-incoming for AoIP (1/2)" In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13706 ) Change subject: Revert "fix inter-BSC-HO-incoming for AoIP (1/2)" ...................................................................... Patch Set 2: Code-Review+2 >From neels: "apparently the ttcn3 tests require a fixed ordering of messages that now happens in a different sequence. I guess the ttcn3 tests need fixing. So my conclusion is that we should revert the BSC related changes and wait for the TTCN3 tests to have their expectations adjusted before the related BSC change[s] can be re-introduced. -- To view, visit https://gerrit.osmocom.org/13706 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I01d93778fb19c601c21f99ec4d2a3ab8a4a48f67 Gerrit-Change-Number: 13706 Gerrit-PatchSet: 2 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Fri, 19 Apr 2019 19:46:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 19:46:29 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 19:46:29 +0000 Subject: Change in osmo-bsc[master]: Revert "fix inter-BSC-HO-incoming for AoIP (1/2)" In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13706 ) Change subject: Revert "fix inter-BSC-HO-incoming for AoIP (1/2)" ...................................................................... Revert "fix inter-BSC-HO-incoming for AoIP (1/2)" This reverts commit 94c9324fe07cd0ba1277278270c8979d949e49ec. Multiple ttcn3 handover tests were broken due to this commit. Let's merge this once all the other commits pertaining to that fix can be merged as well. Fixes: OS#3942 Change-Id: I01d93778fb19c601c21f99ec4d2a3ab8a4a48f67 --- M include/osmocom/bsc/handover_fsm.h M src/osmo-bsc/handover_fsm.c 2 files changed, 85 insertions(+), 106 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/handover_fsm.h b/include/osmocom/bsc/handover_fsm.h index 7c2145e..4db0890 100644 --- a/include/osmocom/bsc/handover_fsm.h +++ b/include/osmocom/bsc/handover_fsm.h @@ -28,10 +28,10 @@ HO_ST_NOT_STARTED, HO_ST_WAIT_LCHAN_ACTIVE, - HO_ST_WAIT_MGW_ENDPOINT_TO_MSC, HO_ST_WAIT_RR_HO_DETECT, HO_ST_WAIT_RR_HO_COMPLETE, HO_ST_WAIT_LCHAN_ESTABLISHED, + HO_ST_WAIT_MGW_ENDPOINT_TO_MSC, /* The inter-BSC Outgoing Handover FSM has completely separate states, but since it makes sense for it * to also live in conn->ho.fi, it should share the same event enum. From there it is merely @@ -46,11 +46,11 @@ HO_EV_LCHAN_ACTIVE, HO_EV_LCHAN_ESTABLISHED, HO_EV_LCHAN_ERROR, - HO_EV_MSC_MGW_OK, - HO_EV_MSC_MGW_FAIL, HO_EV_RR_HO_DETECT, HO_EV_RR_HO_COMPLETE, HO_EV_RR_HO_FAIL, + HO_EV_MSC_MGW_OK, + HO_EV_MSC_MGW_FAIL, HO_EV_CONN_RELEASING, HO_OUT_EV_BSSMAP_HO_COMMAND, diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 3b5a660..421c32e 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -161,10 +161,10 @@ static const struct state_timeout ho_fsm_timeouts[32] = { [HO_ST_WAIT_LCHAN_ACTIVE] = { .T = 23042 }, - [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { .T = 23042 }, [HO_ST_WAIT_RR_HO_DETECT] = { .T = 23042 }, [HO_ST_WAIT_RR_HO_COMPLETE] = { .T = 23042 }, [HO_ST_WAIT_LCHAN_ESTABLISHED] = { .T = 23042 }, + [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { .T = 23042 }, [HO_OUT_ST_WAIT_HO_COMMAND] = { .T = 7 }, [HO_OUT_ST_WAIT_CLEAR] = { .T = 8 }, }; @@ -876,24 +876,10 @@ static void ho_fsm_wait_lchan_active(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - struct handover *ho = &conn->ho; switch (event) { case HO_EV_LCHAN_ACTIVE: - /* - If the lchan is voiceless, no need to even think about the MGW. - * - If this is an intra-BSC Handover, we already have an RTP stream towards the MSC and aren't - * touching it. - * - If we're on SCCPlite, the MSC manages the MGW endpoint, all we do is the BTS side CI, so we can - * skip the part that would CRCX towards the MSC. - * So create an MSC side endpoint CI only if a voice lchan is established for an incoming inter-BSC - * handover on AoIP. Otherwise go on to send a Handover Command and wait for the Detect. - */ - if (ho->new_lchan->activate.info.requires_voice_stream - && (ho->scope & HO_INTER_BSC_IN) - && gscon_is_aoip(conn)) - ho_fsm_state_chg(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC); - else - ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); + ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); return; case HO_EV_LCHAN_ERROR: @@ -906,76 +892,6 @@ } } -/* Only for voice, only for inter-BSC Handover into this BSC, and only for AoIP: - * - * Establish the MGW endpoint CI that points towards the MSC. This needs to happen after the lchan (lchan_rtp_fsm) has - * created an MGW endpoint with the first CRCX, so that an endpoint is available, and before sending the Handover - * Request Acknowledge, so that the RTP address and port established towards the MSC can be included in the Handover - * Request Acknowledge message. - * (For SCCPlite, the MSC manages the CN side endpoint CI itself, and we don't need to send any RTP address in the - * Handover Request Acknowledge.) - * - * Actually, it should be possible to kick this off even above in handover_start_inter_bsc_in(), to do the CRCX towards - * the MSC at the same time as establishing the lchan. The gscon_ensure_mgw_endpoint() doesn't care which one of - * lchan_rtp_fsm or handover_start_inter_bsc_in() calls it first. The benefit would be that we'd send out the Handover - * Command ever so slightly sooner -- which isn't critical really, because a) how long does a CRCX take, milliseconds? - * and b) the time critical part is *after* the Handover Command was kicked off to keep the transition between cells as - * short as possible. The drawback of doing this earlier is code complexity: receiving the HO_EV_MSC_MGW_OK / - * HO_EV_MSC_MGW_FAIL events would need to be juggled in between the HO_EV_LCHAN_ACTIVE / HO_EV_LCHAN_ERROR. So the - * decision for now is to leave it here. - */ -static void ho_fsm_wait_mgw_endpoint_to_msc_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - struct handover *ho = &conn->ho; - - if (!gscon_connect_mgw_to_msc(conn, - ho->new_lchan, - ho->inter_bsc_in.msc_assigned_rtp_addr, - ho->inter_bsc_in.msc_assigned_rtp_port, - fi, - HO_EV_MSC_MGW_OK, - HO_EV_MSC_MGW_FAIL, - NULL, - &ho->created_ci_for_msc)) { - ho_fail(HO_RESULT_ERROR, - "Unable to connect MGW endpoint to the MSC side"); - } -} - -static void ho_fsm_wait_mgw_endpoint_to_msc(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - const struct mgcp_conn_peer *mgw_info; - - switch (event) { - - case HO_EV_MSC_MGW_OK: - /* Ensure the endpoint is really there, and log it. This state is only entered for AoIP connections, see - * ho_fsm_wait_lchan_active() above. */ - mgw_info = mgwep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); - if (!mgw_info) { - ho_fail(HO_RESULT_ERROR, - "Unable to retrieve RTP port info allocated by MGW for" - " the MSC side."); - return; - } - LOG_HO(conn, LOGL_DEBUG, "MGW's MSC side CI: %s:%u\n", - mgw_info->addr, mgw_info->port); - ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); - return; - - case HO_EV_MSC_MGW_FAIL: - ho_fail(HO_RESULT_ERROR, - "Unable to connect MGW endpoint to the MSC side"); - return; - - default: - OSMO_ASSERT(false); - } -} - - static void ho_fsm_wait_rr_ho_detect_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { int rc; @@ -1093,24 +1009,24 @@ } } +static void ho_fsm_post_lchan_established(struct osmo_fsm_inst *fi); + static void ho_fsm_wait_lchan_established_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { struct gsm_subscriber_connection *conn = ho_fi_conn(fi); if (conn->ho.fi && lchan_state_is(conn->ho.new_lchan, LCHAN_ST_ESTABLISHED)) { LOG_HO(conn, LOGL_DEBUG, "lchan already established earlier\n"); - ho_success(); + ho_fsm_post_lchan_established(fi); } } static void ho_fsm_wait_lchan_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) { - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - switch (event) { case HO_EV_LCHAN_ESTABLISHED: - ho_success(); + ho_fsm_post_lchan_established(fi); break; default: @@ -1118,6 +1034,69 @@ } } +static void ho_fsm_post_lchan_established(struct osmo_fsm_inst *fi) +{ + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + struct handover *ho = &conn->ho; + + if (ho->new_lchan->activate.info.requires_voice_stream + && (ho->scope & HO_INTER_BSC_IN)) + ho_fsm_state_chg(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC); + else + ho_success(); +} + +static void ho_fsm_wait_mgw_endpoint_to_msc_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + struct handover *ho = &conn->ho; + + if (!gscon_connect_mgw_to_msc(conn, + ho->new_lchan, + ho->inter_bsc_in.msc_assigned_rtp_addr, + ho->inter_bsc_in.msc_assigned_rtp_port, + fi, + HO_EV_MSC_MGW_OK, + HO_EV_MSC_MGW_FAIL, + NULL, + &ho->created_ci_for_msc)) { + ho_fail(HO_RESULT_ERROR, + "Unable to connect MGW endpoint to the MSC side"); + } +} + +static void ho_fsm_wait_mgw_endpoint_to_msc(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + switch (event) { + + case HO_EV_MSC_MGW_OK: + /* For AoIP, we created the MGW endpoint. Ensure it is really there, and log it. */ + if (gscon_is_aoip(conn)) { + const struct mgcp_conn_peer *mgw_info; + mgw_info = mgwep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); + if (!mgw_info) { + ho_fail(HO_RESULT_ERROR, + "Unable to retrieve RTP port info allocated by MGW for" + " the MSC side."); + return; + } + LOG_HO(conn, LOGL_DEBUG, "MGW's MSC side CI: %s:%u\n", + mgw_info->addr, mgw_info->port); + } + ho_success(); + return; + + case HO_EV_MSC_MGW_FAIL: + ho_fail(HO_RESULT_ERROR, + "Unable to connect MGW endpoint to the MSC side"); + return; + + default: + OSMO_ASSERT(false); + } +} + /* Inter-BSC OUT */ static void handover_start_inter_bsc_out(struct gsm_subscriber_connection *conn, @@ -1206,19 +1185,6 @@ , .out_state_mask = 0 | S(HO_ST_WAIT_LCHAN_ACTIVE) - | S(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC) - | S(HO_ST_WAIT_RR_HO_DETECT) - , - }, - [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { - .name = "WAIT_MGW_ENDPOINT_TO_MSC", - .onenter = ho_fsm_wait_mgw_endpoint_to_msc_onenter, - .action = ho_fsm_wait_mgw_endpoint_to_msc, - .in_event_mask = 0 - | S(HO_EV_MSC_MGW_OK) - | S(HO_EV_MSC_MGW_FAIL) - , - .out_state_mask = 0 | S(HO_ST_WAIT_RR_HO_DETECT) , }, @@ -1256,7 +1222,20 @@ .in_event_mask = 0 | S(HO_EV_LCHAN_ESTABLISHED) , + .out_state_mask = 0 + | S(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC) + , }, + [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { + .name = "WAIT_MGW_ENDPOINT_TO_MSC", + .onenter = ho_fsm_wait_mgw_endpoint_to_msc_onenter, + .action = ho_fsm_wait_mgw_endpoint_to_msc, + .in_event_mask = 0 + | S(HO_EV_MSC_MGW_OK) + | S(HO_EV_MSC_MGW_FAIL) + , + }, + [HO_OUT_ST_WAIT_HO_COMMAND] = { .name = "inter-BSC-OUT:WAIT_HO_COMMAND", .action = ho_out_fsm_wait_ho_command, -- To view, visit https://gerrit.osmocom.org/13706 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I01d93778fb19c601c21f99ec4d2a3ab8a4a48f67 Gerrit-Change-Number: 13706 Gerrit-PatchSet: 2 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 19:55:40 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 19 Apr 2019 19:55:40 +0000 Subject: Change in osmo-bts[master]: common/oml.c: use proper OML object for Get Attribute Response In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13701 ) Change subject: common/oml.c: use proper OML object for Get Attribute Response ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13701 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icb1ee75d4bf680deb6365288d8c2053816a12217 Gerrit-Change-Number: 13701 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 19 Apr 2019 19:55:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 20:14:59 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Apr 2019 20:14:59 +0000 Subject: Change in osmo-bts[master]: common/oml.c: refactor Get Attribute Response message generation 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/13708 to look at the new patch set (#2). Change subject: common/oml.c: refactor Get Attribute Response message generation ...................................................................... common/oml.c: refactor Get Attribute Response message generation Instead of allocating two transitional buffers (one static, another dynamic), we can use the existing message buffer. Both handle_attrs_bts() and handle_attrs_trx() can put (append) the reported attributes, and push (prepend) non-reported ones as per 3GPP TS 52.021, 9.4.64 "Get Attribute Response Info". Change-Id: I349447a43bce360f59e0c6b435906c65167d158b --- M src/common/oml.c 1 file changed, 54 insertions(+), 68 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/13708/2 -- To view, visit https://gerrit.osmocom.org/13708 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I349447a43bce360f59e0c6b435906c65167d158b Gerrit-Change-Number: 13708 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 20:58:57 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Apr 2019 20:58:57 +0000 Subject: Change in osmo-bts[master]: common/oml.c: fix: properly encode NM_ATT_SW_CONFIG In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13709 ) Change subject: common/oml.c: fix: properly encode NM_ATT_SW_CONFIG ...................................................................... Patch Set 2: > did you check how this is with a nanoBTS? I saw a few comments in OsmoBSC stating that nanoBTS is using a non-standard (spec. violating) attribute formatting. This can be also seen looking at the captures from OS#3814. > I think it's best to align with how they implement this. Not sure if it's a good idea to replicate such vendor-specific behaviour. The current patch follows what the specs. recommend to follow... > Also, the big question is what we do in terms of compatibility. > Maybe add it twice: both in the correct and in the incorrect form? Of course we can do that. But I would rather write a fix for OpenBSC. -- To view, visit https://gerrit.osmocom.org/13709 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id26104719891944f3e2151df362bd45bb057a9c5 Gerrit-Change-Number: 13709 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 19 Apr 2019 20:58:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 19 22:24:35 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Apr 2019 22:24:35 +0000 Subject: Change in osmo-ccid-firmware[master]: obtain chip-unique serial number and print it during startup. Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13710 Change subject: obtain chip-unique serial number and print it during startup. ...................................................................... obtain chip-unique serial number and print it during startup. Change-Id: I298942e12f9ffd6f571555253fda160baece5c6c --- M sysmoOCTSIM/main.c 1 file changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/10/13710/1 diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c index 843652b..1e34e20 100644 --- a/sysmoOCTSIM/main.c +++ b/sysmoOCTSIM/main.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -304,9 +305,43 @@ extern void testmode_init(void); +/* Section 9.6 of SAMD5x/E5x Family Data Sheet */ +static int get_chip_unique_serial(uint8_t *out, size_t len) +{ + uint32_t *out32 = (uint32_t *)out; + if (len < 16) + return -EINVAL; + + out32[0] = *(uint32_t *)0x008061fc; + out32[1] = *(uint32_t *)0x00806010; + out32[2] = *(uint32_t *)0x00806014; + out32[3] = *(uint32_t *)0x00806018; + + return 0; +} + +/* same as get_chip_unique_serial but in hex-string format */ +static int get_chip_unique_serial_str(char *out, size_t len) +{ + uint8_t buf[16]; + int rc; + + if (len < 16*2 + 1) + return -EINVAL; + + rc = get_chip_unique_serial(buf, sizeof(buf)); + if (rc < 0) + return rc; + osmo_hexdump_buf(out, len, buf, sizeof(buf), NULL, false); + return 0; +} + int main(void) { + char sernr_buf[16*2+1]; + atmel_start_init(); + get_chip_unique_serial_str(sernr_buf, sizeof(sernr_buf)); usart_sync_enable(&UART_debug); @@ -324,6 +359,7 @@ testmode_init(); printf("\r\n\r\nsysmocom sysmoOCTSIM\r\n"); + printf("Chip-Id %s\r\n", sernr_buf); command_print_prompt(); while (true) { // main loop -- To view, visit https://gerrit.osmocom.org/13710 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I298942e12f9ffd6f571555253fda160baece5c6c Gerrit-Change-Number: 13710 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 09:35:15 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Apr 2019 09:35:15 +0000 Subject: Change in osmo-hlr[master]: db_hlr.c: db_subscr_create(): nam_cs, nam_ps args Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13711 Change subject: db_hlr.c: db_subscr_create(): nam_cs, nam_ps args ...................................................................... db_hlr.c: db_subscr_create(): nam_cs, nam_ps args Allow creating new subscribers without giving them access to CS or PS. This will be used by the create-subscriber-on-demand feature. Related: OS#2542 Change-Id: I1a6dd85387723dab5487c53b33d2d9ec6d05d006 --- M src/db.c M src/db.h M src/db_hlr.c M src/hlr_db_tool.c M src/hlr_vty_subscr.c M tests/db/db_test.c M tests/db/db_test.err 7 files changed, 96 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/11/13711/1 diff --git a/src/db.c b/src/db.c index 09e1776..770c3a4 100644 --- a/src/db.c +++ b/src/db.c @@ -66,7 +66,7 @@ [DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps = $val WHERE imsi = $imsi", [DB_STMT_UPD_NAM_CS_BY_IMSI] = "UPDATE subscriber SET nam_cs = $val WHERE imsi = $imsi", [DB_STMT_UPD_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps = $val WHERE imsi = $imsi", - [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)", + [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi, nam_cs, nam_ps) VALUES ($imsi, $nam_cs, $nam_ps)", [DB_STMT_DEL_BY_ID] = "DELETE FROM subscriber WHERE id = $subscriber_id", [DB_STMT_SET_MSISDN_BY_IMSI] = "UPDATE subscriber SET msisdn = $msisdn WHERE imsi = $imsi", [DB_STMT_DELETE_MSISDN_BY_IMSI] = "UPDATE subscriber SET msisdn = NULL WHERE imsi = $imsi", diff --git a/src/db.h b/src/db.h index c438b8d..7187bb3 100644 --- a/src/db.h +++ b/src/db.h @@ -118,7 +118,7 @@ } u; }; -int db_subscr_create(struct db_context *dbc, const char *imsi); +int db_subscr_create(struct db_context *dbc, const char *imsi, int nam_cs, int nam_ps); int db_subscr_delete_by_id(struct db_context *dbc, int64_t subscr_id); int db_subscr_update_msisdn_by_imsi(struct db_context *dbc, const char *imsi, diff --git a/src/db_hlr.c b/src/db_hlr.c index 3ba457c..e879ae8 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -44,9 +44,11 @@ /*! Add new subscriber record to the HLR database. * \param[in,out] dbc database context. * \param[in] imsi ASCII string of IMSI digits, is validated. + * \param[in] nam_cs CS Network access mode (1: enable, 0: disable) + * \param[in] nam_ps PS Network access mode (1: enable, 0: disable) * \returns 0 on success, -EINVAL on invalid IMSI, -EIO on database error. */ -int db_subscr_create(struct db_context *dbc, const char *imsi) +int db_subscr_create(struct db_context *dbc, const char *imsi, int nam_cs, int nam_ps) { sqlite3_stmt *stmt; int rc; @@ -61,6 +63,10 @@ if (!db_bind_text(stmt, "$imsi", imsi)) return -EIO; + if (!db_bind_int(stmt, "$nam_cs", nam_cs)) + return -EIO; + if (!db_bind_int(stmt, "$nam_ps", nam_ps)) + return -EIO; /* execute the statement */ rc = sqlite3_step(stmt); diff --git a/src/hlr_db_tool.c b/src/hlr_db_tool.c index 516b91e..93fd49b 100644 --- a/src/hlr_db_tool.c +++ b/src/hlr_db_tool.c @@ -302,7 +302,7 @@ snprintf(imsi_str, sizeof(imsi_str), "%" PRId64, imsi); - rc = db_subscr_create(dbc, imsi_str); + rc = db_subscr_create(dbc, imsi_str, 1, 1); if (rc < 0) { LOGP(DDB, LOGL_ERROR, "OsmoNITB DB import to %s: failed to create IMSI %s: %d: %s\n", dbc->fname, diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c index 998d1be..89dcaff 100644 --- a/src/hlr_vty_subscr.c +++ b/src/hlr_vty_subscr.c @@ -220,7 +220,7 @@ return CMD_WARNING; } - rc = db_subscr_create(g_hlr->dbc, imsi); + rc = db_subscr_create(g_hlr->dbc, imsi, 1, 1); if (rc) { if (rc == -EEXIST) diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 56905a9..0ec366b 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -221,37 +221,37 @@ comment("Create with valid / invalid IMSI"); - ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_RC(db_subscr_create(dbc, imsi0, 1, 1), 0); ASSERT_SEL(imsi, imsi0, 0); id0 = g_subscr.id; - ASSERT_RC(db_subscr_create(dbc, imsi1), 0); + ASSERT_RC(db_subscr_create(dbc, imsi1, 1, 1), 0); ASSERT_SEL(imsi, imsi1, 0); id1 = g_subscr.id; - ASSERT_RC(db_subscr_create(dbc, imsi2), 0); + ASSERT_RC(db_subscr_create(dbc, imsi2, 1, 1), 0); ASSERT_SEL(imsi, imsi2, 0); id2 = g_subscr.id; - ASSERT_RC(db_subscr_create(dbc, imsi0), -EIO); + ASSERT_RC(db_subscr_create(dbc, imsi0, 1, 1), -EIO); ASSERT_SEL(imsi, imsi0, 0); - ASSERT_RC(db_subscr_create(dbc, imsi1), -EIO); - ASSERT_RC(db_subscr_create(dbc, imsi1), -EIO); + ASSERT_RC(db_subscr_create(dbc, imsi1, 1, 1), -EIO); + ASSERT_RC(db_subscr_create(dbc, imsi1, 1, 1), -EIO); ASSERT_SEL(imsi, imsi1, 0); - ASSERT_RC(db_subscr_create(dbc, imsi2), -EIO); - ASSERT_RC(db_subscr_create(dbc, imsi2), -EIO); + ASSERT_RC(db_subscr_create(dbc, imsi2, 1, 1), -EIO); + ASSERT_RC(db_subscr_create(dbc, imsi2, 1, 1), -EIO); ASSERT_SEL(imsi, imsi2, 0); - ASSERT_RC(db_subscr_create(dbc, "123456789 000003"), -EINVAL); + ASSERT_RC(db_subscr_create(dbc, "123456789 000003", 1, 1), -EINVAL); ASSERT_SEL(imsi, "123456789000003", -ENOENT); - ASSERT_RC(db_subscr_create(dbc, "123456789000002123456"), -EINVAL); + ASSERT_RC(db_subscr_create(dbc, "123456789000002123456", 1, 1), -EINVAL); ASSERT_SEL(imsi, "123456789000002123456", -ENOENT); - ASSERT_RC(db_subscr_create(dbc, "foobar123"), -EINVAL); + ASSERT_RC(db_subscr_create(dbc, "foobar123", 1, 1), -EINVAL); ASSERT_SEL(imsi, "foobar123", -ENOENT); - ASSERT_RC(db_subscr_create(dbc, "123"), -EINVAL); + ASSERT_RC(db_subscr_create(dbc, "123", 1, 1), -EINVAL); ASSERT_SEL(imsi, "123", -ENOENT); - ASSERT_RC(db_subscr_create(dbc, short_imsi), 0); + ASSERT_RC(db_subscr_create(dbc, short_imsi, 1, 1), 0); ASSERT_SEL(imsi, short_imsi, 0); id_short = g_subscr.id; @@ -452,6 +452,22 @@ ASSERT_RC(db_subscr_delete_by_id(dbc, id_short), 0); ASSERT_SEL(imsi, short_imsi, -ENOENT); + comment("Create and delete subscribers with non-default nam_cs and nam_ps"); + + ASSERT_RC(db_subscr_create(dbc, imsi0, 0, 0), 0); + ASSERT_SEL(imsi, imsi0, 0); + id0 = g_subscr.id; + ASSERT_RC(db_subscr_create(dbc, imsi1, 0, 1), 0); + ASSERT_SEL(imsi, imsi1, 0); + id1 = g_subscr.id; + ASSERT_RC(db_subscr_create(dbc, imsi2, 1, 0), 0); + ASSERT_SEL(imsi, imsi2, 0); + id2 = g_subscr.id; + + ASSERT_RC(db_subscr_delete_by_id(dbc, id0), 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id1), 0); + ASSERT_RC(db_subscr_delete_by_id(dbc, id2), 0); + comment_end(); } @@ -495,7 +511,7 @@ comment("Create subscriber"); - ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_RC(db_subscr_create(dbc, imsi0, 1, 1), 0); ASSERT_SEL(imsi, imsi0, 0); id = g_subscr.id; @@ -707,7 +723,7 @@ comment("Re-add subscriber and verify auth data didn't come back"); - ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_RC(db_subscr_create(dbc, imsi0, 1, 1), 0); ASSERT_SEL(imsi, imsi0, 0); /* For this test to work, we want to get the same subscriber ID back, @@ -739,7 +755,7 @@ comment("Create subscriber"); - ASSERT_RC(db_subscr_create(dbc, imsi0), 0); + ASSERT_RC(db_subscr_create(dbc, imsi0, 1, 1), 0); ASSERT_SEL(imsi, imsi0, 0); id = g_subscr.id; diff --git a/tests/db/db_test.err b/tests/db/db_test.err index 6ebdae2..bfab345 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -3,7 +3,7 @@ --- Create with valid / invalid IMSI -db_subscr_create(dbc, imsi0) --> 0 +db_subscr_create(dbc, imsi0, 1, 1) --> 0 db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 struct hlr_subscriber { @@ -11,7 +11,7 @@ .imsi = '123456789000000', } -db_subscr_create(dbc, imsi1) --> 0 +db_subscr_create(dbc, imsi1, 1, 1) --> 0 db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 struct hlr_subscriber { @@ -19,7 +19,7 @@ .imsi = '123456789000001', } -db_subscr_create(dbc, imsi2) --> 0 +db_subscr_create(dbc, imsi2, 1, 1) --> 0 db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 struct hlr_subscriber { @@ -27,7 +27,7 @@ .imsi = '123456789000002', } -db_subscr_create(dbc, imsi0) --> -EIO +db_subscr_create(dbc, imsi0, 1, 1) --> -EIO DAUC IMSI='123456789000000': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 @@ -36,10 +36,10 @@ .imsi = '123456789000000', } -db_subscr_create(dbc, imsi1) --> -EIO +db_subscr_create(dbc, imsi1, 1, 1) --> -EIO DAUC IMSI='123456789000001': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi -db_subscr_create(dbc, imsi1) --> -EIO +db_subscr_create(dbc, imsi1, 1, 1) --> -EIO DAUC IMSI='123456789000001': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 @@ -48,10 +48,10 @@ .imsi = '123456789000001', } -db_subscr_create(dbc, imsi2) --> -EIO +db_subscr_create(dbc, imsi2, 1, 1) --> -EIO DAUC IMSI='123456789000002': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi -db_subscr_create(dbc, imsi2) --> -EIO +db_subscr_create(dbc, imsi2, 1, 1) --> -EIO DAUC IMSI='123456789000002': Cannot create subscriber: SQL error: (2067) UNIQUE constraint failed: subscriber.imsi db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 @@ -60,31 +60,31 @@ .imsi = '123456789000002', } -db_subscr_create(dbc, "123456789 000003") --> -EINVAL +db_subscr_create(dbc, "123456789 000003", 1, 1) --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: '123456789 000003' db_subscr_get_by_imsi(dbc, "123456789000003", &g_subscr) --> -ENOENT DAUC Cannot read subscriber from db: IMSI='123456789000003': No such subscriber -db_subscr_create(dbc, "123456789000002123456") --> -EINVAL +db_subscr_create(dbc, "123456789000002123456", 1, 1) --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: '123456789000002123456' db_subscr_get_by_imsi(dbc, "123456789000002123456", &g_subscr) --> -ENOENT DAUC Cannot read subscriber from db: IMSI='123456789000002123456': No such subscriber -db_subscr_create(dbc, "foobar123") --> -EINVAL +db_subscr_create(dbc, "foobar123", 1, 1) --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: 'foobar123' db_subscr_get_by_imsi(dbc, "foobar123", &g_subscr) --> -ENOENT DAUC Cannot read subscriber from db: IMSI='foobar123': No such subscriber -db_subscr_create(dbc, "123") --> -EINVAL +db_subscr_create(dbc, "123", 1, 1) --> -EINVAL DAUC Cannot create subscriber: invalid IMSI: '123' db_subscr_get_by_imsi(dbc, "123", &g_subscr) --> -ENOENT DAUC Cannot read subscriber from db: IMSI='123': No such subscriber -db_subscr_create(dbc, short_imsi) --> 0 +db_subscr_create(dbc, short_imsi, 1, 1) --> 0 db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> 0 struct hlr_subscriber { @@ -752,6 +752,43 @@ db_subscr_get_by_imsi(dbc, short_imsi, &g_subscr) --> -ENOENT DAUC Cannot read subscriber from db: IMSI='123456': No such subscriber + +--- Create and delete subscribers with non-default nam_cs and nam_ps + +db_subscr_create(dbc, imsi0, 0, 0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 1, + .imsi = '123456789000000', + .nam_cs = false, + .nam_ps = false, +} + +db_subscr_create(dbc, imsi1, 0, 1) --> 0 + +db_subscr_get_by_imsi(dbc, imsi1, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 2, + .imsi = '123456789000001', + .nam_cs = false, +} + +db_subscr_create(dbc, imsi2, 1, 0) --> 0 + +db_subscr_get_by_imsi(dbc, imsi2, &g_subscr) --> 0 +struct hlr_subscriber { + .id = 3, + .imsi = '123456789000002', + .nam_ps = false, +} + +db_subscr_delete_by_id(dbc, id0) --> 0 + +db_subscr_delete_by_id(dbc, id1) --> 0 + +db_subscr_delete_by_id(dbc, id2) --> 0 + ===== test_subscr_create_update_sel_delete: SUCCESS @@ -769,7 +806,7 @@ --- Create subscriber -db_subscr_create(dbc, imsi0) --> 0 +db_subscr_create(dbc, imsi0, 1, 1) --> 0 db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 struct hlr_subscriber { @@ -1259,7 +1296,7 @@ --- Re-add subscriber and verify auth data didn't come back -db_subscr_create(dbc, imsi0) --> 0 +db_subscr_create(dbc, imsi0, 1, 1) --> 0 db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 struct hlr_subscriber { @@ -1306,7 +1343,7 @@ --- Create subscriber -db_subscr_create(dbc, imsi0) --> 0 +db_subscr_create(dbc, imsi0, 1, 1) --> 0 db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 struct hlr_subscriber { -- To view, visit https://gerrit.osmocom.org/13711 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1a6dd85387723dab5487c53b33d2d9ec6d05d006 Gerrit-Change-Number: 13711 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 09:35:16 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Apr 2019 09:35:16 +0000 Subject: Change in osmo-hlr[master]: db_hlr.c: add db_subscr_exists_by_imsi() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13712 Change subject: db_hlr.c: add db_subscr_exists_by_imsi() ...................................................................... db_hlr.c: add db_subscr_exists_by_imsi() Check if a subscriber exists without generating an error log entry if it does not. This is cheaper than db_subscr_get_by_imsi(), as it does not fetch the subscriber entry. subscriber-create-on-demand will use this function. Related: OS#2542 Change-Id: I63818c0dd4fd22b41dadeeba2a07a651b5454c54 --- M src/db.c M src/db.h M src/db_hlr.c M tests/db/db_test.c M tests/db/db_test.err 5 files changed, 40 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/12/13712/1 diff --git a/src/db.c b/src/db.c index 770c3a4..9cad263 100644 --- a/src/db.c +++ b/src/db.c @@ -79,6 +79,7 @@ " VALUES($subscriber_id, $algo_id_3g, $k, $op, $opc, $ind_bitlen)", [DB_STMT_AUC_3G_DELETE] = "DELETE FROM auc_3g WHERE subscriber_id = $subscriber_id", [DB_STMT_SET_LAST_LU_SEEN] = "UPDATE subscriber SET last_lu_seen = datetime($val, 'unixepoch') WHERE id = $subscriber_id", + [DB_STMT_EXISTS_BY_IMSI] = "SELECT 1 FROM subscriber WHERE imsi = $imsi", }; static void sql3_error_log_cb(void *arg, int err_code, const char *msg) diff --git a/src/db.h b/src/db.h index 7187bb3..1ebdaeb 100644 --- a/src/db.h +++ b/src/db.h @@ -28,6 +28,7 @@ DB_STMT_AUC_3G_INSERT, DB_STMT_AUC_3G_DELETE, DB_STMT_SET_LAST_LU_SEEN, + DB_STMT_EXISTS_BY_IMSI, _NUM_DB_STMT }; @@ -127,6 +128,8 @@ const struct sub_auth_data_str *aud); int db_subscr_update_imei_by_imsi(struct db_context *dbc, const char* imsi, const char *imei); +int db_subscr_exists_by_imsi(struct db_context *dbc, const char *imsi); + int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr); int db_subscr_get_by_msisdn(struct db_context *dbc, const char *msisdn, diff --git a/src/db_hlr.c b/src/db_hlr.c index e879ae8..10f6287 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -512,6 +512,31 @@ return ret; } +/*! Check if a subscriber exists in the HLR database. + * \param[in, out] dbc database context. + * \param[in] imsi ASCII string of IMSI digits. + * \returns 0 if it exists, -ENOENT if it does not exist, -EIO on database error. + */ +int db_subscr_exists_by_imsi(struct db_context *dbc, const char *imsi) { + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_EXISTS_BY_IMSI]; + const char *err; + int rc; + + if (!db_bind_text(stmt, NULL, imsi)) + return -EIO; + + rc = sqlite3_step(stmt); + db_remove_reset(stmt); + if (rc == SQLITE_ROW) + return 0; /* exists */ + if (rc == SQLITE_DONE) + return -ENOENT; /* does not exist */ + + err = sqlite3_errmsg(dbc->db); + LOGP(DAUC, LOGL_ERROR, "Failed to check if subscriber exists by IMSI='%s': %s\n", imsi, err); + return rc; +} + /*! Retrieve subscriber data from the HLR database. * \param[in,out] dbc database context. * \param[in] imsi ASCII string of IMSI digits. diff --git a/tests/db/db_test.c b/tests/db/db_test.c index 0ec366b..2bd7819 100644 --- a/tests/db/db_test.c +++ b/tests/db/db_test.c @@ -255,6 +255,10 @@ ASSERT_SEL(imsi, short_imsi, 0); id_short = g_subscr.id; + comment("Check if subscriber exists"); + + ASSERT_RC(db_subscr_exists_by_imsi(dbc, imsi0), 0); + ASSERT_RC(db_subscr_exists_by_imsi(dbc, unknown_imsi), -ENOENT); comment("Set valid / invalid MSISDN"); diff --git a/tests/db/db_test.err b/tests/db/db_test.err index bfab345..39f3e54 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -93,6 +93,13 @@ } +--- Check if subscriber exists + +db_subscr_exists_by_imsi(dbc, imsi0) --> 0 + +db_subscr_exists_by_imsi(dbc, unknown_imsi) --> -ENOENT + + --- Set valid / invalid MSISDN db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0 -- To view, visit https://gerrit.osmocom.org/13712 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I63818c0dd4fd22b41dadeeba2a07a651b5454c54 Gerrit-Change-Number: 13712 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 09:35:16 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Apr 2019 09:35:16 +0000 Subject: Change in osmo-hlr[master]: Add subscriber-create-on-demand option Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13713 Change subject: Add subscriber-create-on-demand option ...................................................................... Add subscriber-create-on-demand option Related: OS#2542 Change-Id: I0c9fe93f5c24b5e9fefb513c4d049fb7ebd47ecd --- M src/hlr.c M src/hlr.h M src/hlr_vty.c 3 files changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/13/13713/1 diff --git a/src/hlr.c b/src/hlr.c index 422a56d..b739e71 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -148,6 +148,18 @@ } } +static void subscr_create_on_demand(const char *imsi) { + int rc; + + if (!g_hlr->create_subscr_on_demand || db_subscr_exists_by_imsi(g_hlr->dbc, imsi) == 0) + return; + + LOGP(DMAIN, LOGL_INFO, "IMSI='%s': Creating subscriber on demand\n", imsi); + rc = db_subscr_create(g_hlr->dbc, imsi, 0, 0); + if (rc) + LOGP(DMAIN, LOGL_ERROR, "Failed to create subscriber on demand (rc=%d): IMSI='%s'\n", rc, imsi); +} + /*********************************************************************** * Send Auth Info handling ***********************************************************************/ @@ -161,6 +173,8 @@ struct msgb *msg_out; int rc; + subscr_create_on_demand(gsup->imsi); + /* initialize return message structure */ memset(&gsup_out, 0, sizeof(gsup_out)); memcpy(&gsup_out.imsi, &gsup->imsi, sizeof(gsup_out.imsi)); @@ -291,6 +305,8 @@ } llist_add(&luop->list, &g_lu_ops); + subscr_create_on_demand(gsup->imsi); + /* Roughly follwing "Process Update_Location_HLR" of TS 09.02 */ /* check if subscriber is known at all */ diff --git a/src/hlr.h b/src/hlr.h index 00fa43c..dc1c720 100644 --- a/src/hlr.h +++ b/src/hlr.h @@ -53,6 +53,7 @@ struct llist_head ss_sessions; bool store_imei; + bool create_subscr_on_demand; }; extern struct hlr *g_hlr; diff --git a/src/hlr_vty.c b/src/hlr_vty.c index d0a623a..7bf27da 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -325,6 +325,23 @@ return CMD_SUCCESS; } +DEFUN(cfg_subscr_create_on_demand, cfg_subscr_create_on_demand_cmd, + "subscriber-create-on-demand", + "Make a new record when a subscriber is first seen. If you enable this feature, you must also enforce checking" + " the IMEI in your MSC (OsmoMSC: 'check-imei-rqd 1').") +{ + g_hlr->create_subscr_on_demand = true; + return CMD_SUCCESS; +} + +DEFUN(cfg_no_subscr_create_on_demand, cfg_no_subscr_create_on_demand_cmd, + "no subscriber-create-on-demand", + "Do not make a new record when a subscriber is first seen.") +{ + g_hlr->create_subscr_on_demand = false; + return CMD_SUCCESS; +} + /*********************************************************************** * Common Code ***********************************************************************/ @@ -391,6 +408,8 @@ install_element(HLR_NODE, &cfg_ncss_guard_timeout_cmd); install_element(HLR_NODE, &cfg_store_imei_cmd); install_element(HLR_NODE, &cfg_no_store_imei_cmd); + install_element(HLR_NODE, &cfg_subscr_create_on_demand_cmd); + install_element(HLR_NODE, &cfg_no_subscr_create_on_demand_cmd); hlr_vty_subscriber_init(); } -- To view, visit https://gerrit.osmocom.org/13713 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0c9fe93f5c24b5e9fefb513c4d049fb7ebd47ecd Gerrit-Change-Number: 13713 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 09:35:17 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Apr 2019 09:35:17 +0000 Subject: Change in osmo-hlr[master]: add lu-ignore-nam-cs Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13714 Change subject: add lu-ignore-nam-cs ...................................................................... add lu-ignore-nam-cs Change-Id: I62e750faab92b142b9ca89ad2de5dc63afaeb61c --- M src/hlr.c M src/hlr.h M src/hlr_vty.c 3 files changed, 50 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/14/13714/1 diff --git a/src/hlr.c b/src/hlr.c index b739e71..882362d 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -320,8 +320,15 @@ /* Check if subscriber is generally permitted on CS or PS * service (as requested) */ if (!luop->is_ps && !luop->subscr.nam_cs) { - lu_op_tx_error(luop, GMM_CAUSE_PLMN_NOTALLOWED); - return 0; + if (g_hlr->lu_ignore_nam_cs) + /* Subscriber will be kicked later in the IMEI check, which the operator must enable together + * with lu-ignore-nam-cs. See rx_check_imei_req() below. */ + LOGP(DMAIN, LOGL_DEBUG, "LU REQ: subscriber not allowed for CS, but allowing anyway" + " (lu-ignore-nam-cs)"); + else { + lu_op_tx_error(luop, GMM_CAUSE_PLMN_NOTALLOWED); + return 0; + } } else if (luop->is_ps && !luop->subscr.nam_ps) { lu_op_tx_error(luop, GMM_CAUSE_GPRS_NOTALLOWED); return 0; @@ -413,6 +420,7 @@ static int rx_check_imei_req(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup) { + struct hlr_subscriber subscr; struct osmo_gsup_message gsup_reply = {0}; struct msgb *msg_out; char imei[GSM23003_IMEI_NUM_DIGITS+1] = {0}; @@ -431,6 +439,12 @@ return -1; } + /* Get subscriber */ + if (db_subscr_get_by_imsi(g_hlr->dbc, gsup->imsi, &subscr) < 0) { + gsup_send_err_reply(conn, gsup->imsi, gsup->message_type, GMM_CAUSE_INV_MAND_INFO); + return -1; + } + /* Save in DB if desired */ if (g_hlr->store_imei) { LOGP(DAUC, LOGL_DEBUG, "IMSI='%s': storing IMEI = %s\n", gsup->imsi, imei); @@ -438,18 +452,21 @@ gsup_send_err_reply(conn, gsup->imsi, gsup->message_type, GMM_CAUSE_INV_MAND_INFO); return -1; } - } else { - /* Check if subscriber exists and print IMEI */ + } else LOGP(DMAIN, LOGL_INFO, "IMSI='%s': has IMEI = %s (consider setting 'store-imei')\n", gsup->imsi, imei); - struct hlr_subscriber subscr; - if (db_subscr_get_by_imsi(g_hlr->dbc, gsup->imsi, &subscr) < 0) { - gsup_send_err_reply(conn, gsup->imsi, gsup->message_type, GMM_CAUSE_INV_MAND_INFO); - return -1; - } - } /* Accept all IMEIs */ gsup_reply.imei_result = OSMO_GSUP_IMEI_RESULT_ACK; + + /* lu-ignore-nam-cs: use Check IMEI to do a late check for CS/PS enabled. This would usually be done in the LU + * REQ, but then the ME will immediatelly disconnect without sending the IMEI. */ + if (g_hlr->lu_ignore_nam_cs && !subscr.nam_cs && !subscr.nam_ps) { + LOGP(DAUC, LOGL_DEBUG, "IMSI='%s': pretending that the IMEI is not allowed, because subscriber" + " has both CS and PS NAM disabled (lu-ignore-nam-cs)", gsup->imsi); + gsup_reply.imei_result = OSMO_GSUP_IMEI_RESULT_NACK; + } + + /* Send response */ gsup_reply.message_type = OSMO_GSUP_MSGT_CHECK_IMEI_RESULT; msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP Check_IMEI response"); memcpy(gsup_reply.imsi, gsup->imsi, sizeof(gsup_reply.imsi)); diff --git a/src/hlr.h b/src/hlr.h index dc1c720..ad9ef7e 100644 --- a/src/hlr.h +++ b/src/hlr.h @@ -54,6 +54,7 @@ bool store_imei; bool create_subscr_on_demand; + bool lu_ignore_nam_cs; }; extern struct hlr *g_hlr; diff --git a/src/hlr_vty.c b/src/hlr_vty.c index 7bf27da..2804fd0 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -342,6 +342,26 @@ return CMD_SUCCESS; } +DEFUN(cfg_lu_ignore_nam_cs, cfg_lu_ignore_nam_cs_cmd, + "lu-ignore-nam-cs", + "Allow subscribers to do the LU (Location Update) for the CS domain, even if they should not have access to it." + " OsmoHLR will do the CS domain check again after the LU, during the Check IMEI procedure, and pretend that the" + " IMEI is not allowed on the network if the CS domain is disabled for the subscriber. This is needed to make" + " store-imei work with subscriber-create-on-demand. ONLY ENABLE TOGETHER WITH ENFORCED IMEI CHECKING IN YOUR" + " MSC! (OsmoMSC: 'check-imei-rqd 1')") +{ + g_hlr->lu_ignore_nam_cs = true; + return CMD_SUCCESS; +} + +DEFUN(cfg_no_lu_ignore_nam_cs, cfg_no_lu_ignore_nam_cs_cmd, + "no lu-ignore-nam-cs", + "Only allow LU (Location Update) for the CS domain, if the subscriber has access to it.") +{ + g_hlr->lu_ignore_nam_cs = false; + return CMD_SUCCESS; +} + /*********************************************************************** * Common Code ***********************************************************************/ @@ -410,6 +430,8 @@ install_element(HLR_NODE, &cfg_no_store_imei_cmd); install_element(HLR_NODE, &cfg_subscr_create_on_demand_cmd); install_element(HLR_NODE, &cfg_no_subscr_create_on_demand_cmd); + install_element(HLR_NODE, &cfg_lu_ignore_nam_cs_cmd); + install_element(HLR_NODE, &cfg_no_lu_ignore_nam_cs_cmd); hlr_vty_subscriber_init(); } -- To view, visit https://gerrit.osmocom.org/13714 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I62e750faab92b142b9ca89ad2de5dc63afaeb61c Gerrit-Change-Number: 13714 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 09:35:17 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Apr 2019 09:35:17 +0000 Subject: Change in osmo-hlr[master]: WIP: documentation for subscribers create on demand Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13715 Change subject: WIP: documentation for subscribers create on demand ...................................................................... WIP: documentation for subscribers create on demand Change-Id: I2dd4a56f7b8be8b5d0e6fc32e04459e5e278d0a9 --- M doc/manuals/chapters/subscribers.adoc 1 file changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/13715/1 diff --git a/doc/manuals/chapters/subscribers.adoc b/doc/manuals/chapters/subscribers.adoc index bb57d24..77f2f9b 100644 --- a/doc/manuals/chapters/subscribers.adoc +++ b/doc/manuals/chapters/subscribers.adoc @@ -67,3 +67,18 @@ |ms_purged_ps|1|3GPP TS 23.008 chapter 2.7.6 |=== +=== Configuring the Subscribers Create on Demand Feature + +Usually a HLR will only allow devices on the network, which are already in the +HLR database. But OsmoHLR can also be configured to automatically create new +entries for new devices, with the subscribers-create-on-demand VTY option. + +After a subscriber has been added automatically, it will get disconnected from +the network. The operator needs to assign a MSISDN and enable PS/CS NAM, before +the subscriber can actually use the network. + +Oftentimes it is hard to know which IMSI belongs to which person, but the IMEI +is readily available. With a few more configuration options, it is possible to +extend the subscriber on demand entries with the respective IMEIs: store-imei +and lu-ignore-nam-cs. You must also enable IMEI checking in the MSC, for OsmoMSC +this can be done with the check-imei-rqd VTY option. -- To view, visit https://gerrit.osmocom.org/13715 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2dd4a56f7b8be8b5d0e6fc32e04459e5e278d0a9 Gerrit-Change-Number: 13715 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 09:35:18 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Apr 2019 09:35:18 +0000 Subject: Change in osmo-hlr[master]: Allow both CS and PS by default for subscribers created on demand Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13716 Change subject: Allow both CS and PS by default for subscribers created on demand ...................................................................... Allow both CS and PS by default for subscribers created on demand Change-Id: I6668171f17eeec9f483f6cdd981d5b8b81b09cb0 --- M src/hlr.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/16/13716/1 diff --git a/src/hlr.c b/src/hlr.c index 882362d..2cd6789 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -155,7 +155,7 @@ return; LOGP(DMAIN, LOGL_INFO, "IMSI='%s': Creating subscriber on demand\n", imsi); - rc = db_subscr_create(g_hlr->dbc, imsi, 0, 0); + rc = db_subscr_create(g_hlr->dbc, imsi, 1, 1); /* Allow both CS and PS domains by default */ if (rc) LOGP(DMAIN, LOGL_ERROR, "Failed to create subscriber on demand (rc=%d): IMSI='%s'\n", rc, imsi); } -- To view, visit https://gerrit.osmocom.org/13716 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6668171f17eeec9f483f6cdd981d5b8b81b09cb0 Gerrit-Change-Number: 13716 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 09:35:18 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Apr 2019 09:35:18 +0000 Subject: Change in osmo-hlr[master]: src/hlr.c: simplify initial check in subscr_create_on_demand() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13717 Change subject: src/hlr.c: simplify initial check in subscr_create_on_demand() ...................................................................... src/hlr.c: simplify initial check in subscr_create_on_demand() Change-Id: If6b78adc236ef923e0b2e37b4e2407338a4b98b8 --- M src/hlr.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/17/13717/1 diff --git a/src/hlr.c b/src/hlr.c index 2cd6789..ef93d7f 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -151,7 +151,9 @@ static void subscr_create_on_demand(const char *imsi) { int rc; - if (!g_hlr->create_subscr_on_demand || db_subscr_exists_by_imsi(g_hlr->dbc, imsi) == 0) + if (!g_hlr->create_subscr_on_demand) + return; + if (db_subscr_exists_by_imsi(g_hlr->dbc, imsi) == 0) return; LOGP(DMAIN, LOGL_INFO, "IMSI='%s': Creating subscriber on demand\n", imsi); -- To view, visit https://gerrit.osmocom.org/13717 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If6b78adc236ef923e0b2e37b4e2407338a4b98b8 Gerrit-Change-Number: 13717 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 09:35:19 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Apr 2019 09:35:19 +0000 Subject: Change in osmo-hlr[master]: src/hlr.c: fix coding style of subscr_create_on_demand() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13718 Change subject: src/hlr.c: fix coding style of subscr_create_on_demand() ...................................................................... src/hlr.c: fix coding style of subscr_create_on_demand() Change-Id: I1b9aa628e16e20d823eda2098a77c624bc934e11 --- M src/hlr.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/18/13718/1 diff --git a/src/hlr.c b/src/hlr.c index ef93d7f..7facef7 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -148,7 +148,8 @@ } } -static void subscr_create_on_demand(const char *imsi) { +static void subscr_create_on_demand(const char *imsi) +{ int rc; if (!g_hlr->create_subscr_on_demand) -- To view, visit https://gerrit.osmocom.org/13718 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1b9aa628e16e20d823eda2098a77c624bc934e11 Gerrit-Change-Number: 13718 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 09:35:19 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Apr 2019 09:35:19 +0000 Subject: Change in osmo-hlr[master]: db_hlr.c: add db_subscr_exists_by_msisdn() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13719 Change subject: db_hlr.c: add db_subscr_exists_by_msisdn() ...................................................................... db_hlr.c: add db_subscr_exists_by_msisdn() Check if a subscriber exists without generating an error log entry if it does not. This is cheaper than db_subscr_get_by_msisdn(), as it does not fetch the subscriber entry. subscriber-create-on-demand will use this function to generate a random unique MSISDN for new subscribers. TODO: update the unit test! Change-Id: Ibfbc408c966197682ba2b12d166ade4bfeb7abc2 Related: OS#2542 --- M src/db.c M src/db.h M src/db_hlr.c 3 files changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/19/13719/1 diff --git a/src/db.c b/src/db.c index 9cad263..7de61a2 100644 --- a/src/db.c +++ b/src/db.c @@ -80,6 +80,7 @@ [DB_STMT_AUC_3G_DELETE] = "DELETE FROM auc_3g WHERE subscriber_id = $subscriber_id", [DB_STMT_SET_LAST_LU_SEEN] = "UPDATE subscriber SET last_lu_seen = datetime($val, 'unixepoch') WHERE id = $subscriber_id", [DB_STMT_EXISTS_BY_IMSI] = "SELECT 1 FROM subscriber WHERE imsi = $imsi", + [DB_STMT_EXISTS_BY_MSISDN] = "SELECT 1 FROM subscriber WHERE msisdn = $msisdn", }; static void sql3_error_log_cb(void *arg, int err_code, const char *msg) diff --git a/src/db.h b/src/db.h index 1ebdaeb..70d77be 100644 --- a/src/db.h +++ b/src/db.h @@ -29,6 +29,7 @@ DB_STMT_AUC_3G_DELETE, DB_STMT_SET_LAST_LU_SEEN, DB_STMT_EXISTS_BY_IMSI, + DB_STMT_EXISTS_BY_MSISDN, _NUM_DB_STMT }; @@ -129,6 +130,7 @@ int db_subscr_update_imei_by_imsi(struct db_context *dbc, const char* imsi, const char *imei); int db_subscr_exists_by_imsi(struct db_context *dbc, const char *imsi); +int db_subscr_exists_by_msisdn(struct db_context *dbc, const char *msisdn); int db_subscr_get_by_imsi(struct db_context *dbc, const char *imsi, struct hlr_subscriber *subscr); diff --git a/src/db_hlr.c b/src/db_hlr.c index 10f6287..1d2ff3a 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -561,6 +561,33 @@ return rc; } +/*! Check if a subscriber exists in the HLR database. + * \param[in, out] dbc database context. + * \param[in] msisdn ASCII string of MSISDN digits. + * \returns 0 if it exists, -ENOENT if it does not exist, -EIO on database error. + */ +int db_subscr_exists_by_msisdn(struct db_context *dbc, const char *msisdn) +{ + sqlite3_stmt *stmt = dbc->stmt[DB_STMT_EXISTS_BY_MSISDN]; + const char *err; + int rc; + + if (!db_bind_text(stmt, NULL, msisdn)) + return -EIO; + + rc = sqlite3_step(stmt); + db_remove_reset(stmt); + if (rc == SQLITE_ROW) + return 0; /* exists */ + if (rc == SQLITE_DONE) + return -ENOENT; /* does not exist */ + + err = sqlite3_errmsg(dbc->db); + LOGP(DAUC, LOGL_ERROR, "Failed to check if subscriber exists " + "by MSISDN='%s': %s\n", msisdn, err); + return rc; +} + /*! Retrieve subscriber data from the HLR database. * \param[in,out] dbc database context. * \param[in] msisdn ASCII string of MSISDN digits. -- To view, visit https://gerrit.osmocom.org/13719 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibfbc408c966197682ba2b12d166ade4bfeb7abc2 Gerrit-Change-Number: 13719 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 09:35:20 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Apr 2019 09:35:20 +0000 Subject: Change in osmo-hlr[master]: Assign random MSISDN to subscribers created on demand Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13720 Change subject: Assign random MSISDN to subscribers created on demand ...................................................................... Assign random MSISDN to subscribers created on demand Change-Id: I475c71f9902950fa7498855a616e1ec231fad6ac --- M src/hlr.c 1 file changed, 41 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/20/13720/1 diff --git a/src/hlr.c b/src/hlr.c index 7facef7..4fb039e 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "db.h" #include "hlr.h" @@ -148,19 +149,54 @@ } } -static void subscr_create_on_demand(const char *imsi) +static int subscr_create_on_demand(const char *imsi) { - int rc; + uint8_t rand_buf[15]; + char msisdn[15 + 1]; + int i, rc; if (!g_hlr->create_subscr_on_demand) - return; + return -1; if (db_subscr_exists_by_imsi(g_hlr->dbc, imsi) == 0) - return; + return -1; LOGP(DMAIN, LOGL_INFO, "IMSI='%s': Creating subscriber on demand\n", imsi); rc = db_subscr_create(g_hlr->dbc, imsi, 1, 1); /* Allow both CS and PS domains by default */ - if (rc) + if (rc) { LOGP(DMAIN, LOGL_ERROR, "Failed to create subscriber on demand (rc=%d): IMSI='%s'\n", rc, imsi); + return rc; + } + + /* FIXME: this should be optional and configurable! */ + #define RAND_MSISDN_LEN 6 + + /* Generate a random unique MSISDN */ + while (1) { + rc = osmo_get_rand_id(rand_buf, RAND_MSISDN_LEN); + if (rc) /* Keep trying until we get some result */ + continue; + + /* Shift 0x00 ... 0xff range to 30 ... 39 (ASCII numbers) */ + for (i = 0; i < RAND_MSISDN_LEN; i++) + msisdn[i] = 48 + (rand_buf[i] % 10); + msisdn[i] = '\0'; + + /* Ensure there is subscriber with such MSISDN */ + if (db_subscr_exists_by_msisdn(g_hlr->dbc, msisdn)) + break; + } + + /* Update MSISDN of the new (just allocated) subscriber */ + rc = db_subscr_update_msisdn_by_imsi(g_hlr->dbc, imsi, msisdn); + if (rc) { + LOGP(DMAIN, LOGL_ERROR, "IMSI='%s': Failed to assign MSISDN='%s' " + "(rc=%d)\n", imsi, msisdn, rc); + return rc; + } + + LOGP(DMAIN, LOGL_INFO, "IMSI='%s': Successfully assigned MSISDN='%s'\n", imsi, msisdn); + + return 0; } /*********************************************************************** -- To view, visit https://gerrit.osmocom.org/13720 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I475c71f9902950fa7498855a616e1ec231fad6ac Gerrit-Change-Number: 13720 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 13:26:01 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 20 Apr 2019 13:26:01 +0000 Subject: Change in osmo-hlr[master]: db_hlr.c: db_subscr_create(): nam_cs, nam_ps args In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13711 ) Change subject: db_hlr.c: db_subscr_create(): nam_cs, nam_ps args ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13711 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1a6dd85387723dab5487c53b33d2d9ec6d05d006 Gerrit-Change-Number: 13711 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-Comment-Date: Sat, 20 Apr 2019 13:26:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 13:26:26 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 20 Apr 2019 13:26:26 +0000 Subject: Change in osmo-hlr[master]: db_hlr.c: add db_subscr_exists_by_imsi() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13712 ) Change subject: db_hlr.c: add db_subscr_exists_by_imsi() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13712 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I63818c0dd4fd22b41dadeeba2a07a651b5454c54 Gerrit-Change-Number: 13712 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-Comment-Date: Sat, 20 Apr 2019 13:26:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 13:28:28 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 20 Apr 2019 13:28:28 +0000 Subject: Change in osmo-hlr[master]: add lu-ignore-nam-cs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13714 ) Change subject: add lu-ignore-nam-cs ...................................................................... Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/13714/1/src/hlr.h File src/hlr.h: https://gerrit.osmocom.org/#/c/13714/1/src/hlr.h at 57 PS1, Line 57: bool lu_ignore_nam_cs; this new member should definitely have some explanation here. https://gerrit.osmocom.org/#/c/13714/1/src/hlr.c File src/hlr.c: https://gerrit.osmocom.org/#/c/13714/1/src/hlr.c at 326 PS1, Line 326: LU REQ: subscriber not allowed for CS, but allowing anyway message could be a bit more descriptive (like "but accepting until check-imei" or so https://gerrit.osmocom.org/#/c/13714/1/src/hlr_vty.c File src/hlr_vty.c: https://gerrit.osmocom.org/#/c/13714/1/src/hlr_vty.c at 347 PS1, Line 347: "Allow subscribers to do the LU (Location Update) for the CS domain, even if they should not have access to it." I wonder how such long help strings are rendered in the VTY. I've never tried... -- To view, visit https://gerrit.osmocom.org/13714 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I62e750faab92b142b9ca89ad2de5dc63afaeb61c Gerrit-Change-Number: 13714 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-CC: Harald Welte Gerrit-Comment-Date: Sat, 20 Apr 2019 13:28:28 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 13:29:04 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 20 Apr 2019 13:29:04 +0000 Subject: Change in osmo-hlr[master]: Add subscriber-create-on-demand option In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13713 ) Change subject: Add subscriber-create-on-demand option ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13713 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0c9fe93f5c24b5e9fefb513c4d049fb7ebd47ecd Gerrit-Change-Number: 13713 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: osmith Gerrit-Comment-Date: Sat, 20 Apr 2019 13:29:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 13:30:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 20 Apr 2019 13:30:45 +0000 Subject: Change in osmo-bts[master]: common/oml.c: refactor Get Attribute Response message generation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13708 ) Change subject: common/oml.c: refactor Get Attribute Response message generation ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13708 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I349447a43bce360f59e0c6b435906c65167d158b Gerrit-Change-Number: 13708 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 20 Apr 2019 13:30:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 13:32:55 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 20 Apr 2019 13:32:55 +0000 Subject: Change in osmo-bts[master]: common/oml.c: fix: properly encode NM_ATT_SW_CONFIG In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13709 ) Change subject: common/oml.c: fix: properly encode NM_ATT_SW_CONFIG ...................................................................... Patch Set 2: > Of course we can do that. But I would rather write a fix for > OpenBSC. You cannot fix existing, deployed versions of OpenBSC. We have to ensure both old versions of OsmoBTS will work with old and new versions of OpenbSC / OsmoBSC, as wella s new versions of OsmoBTS work with old version of OpenBSC/OsmoBSC. You can never assume that people would use versions that were released about the same time. The BTS software often runs on some embedded device (on the BTS main processor), while the BSC often runs on some generic linux box in a data center. -- To view, visit https://gerrit.osmocom.org/13709 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id26104719891944f3e2151df362bd45bb057a9c5 Gerrit-Change-Number: 13709 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Harald Welte Gerrit-Comment-Date: Sat, 20 Apr 2019 13:32:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 16:18:47 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Apr 2019 16:18:47 +0000 Subject: Change in osmo-bts[master]: common/oml.c: fix: properly encode NM_ATT_SW_CONFIG In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13709 ) Change subject: common/oml.c: fix: properly encode NM_ATT_SW_CONFIG ...................................................................... Patch Set 2: > We have to ensure both old versions of OsmoBTS will work with old and new versions of OpenbSC / OsmoBSC, as well as new versions of OsmoBTS work with old version of OpenBSC/OsmoBSC. Well, if we merge this change, the old OpenBSC would continue to work with the fixed version of OsmoBTS anyway, in the same way as the current OsmoBSC does work with the current OsmoBTS. There would be no fundamental breakage. Should I add this to the commit message? -- To view, visit https://gerrit.osmocom.org/13709 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id26104719891944f3e2151df362bd45bb057a9c5 Gerrit-Change-Number: 13709 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Harald Welte Gerrit-Comment-Date: Sat, 20 Apr 2019 16:18:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 16:39:55 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Sat, 20 Apr 2019 16:39:55 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/11194 ) Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... Patch Set 2: > @Keith: If you would have time to test it with your manual test > case, we could be 100% sure. Sure. It works as to be expected from static analysis: Basically you did the same thing (at least in the case where I handled it) Here's the log: DMNCC DEBUG <0001> mncc.c:866 MNCC rcvd message type: MNCC_SETUP_IND DMNCC DEBUG <0001> mncc.c:481 Created call(5004) with MNCC leg(2147483654) IMSI(262420312915730) DMNCC DEBUG <0001> mncc.c:68 Starting Timer for MNCC_RTP_CREATE DMNCC DEBUG <0001> mncc.c:866 MNCC rcvd message type: MNCC_DISC_IND DMNCC DEBUG <0001> mncc.c:526 Rcvd MNCC_DISC_IND, Cause: NORM_CALL_CLEAR DMNCC DEBUG <0001> mncc.c:528 leg(2147483654) was disconnected. Releasing DMNCC DEBUG <0001> mncc.c:68 Starting Timer for MNCC_REL_CNF DMNCC DEBUG <0001> mncc.c:142 MNCC sent message type: MNCC_REL_REQ DMNCC DEBUG <0001> mncc.c:866 MNCC rcvd message type: MNCC_RTP_CREATE DMNCC ERROR <0001> mncc.c:389 call(2147483654) can not be found DMNCC DEBUG <0001> mncc.c:142 MNCC sent message type: MNCC_REJ_REQ DMNCC DEBUG <0001> mncc.c:866 MNCC rcvd message type: MNCC_REL_CNF DMNCC DEBUG <0001> mncc.c:82 Got response(MNCC_REL_CNF), stopping timer on leg(2147483654) DMNCC DEBUG <0001> mncc.c:575 leg(2147483654) was cnf released. DAPP DEBUG <0002> call.c:88 call(5004) released. -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 2 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Rafael Diniz Gerrit-Comment-Date: Sat, 20 Apr 2019 16:39:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 16:42:19 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Sat, 20 Apr 2019 16:42:19 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Hello Harald Welte, Rafael Diniz, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/11194 to look at the new patch set (#3). Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... MNCC: Do not continue with B leg if A leg is cancelled. In case we receive MNCC_RTP_CREATE after MNCC_DISC_IND, check if the call is already marked in_release and if so, release instead of proceeding with the B leg. Related: OS#3518 Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 --- M src/mncc.c 1 file changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/94/11194/3 -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 3 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Rafael Diniz -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 16:44:20 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Sat, 20 Apr 2019 16:44:20 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Hello Harald Welte, Rafael Diniz, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/11194 to look at the new patch set (#4). Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... MNCC: Do not continue with B leg if A leg is cancelled. In case we receive MNCC_RTP_CREATE after MNCC_DISC_IND, check if the call is already marked in_release and if so, send MNCC_REJ_REQ and do not proceed with the B leg. Related: OS#3518 Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 --- M src/mncc.c 1 file changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/94/11194/4 -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 4 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Rafael Diniz -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 16:44:33 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Sat, 20 Apr 2019 16:44:33 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/11194 ) Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 4 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Rafael Diniz Gerrit-Comment-Date: Sat, 20 Apr 2019 16:44:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 16:56:22 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Sat, 20 Apr 2019 16:56:22 +0000 Subject: Change in osmo-msc[master]: Move enum definition to header file In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/12598 ) Change subject: Move enum definition to header file ...................................................................... Patch Set 1: Code-Review-2 This is not needed as it turned out we don't want to check the value of the bind flags in alert_all_esme() but only IF we are bound at all. -- To view, visit https://gerrit.osmocom.org/12598 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I71b2512894ec2a71a25f35f07ff4308035d951f9 Gerrit-Change-Number: 12598 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-CC: Daniel Willmann Gerrit-Comment-Date: Sat, 20 Apr 2019 16:56:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 16:56:27 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Sat, 20 Apr 2019 16:56:27 +0000 Subject: Change in osmo-msc[master]: Move enum definition to header file In-Reply-To: References: Message-ID: Keith Whyte has abandoned this change. ( https://gerrit.osmocom.org/12598 ) Change subject: Move enum definition to header file ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/12598 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I71b2512894ec2a71a25f35f07ff4308035d951f9 Gerrit-Change-Number: 12598 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-CC: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 19:13:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 20 Apr 2019 19:13:30 +0000 Subject: Change in osmo-iuh[master]: iu_client: Implement transmission of ResetAcknowledge Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13721 Change subject: iu_client: Implement transmission of ResetAcknowledge ...................................................................... iu_client: Implement transmission of ResetAcknowledge When receiving an Iu Reset, respond with Iu ResetAcknowledge. Closes: OS#3944 Change-Id: Ia09752983a7e2a952aa144635924edbffd894058 --- M src/iu_client.c 1 file changed, 19 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/21/13721/1 diff --git a/src/iu_client.c b/src/iu_client.c index 4aecfec..92d25f5 100644 --- a/src/iu_client.c +++ b/src/iu_client.c @@ -603,8 +603,24 @@ static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) { - /* FIXME: send reset response */ - return -1; + struct osmo_scu_prim *prim = (struct osmo_scu_prim *) ctx; + struct osmo_scu_unitdata_param *ud_prim = &prim->u.unitdata; + RANAP_GlobalRNC_ID_t *grnc_id = NULL; + struct msgb *resp; + + OSMO_ASSERT(prim->oph.primitive == OSMO_SCU_PRIM_N_UNITDATA); + + /* FIXME: verify ies.cN_DomainIndicator */ + + if (ies->presenceMask & RESETIES_RANAP_GLOBALRNC_ID_PRESENT) + grnc_id = &ies->globalRNC_ID; + + /* send reset response */ + resp = ranap_new_msg_reset_ack(ies->cN_DomainIndicator, grnc_id); + if (!resp) + return -ENOMEM; + resp->l2h = resp->data; + return osmo_sccp_tx_unitdata_msg(g_scu, &g_local_sccp_addr, &ud_prim->calling_addr, resp); } static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) @@ -795,7 +811,7 @@ /* connection-less data received */ LOGPIU(LOGL_DEBUG, "N-UNITDATA.ind(%s)\n", osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); - rc = ranap_cn_rx_cl(cn_ranap_handle_cl, scu, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + rc = ranap_cn_rx_cl(cn_ranap_handle_cl, prim, msgb_l2(oph->msg), msgb_l2len(oph->msg)); break; default: rc = -1; -- To view, visit https://gerrit.osmocom.org/13721 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia09752983a7e2a952aa144635924edbffd894058 Gerrit-Change-Number: 13721 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 20:40:56 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 20 Apr 2019 20:40:56 +0000 Subject: Change in osmo-iuh[master]: ranap_msg_factory: Fix criticality of PDUs Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13722 Change subject: ranap_msg_factory: Fix criticality of PDUs ...................................................................... ranap_msg_factory: Fix criticality of PDUs Seveal of our RANAP messages were using criticality values at the PDU level differing from what RANAP_PDU_Descriptions.asn states for the respective procedures. Let's fix that. This was discovered while working on the initial IuCS TTCN3 tests, where the receive templates require the criticality to match. Change-Id: I98eec0bdc0d0cb1b9284bd5d042b1f4403abef95 --- M src/ranap_msg_factory.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/22/13722/1 diff --git a/src/ranap_msg_factory.c b/src/ranap_msg_factory.c index c287f02..2ae2dbf 100644 --- a/src/ranap_msg_factory.c +++ b/src/ranap_msg_factory.c @@ -150,7 +150,7 @@ } msg = ranap_generate_initiating_message(RANAP_ProcedureCode_id_InitialUE_Message, - RANAP_Criticality_reject, + RANAP_Criticality_ignore, &asn_DEF_RANAP_InitialUE_Message, &out); @@ -192,7 +192,7 @@ /* dt -> msg */ msg = ranap_generate_initiating_message(RANAP_ProcedureCode_id_DirectTransfer, - RANAP_Criticality_reject, + RANAP_Criticality_ignore, &asn_DEF_RANAP_DirectTransfer, &dt); @@ -467,7 +467,7 @@ /* out -> msg */ msg = ranap_generate_initiating_message(RANAP_ProcedureCode_id_Paging, - RANAP_Criticality_reject, + RANAP_Criticality_ignore, &asn_DEF_RANAP_Paging, &out); @@ -912,7 +912,7 @@ /* encode the output into the msgb */ msg = ranap_generate_initiating_message(RANAP_ProcedureCode_id_Iu_ReleaseRequest, - RANAP_Criticality_reject, + RANAP_Criticality_ignore, &asn_DEF_RANAP_Iu_ReleaseRequest, &out); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_Iu_ReleaseRequest, &out); @@ -955,7 +955,7 @@ /* encode the output into the msgb */ msg = ranap_generate_initiating_message(RANAP_ProcedureCode_id_RAB_ReleaseRequest, - RANAP_Criticality_reject, + RANAP_Criticality_ignore, &asn_DEF_RANAP_RAB_ReleaseRequest, &out); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_RAB_ReleaseRequest, &out); -- To view, visit https://gerrit.osmocom.org/13722 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I98eec0bdc0d0cb1b9284bd5d042b1f4403abef95 Gerrit-Change-Number: 13722 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 20:54:00 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 20 Apr 2019 20:54:00 +0000 Subject: Change in osmo-iuh[master]: ranap_msg_factory: Fix criticality of PDUs In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13722 to look at the new patch set (#2). Change subject: ranap_msg_factory: Fix criticality of PDUs ...................................................................... ranap_msg_factory: Fix criticality of PDUs Seveal of our RANAP messages were using criticality values at the PDU level differing from what RANAP_PDU_Descriptions.asn states for the respective procedures. Let's fix that. This was discovered while working on the initial IuCS TTCN3 tests, where the receive templates require the criticality to match. Change-Id: I98eec0bdc0d0cb1b9284bd5d042b1f4403abef95 --- M src/ranap_msg_factory.c M src/tests/test-ranap.ok 2 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/22/13722/2 -- To view, visit https://gerrit.osmocom.org/13722 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I98eec0bdc0d0cb1b9284bd5d042b1f4403abef95 Gerrit-Change-Number: 13722 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 22:59:48 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Apr 2019 22:59:48 +0000 Subject: Change in osmo-bts[master]: osmo-bts-trx/scheduler: distinguish synch. sequence of RACH bursts Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13723 Change subject: osmo-bts-trx/scheduler: distinguish synch. sequence of RACH bursts ...................................................................... osmo-bts-trx/scheduler: distinguish synch. sequence of RACH bursts WIP/TODO: add detailed description here (please read the code). At least it makes both TC_rach_content and TC_rach_count TTCN-3 test cases pass again. There were some collisions between the extended (11-bit) RACH bursts and the regular ones, since we used to call gsm0503_rach_ext_decode_ber() first, regardless of the burst type... To be 100% sure, we need a similar TTCN-3 test case for the extended (11-bit) RACH. This would require to do some little changes in both trxcon and the L1CTL protocol. Change-Id: Ibb6d27c6589965c8b59a6d2598a7c43fd860f284 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 124 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/23/13723/1 diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 32bdb98..81bb48d 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -709,72 +709,154 @@ * RX on uplink (indication to upper layer) */ +/* 3GPP TS 05.02, section 5.2.7 */ +#define RACH_EXT_TAIL_LEN 8 +#define RACH_SYNCH_SEQ_LEN 41 + +enum rach_synch_seq_t { + RACH_SYNCH_SEQ_UNKNOWN = -1, + RACH_SYNCH_SEQ_TS0, /* GSM, GMSK (default) */ + RACH_SYNCH_SEQ_TS1, /* EGPRS, 8-PSK */ + RACH_SYNCH_SEQ_TS2, /* EGPRS, GMSK */ + RACH_SYNCH_SEQ_NUM +}; + +static struct value_string rach_synch_seq_names[] = { + { RACH_SYNCH_SEQ_UNKNOWN, "UNKNOWN" }, + { RACH_SYNCH_SEQ_TS0, "TS0: GSM, GMSK" }, + { RACH_SYNCH_SEQ_TS1, "TS1: EGPRS, 8-PSK" }, + { RACH_SYNCH_SEQ_TS2, "TS2: EGPRS, GMSK" }, + { 0, NULL }, +}; + +static enum rach_synch_seq_t rach_get_synch_seq(sbit_t *bits, float *certitude) +{ + sbit_t *synch_seq_burst = bits + RACH_EXT_TAIL_LEN; + unsigned int score[RACH_SYNCH_SEQ_NUM] = { 0 }; + unsigned int max_score = 0; + unsigned int i, j; + + /* 3GPP TS 05.02, section 5.2.7 "Access burst (AB)", synch. sequence bits */ + static const char synch_seq_ref[RACH_SYNCH_SEQ_NUM][RACH_SYNCH_SEQ_LEN] = { + [RACH_SYNCH_SEQ_TS0] = "01001011011111111001100110101010001111000", + [RACH_SYNCH_SEQ_TS1] = "01010100111110001000011000101111001001101", + [RACH_SYNCH_SEQ_TS2] = "11101111001001110101011000001101101110111", + }; + +#define RACH_SYNCH_SEQ_MATCH(seq_ref) \ + (seq_ref[j] == '1' ? synch_seq_burst[j] < 0 : synch_seq_burst[j] >= 0) + +#define RACH_SYNCH_SEQ_SCORE(seq_ref) \ + (RACH_SYNCH_SEQ_MATCH(seq_ref) ? abs(synch_seq_burst[j]) : 0) + + /* For each synch. sequence, count the bit match score. Since we deal with + * soft-bits (-127...127), we sum the absolute values of matching ones, so + * the resulting scores are more accurate than it could be with hard-bits. */ + for (i = 0; i < RACH_SYNCH_SEQ_NUM; i++) { + for (j = 0; j < RACH_SYNCH_SEQ_LEN; j++) + score[i] += RACH_SYNCH_SEQ_SCORE(synch_seq_ref[i]); + /* Keep the maximum value updated */ + if (max_score < score[i]) + max_score = score[i]; + } + + /* Calculate an approximate level of our confidence */ + if (certitude != NULL) + *certitude = max_score * 100 / (RACH_SYNCH_SEQ_LEN * 127); + + /* At least 1/3 of a synch. sequence shall match */ + if (max_score < (127 * RACH_SYNCH_SEQ_LEN / 3)) + return RACH_SYNCH_SEQ_UNKNOWN; + + /* Which synch. sequence is the best? */ + else if (max_score == score[RACH_SYNCH_SEQ_TS0]) + return RACH_SYNCH_SEQ_TS0; + else if (max_score == score[RACH_SYNCH_SEQ_TS1]) + return RACH_SYNCH_SEQ_TS1; + else if (max_score == score[RACH_SYNCH_SEQ_TS2]) + return RACH_SYNCH_SEQ_TS2; + else /* Shall not happen in general */ + return RACH_SYNCH_SEQ_UNKNOWN; +} + int rx_rach_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn, enum trx_chan_type chan, uint8_t bid, sbit_t *bits, uint16_t nbits, int8_t rssi, int16_t toa256) { - uint8_t chan_nr; struct osmo_phsap_prim l1sap; int n_errors, n_bits_total; - bool is_11bit = true; uint16_t ra11; uint8_t ra; - int rc = 1; + int rc; - chan_nr = trx_chan_desc[chan].chan_nr | tn; + /* It would be great if the transceiver were doing some kind of tagging, + * whether it is extended (11-bit) RACH or not. We would not need to guess + * it here. For now, let's try to correlate the synch. sequence of a received + * Access Burst with the known ones (3GPP TS 05.02, section 5.2.7), and + * fall-back to the default TS0 if it fails. This would save some CPU + * power, and what is more important - prevent possible collisions. */ + enum rach_synch_seq_t synch_seq = RACH_SYNCH_SEQ_TS0; + float certitude = 100; - LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Received RACH toa=%d\n", toa256); + /* Handover RACH cannot be extended (11-bit) */ + if (chan == TRXC_RACH) + synch_seq = rach_get_synch_seq(bits, &certitude); - if (chan == TRXC_RACH) /* Attempt to decode as extended (11-bit) RACH first */ - rc = gsm0503_rach_ext_decode_ber(&ra11, bits + 8 + 41, + LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Received RACH (%s; confidence=%.1f%%) toa=%d\n", + get_value_string(rach_synch_seq_names, synch_seq), certitude, toa256); + + /* Compose a new L1SAP primitive */ + memset(&l1sap, 0x00, sizeof(l1sap)); + osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_RACH, PRIM_OP_INDICATION, NULL); + l1sap.u.rach_ind.chan_nr = trx_chan_desc[chan].chan_nr | tn; + l1sap.u.rach_ind.acc_delay = (toa256 >= 0) ? toa256 / 256 : 0; + l1sap.u.rach_ind.acc_delay_256bits = toa256; + l1sap.u.rach_ind.rssi = rssi; + l1sap.u.rach_ind.fn = fn; + + /* Decode RACH depending on its synch. sequence */ + switch (synch_seq) { + case RACH_SYNCH_SEQ_TS1: + case RACH_SYNCH_SEQ_TS2: + rc = gsm0503_rach_ext_decode_ber(&ra11, bits + RACH_EXT_TAIL_LEN + RACH_SYNCH_SEQ_LEN, l1t->trx->bts->bsic, &n_errors, &n_bits_total); - if (rc) { - /* Indicate non-extended RACH */ - is_11bit = false; - - /* Fall-back to the normal RACH decoding */ - rc = gsm0503_rach_decode_ber(&ra, bits + 8 + 41, - l1t->trx->bts->bsic, &n_errors, &n_bits_total); if (rc) { - LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Received bad AB frame\n"); + LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Received bad Access Burst\n"); return 0; } - } - /* compose primitive */ - /* generate prim */ - memset(&l1sap, 0, sizeof(l1sap)); - osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_RACH, PRIM_OP_INDICATION, - NULL); - l1sap.u.rach_ind.chan_nr = chan_nr; - l1sap.u.rach_ind.acc_delay = (toa256 >= 0) ? toa256/256 : 0; - l1sap.u.rach_ind.fn = fn; - l1sap.u.rach_ind.rssi = rssi; - l1sap.u.rach_ind.ber10k = compute_ber10k(n_bits_total, n_errors); - l1sap.u.rach_ind.acc_delay_256bits = toa256; + if (synch_seq == RACH_SYNCH_SEQ_TS1) + l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_ACCESS_1; + else + l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_ACCESS_2; - if (is_11bit) { l1sap.u.rach_ind.is_11bit = 1; l1sap.u.rach_ind.ra = ra11; - l1sap.u.rach_ind.burst_type = BSIC2BCC(l1t->trx->bts->bsic); - switch (l1sap.u.rach_ind.burst_type) { - case GSM_L1_BURST_TYPE_ACCESS_0: - case GSM_L1_BURST_TYPE_ACCESS_1: - case GSM_L1_BURST_TYPE_ACCESS_2: - break; - default: - LOGL1S(DL1P, LOGL_NOTICE, l1t, tn, chan, fn, - "Received RACH frame with unexpected TSC %u, " - "forcing default %u\n", l1sap.u.rach_ind.burst_type, - GSM_L1_BURST_TYPE_ACCESS_0); - l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_ACCESS_0; + break; + + case RACH_SYNCH_SEQ_TS0: + default: + /* Fall-back to the default TS0 if needed */ + if (synch_seq != RACH_SYNCH_SEQ_TS0) { + LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Falling-back to the default TS0\n"); + synch_seq = RACH_SYNCH_SEQ_TS0; } - } else { + + rc = gsm0503_rach_decode_ber(&ra, bits + RACH_EXT_TAIL_LEN + RACH_SYNCH_SEQ_LEN, + l1t->trx->bts->bsic, &n_errors, &n_bits_total); + if (rc) { + LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Received bad Access Burst\n"); + return 0; + } + + l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_ACCESS_0; l1sap.u.rach_ind.is_11bit = 0; l1sap.u.rach_ind.ra = ra; - l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_ACCESS_0; + break; } + l1sap.u.rach_ind.ber10k = compute_ber10k(n_bits_total, n_errors); + /* forward primitive */ l1sap_up(l1t->trx, &l1sap); -- To view, visit https://gerrit.osmocom.org/13723 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibb6d27c6589965c8b59a6d2598a7c43fd860f284 Gerrit-Change-Number: 13723 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 20 23:05:40 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Apr 2019 23:05:40 +0000 Subject: Change in osmo-bts[master]: osmo-bts-trx/scheduler: distinguish synch. sequence of RACH bursts In-Reply-To: References: Message-ID: Vadim Yanitskiy has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13723 ) Change subject: osmo-bts-trx/scheduler: distinguish synch. sequence of RACH bursts ...................................................................... osmo-bts-trx/scheduler: distinguish synch. sequence of RACH bursts WIP/TODO: add detailed description here (please read the code). At least it makes both TC_rach_content and TC_rach_count TTCN-3 test cases pass again. There were some collisions between the extended (11-bit) RACH bursts and the regular ones, since we used to call gsm0503_rach_ext_decode_ber() first, regardless of the burst type... To be 100% sure, we need a similar TTCN-3 test case for the extended (11-bit) RACH. This would require to do some little changes in both trxcon and the L1CTL protocol. Change-Id: Ibb6d27c6589965c8b59a6d2598a7c43fd860f284 Related: OS#1854 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 124 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/23/13723/2 -- To view, visit https://gerrit.osmocom.org/13723 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibb6d27c6589965c8b59a6d2598a7c43fd860f284 Gerrit-Change-Number: 13723 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-CC: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 08:03:27 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 08:03:27 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/11194 ) Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 4 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Rafael Diniz Gerrit-Comment-Date: Sun, 21 Apr 2019 08:03:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 08:03:38 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 08:03:38 +0000 Subject: Change in osmo-sip-connector[master]: MNCC: Do not continue with B leg if A leg is cancelled. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11194 ) Change subject: MNCC: Do not continue with B leg if A leg is cancelled. ...................................................................... MNCC: Do not continue with B leg if A leg is cancelled. In case we receive MNCC_RTP_CREATE after MNCC_DISC_IND, check if the call is already marked in_release and if so, send MNCC_REJ_REQ and do not proceed with the B leg. Related: OS#3518 Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 --- M src/mncc.c 1 file changed, 13 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Keith Whyte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/mncc.c b/src/mncc.c index b7977c4..ab2bed6 100644 --- a/src/mncc.c +++ b/src/mncc.c @@ -104,6 +104,17 @@ return NULL; } +/* Find a MNCC Call leg (by callref) which is not yet in release */ +static struct mncc_call_leg *mncc_find_leg_not_released(uint32_t callref) +{ + struct mncc_call_leg *leg = mncc_find_leg(callref); + if (!leg) + return NULL; + if (leg->base.in_release) + return NULL; + return leg; +} + static void mncc_fill_header(struct gsm_mncc *mncc, uint32_t msg_type, uint32_t callref) { struct mncc_call_leg *mncc_leg; @@ -343,7 +354,7 @@ } rtp = (const struct gsm_mncc_rtp *) buf; - leg = mncc_find_leg(rtp->callref); + leg = mncc_find_leg_not_released(rtp->callref); if (!leg) { LOGP(DMNCC, LOGL_ERROR, "leg(%u) can not be found\n", rtp->callref); return mncc_send(conn, MNCC_REJ_REQ, rtp->callref); @@ -373,7 +384,7 @@ } rtp = (const struct gsm_mncc_rtp *) buf; - leg = mncc_find_leg(rtp->callref); + leg = mncc_find_leg_not_released(rtp->callref); if (!leg) { LOGP(DMNCC, LOGL_ERROR, "call(%u) can not be found\n", rtp->callref); return mncc_send(conn, MNCC_REJ_REQ, rtp->callref); -- To view, visit https://gerrit.osmocom.org/11194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0eca9a741f7924c2fc32c503dd1a0fc083f94f37 Gerrit-Change-Number: 11194 Gerrit-PatchSet: 5 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Rafael Diniz -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 08:06:37 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 08:06:37 +0000 Subject: Change in osmo-bts[master]: common/oml.c: constify argument 'trx' of handle_attrs_trx() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13699 ) Change subject: common/oml.c: constify argument 'trx' of handle_attrs_trx() ...................................................................... common/oml.c: constify argument 'trx' of handle_attrs_trx() Change-Id: Id476d492b3c1d0c728fca9eb0fb2254512bdef72 --- M include/osmo-bts/phy_link.h M src/common/oml.c 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 2472c05..812f186 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -166,7 +166,7 @@ void phy_user_statechg_notif(struct phy_instance *pinst, enum phy_link_state link_state); -static inline struct phy_instance *trx_phy_instance(struct gsm_bts_trx *trx) +static inline struct phy_instance *trx_phy_instance(const struct gsm_bts_trx *trx) { OSMO_ASSERT(trx); return trx->role_bts.l1h; diff --git a/src/common/oml.c b/src/common/oml.c index 80d424f..03fdc56 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -155,7 +155,7 @@ msgb_tl16v_put(msg, NM_ATT_MANUF_ID, _NUM_BTS_FEAT/8 + 1, bts->_features_data); } -static inline void add_trx_attr(struct msgb *msg, struct gsm_bts_trx *trx) +static inline void add_trx_attr(struct msgb *msg, const struct gsm_bts_trx *trx) { const struct phy_instance *pinst = trx_phy_instance(trx); @@ -191,7 +191,7 @@ return len + out_offset + 1; } -static inline int handle_attrs_trx(uint8_t *out, struct gsm_bts_trx *trx, const uint8_t *attr, uint16_t attr_len) +static inline int handle_attrs_trx(uint8_t *out, const struct gsm_bts_trx *trx, const uint8_t *attr, uint16_t attr_len) { uint16_t i, attr_out_index = 1; /* byte 0 is reserved for unsupported attributes counter */ struct msgb *attr_buf = oml_msgb_alloc(); -- To view, visit https://gerrit.osmocom.org/13699 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id476d492b3c1d0c728fca9eb0fb2254512bdef72 Gerrit-Change-Number: 13699 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 08:06:37 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 08:06:37 +0000 Subject: Change in osmo-bts[master]: common/oml.c: use proper NACK reason in oml_tx_attr_resp() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13700 ) Change subject: common/oml.c: use proper NACK reason in oml_tx_attr_resp() ...................................................................... common/oml.c: use proper NACK reason in oml_tx_attr_resp() Change-Id: I482caa0747f81da2979bfbdbd22bd6962af728cd --- M src/common/oml.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/common/oml.c b/src/common/oml.c index 03fdc56..568d406 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -275,7 +275,7 @@ default: LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute Response\n", get_value_string(abis_nm_obj_class_names, foh->obj_class)); - len = -NM_NACK_RES_NOTIMPL; + len = -NM_NACK_OBJCLASS_NOTSUPP; } if (len < 0) { -- To view, visit https://gerrit.osmocom.org/13700 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I482caa0747f81da2979bfbdbd22bd6962af728cd Gerrit-Change-Number: 13700 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 08:06:37 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 08:06:37 +0000 Subject: Change in osmo-bts[master]: common/oml.c: use proper OML object for Get Attribute Response In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13701 ) Change subject: common/oml.c: use proper OML object for Get Attribute Response ...................................................................... common/oml.c: use proper OML object for Get Attribute Response It was noticed that the Get Attribute Response message always indicates BTS(00,ff,ff) as the addressed OML entity, even if e.g. Baseband Transceiver(00,00,ff) was requested by the BSC. Despite neither OsmoBSC nor OpenBSC does complain about this, such behaviour violates 3GPP TS 52.021. Let's fix this. Change-Id: Icb1ee75d4bf680deb6365288d8c2053816a12217 Related: OS#3938 --- M src/common/oml.c 1 file changed, 20 insertions(+), 11 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved diff --git a/src/common/oml.c b/src/common/oml.c index 568d406..307e8d9 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -252,29 +252,29 @@ } /* send 3GPP TS 52.021 ?8.11.2 Get Attribute Response */ -static int oml_tx_attr_resp(struct gsm_bts *bts, const struct abis_om_fom_hdr *foh, const uint8_t *attr, - uint16_t attr_len) +static int oml_tx_attr_resp(const struct gsm_abis_mo *mo, + const uint8_t *attr, uint16_t attr_len) { struct msgb *nmsg = oml_msgb_alloc(); uint8_t resp[MAX_VERSION_LENGTH * attr_len * 2]; /* heuristic for Attribute Response Info space requirements */ int len; LOGP(DOML, LOGL_INFO, "%s Tx Get Attribute Response\n", - get_value_string(abis_nm_obj_class_names, foh->obj_class)); + get_value_string(abis_nm_obj_class_names, mo->obj_class)); if (!nmsg) return -NM_NACK_CANT_PERFORM; - switch (foh->obj_class) { + switch (mo->obj_class) { case NM_OC_BTS: - len = handle_attrs_bts(resp, bts, attr, attr_len); + len = handle_attrs_bts(resp, mo->bts, attr, attr_len); break; case NM_OC_BASEB_TRANSC: - len = handle_attrs_trx(resp, gsm_bts_trx_num(bts, foh->obj_inst.trx_nr), attr, attr_len); + len = handle_attrs_trx(resp, gsm_bts_trx_num(mo->bts, mo->obj_inst.trx_nr), attr, attr_len); break; default: LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get Attribute Response\n", - get_value_string(abis_nm_obj_class_names, foh->obj_class)); + get_value_string(abis_nm_obj_class_names, mo->obj_class)); len = -NM_NACK_OBJCLASS_NOTSUPP; } @@ -287,7 +287,7 @@ /* ?9.4.64 Get Attribute Response Info */ msgb_tl16v_put(nmsg, NM_ATT_GET_ARI, len, resp); - len = oml_mo_send_msg(&bts->mo, nmsg, NM_MT_GET_ATTR_RESP); + len = oml_mo_send_msg(mo, nmsg, NM_MT_GET_ATTR_RESP); return (len < 0) ? -NM_NACK_CANT_PERFORM : len; } @@ -527,6 +527,7 @@ static int oml_rx_get_attr(struct gsm_bts *bts, struct msgb *msg) { struct abis_om_fom_hdr *foh = msgb_l3(msg); + const struct gsm_abis_mo *mo; struct tlv_parsed tp; int rc; @@ -536,18 +537,26 @@ abis_nm_debugp_foh(DOML, foh); DEBUGPC(DOML, "Rx GET ATTR\n"); + /* Determine which OML object is addressed */ + mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); + if (!mo) { + LOGP(DOML, LOGL_ERROR, "%s Get Attributes for unknown Object Instance\n", + abis_nm_dump_foh(foh)); + return oml_fom_ack_nack(msg, NM_NACK_OBJINST_UNKN); + } + rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); if (rc < 0) { - oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UNSUP_ATTR, "Get Attribute parsing failure"); + oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UNSUP_ATTR, "Get Attribute parsing failure"); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } if (!TLVP_PRES_LEN(&tp, NM_ATT_LIST_REQ_ATTR, 1)) { - oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UNSUP_ATTR, "Get Attribute without Attribute List"); + oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UNSUP_ATTR, "Get Attribute without Attribute List"); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } - rc = oml_tx_attr_resp(bts, foh, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); + rc = oml_tx_attr_resp(mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); if (rc < 0) { LOGP(DOML, LOGL_ERROR, "responding to O&M Get Attributes message with NACK 0%x\n", -rc); return oml_fom_ack_nack(msg, -rc); -- To view, visit https://gerrit.osmocom.org/13701 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Icb1ee75d4bf680deb6365288d8c2053816a12217 Gerrit-Change-Number: 13701 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 09:06:52 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 21 Apr 2019 09:06:52 +0000 Subject: Change in osmo-bts[master]: common/oml.c: fix total length calculation in cleanup_attr_msg() In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13707 ) Change subject: common/oml.c: fix total length calculation in cleanup_attr_msg() ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13707 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic7c2c4e54e9f99b60aaf70604044933978be945c Gerrit-Change-Number: 13707 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sun, 21 Apr 2019 09:06:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 09:06:58 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 21 Apr 2019 09:06:58 +0000 Subject: Change in osmo-bts[master]: common/oml.c: fix total length calculation in cleanup_attr_msg() In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13707 ) Change subject: common/oml.c: fix total length calculation in cleanup_attr_msg() ...................................................................... common/oml.c: fix total length calculation in cleanup_attr_msg() Both callers of cleanup_attr_msg(), i.e. handle_attrs_trx() and handle_attrs_bts(), always pass out_offset >= 1, so the length of the unsupported attributes counter is already accounted. Otherwise, both callers would copy an additional garbage byte from uninitialized memory. Discovered using Valgrind: DOML DEBUG oml.c:539 OC=BTS(01) INST=(ff,ff,ff) Rx GET ATTR DOML INFO oml.c:265 BTS Tx Get Attribute Response ==25467== Syscall param socketcall.sendto(msg) points to uninitialised byte(s) ==25467== at 0x623E0BD: send (send.c:27) ==25467== by 0x5685846: __handle_ts1_write (ipaccess.c:358) ==25467== by 0x5683F8B: ipa_client_write (ipa.c:79) ==25467== by 0x5683F8B: ipa_client_fd_cb (ipa.c:140) ==25467== by 0x5F1DC23: osmo_fd_disp_fds (select.c:223) ==25467== by 0x5F1DC23: osmo_select_main (select.c:263) ==25467== by 0x42980B: bts_main (main.c:354) ==25467== by 0x6160F44: (below main) (libc-start.c:287) ==25467== Address 0x7d83895 is 23,669 bytes inside a block of size 102,528 alloc'd ==25467== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==25467== by 0x589A6B4: talloc_pool (in /usr/lib/x86_64-linux-gnu/libtalloc.so.2.1.5) ==25467== by 0x5F1E28B: msgb_talloc_ctx_init (msgb.c:316) ==25467== by 0x4293D0: bts_main (main.c:234) ==25467== by 0x6160F44: (below main) (libc-start.c:287) ==25467== Uninitialised value was created by a stack allocation ==25467== at 0x415FE5: oml_tx_attr_resp (oml.c:259) ==25467== by 0x415FE5: oml_rx_get_attr (oml.c:561) ==25467== Change-Id: Ic7c2c4e54e9f99b60aaf70604044933978be945c Related: OS#3938 --- M src/common/oml.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve diff --git a/src/common/oml.c b/src/common/oml.c index 307e8d9..de7a0e7 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -188,7 +188,7 @@ msgb_free(msg); } - return len + out_offset + 1; + return len + out_offset; } static inline int handle_attrs_trx(uint8_t *out, const struct gsm_bts_trx *trx, const uint8_t *attr, uint16_t attr_len) -- To view, visit https://gerrit.osmocom.org/13707 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic7c2c4e54e9f99b60aaf70604044933978be945c Gerrit-Change-Number: 13707 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 09:41:53 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Sun, 21 Apr 2019 09:41:53 +0000 Subject: Change in openbsc[master]: Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/13703 ) Change subject: Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. ...................................................................... Patch Set 1: > Uploaded patch set 1. This seems to catch the problem. People here generally go for a little more verbosity in the commit message. Maybe add some context? -- To view, visit https://gerrit.osmocom.org/13703 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3690acebf882d3a8abbeabe0e3aefdfcd066a052 Gerrit-Change-Number: 13703 Gerrit-PatchSet: 1 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Comment-Date: Sun, 21 Apr 2019 09:41:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 09:59:42 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 09:59:42 +0000 Subject: Change in openbsc[master]: Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#2) to the change originally created by Rafael Diniz. ( https://gerrit.osmocom.org/13703 ) Change subject: Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. ...................................................................... Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. Change-Id: I3690acebf882d3a8abbeabe0e3aefdfcd066a052 --- M openbsc/src/libmsc/gsm_04_08.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/03/13703/2 -- To view, visit https://gerrit.osmocom.org/13703 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3690acebf882d3a8abbeabe0e3aefdfcd066a052 Gerrit-Change-Number: 13703 Gerrit-PatchSet: 2 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 09:59:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 09:59:54 +0000 Subject: Change in openbsc[master]: Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13703 ) Change subject: Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13703 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3690acebf882d3a8abbeabe0e3aefdfcd066a052 Gerrit-Change-Number: 13703 Gerrit-PatchSet: 2 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Comment-Date: Sun, 21 Apr 2019 09:59:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 10:31:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 10:31:57 +0000 Subject: Change in osmo-ci[master]: ttcn3-slave: Add libfftranscode0 + libffstranscode-dev packages Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13724 Change subject: ttcn3-slave: Add libfftranscode0 + libffstranscode-dev packages ...................................................................... ttcn3-slave: Add libfftranscode0 + libffstranscode-dev packages Those proprietary libraries are required for testing APER based protocols such as those spoken on IuCS, IuPS and Iuh. Change-Id: I07489575d0b71c36b35096ecf1e2aab9577cb43e --- M ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/24/13724/1 diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml b/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml index 72166ab..8e30cbf 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml @@ -30,3 +30,10 @@ update_cache: yes cache_valid_time: 3600 +- name: Install libfftranscode0 + apt: + deb: https://ftp.osmocom.org/binaries/libfftranscode/libfftranscode0_0.1_amd64.deb + +- name: Install libfftranscode-dev + apt: + deb: https://ftp.osmocom.org/binaries/libfftranscode/libfftranscode-dev_0.1_amd64.deb -- To view, visit https://gerrit.osmocom.org/13724 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I07489575d0b71c36b35096ecf1e2aab9577cb43e Gerrit-Change-Number: 13724 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 10:32:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 10:32:12 +0000 Subject: Change in osmo-ci[master]: ttcn3-slave: Add libfftranscode0 + libffstranscode-dev packages In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13724 ) Change subject: ttcn3-slave: Add libfftranscode0 + libffstranscode-dev packages ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13724 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I07489575d0b71c36b35096ecf1e2aab9577cb43e Gerrit-Change-Number: 13724 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Sun, 21 Apr 2019 10:32:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 11:01:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 11:01:08 +0000 Subject: Change in docker-playground[master]: debian-stretch-titan: include libfftranscode for our Iu related tests Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13725 Change subject: debian-stretch-titan: include libfftranscode for our Iu related tests ...................................................................... debian-stretch-titan: include libfftranscode for our Iu related tests Change-Id: Ifd7d682df90f1b17823d8358a8a498f149e4591b --- M debian-stretch-titan/Dockerfile 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/25/13725/1 diff --git a/debian-stretch-titan/Dockerfile b/debian-stretch-titan/Dockerfile index a308c2a..18aad4b 100644 --- a/debian-stretch-titan/Dockerfile +++ b/debian-stretch-titan/Dockerfile @@ -29,3 +29,12 @@ # somehow Debian folks updated the gcc version but not titan :/ RUN sed -i 's/^#error/\/\/#error/' /usr/include/titan/cversion.h + + +# binary-only transcoding library for RANAP/RUA/HNBAP to work around TITAN only implementing BER +RUN apt-get update && \ + apt-get -y install wget +RUN wget https://ftp.osmocom.org/binaries/libfftranscode/libfftranscode0_0.1_amd64.deb && \ + wget https://ftp.osmocom.org/binaries/libfftranscode/libfftranscode-dev_0.1_amd64.deb && \ + apt install ./libfftranscode0_0.1_amd64.deb ./libfftranscode-dev_0.1_amd64.deb && \ + rm libfftranscode*.deb -- To view, visit https://gerrit.osmocom.org/13725 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd7d682df90f1b17823d8358a8a498f149e4591b Gerrit-Change-Number: 13725 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 11:01:49 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 11:01:49 +0000 Subject: Change in osmo-ci[master]: ttcn3-slave: Add libfftranscode0 + libffstranscode-dev packages In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13724 ) Change subject: ttcn3-slave: Add libfftranscode0 + libffstranscode-dev packages ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13724 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I07489575d0b71c36b35096ecf1e2aab9577cb43e Gerrit-Change-Number: 13724 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Sun, 21 Apr 2019 11:01:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 11:01:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 11:01:51 +0000 Subject: Change in osmo-ci[master]: ttcn3-slave: Add libfftranscode0 + libffstranscode-dev packages In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13724 ) Change subject: ttcn3-slave: Add libfftranscode0 + libffstranscode-dev packages ...................................................................... ttcn3-slave: Add libfftranscode0 + libffstranscode-dev packages Those proprietary libraries are required for testing APER based protocols such as those spoken on IuCS, IuPS and Iuh. Change-Id: I07489575d0b71c36b35096ecf1e2aab9577cb43e --- M ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml b/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml index 72166ab..8e30cbf 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml @@ -30,3 +30,10 @@ update_cache: yes cache_valid_time: 3600 +- name: Install libfftranscode0 + apt: + deb: https://ftp.osmocom.org/binaries/libfftranscode/libfftranscode0_0.1_amd64.deb + +- name: Install libfftranscode-dev + apt: + deb: https://ftp.osmocom.org/binaries/libfftranscode/libfftranscode-dev_0.1_amd64.deb -- To view, visit https://gerrit.osmocom.org/13724 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I07489575d0b71c36b35096ecf1e2aab9577cb43e Gerrit-Change-Number: 13724 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 11:01:58 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 11:01:58 +0000 Subject: Change in docker-playground[master]: debian-stretch-titan: include libfftranscode for our Iu related tests In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13725 ) Change subject: debian-stretch-titan: include libfftranscode for our Iu related tests ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13725 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ifd7d682df90f1b17823d8358a8a498f149e4591b Gerrit-Change-Number: 13725 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Sun, 21 Apr 2019 11:01:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 11:01:59 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 11:01:59 +0000 Subject: Change in docker-playground[master]: debian-stretch-titan: include libfftranscode for our Iu related tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13725 ) Change subject: debian-stretch-titan: include libfftranscode for our Iu related tests ...................................................................... debian-stretch-titan: include libfftranscode for our Iu related tests Change-Id: Ifd7d682df90f1b17823d8358a8a498f149e4591b --- M debian-stretch-titan/Dockerfile 1 file changed, 9 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/debian-stretch-titan/Dockerfile b/debian-stretch-titan/Dockerfile index a308c2a..18aad4b 100644 --- a/debian-stretch-titan/Dockerfile +++ b/debian-stretch-titan/Dockerfile @@ -29,3 +29,12 @@ # somehow Debian folks updated the gcc version but not titan :/ RUN sed -i 's/^#error/\/\/#error/' /usr/include/titan/cversion.h + + +# binary-only transcoding library for RANAP/RUA/HNBAP to work around TITAN only implementing BER +RUN apt-get update && \ + apt-get -y install wget +RUN wget https://ftp.osmocom.org/binaries/libfftranscode/libfftranscode0_0.1_amd64.deb && \ + wget https://ftp.osmocom.org/binaries/libfftranscode/libfftranscode-dev_0.1_amd64.deb && \ + apt install ./libfftranscode0_0.1_amd64.deb ./libfftranscode-dev_0.1_amd64.deb && \ + rm libfftranscode*.deb -- To view, visit https://gerrit.osmocom.org/13725 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ifd7d682df90f1b17823d8358a8a498f149e4591b Gerrit-Change-Number: 13725 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 12:40:49 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 21 Apr 2019 12:40:49 +0000 Subject: Change in osmo-bts[master]: common/l1sap.c: fix: add missing new line to a debug message Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13726 Change subject: common/l1sap.c: fix: add missing new line to a debug message ...................................................................... common/l1sap.c: fix: add missing new line to a debug message Change-Id: I7c0dab255289a5847d1a0af009e8962e4410e5ca --- M src/common/l1sap.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/26/13726/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index f8f3fef..247763e 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1276,7 +1276,7 @@ struct gsm_bts *bts = trx->bts; struct lapdm_channel *lc; - DEBUGPFN(DL1P, rach_ind->fn, "Rx PH-RA.ind"); + DEBUGPFN(DL1P, rach_ind->fn, "Rx PH-RA.ind\n"); /* check for handover access burst on dedicated channels */ if (!L1SAP_IS_CHAN_RACH(rach_ind->chan_nr)) { -- To view, visit https://gerrit.osmocom.org/13726 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7c0dab255289a5847d1a0af009e8962e4410e5ca Gerrit-Change-Number: 13726 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 13:50:16 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 13:50:16 +0000 Subject: Change in osmo-bts[master]: common/l1sap.c: fix: add missing new line to a debug message In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13726 ) Change subject: common/l1sap.c: fix: add missing new line to a debug message ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13726 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7c0dab255289a5847d1a0af009e8962e4410e5ca Gerrit-Change-Number: 13726 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sun, 21 Apr 2019 13:50:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 13:50:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 13:50:21 +0000 Subject: Change in osmo-bts[master]: common/l1sap.c: fix: add missing new line to a debug message In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13726 ) Change subject: common/l1sap.c: fix: add missing new line to a debug message ...................................................................... common/l1sap.c: fix: add missing new line to a debug message Change-Id: I7c0dab255289a5847d1a0af009e8962e4410e5ca --- M src/common/l1sap.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index f8f3fef..247763e 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1276,7 +1276,7 @@ struct gsm_bts *bts = trx->bts; struct lapdm_channel *lc; - DEBUGPFN(DL1P, rach_ind->fn, "Rx PH-RA.ind"); + DEBUGPFN(DL1P, rach_ind->fn, "Rx PH-RA.ind\n"); /* check for handover access burst on dedicated channels */ if (!L1SAP_IS_CHAN_RACH(rach_ind->chan_nr)) { -- To view, visit https://gerrit.osmocom.org/13726 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7c0dab255289a5847d1a0af009e8962e4410e5ca Gerrit-Change-Number: 13726 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 15:45:49 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 15:45:49 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Rename BSSMAP_Emulation -> RAN_Emulation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13650 to look at the new patch set (#2). Change subject: Rename BSSMAP_Emulation -> RAN_Emulation ...................................................................... Rename BSSMAP_Emulation -> RAN_Emulation So far, BSSMAP_Emulation supported only a transport over BSSMAP. However, we soon intend to merge support for RANAP in order to simulate RANAP/Iu connections as well as BSSMAP. Let's start by renaming some of the existing types/functions/ports/modules without introducing any functional changes just yet. Related: OS#2857, OS#2856 Change-Id: Iecbcb0c6c136baad9460eca40606bb4010d8882d --- M bsc-nat/BSC_MS_ConnectionHandler.ttcn M bsc-nat/BSC_MS_Simulation.ttcn M bsc-nat/MSC_ConnectionHandler.ttcn M bsc-nat/MSC_Simulation.ttcn M bsc-nat/gen_links.sh M bsc/BSC_Tests.ttcn M bsc/BSC_Tests_LCLS.ttcn M bsc/MSC_ConnectionHandler.ttcn M bsc/gen_links.sh R library/RAN_Adapter.ttcn R library/RAN_Emulation.ttcn M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn M msc/gen_links.sh 14 files changed, 228 insertions(+), 230 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/50/13650/2 -- To view, visit https://gerrit.osmocom.org/13650 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iecbcb0c6c136baad9460eca40606bb4010d8882d Gerrit-Change-Number: 13650 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 15:45:49 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 15:45:49 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Modularize protocol support In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13651 to look at the new patch set (#2). Change subject: RAN_Emulation: Modularize protocol support ...................................................................... RAN_Emulation: Modularize protocol support The RAN_Emulation currently unconditionally provides BSSAP and MGCP support. Let's re-structure the code so that support for those protocols is now possible to enable/disable at compile time. This patch is in preparation of introducing RANAP support in RAN_Emulation. Change-Id: Id53ba3ff05f9946230e0e4a759245de14a0f9fbd Related: OS#2856 --- M bsc-nat/BSC_MS_ConnectionHandler.ttcn M bsc-nat/MSC_ConnectionHandler.ttcn M bsc-nat/gen_links.sh M bsc-nat/regen_makefile.sh M bsc/MSC_ConnectionHandler.ttcn M bsc/gen_links.sh M bsc/regen_makefile.sh R library/RAN_Adapter.ttcnpp R library/RAN_Emulation.ttcnpp M msc/BSC_ConnectionHandler.ttcn M msc/gen_links.sh M msc/regen_makefile.sh 12 files changed, 216 insertions(+), 141 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/51/13651/2 -- To view, visit https://gerrit.osmocom.org/13651 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id53ba3ff05f9946230e0e4a759245de14a0f9fbd Gerrit-Change-Number: 13651 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 15:45:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 15:45:51 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_ConnectionHandler: Define SDP template for CN-side CRCX Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13727 Change subject: BSC_ConnectionHandler: Define SDP template for CN-side CRCX ...................................................................... BSC_ConnectionHandler: Define SDP template for CN-side CRCX Change-Id: I90546249c41de8f99ce4a558e76cb46597413518 --- M msc/BSC_ConnectionHandler.ttcn 1 file changed, 11 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/27/13727/1 diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 8e5c5f2..0b2344f 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -469,6 +469,15 @@ hex2str(cpars.called_party), hex2str(g_pars.imsi))); } +private template (value) SDP_Message ts_SDP_CRCX_CN(CallParameters cpars) := + ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, + hex2str(cpars.mgcp_call_id), "42", + cpars.mgw_rtp_port_mss, + { int2str(cpars.rtp_payload_type) }, + { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, + cpars.rtp_sdp_format)), + valueof(ts_SDP_ptime(20)) }); + /* Complete call, begin with a paging response message via BSSAP */ function f_mt_call_complete(inout CallParameters cpars) runs on BSC_ConnHdlr { @@ -521,13 +530,7 @@ interleave { /* Second MGCP CRCX (this time for MSS/CN side) */ [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { - var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, - hex2str(cpars.mgcp_call_id), "42", - cpars.mgw_rtp_port_mss, - { int2str(cpars.rtp_payload_type) }, - { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, - cpars.rtp_sdp_format)), - valueof(ts_SDP_ptime(20)) })); + var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); /* MSC acknowledges the MNCC_CREATE to the MNCC handler */ MNCC.receive(tr_MNCC_RTP_CREATE(cpars.mncc_callref)); @@ -626,13 +629,7 @@ interleave { /* Second MGCP CRCX (this time for MSS/CN side) */ [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { - var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, - hex2str(cpars.mgcp_call_id), "42", - cpars.mgw_rtp_port_mss, - { int2str(cpars.rtp_payload_type) }, - { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, - cpars.rtp_sdp_format)), - valueof(ts_SDP_ptime(20)) })); + var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); /* Alerting */ -- To view, visit https://gerrit.osmocom.org/13727 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I90546249c41de8f99ce4a558e76cb46597413518 Gerrit-Change-Number: 13727 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 15:45:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 15:45:51 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Add f_expect_paging() rather than using tr_BSSMAP_Paging directly Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13728 Change subject: Add f_expect_paging() rather than using tr_BSSMAP_Paging directly ...................................................................... Add f_expect_paging() rather than using tr_BSSMAP_Paging directly this will ease the introduction of RANAP support Change-Id: I213303337373c349676be4f8ac4175acdc701e47 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 14 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/28/13728/1 diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 0eace36..b3345ff 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -553,6 +553,11 @@ MNCC.receive(tr_MNCC_SETUP_cnf(cpars.mncc_callref)); } +function f_expect_paging(boolean by_tmsi := true) +runs on BSC_ConnHdlr { + BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); +} + function f_mt_call_establish(inout CallParameters cpars) runs on BSC_ConnHdlr { @@ -561,7 +566,7 @@ /* BSC <- MSC: Expect paging. FIXME: By TMSI or not? */ f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging() /* Complete the call via BSSAP */ f_mt_call_complete(cpars); diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index a9eb316..6ad8860 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -1443,7 +1443,8 @@ hex2str(cpars.called_party), hex2str(g_pars.imsi))); /* MSC->BSC: expect PAGING from MSC */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging(); + /* MS -> MSC: PAGING RESPONSE */ f_establish_fully(EST_TYPE_PAG_RESP); @@ -2022,7 +2023,8 @@ f_vty_sms_send(hex2str(pars.imsi), "2342", "Hello SMS"); /* MSC->BSC: expect PAGING from MSC */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging(); + /* Establish DTAP / BSSAP / SCCP connection */ f_establish_fully(EST_TYPE_PAG_RESP); @@ -2326,7 +2328,7 @@ f_gsup_forwardSM_req(spars); /* Expect Paging Request and Establish DTAP / BSSAP / SCCP connection */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging(); f_establish_fully(EST_TYPE_PAG_RESP); /* Wait for MT SMS on DTAP */ @@ -2391,7 +2393,7 @@ f_gsup_forwardSM_req(spars); /* Expect Paging Request and Establish DTAP / BSSAP / SCCP connection */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging(); f_establish_fully(EST_TYPE_PAG_RESP); /* Wait for MT SMS on DTAP */ @@ -2451,7 +2453,7 @@ f_gsup_forwardSM_req(spars1); /* Expect Paging Request and Establish DTAP / BSSAP / SCCP connection */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging(); f_establish_fully(EST_TYPE_PAG_RESP); /* Wait for 1st MT SMS on DTAP */ @@ -2785,7 +2787,7 @@ } /* MSC->BSC: expect PAGING from MSC */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging(); /* Establish DTAP / BSSAP / SCCP connection */ f_establish_fully(EST_TYPE_PAG_RESP); SMPP.receive(tr_SMPP(c_SMPP_command_id_alert_notification, ESME_ROK)); -- To view, visit https://gerrit.osmocom.org/13728 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I213303337373c349676be4f8ac4175acdc701e47 Gerrit-Change-Number: 13728 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 15:45:52 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 15:45:52 +0000 Subject: Change in osmo-ttcn3-hacks[master]: f_perform_lu(): Use f_expect_clear(), reduce code duplication Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13729 Change subject: f_perform_lu(): Use f_expect_clear(), reduce code duplication ...................................................................... f_perform_lu(): Use f_expect_clear(), reduce code duplication Change-Id: I64b183ad6615f2b0b9565a711de87fe4249625a1 --- M msc/BSC_ConnectionHandler.ttcn 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/29/13729/1 diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index b3345ff..db0e683 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -384,9 +384,7 @@ f_expect_mm_info(); /* FIXME: there could be pending SMS or other common procedures by the MSC, let's ignore them */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + f_expect_clear(); setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/13729 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I64b183ad6615f2b0b9565a711de87fe4249625a1 Gerrit-Change-Number: 13729 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 15:45:52 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Apr 2019 15:45:52 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: Allow test cases to specify RAN index Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13730 Change subject: MSC_Tests: Allow test cases to specify RAN index ...................................................................... MSC_Tests: Allow test cases to specify RAN index This allows to start ConnHdlr on specific RAN connections, i.e. on different emulated BSCs (and soon RNCs). Change-Id: I3d7ec567a7b69d8c6f79d26971bf1c94e077d5f5 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 12 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/30/13730/1 diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index db0e683..4534a9b 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -74,7 +74,8 @@ boolean ipa_ctrl_enable, boolean mm_info, boolean sgsap_enable, - boolean gsup_enable + boolean gsup_enable, + integer ran_idx }; /* get a one-octet bitmaks of supported algorithms based on Classmark information */ diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 6ad8860..8c221dc 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -485,7 +485,8 @@ type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; /* FIXME: move into BSC_ConnectionHandler? */ -function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup := true) runs on MTC_CT return BSC_ConnHdlrPars { +function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup := true, integer ran_idx := 0) +runs on MTC_CT return BSC_ConnHdlrPars { var BSC_ConnHdlrNetworkPars net_pars := { kc_support := '0A'O, /* A5/1 and A5/3 enabled */ expect_tmsi := true, @@ -493,8 +494,8 @@ expect_ciph := false }; var BSC_ConnHdlrPars pars := { - sccp_addr_own := g_bssap[0].sccp_addr_own, - sccp_addr_peer := g_bssap[0].sccp_addr_peer, + sccp_addr_own := g_bssap[ran_idx].sccp_addr_own, + sccp_addr_peer := g_bssap[ran_idx].sccp_addr_peer, cell_id := valueof(ts_CellId_CGI('262'H, '42'H, 23, 42)), imei := f_gen_imei(imsi_suffix), imsi := f_gen_imsi(imsi_suffix), @@ -511,7 +512,8 @@ ipa_ctrl_enable := true, mm_info := mp_mm_info, sgsap_enable := sgsap, - gsup_enable := gsup + gsup_enable := gsup, + ran_idx := ran_idx }; return pars; } @@ -522,8 +524,8 @@ vc_conn := BSC_ConnHdlr.create(id); /* BSSMAP part / A interface */ - connect(vc_conn:BSSAP, g_bssap[0].vc_RAN:CLIENT); - connect(vc_conn:BSSAP_PROC, g_bssap[0].vc_RAN:PROC); + connect(vc_conn:BSSAP, g_bssap[pars.ran_idx].vc_RAN:CLIENT); + connect(vc_conn:BSSAP_PROC, g_bssap[pars.ran_idx].vc_RAN:PROC); /* MNCC part */ connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT); connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC); @@ -550,8 +552,8 @@ return vc_conn; } -function f_start_handler(void_fn fn, integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlr { - return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix)); +function f_start_handler(void_fn fn, integer imsi_suffix, integer ran_idx := 0) runs on MTC_CT return BSC_ConnHdlr { + return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix, ran_idx := ran_idx)); } private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { -- To view, visit https://gerrit.osmocom.org/13730 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3d7ec567a7b69d8c6f79d26971bf1c94e077d5f5 Gerrit-Change-Number: 13730 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 20:24:34 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 21 Apr 2019 20:24:34 +0000 Subject: Change in osmocom-bb[master]: l1ctl_proto.h: add extended RACH (11-bit) message Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13731 Change subject: l1ctl_proto.h: add extended RACH (11-bit) message ...................................................................... l1ctl_proto.h: add extended RACH (11-bit) message Change-Id: Iae0267a31b3314c990eb41acb2f570ca3219021c --- M include/l1ctl_proto.h 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/31/13731/1 diff --git a/include/l1ctl_proto.h b/include/l1ctl_proto.h index c6156f5..05d65de 100644 --- a/include/l1ctl_proto.h +++ b/include/l1ctl_proto.h @@ -64,6 +64,9 @@ L1CTL_DATA_TBF_REQ, L1CTL_DATA_TBF_CONF, + + /* Extended (11-bit) RACH (see 3GPP TS 05.02, section 5.2.7) */ + L1CTL_EXT_RACH_REQ, }; enum ccch_mode { @@ -238,6 +241,15 @@ uint16_t offset; } __attribute__((packed)); + +/* the l1_info_ul header is in front */ +struct l1ctl_ext_rach_req { + uint16_t ra11; + uint8_t synch_seq; + uint8_t combined; + uint16_t offset; +} __attribute__((packed)); + /* the l1_info_ul header is in front */ struct l1ctl_par_req { int8_t ta; -- To view, visit https://gerrit.osmocom.org/13731 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iae0267a31b3314c990eb41acb2f570ca3219021c Gerrit-Change-Number: 13731 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 20:24:34 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 21 Apr 2019 20:24:34 +0000 Subject: Change in osmocom-bb[master]: trxcon: introduce extended (11-bit) RACH support Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13732 Change subject: trxcon: introduce extended (11-bit) RACH support ...................................................................... trxcon: introduce extended (11-bit) RACH support According to 3GPP TS 05.03, section 5.3, two coding schemes are specified for access bursts: one for regular 8-bit bursts, another for extended 11-bit packet access bursts. Change-Id: I36fd20cd5502ce33c52f644ee4c22abb83350df8 --- M src/host/trxcon/l1ctl.c M src/host/trxcon/sched_lchan_rach.c 2 files changed, 125 insertions(+), 49 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/32/13732/1 diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c index 97c2496..653ddf3 100644 --- a/src/host/trxcon/l1ctl.c +++ b/src/host/trxcon/l1ctl.c @@ -500,8 +500,9 @@ return rc; } -static int l1ctl_rx_rach_req(struct l1ctl_link *l1l, struct msgb *msg) +static int l1ctl_rx_rach_req(struct l1ctl_link *l1l, struct msgb *msg, bool ext) { + struct l1ctl_ext_rach_req *ext_req; struct l1ctl_rach_req *req; struct l1ctl_info_ul *ul; struct trx_ts_prim *prim; @@ -510,11 +511,25 @@ int rc; ul = (struct l1ctl_info_ul *) msg->l1h; - req = (struct l1ctl_rach_req *) ul->payload; - len = sizeof(struct l1ctl_rach_req); - /* Convert offset value to host format */ - req->offset = ntohs(req->offset); + /* Is it extended (11-bit) RACH or not? */ + if (ext) { + ext_req = (struct l1ctl_ext_rach_req *) ul->payload; + ext_req->offset = ntohs(ext_req->offset); + ext_req->ra11 = ntohs(ext_req->ra11); + len = sizeof(*ext_req); + + LOGP(DL1C, LOGL_NOTICE, "Received extended (11-bit) RACH request " + "(offset=%u, synch_seq=%u, ra11=0x%02hx)\n", + ext_req->offset, ext_req->synch_seq, ext_req->ra11); + } else { + req = (struct l1ctl_rach_req *) ul->payload; + req->offset = ntohs(req->offset); + len = sizeof(*req); + + LOGP(DL1C, LOGL_NOTICE, "Received regular (8-bit) RACH request " + "(offset=%u, ra=0x%02x)\n", req->offset, req->ra); + } /** * FIXME: l1ctl_info_ul doesn't provide channel description @@ -523,9 +538,6 @@ chan_nr = 0x88; link_id = 0x00; - LOGP(DL1C, LOGL_NOTICE, "Received RACH request " - "(offset=%u ra=0x%02x)\n", req->offset, req->ra); - /* Init a new primitive */ rc = sched_prim_init(l1l->trx, &prim, len, chan_nr, link_id); if (rc) @@ -544,7 +556,7 @@ } /* Fill in the payload */ - memcpy(prim->payload, req, len); + memcpy(prim->payload, ul->payload, len); exit: msgb_free(msg); @@ -845,7 +857,9 @@ case L1CTL_CCCH_MODE_REQ: return l1ctl_rx_ccch_mode_req(l1l, msg); case L1CTL_RACH_REQ: - return l1ctl_rx_rach_req(l1l, msg); + return l1ctl_rx_rach_req(l1l, msg, false); + case L1CTL_EXT_RACH_REQ: + return l1ctl_rx_rach_req(l1l, msg, true); case L1CTL_DM_EST_REQ: return l1ctl_rx_dm_est_req(l1l, msg); case L1CTL_DM_REL_REQ: diff --git a/src/host/trxcon/sched_lchan_rach.c b/src/host/trxcon/sched_lchan_rach.c index ecf5df8..b2e5f9f 100644 --- a/src/host/trxcon/sched_lchan_rach.c +++ b/src/host/trxcon/sched_lchan_rach.c @@ -40,68 +40,130 @@ #include "trx_if.h" #include "l1ctl.h" -/** - * 8-bit RACH extended tail bits - * GSM 05.02 Chapter 5.2.7 Access burst (AB) - */ +/* FIXME: we need a better way to identify / distinguish primitives */ +#define PRIM_IS_EXT_RACH(prim) \ + (prim->payload_len == sizeof(struct l1ctl_ext_rach_req)) +#define PRIM_IS_RACH(prim) \ + (prim->payload_len == sizeof(struct l1ctl_rach_req)) -static ubit_t rach_ext_tail_bits[] = { +/* 3GPP TS 05.02, section 5.2.7 "Access burst (AB)" */ +#define RACH_EXT_TAIL_BITS_LEN 8 +#define RACH_SYNCH_SEQ_LEN 41 +#define RACH_PAYLOAD_LEN 36 + +/* Extended tail bits (BN0..BN7) */ +static const ubit_t rach_ext_tail_bits[] = { 0, 0, 1, 1, 1, 0, 1, 0, }; -/** - * 41-bit RACH synchronization sequence - * GSM 05.02 Chapter 5.2.7 Access burst (AB) - */ -static ubit_t rach_synch_seq[] = { - 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, - 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, +/* Synchronization (training) sequence types */ +enum rach_synch_seq_t { + RACH_SYNCH_SEQ_UNKNOWN = -1, + RACH_SYNCH_SEQ_TS0, /* GSM, GMSK (default) */ + RACH_SYNCH_SEQ_TS1, /* EGPRS, 8-PSK */ + RACH_SYNCH_SEQ_TS2, /* EGPRS, GMSK */ + RACH_SYNCH_SEQ_NUM +}; + +/* Synchronization (training) sequence bits */ +static const char rach_synch_seq_bits[RACH_SYNCH_SEQ_NUM][RACH_SYNCH_SEQ_LEN] = { + [RACH_SYNCH_SEQ_TS0] = "01001011011111111001100110101010001111000", + [RACH_SYNCH_SEQ_TS1] = "01010100111110001000011000101111001001101", + [RACH_SYNCH_SEQ_TS2] = "11101111001001110101011000001101101110111", +}; + +/* Synchronization (training) sequence names */ +static struct value_string rach_synch_seq_names[] = { + { RACH_SYNCH_SEQ_UNKNOWN, "UNKNOWN" }, + { RACH_SYNCH_SEQ_TS0, "TS0: GSM, GMSK" }, + { RACH_SYNCH_SEQ_TS1, "TS1: EGPRS, 8-PSK" }, + { RACH_SYNCH_SEQ_TS2, "TS2: EGPRS, GMSK" }, + { 0, NULL }, }; /* Obtain a to-be-transmitted RACH burst */ int tx_rach_fn(struct trx_instance *trx, struct trx_ts *ts, struct trx_lchan_state *lchan, uint32_t fn, uint8_t bid) { - struct l1ctl_rach_req *req; + struct l1ctl_ext_rach_req *ext_req = NULL; + struct l1ctl_rach_req *req = NULL; + enum rach_synch_seq_t synch_seq; uint8_t burst[GSM_BURST_LEN]; + uint8_t *burst_ptr = burst; uint8_t payload[36]; - int rc; + int i, rc; - /* Check the prim payload length */ - if (lchan->prim->payload_len != sizeof(*req)) { - LOGP(DSCHD, LOGL_ERROR, "Primitive has odd length %zu (expected %zu), " - "so dropping...\n", lchan->prim->payload_len, sizeof(*req)); + /* Is it extended (11-bit) RACH or not? */ + if (PRIM_IS_EXT_RACH(lchan->prim)) { + ext_req = (struct l1ctl_ext_rach_req *) lchan->prim->payload; + synch_seq = ext_req->synch_seq; + /* Delay sending according to offset value */ + if (ext_req->offset-- > 0) + return 0; + + /* Chose a synch. sequence */ + if (synch_seq >= RACH_SYNCH_SEQ_NUM) { + LOGP(DSCHD, LOGL_ERROR, "Unknown RACH synch. sequence=0x%02x\n", synch_seq); + + /* Forget this primitive */ + sched_prim_drop(lchan); + return -ENOTSUP; + } + + /* Encode extended (11-bit) payload */ + rc = gsm0503_rach_ext_encode(payload, ext_req->ra11, trx->bsic, true); + if (rc) { + LOGP(DSCHD, LOGL_ERROR, "Could not encode extended RACH burst\n"); + + /* Forget this primitive */ + sched_prim_drop(lchan); + return rc; + } + } else if (PRIM_IS_RACH(lchan->prim)) { + req = (struct l1ctl_rach_req *) lchan->prim->payload; + synch_seq = RACH_SYNCH_SEQ_TS0; + + /* Delay sending according to offset value */ + if (req->offset-- > 0) + return 0; + + /* Encode regular (8-bit) payload */ + rc = gsm0503_rach_ext_encode(payload, req->ra, trx->bsic, false); + if (rc) { + LOGP(DSCHD, LOGL_ERROR, "Could not encode RACH burst\n"); + + /* Forget this primitive */ + sched_prim_drop(lchan); + return rc; + } + } else { + LOGP(DSCHD, LOGL_ERROR, "Primitive has odd length %zu (expected %zu or %zu), " + "so dropping...\n", lchan->prim->payload_len, + sizeof(*req), sizeof(*ext_req)); sched_prim_drop(lchan); return -EINVAL; } - /* Get the payload from a current primitive */ - req = (struct l1ctl_rach_req *) lchan->prim->payload; - /* Delay RACH sending according to offset value */ - if (req->offset-- > 0) - return 0; + /* BN0-7: extended tail bits */ + memcpy(burst_ptr, rach_ext_tail_bits, RACH_EXT_TAIL_BITS_LEN); + burst_ptr += RACH_EXT_TAIL_BITS_LEN; - /* Encode (8-bit) payload */ - rc = gsm0503_rach_ext_encode(payload, req->ra, trx->bsic, false); - if (rc) { - LOGP(DSCHD, LOGL_ERROR, "Could not encode RACH burst\n"); + /* BN8-48: chosen synch. (training) sequence */ + for (i = 0; i < RACH_SYNCH_SEQ_LEN; i++) + *(burst_ptr++) = rach_synch_seq_bits[synch_seq][i] == '1'; - /* Forget this primitive */ - sched_prim_drop(lchan); + /* BN49-84: encrypted bits (the payload) */ + memcpy(burst_ptr, payload, RACH_PAYLOAD_LEN); + burst_ptr += RACH_PAYLOAD_LEN; - return rc; - } + /* BN85-156: tail bits & extended guard period */ + memset(burst_ptr, 0, burst + GSM_BURST_LEN - burst_ptr); - /* Compose RACH burst */ - memcpy(burst, rach_ext_tail_bits, 8); /* TB */ - memcpy(burst + 8, rach_synch_seq, 41); /* sync seq */ - memcpy(burst + 49, payload, 36); /* payload */ - memset(burst + 85, 0, 63); /* TB + GP */ - - LOGP(DSCHD, LOGL_DEBUG, "Transmitting RACH fn=%u\n", fn); + LOGP(DSCHD, LOGL_DEBUG, "Transmitting %s RACH (%s) fn=%u\n", + PRIM_IS_EXT_RACH(lchan->prim) ? "extended (11-bit)" : "regular (8-bit)", + get_value_string(rach_synch_seq_names, synch_seq), fn); /* Forward burst to scheduler */ rc = sched_trx_handle_tx_burst(trx, ts, lchan, fn, burst); -- To view, visit https://gerrit.osmocom.org/13732 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I36fd20cd5502ce33c52f644ee4c22abb83350df8 Gerrit-Change-Number: 13732 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 22:13:47 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 21 Apr 2019 22:13:47 +0000 Subject: Change in osmocom-bb[master]: l1ctl_proto.h: add extended RACH (11-bit) request message In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13731 ) Change subject: l1ctl_proto.h: add extended RACH (11-bit) request message ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13731 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iae0267a31b3314c990eb41acb2f570ca3219021c Gerrit-Change-Number: 13731 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sun, 21 Apr 2019 22:13:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 21 22:13:55 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 21 Apr 2019 22:13:55 +0000 Subject: Change in osmocom-bb[master]: trxcon: introduce extended (11-bit) RACH support In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13732 ) Change subject: trxcon: introduce extended (11-bit) RACH support ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13732 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I36fd20cd5502ce33c52f644ee4c22abb83350df8 Gerrit-Change-Number: 13732 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sun, 21 Apr 2019 22:13:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 00:02:00 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 22 Apr 2019 00:02:00 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library/L1CTL_Types.ttcn: fix: add missing L1CTL_BURST_IND message Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13733 Change subject: library/L1CTL_Types.ttcn: fix: add missing L1CTL_BURST_IND message ...................................................................... library/L1CTL_Types.ttcn: fix: add missing L1CTL_BURST_IND message Change-Id: Ibf75792be70f694bca9222ec6568371475d193bb --- M library/L1CTL_Types.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/33/13733/1 diff --git a/library/L1CTL_Types.ttcn b/library/L1CTL_Types.ttcn index 4273ba3..ae800b0 100644 --- a/library/L1CTL_Types.ttcn +++ b/library/L1CTL_Types.ttcn @@ -42,6 +42,7 @@ L1CTL_TRAFFIC_REQ, L1CTL_TRAFFIC_CONF, L1CTL_TRAFFIC_IND, + L1CTL_BURST_IND, L1CTL_TBF_CFG_REQ, L1CTL_TBF_CFG_CONF, L1CTL_DATA_TBF_REQ, -- To view, visit https://gerrit.osmocom.org/13733 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf75792be70f694bca9222ec6568371475d193bb Gerrit-Change-Number: 13733 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 00:02:01 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 22 Apr 2019 00:02:01 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13734 Change subject: library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message ...................................................................... library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message According to 3GPP TS 04.60, section 11.2.5a, the extended (11-bit) Access Burst on RACH/PRACH is used by the MS to indicate its EGPRS capability. One of the alternative synch. sequences (see 3GPP TS 05.02, TS1 and TS2) shall be used. Change-Id: If037cb2f2687697f168d10a033eeb20d20183328 Related: OS#1854 --- M library/L1CTL_Types.ttcn 1 file changed, 42 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/34/13734/1 diff --git a/library/L1CTL_Types.ttcn b/library/L1CTL_Types.ttcn index ae800b0..6ffbbb8 100644 --- a/library/L1CTL_Types.ttcn +++ b/library/L1CTL_Types.ttcn @@ -47,7 +47,8 @@ L1CTL_TBF_CFG_CONF, L1CTL_DATA_TBF_REQ, L1CTL_DATA_TBF_CONF, - L1CTL_DATA_ABS_REQ + L1CTL_EXT_RACH_REQ, + L1CTL_DATA_ABS_REQ /*!< FIXME: no such message in OsmocomBB */ } with { variant "FIELDLENGTH(8)" }; type enumerated L1ctlCcchMode { @@ -256,6 +257,19 @@ uint16_t offset } with { variant "" }; + type enumerated L1ctlRachSynchSeq { + RACH_SYNCH_SEQ_TS0 (0), + RACH_SYNCH_SEQ_TS1, + RACH_SYNCH_SEQ_TS2 + } with { variant "FIELDLENGTH(8)" }; + + type record L1ctlExtRachReq { + uint16_t ra11, + L1ctlRachSynchSeq synch_seq, + uint8_t combined, + uint16_t offset + } with { variant "" }; + type record L1ctlParReq { int8_t ta, uint8_t tx_power, @@ -317,6 +331,7 @@ L1ctlCcchModeReq ccch_mode_req, L1ctlTchModeReq tch_mode_req, L1ctlRachReq rach_req, + L1ctlExtRachReq ext_rach_req, L1ctlParReq par_req, L1ctlDmEstReq dm_est_req, L1ctlReset reset_req, @@ -337,6 +352,7 @@ L1ctlUlAbsInfo ul_info_abs optional, L1ctlUlPayload payload } with { variant (ul_info) "PRESENCE(header.msg_type = L1CTL_RACH_REQ, + header.msg_type = L1CTL_EXT_RACH_REQ, header.msg_type = L1CTL_PARAM_REQ, header.msg_type = L1CTL_CRYPTO_REQ, header.msg_type = L1CTL_DATA_REQ, @@ -350,6 +366,7 @@ ccch_mode_req, header.msg_type = L1CTL_CCCH_MODE_REQ; tch_mode_req, header.msg_type = L1CTL_TCH_MODE_REQ; rach_req, header.msg_type = L1CTL_RACH_REQ; + ext_rach_req, header.msg_type = L1CTL_EXT_RACH_REQ; par_req, header.msg_type = L1CTL_PARAM_REQ; dm_est_req, header.msg_type = L1CTL_DM_EST_REQ; reset_req, header.msg_type = L1CTL_RESET_REQ; @@ -464,6 +481,7 @@ template L1ctlUlMessage ts_L1CTL_RACH_REQ(uint8_t ra, uint8_t combined, uint16_t offset) := { header := ts_L1ctlHeader(L1CTL_RACH_REQ), ul_info := { + /* FIXME: both RSL chan_nr and link_id should be configurable */ chan_nr := t_RslChanNr_RACH(0), link_id := ts_RslLinkID_DCCH(0), padding := '0000'O @@ -479,6 +497,29 @@ } } + template L1ctlUlMessage ts_L1CTL_EXT_RACH_REQ( + uint16_t ra11, L1ctlRachSynchSeq seq, + uint8_t combined, uint16_t offset + ) := { + header := ts_L1ctlHeader(L1CTL_EXT_RACH_REQ), + ul_info := { + /* FIXME: both RSL chan_nr and link_id should be configurable */ + chan_nr := t_RslChanNr_RACH(0), + link_id := ts_RslLinkID_DCCH(0), + padding := '0000'O + }, + ul_info_tbf := omit, + ul_info_abs := omit, + payload := { + ext_rach_req := { + ra11 := ra11, + synch_seq := seq, + combined := combined, + offset := offset + } + } + } + template L1ctlUlMessage ts_L1CTL_PAR_REQ(uint8_t ta, uint8_t tx_power) := { header := ts_L1ctlHeader(L1CTL_PARAM_REQ), ul_info := { -- To view, visit https://gerrit.osmocom.org/13734 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If037cb2f2687697f168d10a033eeb20d20183328 Gerrit-Change-Number: 13734 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 00:02:01 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 22 Apr 2019 00:02:01 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13735 Change subject: BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH ...................................................................... BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH According to 3GPP TS 04.60, section 11.2.5a, the extended (11-bit) Access Burst on RACH/PRACH is used by the MS to indicate its EGPRS capability. One of the alternative synch. sequences (see 3GPP TS 05.02, TS1 and TS2) shall be used. Add a test case to verify extended (11-bit) RACH decoding. Depends: (OsmocomBB) I36fd20cd5502ce33c52f644ee4c22abb83350df8 Change-Id: I8fe156aeac9de3dc1e71a4950821d4942ba9a253 Related: OS#1854 --- M bts/BTS_Tests.ttcn M bts/expected-results.xml M library/L1CTL_PortType.ttcn 3 files changed, 89 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/35/13735/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index e617323..3dd600a 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -989,6 +989,13 @@ return ra; } +/* generate a random 11-bit RA (packet-switched only) */ +private function f_rnd_ra11_ps() return BIT11 { + /* 2047 is 0x7ff (0b11111111111) */ + var integer ra11 := f_rnd_int(2047); + return int2bit(ra11, 11); +} + /* Send 1000 RACH requests and check their RA+FN on the RSL side */ testcase TC_rach_content() runs on test_CT { f_init(testcasename()); @@ -2969,6 +2976,64 @@ setverdict(pass); } +/* Send extended (11-bit, TS1 & TS2) RACH bursts from the Um side, + * expect them to show up on PCU socket (with proper BURST_TYPE_*). */ +testcase TC_pcu_ext_rach_content() runs on test_CT { + var template PCUIF_Message pcu_rach_ind; + var GsmFrameNumber fn_last := 0; + var L1ctlRachSynchSeq synch_seq; + var PCUIF_BurstType pcu_bt; + var GsmFrameNumber fn; + var BIT11 ra11; + + f_init_pcu_test(); + f_init_l1ctl(); + f_l1_tune(L1CTL); + + for (var integer i := 0; i < 1000; i := i+1) { + /* We need to test both TS1 & TS2 */ + if (i rem 2 == 0) { + synch_seq := RACH_SYNCH_SEQ_TS1; + pcu_bt := BURST_TYPE_1; + } else { + synch_seq := RACH_SYNCH_SEQ_TS2; + pcu_bt := BURST_TYPE_2; + } + + ra11 := f_rnd_ra11_ps(); + fn := f_L1CTL_EXT_RACH(L1CTL, bit2int(ra11), synch_seq); + if (fn == fn_last) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "Two RACH in same FN?!?"); + } + fn_last := fn; + + /* Compose the expected message */ + pcu_rach_ind := tr_PCUIF_RACH_IND( + bts_nr := 0, + ra := bit2int(ra11), + is_11bit := 1, + burst_type := pcu_bt, + fn := fn); + + timer T := 2.0; + T.start; + alt { + [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, pcu_rach_ind)) { + T.stop; + } + [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RACH_IND)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Unexpected RACH IND"); + } + [] PCU.receive { repeat; } + [] T.timeout { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for RACH IND"); + } + } + } + setverdict(pass); +} + private function f_pad_oct(octetstring str, integer len, OCT1 pad) return octetstring { var integer strlen := lengthof(str); for (var integer i := 0; i < len-strlen; i := i+1) { @@ -4311,6 +4376,7 @@ execute( TC_pcu_data_req_agch() ); execute( TC_pcu_data_req_imm_ass_pch() ); execute( TC_pcu_rach_content() ); + execute( TC_pcu_ext_rach_content() ); execute( TC_pcu_paging_from_rsl() ); } else { log("PCU socket path not available, skipping PCU tests"); diff --git a/bts/expected-results.xml b/bts/expected-results.xml index 2eadffd..7d89da3 100644 --- a/bts/expected-results.xml +++ b/bts/expected-results.xml @@ -77,6 +77,7 @@ + diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn index 8e03c02..7dac4c3 100644 --- a/library/L1CTL_PortType.ttcn +++ b/library/L1CTL_PortType.ttcn @@ -87,6 +87,28 @@ return fn; } + function f_L1CTL_EXT_RACH( + L1CTL_PT pt, uint16_t ra11, L1ctlRachSynchSeq seq, + uint8_t combined := 1, uint16_t offset := 0 + ) return GsmFrameNumber { + var L1ctlDlMessage rc; + var GsmFrameNumber fn; + timer T := 2.0; + + T.start; + pt.send(ts_L1CTL_EXT_RACH_REQ(ra11, seq, combined, offset)); + alt { + [] pt.receive(tr_L1CTL_RACH_CONF) -> value rc { fn := rc.dl_info.frame_nr }; + [] pt.receive { repeat; }; + [] T.timeout { + setverdict(fail, "Timeout in extended RACH"); + mtc.stop; + } + } + + return fn; + } + function f_L1CTL_PARAM(L1CTL_PT pt, uint8_t ta, uint8_t tx_power) { pt.send(ts_L1CTL_PAR_REQ(ta, tx_power)); } -- To view, visit https://gerrit.osmocom.org/13735 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8fe156aeac9de3dc1e71a4950821d4942ba9a253 Gerrit-Change-Number: 13735 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 00:12:40 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 22 Apr 2019 00:12:40 +0000 Subject: Change in osmocom-bb[master]: l1ctl_proto.h: add extended RACH (11-bit) request message In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13731 ) Change subject: l1ctl_proto.h: add extended RACH (11-bit) request message ...................................................................... Patch Set 2: Verified+1 Verified using a TTCN-3 test case from I8fe156aeac9de3dc1e71a4950821d4942ba9a253. -- To view, visit https://gerrit.osmocom.org/13731 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iae0267a31b3314c990eb41acb2f570ca3219021c Gerrit-Change-Number: 13731 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 22 Apr 2019 00:12:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 00:12:55 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 22 Apr 2019 00:12:55 +0000 Subject: Change in osmocom-bb[master]: trxcon: introduce extended (11-bit) RACH support In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13732 ) Change subject: trxcon: introduce extended (11-bit) RACH support ...................................................................... Patch Set 2: Verified+1 Verified using a TTCN-3 test case from I8fe156aeac9de3dc1e71a4950821d4942ba9a253. -- To view, visit https://gerrit.osmocom.org/13732 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I36fd20cd5502ce33c52f644ee4c22abb83350df8 Gerrit-Change-Number: 13732 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 22 Apr 2019 00:12:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 08:15:58 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 08:15:58 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library/L1CTL_Types.ttcn: fix: add missing L1CTL_BURST_IND message In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13733 ) Change subject: library/L1CTL_Types.ttcn: fix: add missing L1CTL_BURST_IND message ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13733 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibf75792be70f694bca9222ec6568371475d193bb Gerrit-Change-Number: 13733 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 22 Apr 2019 08:15:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 08:16:27 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 08:16:27 +0000 Subject: Change in osmocom-bb[master]: l1ctl_proto.h: add extended RACH (11-bit) request message In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13731 ) Change subject: l1ctl_proto.h: add extended RACH (11-bit) request message ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13731 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iae0267a31b3314c990eb41acb2f570ca3219021c Gerrit-Change-Number: 13731 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 22 Apr 2019 08:16:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 08:17:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 08:17:08 +0000 Subject: Change in osmocom-bb[master]: trxcon: introduce extended (11-bit) RACH support In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13732 ) Change subject: trxcon: introduce extended (11-bit) RACH support ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13732 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I36fd20cd5502ce33c52f644ee4c22abb83350df8 Gerrit-Change-Number: 13732 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 22 Apr 2019 08:17:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 08:17:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 08:17:54 +0000 Subject: Change in osmo-iuh[master]: iu_client: Implement transmission of ResetAcknowledge In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13721 ) Change subject: iu_client: Implement transmission of ResetAcknowledge ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13721 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia09752983a7e2a952aa144635924edbffd894058 Gerrit-Change-Number: 13721 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 22 Apr 2019 08:17:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 08:17:56 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 08:17:56 +0000 Subject: Change in osmo-iuh[master]: ranap_msg_factory: Fix criticality of PDUs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13722 ) Change subject: ranap_msg_factory: Fix criticality of PDUs ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13722 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I98eec0bdc0d0cb1b9284bd5d042b1f4403abef95 Gerrit-Change-Number: 13722 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 22 Apr 2019 08:17:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 08:18:04 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 08:18:04 +0000 Subject: Change in osmo-iuh[master]: iu_client: Implement transmission of ResetAcknowledge In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13721 ) Change subject: iu_client: Implement transmission of ResetAcknowledge ...................................................................... iu_client: Implement transmission of ResetAcknowledge When receiving an Iu Reset, respond with Iu ResetAcknowledge. Closes: OS#3944 Change-Id: Ia09752983a7e2a952aa144635924edbffd894058 --- M src/iu_client.c 1 file changed, 19 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/iu_client.c b/src/iu_client.c index 4aecfec..92d25f5 100644 --- a/src/iu_client.c +++ b/src/iu_client.c @@ -603,8 +603,24 @@ static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) { - /* FIXME: send reset response */ - return -1; + struct osmo_scu_prim *prim = (struct osmo_scu_prim *) ctx; + struct osmo_scu_unitdata_param *ud_prim = &prim->u.unitdata; + RANAP_GlobalRNC_ID_t *grnc_id = NULL; + struct msgb *resp; + + OSMO_ASSERT(prim->oph.primitive == OSMO_SCU_PRIM_N_UNITDATA); + + /* FIXME: verify ies.cN_DomainIndicator */ + + if (ies->presenceMask & RESETIES_RANAP_GLOBALRNC_ID_PRESENT) + grnc_id = &ies->globalRNC_ID; + + /* send reset response */ + resp = ranap_new_msg_reset_ack(ies->cN_DomainIndicator, grnc_id); + if (!resp) + return -ENOMEM; + resp->l2h = resp->data; + return osmo_sccp_tx_unitdata_msg(g_scu, &g_local_sccp_addr, &ud_prim->calling_addr, resp); } static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) @@ -795,7 +811,7 @@ /* connection-less data received */ LOGPIU(LOGL_DEBUG, "N-UNITDATA.ind(%s)\n", osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); - rc = ranap_cn_rx_cl(cn_ranap_handle_cl, scu, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + rc = ranap_cn_rx_cl(cn_ranap_handle_cl, prim, msgb_l2(oph->msg), msgb_l2len(oph->msg)); break; default: rc = -1; -- To view, visit https://gerrit.osmocom.org/13721 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia09752983a7e2a952aa144635924edbffd894058 Gerrit-Change-Number: 13721 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 08:18:04 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 08:18:04 +0000 Subject: Change in osmo-iuh[master]: ranap_msg_factory: Fix criticality of PDUs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13722 ) Change subject: ranap_msg_factory: Fix criticality of PDUs ...................................................................... ranap_msg_factory: Fix criticality of PDUs Seveal of our RANAP messages were using criticality values at the PDU level differing from what RANAP_PDU_Descriptions.asn states for the respective procedures. Let's fix that. This was discovered while working on the initial IuCS TTCN3 tests, where the receive templates require the criticality to match. Change-Id: I98eec0bdc0d0cb1b9284bd5d042b1f4403abef95 --- M src/ranap_msg_factory.c M src/tests/test-ranap.ok 2 files changed, 10 insertions(+), 10 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/ranap_msg_factory.c b/src/ranap_msg_factory.c index c287f02..2ae2dbf 100644 --- a/src/ranap_msg_factory.c +++ b/src/ranap_msg_factory.c @@ -150,7 +150,7 @@ } msg = ranap_generate_initiating_message(RANAP_ProcedureCode_id_InitialUE_Message, - RANAP_Criticality_reject, + RANAP_Criticality_ignore, &asn_DEF_RANAP_InitialUE_Message, &out); @@ -192,7 +192,7 @@ /* dt -> msg */ msg = ranap_generate_initiating_message(RANAP_ProcedureCode_id_DirectTransfer, - RANAP_Criticality_reject, + RANAP_Criticality_ignore, &asn_DEF_RANAP_DirectTransfer, &dt); @@ -467,7 +467,7 @@ /* out -> msg */ msg = ranap_generate_initiating_message(RANAP_ProcedureCode_id_Paging, - RANAP_Criticality_reject, + RANAP_Criticality_ignore, &asn_DEF_RANAP_Paging, &out); @@ -912,7 +912,7 @@ /* encode the output into the msgb */ msg = ranap_generate_initiating_message(RANAP_ProcedureCode_id_Iu_ReleaseRequest, - RANAP_Criticality_reject, + RANAP_Criticality_ignore, &asn_DEF_RANAP_Iu_ReleaseRequest, &out); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_Iu_ReleaseRequest, &out); @@ -955,7 +955,7 @@ /* encode the output into the msgb */ msg = ranap_generate_initiating_message(RANAP_ProcedureCode_id_RAB_ReleaseRequest, - RANAP_Criticality_reject, + RANAP_Criticality_ignore, &asn_DEF_RANAP_RAB_ReleaseRequest, &out); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_RAB_ReleaseRequest, &out); diff --git a/src/tests/test-ranap.ok b/src/tests/test-ranap.ok index 2a8de8f..a0ea521 100644 --- a/src/tests/test-ranap.ok +++ b/src/tests/test-ranap.ok @@ -23,7 +23,7 @@ 00 -00 14 00 10 00 00 02 00 10 40 04 03 aa bb cc 00 3b 40 01 00 +00 14 40 10 00 00 02 00 10 40 04 03 aa bb cc 00 3b 40 01 00 ==> SECURITY MODE COMMAND @@ -81,7 +81,7 @@ 00 01 23 45 67 -00 0e 00 1e 00 00 03 00 03 40 01 00 00 17 40 09 50 09 71 00 21 43 65 87 f9 00 40 40 05 00 01 23 45 67 +00 0e 40 1e 00 00 03 00 03 40 01 00 00 17 40 09 50 09 71 00 21 43 65 87 f9 00 40 40 05 00 01 23 45 67 ==> RAB ASSIGNMENT COMMAND (VOICE) @@ -194,7 +194,7 @@ 09 01 99 09 26 -00 13 00 36 00 00 06 00 03 40 01 00 00 0f 40 06 00 09 01 99 42 23 00 3a 40 08 00 09 01 99 42 23 42 23 00 10 40 04 03 aa bb cc 00 4f 40 03 00 00 17 00 56 40 05 09 01 99 09 26 +00 13 40 36 00 00 06 00 03 40 01 00 00 0f 40 06 00 09 01 99 42 23 00 3a 40 08 00 09 01 99 42 23 42 23 00 10 40 04 03 aa bb cc 00 4f 40 03 00 00 17 00 56 40 05 09 01 99 09 26 ==> IU RELEASE REQ @@ -202,7 +202,7 @@ 0B 40 -00 0b 00 09 00 00 01 00 04 40 02 0b 40 +00 0b 40 09 00 00 01 00 04 40 02 0b 40 ==> RAB RELEASE REQ @@ -215,7 +215,7 @@ 00 00 01 00 28 40 03 05 C2 D0 -00 0a 00 11 00 00 01 00 29 40 0a 00 00 01 00 28 40 03 05 c2 d0 +00 0a 40 11 00 00 01 00 29 40 0a 00 00 01 00 28 40 03 05 c2 d0 report talloc report on 'asn1_context' (total 0 bytes in 1 blocks) talloc report on 'msgb' (total 0 bytes in 1 blocks) -- To view, visit https://gerrit.osmocom.org/13722 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I98eec0bdc0d0cb1b9284bd5d042b1f4403abef95 Gerrit-Change-Number: 13722 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 08:43:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 08:43:51 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13734 ) Change subject: library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message ...................................................................... Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/13734/1/library/L1CTL_Types.ttcn File library/L1CTL_Types.ttcn: https://gerrit.osmocom.org/#/c/13734/1/library/L1CTL_Types.ttcn at 51 PS1, Line 51: L1CTL_DATA_ABS_REQ /*!< FIXME: no such message in OsmocomBB */ this will break the existing (but long not executed) GPRS/PCU tests using virt_phy. Can you not just simply use the next unallocated message type, rather than changing the numeric value of L1CTL_DATA_ABS_REQ? L1CTL_DATA_ABS_REQ is used to transmit a MAC block at a given fixed frame number. -- To view, visit https://gerrit.osmocom.org/13734 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If037cb2f2687697f168d10a033eeb20d20183328 Gerrit-Change-Number: 13734 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 22 Apr 2019 08:43:51 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 09:04:43 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 22 Apr 2019 09:04:43 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13734 ) Change subject: library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13734/1/library/L1CTL_Types.ttcn File library/L1CTL_Types.ttcn: https://gerrit.osmocom.org/#/c/13734/1/library/L1CTL_Types.ttcn at 51 PS1, Line 51: L1CTL_DATA_ABS_REQ /*!< FIXME: no such message in OsmocomBB */ > L1CTL_DATA_ABS_REQ is used to transmit a MAC block at a given fixed frame number. This message is neither defined in l1ctl_proto.h, not handled in virt_phy, as far as I can see reading the current code of OsmocomBB. Not sure how we can break non-existing stuff... Maybe it's somewhere in a separate branch? Using: git grep L1CTL_DATA_ABS_REQ $(git rev-list --all) I found 8dfe3acd30423c7699e6a871263f37510d1fb9c1 / I77b168791cf972d8e625df54c4653b23f4abcb82, but it's definitely not in master. -- To view, visit https://gerrit.osmocom.org/13734 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If037cb2f2687697f168d10a033eeb20d20183328 Gerrit-Change-Number: 13734 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 22 Apr 2019 09:04:43 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 09:17:27 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 22 Apr 2019 09:17:27 +0000 Subject: Change in osmocom-bb[master]: trxcon: introduce extended (11-bit) RACH support 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/13732 to look at the new patch set (#3). Change subject: trxcon: introduce extended (11-bit) RACH support ...................................................................... trxcon: introduce extended (11-bit) RACH support According to 3GPP TS 05.03, section 5.3, two coding schemes are specified for access bursts: one for regular 8-bit bursts, another - for extended 11-bit packet access bursts. According to 3GPP TS 05.02, section 5.2.7, there are two additional training (synchronization) sequences for RACH bursts: TS1 & TS2. By default, TS0 synch. sequence is used, unless explicitly stated otherwise (see 3GPP TS 04.60). According to 3GPP TS 04.60, section 11.2.5a, the EGPRS capability can be indicated by the MS using an alternative training sequence (i.e. TS1 or TS2) and the 11-bit RACH coding scheme. Change-Id: I36fd20cd5502ce33c52f644ee4c22abb83350df8 --- M src/host/trxcon/l1ctl.c M src/host/trxcon/sched_lchan_rach.c 2 files changed, 125 insertions(+), 49 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/32/13732/3 -- To view, visit https://gerrit.osmocom.org/13732 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I36fd20cd5502ce33c52f644ee4c22abb83350df8 Gerrit-Change-Number: 13732 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 09:17:52 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 22 Apr 2019 09:17:52 +0000 Subject: Change in osmocom-bb[master]: trxcon: introduce extended (11-bit) RACH support In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13732 ) Change subject: trxcon: introduce extended (11-bit) RACH support ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13732 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I36fd20cd5502ce33c52f644ee4c22abb83350df8 Gerrit-Change-Number: 13732 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 22 Apr 2019 09:17:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 09:18:07 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 22 Apr 2019 09:18:07 +0000 Subject: Change in osmocom-bb[master]: l1ctl_proto.h: add extended RACH (11-bit) request message In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13731 ) Change subject: l1ctl_proto.h: add extended RACH (11-bit) request message ...................................................................... l1ctl_proto.h: add extended RACH (11-bit) request message According to 3GPP TS 04.60, section 11.2.5a, the extended (11-bit) Access Burst on RACH/PRACH is used by the MS to indicate its EGPRS capability. One of the alternative synch. sequences (see 3GPP TS 05.02, TS1 and TS2) shall be used. Change-Id: Iae0267a31b3314c990eb41acb2f570ca3219021c --- M include/l1ctl_proto.h 1 file changed, 12 insertions(+), 0 deletions(-) Approvals: Vadim Yanitskiy: Verified Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/l1ctl_proto.h b/include/l1ctl_proto.h index c6156f5..05d65de 100644 --- a/include/l1ctl_proto.h +++ b/include/l1ctl_proto.h @@ -64,6 +64,9 @@ L1CTL_DATA_TBF_REQ, L1CTL_DATA_TBF_CONF, + + /* Extended (11-bit) RACH (see 3GPP TS 05.02, section 5.2.7) */ + L1CTL_EXT_RACH_REQ, }; enum ccch_mode { @@ -238,6 +241,15 @@ uint16_t offset; } __attribute__((packed)); + +/* the l1_info_ul header is in front */ +struct l1ctl_ext_rach_req { + uint16_t ra11; + uint8_t synch_seq; + uint8_t combined; + uint16_t offset; +} __attribute__((packed)); + /* the l1_info_ul header is in front */ struct l1ctl_par_req { int8_t ta; -- To view, visit https://gerrit.osmocom.org/13731 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iae0267a31b3314c990eb41acb2f570ca3219021c Gerrit-Change-Number: 13731 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 09:18:08 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 22 Apr 2019 09:18:08 +0000 Subject: Change in osmocom-bb[master]: trxcon: introduce extended (11-bit) RACH support In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13732 ) Change subject: trxcon: introduce extended (11-bit) RACH support ...................................................................... trxcon: introduce extended (11-bit) RACH support According to 3GPP TS 05.03, section 5.3, two coding schemes are specified for access bursts: one for regular 8-bit bursts, another - for extended 11-bit packet access bursts. According to 3GPP TS 05.02, section 5.2.7, there are two additional training (synchronization) sequences for RACH bursts: TS1 & TS2. By default, TS0 synch. sequence is used, unless explicitly stated otherwise (see 3GPP TS 04.60). According to 3GPP TS 04.60, section 11.2.5a, the EGPRS capability can be indicated by the MS using an alternative training sequence (i.e. TS1 or TS2) and the 11-bit RACH coding scheme. Change-Id: I36fd20cd5502ce33c52f644ee4c22abb83350df8 --- M src/host/trxcon/l1ctl.c M src/host/trxcon/sched_lchan_rach.c 2 files changed, 125 insertions(+), 49 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, approved; Verified Jenkins Builder: Verified diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c index 97c2496..653ddf3 100644 --- a/src/host/trxcon/l1ctl.c +++ b/src/host/trxcon/l1ctl.c @@ -500,8 +500,9 @@ return rc; } -static int l1ctl_rx_rach_req(struct l1ctl_link *l1l, struct msgb *msg) +static int l1ctl_rx_rach_req(struct l1ctl_link *l1l, struct msgb *msg, bool ext) { + struct l1ctl_ext_rach_req *ext_req; struct l1ctl_rach_req *req; struct l1ctl_info_ul *ul; struct trx_ts_prim *prim; @@ -510,11 +511,25 @@ int rc; ul = (struct l1ctl_info_ul *) msg->l1h; - req = (struct l1ctl_rach_req *) ul->payload; - len = sizeof(struct l1ctl_rach_req); - /* Convert offset value to host format */ - req->offset = ntohs(req->offset); + /* Is it extended (11-bit) RACH or not? */ + if (ext) { + ext_req = (struct l1ctl_ext_rach_req *) ul->payload; + ext_req->offset = ntohs(ext_req->offset); + ext_req->ra11 = ntohs(ext_req->ra11); + len = sizeof(*ext_req); + + LOGP(DL1C, LOGL_NOTICE, "Received extended (11-bit) RACH request " + "(offset=%u, synch_seq=%u, ra11=0x%02hx)\n", + ext_req->offset, ext_req->synch_seq, ext_req->ra11); + } else { + req = (struct l1ctl_rach_req *) ul->payload; + req->offset = ntohs(req->offset); + len = sizeof(*req); + + LOGP(DL1C, LOGL_NOTICE, "Received regular (8-bit) RACH request " + "(offset=%u, ra=0x%02x)\n", req->offset, req->ra); + } /** * FIXME: l1ctl_info_ul doesn't provide channel description @@ -523,9 +538,6 @@ chan_nr = 0x88; link_id = 0x00; - LOGP(DL1C, LOGL_NOTICE, "Received RACH request " - "(offset=%u ra=0x%02x)\n", req->offset, req->ra); - /* Init a new primitive */ rc = sched_prim_init(l1l->trx, &prim, len, chan_nr, link_id); if (rc) @@ -544,7 +556,7 @@ } /* Fill in the payload */ - memcpy(prim->payload, req, len); + memcpy(prim->payload, ul->payload, len); exit: msgb_free(msg); @@ -845,7 +857,9 @@ case L1CTL_CCCH_MODE_REQ: return l1ctl_rx_ccch_mode_req(l1l, msg); case L1CTL_RACH_REQ: - return l1ctl_rx_rach_req(l1l, msg); + return l1ctl_rx_rach_req(l1l, msg, false); + case L1CTL_EXT_RACH_REQ: + return l1ctl_rx_rach_req(l1l, msg, true); case L1CTL_DM_EST_REQ: return l1ctl_rx_dm_est_req(l1l, msg); case L1CTL_DM_REL_REQ: diff --git a/src/host/trxcon/sched_lchan_rach.c b/src/host/trxcon/sched_lchan_rach.c index ecf5df8..58e86ae 100644 --- a/src/host/trxcon/sched_lchan_rach.c +++ b/src/host/trxcon/sched_lchan_rach.c @@ -40,68 +40,130 @@ #include "trx_if.h" #include "l1ctl.h" -/** - * 8-bit RACH extended tail bits - * GSM 05.02 Chapter 5.2.7 Access burst (AB) - */ +/* FIXME: we need a better way to identify / distinguish primitives */ +#define PRIM_IS_EXT_RACH(prim) \ + (prim->payload_len == sizeof(struct l1ctl_ext_rach_req)) +#define PRIM_IS_RACH(prim) \ + (prim->payload_len == sizeof(struct l1ctl_rach_req)) -static ubit_t rach_ext_tail_bits[] = { +/* 3GPP TS 05.02, section 5.2.7 "Access burst (AB)" */ +#define RACH_EXT_TAIL_BITS_LEN 8 +#define RACH_SYNCH_SEQ_LEN 41 +#define RACH_PAYLOAD_LEN 36 + +/* Extended tail bits (BN0..BN7) */ +static const ubit_t rach_ext_tail_bits[] = { 0, 0, 1, 1, 1, 0, 1, 0, }; -/** - * 41-bit RACH synchronization sequence - * GSM 05.02 Chapter 5.2.7 Access burst (AB) - */ -static ubit_t rach_synch_seq[] = { - 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, - 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, +/* Synchronization (training) sequence types */ +enum rach_synch_seq_t { + RACH_SYNCH_SEQ_UNKNOWN = -1, + RACH_SYNCH_SEQ_TS0, /* GSM, GMSK (default) */ + RACH_SYNCH_SEQ_TS1, /* EGPRS, 8-PSK */ + RACH_SYNCH_SEQ_TS2, /* EGPRS, GMSK */ + RACH_SYNCH_SEQ_NUM +}; + +/* Synchronization (training) sequence bits */ +static const char rach_synch_seq_bits[RACH_SYNCH_SEQ_NUM][RACH_SYNCH_SEQ_LEN] = { + [RACH_SYNCH_SEQ_TS0] = "01001011011111111001100110101010001111000", + [RACH_SYNCH_SEQ_TS1] = "01010100111110001000011000101111001001101", + [RACH_SYNCH_SEQ_TS2] = "11101111001001110101011000001101101110111", +}; + +/* Synchronization (training) sequence names */ +static struct value_string rach_synch_seq_names[] = { + { RACH_SYNCH_SEQ_UNKNOWN, "UNKNOWN" }, + { RACH_SYNCH_SEQ_TS0, "TS0: GSM, GMSK" }, + { RACH_SYNCH_SEQ_TS1, "TS1: EGPRS, 8-PSK" }, + { RACH_SYNCH_SEQ_TS2, "TS2: EGPRS, GMSK" }, + { 0, NULL }, }; /* Obtain a to-be-transmitted RACH burst */ int tx_rach_fn(struct trx_instance *trx, struct trx_ts *ts, struct trx_lchan_state *lchan, uint32_t fn, uint8_t bid) { - struct l1ctl_rach_req *req; + struct l1ctl_ext_rach_req *ext_req = NULL; + struct l1ctl_rach_req *req = NULL; + enum rach_synch_seq_t synch_seq; uint8_t burst[GSM_BURST_LEN]; + uint8_t *burst_ptr = burst; uint8_t payload[36]; - int rc; + int i, rc; - /* Check the prim payload length */ - if (lchan->prim->payload_len != sizeof(*req)) { - LOGP(DSCHD, LOGL_ERROR, "Primitive has odd length %zu (expected %zu), " - "so dropping...\n", lchan->prim->payload_len, sizeof(*req)); + /* Is it extended (11-bit) RACH or not? */ + if (PRIM_IS_EXT_RACH(lchan->prim)) { + ext_req = (struct l1ctl_ext_rach_req *) lchan->prim->payload; + synch_seq = ext_req->synch_seq; + /* Check requested synch. sequence */ + if (synch_seq >= RACH_SYNCH_SEQ_NUM) { + LOGP(DSCHD, LOGL_ERROR, "Unknown RACH synch. sequence=0x%02x\n", synch_seq); + + /* Forget this primitive */ + sched_prim_drop(lchan); + return -ENOTSUP; + } + + /* Delay sending according to offset value */ + if (ext_req->offset-- > 0) + return 0; + + /* Encode extended (11-bit) payload */ + rc = gsm0503_rach_ext_encode(payload, ext_req->ra11, trx->bsic, true); + if (rc) { + LOGP(DSCHD, LOGL_ERROR, "Could not encode extended RACH burst\n"); + + /* Forget this primitive */ + sched_prim_drop(lchan); + return rc; + } + } else if (PRIM_IS_RACH(lchan->prim)) { + req = (struct l1ctl_rach_req *) lchan->prim->payload; + synch_seq = RACH_SYNCH_SEQ_TS0; + + /* Delay sending according to offset value */ + if (req->offset-- > 0) + return 0; + + /* Encode regular (8-bit) payload */ + rc = gsm0503_rach_ext_encode(payload, req->ra, trx->bsic, false); + if (rc) { + LOGP(DSCHD, LOGL_ERROR, "Could not encode RACH burst\n"); + + /* Forget this primitive */ + sched_prim_drop(lchan); + return rc; + } + } else { + LOGP(DSCHD, LOGL_ERROR, "Primitive has odd length %zu (expected %zu or %zu), " + "so dropping...\n", lchan->prim->payload_len, + sizeof(*req), sizeof(*ext_req)); sched_prim_drop(lchan); return -EINVAL; } - /* Get the payload from a current primitive */ - req = (struct l1ctl_rach_req *) lchan->prim->payload; - /* Delay RACH sending according to offset value */ - if (req->offset-- > 0) - return 0; + /* BN0-7: extended tail bits */ + memcpy(burst_ptr, rach_ext_tail_bits, RACH_EXT_TAIL_BITS_LEN); + burst_ptr += RACH_EXT_TAIL_BITS_LEN; - /* Encode (8-bit) payload */ - rc = gsm0503_rach_ext_encode(payload, req->ra, trx->bsic, false); - if (rc) { - LOGP(DSCHD, LOGL_ERROR, "Could not encode RACH burst\n"); + /* BN8-48: chosen synch. (training) sequence */ + for (i = 0; i < RACH_SYNCH_SEQ_LEN; i++) + *(burst_ptr++) = rach_synch_seq_bits[synch_seq][i] == '1'; - /* Forget this primitive */ - sched_prim_drop(lchan); + /* BN49-84: encrypted bits (the payload) */ + memcpy(burst_ptr, payload, RACH_PAYLOAD_LEN); + burst_ptr += RACH_PAYLOAD_LEN; - return rc; - } + /* BN85-156: tail bits & extended guard period */ + memset(burst_ptr, 0, burst + GSM_BURST_LEN - burst_ptr); - /* Compose RACH burst */ - memcpy(burst, rach_ext_tail_bits, 8); /* TB */ - memcpy(burst + 8, rach_synch_seq, 41); /* sync seq */ - memcpy(burst + 49, payload, 36); /* payload */ - memset(burst + 85, 0, 63); /* TB + GP */ - - LOGP(DSCHD, LOGL_DEBUG, "Transmitting RACH fn=%u\n", fn); + LOGP(DSCHD, LOGL_DEBUG, "Transmitting %s RACH (%s) fn=%u\n", + PRIM_IS_EXT_RACH(lchan->prim) ? "extended (11-bit)" : "regular (8-bit)", + get_value_string(rach_synch_seq_names, synch_seq), fn); /* Forward burst to scheduler */ rc = sched_trx_handle_tx_burst(trx, ts, lchan, fn, burst); -- To view, visit https://gerrit.osmocom.org/13732 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I36fd20cd5502ce33c52f644ee4c22abb83350df8 Gerrit-Change-Number: 13732 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 09:24:24 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 09:24:24 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13735 ) Change subject: BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13735/1/bts/BTS_Tests.ttcn File bts/BTS_Tests.ttcn: https://gerrit.osmocom.org/#/c/13735/1/bts/BTS_Tests.ttcn at 994 PS1, Line 994: /* 2047 is 0x7ff (0b11111111111) */ you could use f_rnd_int(bit2int('11111111111'B)) or f_rnd_int(hex2int('7ff'H)) and avoid the comment -- To view, visit https://gerrit.osmocom.org/13735 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8fe156aeac9de3dc1e71a4950821d4942ba9a253 Gerrit-Change-Number: 13735 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 22 Apr 2019 09:24:24 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 12:07:10 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 12:07:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: f_mm_auth(): Add support for UMTS AKA Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13736 Change subject: msc: f_mm_auth(): Add support for UMTS AKA ...................................................................... msc: f_mm_auth(): Add support for UMTS AKA Change-Id: Id57adcebd63a06cfa555824e493561fe08f13d6d --- M msc/BSC_ConnectionHandler.ttcn 1 file changed, 28 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/36/13736/1 diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 4534a9b..e408f82 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -75,7 +75,8 @@ boolean mm_info, boolean sgsap_enable, boolean gsup_enable, - integer ran_idx + integer ran_idx, + boolean use_umts_aka }; /* get a one-octet bitmaks of supported algorithms based on Classmark information */ @@ -293,15 +294,34 @@ function f_mm_auth() runs on BSC_ConnHdlr { if (g_pars.net.expect_auth) { - g_pars.vec := f_gen_auth_vec_2g(); - var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(g_pars.vec.rand, - g_pars.vec.sres, - g_pars.vec.kc)); + var GSUP_IE auth_tuple; GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); - GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(g_pars.vec.rand))); - BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(g_pars.vec.sres))); + if (g_pars.use_umts_aka) { + g_pars.vec := f_gen_auth_vec_3g(); + auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G3G(g_pars.vec.rand, + g_pars.vec.sres, + g_pars.vec.kc, + g_pars.vec.ik, + g_pars.vec.ck, + g_pars.vec.autn, + g_pars.vec.res)); + GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); + + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ_3G(g_pars.vec.rand, g_pars.vec.autn))); + var OCT4 res := substr(g_pars.vec.res, 0, 4); + var OCT4 xres := substr(g_pars.vec.res, 4, 4); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_3G(res, xres))); + } else { + g_pars.vec := f_gen_auth_vec_2g(); + auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(g_pars.vec.rand, + g_pars.vec.sres, + g_pars.vec.kc)); + GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); + + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(g_pars.vec.rand))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(g_pars.vec.sres))); + } } } -- To view, visit https://gerrit.osmocom.org/13736 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id57adcebd63a06cfa555824e493561fe08f13d6d Gerrit-Change-Number: 13736 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 12:07:11 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 12:07:11 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Add testcase for UMTS AKA over GERAN TC_lu_imsi_auth3g_tmsi() Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13737 Change subject: msc: Add testcase for UMTS AKA over GERAN TC_lu_imsi_auth3g_tmsi() ...................................................................... msc: Add testcase for UMTS AKA over GERAN TC_lu_imsi_auth3g_tmsi() Change-Id: I10cc7ed214e83b4624587c60f332034d3f19b22d --- M msc/MSC_Tests.ttcn 1 file changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/37/13737/1 diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 8c221dc..1992054 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -651,6 +651,20 @@ vc_conn.done; } +private function f_tc_lu_imsi_auth3g_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; + pars.use_umts_aka := true; + f_init_handler(pars); + f_perform_lu(); +} +testcase TC_lu_imsi_auth3g_tmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth3g_tmsi), 1005); + vc_conn.done; +} /* Send CM SERVICE REQ for IMSI that has never performed LU before */ private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) @@ -4666,6 +4680,7 @@ execute( TC_lu_imsi_reject() ); execute( TC_lu_imsi_timeout_gsup() ); execute( TC_lu_imsi_auth_tmsi() ); + execute( TC_lu_imsi_auth3g_tmsi() ); execute( TC_cmserv_imsi_unknown() ); execute( TC_lu_and_mo_call() ); execute( TC_lu_auth_sai_timeout() ); -- To view, visit https://gerrit.osmocom.org/13737 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I10cc7ed214e83b4624587c60f332034d3f19b22d Gerrit-Change-Number: 13737 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 13:04:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 13:04:45 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_ConnectionHandler: Define SDP template for CN-side CRCX In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13727 ) Change subject: BSC_ConnectionHandler: Define SDP template for CN-side CRCX ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13727 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I90546249c41de8f99ce4a558e76cb46597413518 Gerrit-Change-Number: 13727 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 22 Apr 2019 13:04:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 13:04:49 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 13:04:49 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Rename BSSMAP_Emulation -> RAN_Emulation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13650 ) Change subject: Rename BSSMAP_Emulation -> RAN_Emulation ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13650 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iecbcb0c6c136baad9460eca40606bb4010d8882d Gerrit-Change-Number: 13650 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 22 Apr 2019 13:04:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 13:04:58 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 13:04:58 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Add f_expect_paging() rather than using tr_BSSMAP_Paging directly In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13728 ) Change subject: Add f_expect_paging() rather than using tr_BSSMAP_Paging directly ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13728 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I213303337373c349676be4f8ac4175acdc701e47 Gerrit-Change-Number: 13728 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 22 Apr 2019 13:04:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 13:05:14 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 13:05:14 +0000 Subject: Change in osmo-ttcn3-hacks[master]: f_perform_lu(): Use f_expect_clear(), reduce code duplication In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13729 ) Change subject: f_perform_lu(): Use f_expect_clear(), reduce code duplication ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13729 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I64b183ad6615f2b0b9565a711de87fe4249625a1 Gerrit-Change-Number: 13729 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 22 Apr 2019 13:05:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 13:05:28 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 13:05:28 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: Allow test cases to specify RAN index In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13730 ) Change subject: MSC_Tests: Allow test cases to specify RAN index ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13730 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3d7ec567a7b69d8c6f79d26971bf1c94e077d5f5 Gerrit-Change-Number: 13730 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 22 Apr 2019 13:05:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 13:07:11 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 13:07:11 +0000 Subject: Change in osmo-ttcn3-hacks[master]: HNBAP, RUA and RANAP protocol codecs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13652 ) Change subject: HNBAP, RUA and RANAP protocol codecs ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13652 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If4a72de9bc54d6e6a7daaca78a4d4aa5684203a5 Gerrit-Change-Number: 13652 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 22 Apr 2019 13:07:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 13:07:14 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 13:07:14 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Add RANAP support In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13653 ) Change subject: RAN_Emulation: Add RANAP support ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33 Gerrit-Change-Number: 13653 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 22 Apr 2019 13:07:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 13:08:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 13:08:12 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_ConnectionHandler: Define SDP template for CN-side CRCX In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13727 ) Change subject: BSC_ConnectionHandler: Define SDP template for CN-side CRCX ...................................................................... BSC_ConnectionHandler: Define SDP template for CN-side CRCX Change-Id: I90546249c41de8f99ce4a558e76cb46597413518 --- M msc/BSC_ConnectionHandler.ttcn 1 file changed, 11 insertions(+), 14 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 8e5c5f2..0b2344f 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -469,6 +469,15 @@ hex2str(cpars.called_party), hex2str(g_pars.imsi))); } +private template (value) SDP_Message ts_SDP_CRCX_CN(CallParameters cpars) := + ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, + hex2str(cpars.mgcp_call_id), "42", + cpars.mgw_rtp_port_mss, + { int2str(cpars.rtp_payload_type) }, + { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, + cpars.rtp_sdp_format)), + valueof(ts_SDP_ptime(20)) }); + /* Complete call, begin with a paging response message via BSSAP */ function f_mt_call_complete(inout CallParameters cpars) runs on BSC_ConnHdlr { @@ -521,13 +530,7 @@ interleave { /* Second MGCP CRCX (this time for MSS/CN side) */ [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { - var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, - hex2str(cpars.mgcp_call_id), "42", - cpars.mgw_rtp_port_mss, - { int2str(cpars.rtp_payload_type) }, - { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, - cpars.rtp_sdp_format)), - valueof(ts_SDP_ptime(20)) })); + var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); /* MSC acknowledges the MNCC_CREATE to the MNCC handler */ MNCC.receive(tr_MNCC_RTP_CREATE(cpars.mncc_callref)); @@ -626,13 +629,7 @@ interleave { /* Second MGCP CRCX (this time for MSS/CN side) */ [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { - var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, - hex2str(cpars.mgcp_call_id), "42", - cpars.mgw_rtp_port_mss, - { int2str(cpars.rtp_payload_type) }, - { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, - cpars.rtp_sdp_format)), - valueof(ts_SDP_ptime(20)) })); + var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); /* Alerting */ -- To view, visit https://gerrit.osmocom.org/13727 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I90546249c41de8f99ce4a558e76cb46597413518 Gerrit-Change-Number: 13727 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 13:08:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 13:08:13 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Rename BSSMAP_Emulation -> RAN_Emulation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13650 ) Change subject: Rename BSSMAP_Emulation -> RAN_Emulation ...................................................................... Rename BSSMAP_Emulation -> RAN_Emulation So far, BSSMAP_Emulation supported only a transport over BSSMAP. However, we soon intend to merge support for RANAP in order to simulate RANAP/Iu connections as well as BSSMAP. Let's start by renaming some of the existing types/functions/ports/modules without introducing any functional changes just yet. Related: OS#2857, OS#2856 Change-Id: Iecbcb0c6c136baad9460eca40606bb4010d8882d --- M bsc-nat/BSC_MS_ConnectionHandler.ttcn M bsc-nat/BSC_MS_Simulation.ttcn M bsc-nat/MSC_ConnectionHandler.ttcn M bsc-nat/MSC_Simulation.ttcn M bsc-nat/gen_links.sh M bsc/BSC_Tests.ttcn M bsc/BSC_Tests_LCLS.ttcn M bsc/MSC_ConnectionHandler.ttcn M bsc/gen_links.sh R library/RAN_Adapter.ttcn R library/RAN_Emulation.ttcn M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn M msc/gen_links.sh 14 files changed, 228 insertions(+), 230 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bsc-nat/BSC_MS_ConnectionHandler.ttcn b/bsc-nat/BSC_MS_ConnectionHandler.ttcn index 27e1b58..63d0451 100644 --- a/bsc-nat/BSC_MS_ConnectionHandler.ttcn +++ b/bsc-nat/BSC_MS_ConnectionHandler.ttcn @@ -5,7 +5,7 @@ import from SCCPasp_Types all; import from BSSAP_Types all; import from BSSAP_CodecPort all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from BSSMAP_Templates all; import from MobileL3_Types all; @@ -17,9 +17,9 @@ import from SDP_Types all; /* this component represents a single subscriber connection at the MSC. - * There is a 1:1 mapping between SCCP connections and BSSAP_ConnHdlr components. - * We inherit all component variables, ports, functions, ... from BSSAP_ConnHdlr */ -type component BSC_MS_ConnHdlr extends BSSAP_ConnHdlr { + * There is a 1:1 mapping between SCCP connections and RAN_ConnHdlr components. + * We inherit all component variables, ports, functions, ... from RAN_ConnHdlr */ +type component BSC_MS_ConnHdlr extends RAN_ConnHdlr { /* SCCP Connecction Identifier for the underlying SCCP connection */ var integer g_sccp_conn_id; var MgcpConnectionId g_mgcp_conn_id; @@ -27,18 +27,18 @@ var BSC_State g_state; } -/* Callback function from general BSSMAP_Emulation whenever a new incoming +/* Callback function from general RAN_Emulation whenever a new incoming * SCCP connection arrivces. Must create + start a new component */ private function CreateCallback(BSSAP_N_CONNECT_ind conn_ind, charstring id) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { +runs on RAN_Emulation_CT return RAN_ConnHdlr { log("Incoming SCCP Connection on BSC ?!?"); self.stop; } -/* Callback function from general BSSMAP_Emulation whenever a connectionless +/* Callback function from general RAN_Emulation whenever a connectionless * BSSMAP message arrives. Can retunr a PDU_BSSAP that should be sent in return */ private function UnitdataCallback(PDU_BSSAP bssap) -runs on BSSMAP_Emulation_CT return template PDU_BSSAP { +runs on RAN_Emulation_CT return template PDU_BSSAP { var template PDU_BSSAP resp := omit; if (match(bssap, tr_BSSMAP_Reset)) { @@ -48,7 +48,7 @@ return resp; } -const BssmapOps BSC_MS_BssmapOps := { +const RanOps BSC_MS_RanOps := { create_cb := refers(CreateCallback), unitdata_cb := refers(UnitdataCallback), decode_dtap := false, @@ -154,16 +154,16 @@ log("Unhandled DTAP ", l3); } - [g_state == BSC_STATE_WAIT_DISC_IND] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + [g_state == BSC_STATE_WAIT_DISC_IND] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { setverdict(pass); self.stop; } - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) { + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND) { } /* disconnect in invalid state */ - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { setverdict(fail); self.stop; } diff --git a/bsc-nat/BSC_MS_Simulation.ttcn b/bsc-nat/BSC_MS_Simulation.ttcn index 2f1961b..c45b5ac 100644 --- a/bsc-nat/BSC_MS_Simulation.ttcn +++ b/bsc-nat/BSC_MS_Simulation.ttcn @@ -9,7 +9,7 @@ import from SCCP_Emulation all; import from BSSAP_CodecPort all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from BSC_MS_ConnectionHandler all; @@ -17,7 +17,7 @@ /* component references */ var IPA_Emulation_CT vc_IPA; var SCCP_CT vc_SCCP; - var BSSMAP_Emulation_CT vc_BSSMAP; + var RAN_Emulation_CT vc_BSSMAP; /* test port to SCCP emulation */ port SCCPasp_PT SCCP; @@ -48,7 +48,7 @@ /* create components for IPA/SCCP/BSS[M]AP stack */ vc_IPA := IPA_Emulation_CT.create(id & "-IPA"); vc_SCCP := SCCP_CT.create(id & "-SCCP"); - vc_BSSMAP := BSSMAP_Emulation_CT.create(id & "-BSSMAP"); + vc_BSSMAP := RAN_Emulation_CT.create(id & "-BSSMAP"); map(vc_IPA:IPA_PORT, system:IPA_CODEC_PT); @@ -64,7 +64,7 @@ /* start components */ vc_IPA.start(IPA_Emulation.main_client(remote_ip, remote_port, local_ip, local_port, ccm_pars)); vc_SCCP.start(SCCPStart(sccp_pars)); - vc_BSSMAP.start(BSSMAP_Emulation.main(BSC_MS_ConnectionHandler.BSC_MS_BssmapOps, id)); + vc_BSSMAP.start(RAN_Emulation.main(BSC_MS_ConnectionHandler.BSC_MS_RanOps, id)); /* Initial delay to wait for IPA connection establishment */ T.start(2.0); diff --git a/bsc-nat/MSC_ConnectionHandler.ttcn b/bsc-nat/MSC_ConnectionHandler.ttcn index 27fbba7..383b67b 100644 --- a/bsc-nat/MSC_ConnectionHandler.ttcn +++ b/bsc-nat/MSC_ConnectionHandler.ttcn @@ -5,7 +5,7 @@ import from SCCPasp_Types all; import from BSSAP_Types all; import from BSSAP_CodecPort all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from BSSMAP_Templates all; import from MGCP_Types all; @@ -13,9 +13,9 @@ import from SDP_Types all; /* this component represents a single subscriber connection at the MSC. - * There is a 1:1 mapping between SCCP connections and BSSAP_ConnHdlr components. - * We inherit all component variables, ports, functions, ... from BSSAP_ConnHdlr */ -type component MSC_ConnHdlr extends BSSAP_ConnHdlr { + * There is a 1:1 mapping between SCCP connections and RAN_ConnHdlr components. + * We inherit all component variables, ports, functions, ... from RAN_ConnHdlr */ +type component MSC_ConnHdlr extends RAN_ConnHdlr { /* SCCP Connecction Identifier for the underlying SCCP connection */ var integer g_sccp_conn_id; @@ -28,10 +28,10 @@ /* Callback function from general BSSMAP_Emulation whenever a new incoming * SCCP connection arrivces. Must create + start a new component */ private function CreateCallback(BSSAP_N_CONNECT_ind conn_ind, charstring id) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { +runs on RAN_Emulation_CT return RAN_ConnHdlr { var MSC_ConnHdlr vc_conn; - /* Create a new BSSAP_ConnHdlr component */ - vc_conn := MSC_ConnHdlr.create(g_bssmap_id & "-Conn-" & int2str(conn_ind.connectionId)); + /* Create a new RAN_ConnHdlr component */ + vc_conn := MSC_ConnHdlr.create(g_ran_id & "-Conn-" & int2str(conn_ind.connectionId)); /* connect it to the port */ connect(vc_conn:BSSAP, self:CLIENT); /* start it */ @@ -44,7 +44,7 @@ /* Callback function from general BSSMAP_Emulation whenever a connectionless * BSSMAP message arrives. Can retunr a PDU_BSSAP that should be sent in return */ private function UnitdataCallback(PDU_BSSAP bssap) -runs on BSSMAP_Emulation_CT return template PDU_BSSAP { +runs on RAN_Emulation_CT return template PDU_BSSAP { var template PDU_BSSAP resp := omit; if (match(bssap, tr_BSSMAP_Reset)) { @@ -54,7 +54,7 @@ return resp; } -const BssmapOps MSC_BssmapOps := { +const RanOps MSC_RanOps := { create_cb := refers(CreateCallback), unitdata_cb := refers(UnitdataCallback), decode_dtap := false, @@ -129,14 +129,14 @@ } [g_state == MSC_STATE_WAIT_DLCX_ACK] BSSAP.receive(tr_DLCX_ACK) { - BSSAP.send(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); + BSSAP.send(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); setverdict(pass); self.stop; } /* TODO: CLEAR REQUEST from BSS */ - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { setverdict(fail); self.stop; } @@ -147,7 +147,7 @@ /* Guard timer has expired, close connection */ [] T.timeout { - BSSAP.send(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); + BSSAP.send(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); setverdict(fail, "Timeout of guard timer"); self.stop; } diff --git a/bsc-nat/MSC_Simulation.ttcn b/bsc-nat/MSC_Simulation.ttcn index 0a13509..bc47f89 100755 --- a/bsc-nat/MSC_Simulation.ttcn +++ b/bsc-nat/MSC_Simulation.ttcn @@ -16,7 +16,7 @@ import from BSSAP_Types all; import from BSSMAP_Templates all; */ -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from MGCP_Adapter all; @@ -26,7 +26,7 @@ /* component references */ var IPA_Emulation_CT vc_IPA; var SCCP_CT vc_SCCP; - var BSSMAP_Emulation_CT vc_BSSMAP; + var RAN_Emulation_CT vc_BSSMAP; var MGCP_Adapter_CT vc_MGCP_UDP; /* test port to SCCP emulation */ port SCCPasp_PT SCCP; @@ -43,7 +43,7 @@ /* create components */ vc_IPA := IPA_Emulation_CT.create(id & "-IPA"); vc_SCCP := SCCP_CT.create(id & "-SCCP"); - vc_BSSMAP := BSSMAP_Emulation_CT.create(id & "-BSSMAP"); + vc_BSSMAP := RAN_Emulation_CT.create(id & "-BSSMAP"); map(vc_IPA:IPA_PORT, system:IPA_CODEC_PT); @@ -64,7 +64,7 @@ vc_IPA.start(IPA_Emulation.main_server(local_ip, local_port)); vc_SCCP.start(SCCPStart(sccp_pars)); - vc_BSSMAP.start(BSSMAP_Emulation.main(MSC_ConnectionHandler.MSC_BssmapOps, id & "-BSSMAP")); + vc_BSSMAP.start(RAN_Emulation.main(MSC_ConnectionHandler.MSC_RanOps, id & "-BSSMAP")); /* wait until termination of respective components */ vc_IPA.done; diff --git a/bsc-nat/gen_links.sh b/bsc-nat/gen_links.sh index 1ab54f1..e54eec4 100755 --- a/bsc-nat/gen_links.sh +++ b/bsc-nat/gen_links.sh @@ -47,7 +47,7 @@ gen_links $DIR $FILES DIR=../library -FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn BSSAP_CodecPort.ttcn" +FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn BSSAP_CodecPort.ttcn" gen_links $DIR $FILES ignore_pp_results diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 1e89cf3..720669b 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -24,7 +24,7 @@ import from IPL4asp_Types all; import from BSSAP_Types all; -import from BSSAP_Adapter all; +import from RAN_Adapter all; import from BSSAP_CodecPort all; import from BSSMAP_Templates all; import from IPA_Emulation all; @@ -82,7 +82,7 @@ var MGCP_Emulation_CT vc_MGCP; port TELNETasp_PT BSCVTY; - var BSSAP_Adapter g_bssap; + var RAN_Adapter g_bssap; /* for old legacy-tests only */ port BSSAP_CODEC_PT BSSAP; @@ -106,7 +106,7 @@ /* IP address at which the test binds */ charstring mp_test_ip := "127.0.0.1"; - BSSAP_Configuration mp_bssap_cfg := { + RAN_Configuration mp_bssap_cfg := { transport := BSSAP_TRANSPORT_AoIP, sccp_service_type := "mtp3_itu", sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" }, @@ -313,10 +313,10 @@ T_guard.start; activate(as_Tguard()); - /* Call a function of our 'parent component' BSSAP_Adapter_CT to start the + /* Call a function of our 'parent component' RAN_Adapter_CT to start the * MSC-side BSSAP emulation */ if (handler_mode) { - f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", MSC_BssmapOps); + f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", MSC_RanOps); f_bssap_start(g_bssap); } else { f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", omit); @@ -1625,10 +1625,10 @@ /*********************************************************************** - * "New world" test cases using RSL_Emulation + BSSMAP_Emulation + * "New world" test cases using RSL_Emulation + RAN_Emulation ***********************************************************************/ -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from RSL_Emulation all; import from MSC_ConnectionHandler all; @@ -1636,7 +1636,7 @@ /* helper function to create and connect a MSC_ConnHdlr component */ private function f_connect_handler(inout MSC_ConnHdlr vc_conn) runs on test_CT { - connect(vc_conn:BSSMAPEM, g_bssap.vc_BSSMAP:PROC); + connect(vc_conn:RAN, g_bssap.vc_RAN:PROC); connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); connect(vc_conn:RSL, bts[0].rsl.vc_RSL:CLIENT_PT); connect(vc_conn:RSL_PROC, bts[0].rsl.vc_RSL:RSL_PROC); @@ -1644,7 +1644,7 @@ connect(vc_conn:RSL1, bts[1].rsl.vc_RSL:CLIENT_PT); connect(vc_conn:RSL1_PROC, bts[1].rsl.vc_RSL:RSL_PROC); } - connect(vc_conn:BSSAP, g_bssap.vc_BSSMAP:CLIENT); + connect(vc_conn:BSSAP, g_bssap.vc_RAN:CLIENT); connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); } @@ -3096,7 +3096,7 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.handover.sccp_addr_bsc, g_pars.handover.sccp_addr_msc, f_gen_handover_req())); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND); /* The RSL Emulation magically accepts the Chan Activ behind the scenes. */ @@ -3168,7 +3168,7 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.handover.sccp_addr_bsc, g_pars.handover.sccp_addr_msc, f_gen_handover_req())); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND); /* The RSL Emulation magically accepts the Chan Activ behind the scenes. */ @@ -3253,7 +3253,7 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.handover.sccp_addr_bsc, g_pars.handover.sccp_addr_msc, f_gen_handover_req())); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND); /* The RSL Emulation magically accepts the Chan Activ behind the scenes. */ @@ -3339,7 +3339,7 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.handover.sccp_addr_bsc, g_pars.handover.sccp_addr_msc, f_gen_handover_req())); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND); /* The RSL Emulation magically accepts the Chan Activ behind the scenes. */ @@ -3430,7 +3430,7 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.handover.sccp_addr_bsc, g_pars.handover.sccp_addr_msc, f_gen_handover_req())); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND); /* The RSL Emulation magically accepts the Chan Activ behind the scenes. */ diff --git a/bsc/BSC_Tests_LCLS.ttcn b/bsc/BSC_Tests_LCLS.ttcn index 67ccecf..f2b9b5d 100644 --- a/bsc/BSC_Tests_LCLS.ttcn +++ b/bsc/BSC_Tests_LCLS.ttcn @@ -24,7 +24,7 @@ import from IPL4asp_Types all; import from BSSAP_Types all; -import from BSSAP_Adapter all; +import from RAN_Adapter all; import from BSSAP_CodecPort all; import from BSSMAP_Templates all; import from IPA_Emulation all; @@ -51,7 +51,7 @@ import from GSM_RR_Types all; import from BSSMAP_Templates all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from MSC_ConnectionHandler all; import from BSC_Tests all; @@ -84,7 +84,7 @@ /* port type between lcls_test_CT and LCLS_MSC_ConnHdlr */ type port LCLS_InterComp_PT message { /* BSSAP from BSSA_ConnHdlr */ - inout PDU_BSSAP, BSSAP_Conn_Prim, PDU_DTAP_MO, PDU_DTAP_MT, + inout PDU_BSSAP, RAN_Conn_Prim, PDU_DTAP_MO, PDU_DTAP_MT, /* RSL from RSL_DchanHdlr */ RSLDC_ChanRqd, RSL_Message, /* MGCP from MGCP_ConnHdlr */ @@ -101,7 +101,7 @@ /* forward messages between the RSL/MGCP/BSSAP Emulation and the master component */ private altstep as_lcls_conn_hdlr_proxy() runs on LCLS_MSC_ConnHdlr { var PDU_BSSAP bssap; - var BSSAP_Conn_Prim bssap_p; + var RAN_Conn_Prim bssap_p; var PDU_DTAP_MO dtap_mo; var PDU_DTAP_MT dtap_mt; var MgcpCommand mgcp_cmd; @@ -109,7 +109,7 @@ var RSL_Message rsl_msg; /* from ConnHdlr to master process */ [] BSSAP.receive(PDU_BSSAP:?) -> value bssap { MASTER.send(bssap); } - [] BSSAP.receive(BSSAP_Conn_Prim:?) -> value bssap_p { MASTER.send(bssap_p); } + [] BSSAP.receive(RAN_Conn_Prim:?) -> value bssap_p { MASTER.send(bssap_p); } [] BSSAP.receive(PDU_DTAP_MO:?) -> value dtap_mo { MASTER.send(dtap_mo); } [] BSSAP.receive(PDU_DTAP_MT:?) -> value dtap_mt { MASTER.send(dtap_mt); } [] MGCP.receive(MgcpCommand:?) -> value mgcp_cmd { MASTER.send(mgcp_cmd); } @@ -117,7 +117,7 @@ [] RSL.receive(RSL_Message:?) -> value rsl_msg { MASTER.send(rsl_msg); } /* from master process to ConnHdlr */ [] MASTER.receive(PDU_BSSAP:?) -> value bssap { BSSAP.send(bssap); } - [] MASTER.receive(BSSAP_Conn_Prim:?) -> value bssap_p { BSSAP.send(bssap_p); } + [] MASTER.receive(RAN_Conn_Prim:?) -> value bssap_p { BSSAP.send(bssap_p); } [] MASTER.receive(PDU_DTAP_MO:?) -> value dtap_mo { BSSAP.send(dtap_mo); } [] MASTER.receive(PDU_DTAP_MT:?) -> value dtap_mt { BSSAP.send(dtap_mt); } [] MASTER.receive(MgcpCommand:?) -> value mgcp_cmd { MGCP.send(mgcp_cmd); } @@ -160,7 +160,7 @@ /* helper function to create and connect a MSC_ConnHdlr component */ /* FIXME: Why can't we use BSC_Tests.f_connect_andler() ?!? */ private function f_connect_handler(inout LCLS_MSC_ConnHdlr vc_conn) runs on lcls_test_CT { - connect(vc_conn:BSSMAPEM, g_bssap.vc_BSSMAP:PROC); + connect(vc_conn:RAN, g_bssap.vc_RAN:PROC); connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); connect(vc_conn:RSL, bts[0].rsl.vc_RSL:CLIENT_PT); connect(vc_conn:RSL_PROC, bts[0].rsl.vc_RSL:RSL_PROC); @@ -168,7 +168,7 @@ connect(vc_conn:RSL1, bts[1].rsl.vc_RSL:CLIENT_PT); connect(vc_conn:RSL1_PROC, bts[1].rsl.vc_RSL:RSL_PROC); } - connect(vc_conn:BSSAP, g_bssap.vc_BSSMAP:CLIENT); + connect(vc_conn:BSSAP, g_bssap.vc_RAN:CLIENT); connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); } @@ -713,7 +713,7 @@ } } [] CONN_A.receive(tr_BSSMAP_ClearComplete) { - CONN_A.send(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); + CONN_A.send(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); } [] CONN_B.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_possible_ls)); } diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 96797c9..36e554d 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -6,7 +6,7 @@ import from GSM_Types all; import from SCCPasp_Types all; import from BSSAP_Types all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from BSSMAP_Templates all; import from IPL4asp_Types all; @@ -330,14 +330,14 @@ } /* this component represents a single subscriber connection at the MSC. - * There is a 1:1 mapping between SCCP connections and BSSAP_ConnHdlr components. - * We inherit all component variables, ports, functions, ... from BSSAP_ConnHdlr */ -type component MSC_ConnHdlr extends BSSAP_ConnHdlr, RSL_DchanHdlr, MGCP_ConnHdlr { + * There is a 1:1 mapping between SCCP connections and RAN_ConnHdlr components. + * We inherit all component variables, ports, functions, ... from RAN_ConnHdlr */ +type component MSC_ConnHdlr extends RAN_ConnHdlr, RSL_DchanHdlr, MGCP_ConnHdlr { /* SCCP Connecction Identifier for the underlying SCCP connection */ var integer g_sccp_conn_id; - /* procedure port back to our parent (BSSMAP_Emulation_CT) for control */ - port BSSMAPEM_PROC_PT BSSMAPEM; + /* procedure port back to our parent (RAN_Emulation_CT) for control */ + port RAN_PROC_PT RAN; port TELNETasp_PT BSCVTY; var MediaState g_media; @@ -357,10 +357,10 @@ } } -/* Callback function from general BSSMAP_Emulation whenever a connectionless +/* Callback function from general RAN_Emulation whenever a connectionless * BSSMAP message arrives. Can retunr a PDU_BSSAP that should be sent in return */ private function UnitdataCallback(PDU_BSSAP bssap) -runs on BSSMAP_Emulation_CT return template PDU_BSSAP { +runs on RAN_Emulation_CT return template PDU_BSSAP { var template PDU_BSSAP resp := omit; /* answer all RESET with a RESET ACK */ @@ -371,8 +371,8 @@ return resp; } -const BssmapOps MSC_BssmapOps := { - create_cb := refers(BSSMAP_Emulation.ExpectedCreateCallback), +const RanOps MSC_RanOps := { + create_cb := refers(RAN_Emulation.ExpectedCreateCallback), unitdata_cb := refers(UnitdataCallback), decode_dtap := false, role_ms := false, @@ -387,8 +387,8 @@ /* register an expect with the BSSMAP core */ private function f_create_bssmap_exp(octetstring l3_enc) runs on MSC_ConnHdlr { - BSSMAPEM.call(BSSMAPEM_register:{l3_enc, self}) { - [] BSSMAPEM.getreply(BSSMAPEM_register:{?, ?}) {}; + RAN.call(RAN_register:{l3_enc, self}) { + [] RAN.getreply(RAN_register:{?, ?}) {}; } } diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh index bf10761..d8393c3 100755 --- a/bsc/gen_links.sh +++ b/bsc/gen_links.sh @@ -67,7 +67,7 @@ gen_links $DIR $FILES DIR=../library -FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn BSSAP_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn" +FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn RAN_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn" gen_links $DIR $FILES ignore_pp_results diff --git a/library/BSSAP_Adapter.ttcn b/library/RAN_Adapter.ttcn similarity index 77% rename from library/BSSAP_Adapter.ttcn rename to library/RAN_Adapter.ttcn index cebdffe..294f747 100644 --- a/library/BSSAP_Adapter.ttcn +++ b/library/RAN_Adapter.ttcn @@ -1,14 +1,13 @@ -module BSSAP_Adapter { +module RAN_Adapter { -/* This module implements a 'dumb' BSSAP adapter. It creates the M3UA and SCCP components and stacks a BSSAP - * codec port on top. As a result, it provides the ability to transceive SCCP-User-SAP primitives with - * deoded BSSAP payload. Use this if you want to have full control about what you transmit or receive, - * without any automatisms in place. Allows you to refuse connections or other abnormal behavior. */ +/* This module implements a 'dumb' RAN adapter. It creates the M3UA and SCCP components and stacks a + * BSSAP/RANAP codec port on top. As a result, it provides the ability to transceive SCCP-User-SAP primitives + * with deoded BSSAP/RANAP payload. Use this if you want to have full control about what you transmit or + * receive, without any automatisms in place. Allows you to refuse connections or other abnormal behavior. */ import from General_Types all; import from Osmocom_Types all; -import from M3UA_Types all; import from M3UA_Emulation all; import from MTP3asp_Types all; import from MTP3asp_PortType all; @@ -23,11 +22,10 @@ import from SCTPasp_Types all; import from SCTPasp_PortType all; -import from BSSAP_CodecPort all; import from BSSMAP_Templates all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; -type record BSSAP_Adapter { +type record RAN_Adapter { /* component references */ M3UA_CT vc_M3UA, /* only in 3GPP AoIP */ IPA_Emulation_CT vc_IPA, /* only in SCCPlite */ @@ -39,17 +37,17 @@ SCCP_PAR_Address sccp_addr_peer, /* handler mode */ - BSSMAP_Emulation_CT vc_BSSMAP + RAN_Emulation_CT vc_RAN } -type enumerated BSSAP_Transport { +type enumerated RAN_Transport { BSSAP_TRANSPORT_AoIP, /* 3GPP AoIP: SCCP over M3UA over SCTP */ BSSAP_TRANSPORT_SCCPlite_SERVER, /* SCCPlite: SCCP over IPA over TCP */ BSSAP_TRANSPORT_SCCPlite_CLIENT /* SCCPlite: SCCP over IPA over TCP */ }; -type record BSSAP_Configuration { - BSSAP_Transport transport, +type record RAN_Configuration { + RAN_Transport transport, charstring sccp_service_type, SCTP_Association_Address sctp_addr, integer own_pc, @@ -60,7 +58,7 @@ integer rctx }; -private function init_pars(inout BSSAP_Adapter ba, in BSSAP_Configuration cfg) { +private function init_pars(inout RAN_Adapter ba, in RAN_Configuration cfg) { ba.sccp_pars := { sio := { ni := substr(oct2bit(cfg.sio),0,2), @@ -78,8 +76,8 @@ } -function f_bssap_init(inout BSSAP_Adapter ba, in BSSAP_Configuration cfg, charstring id, - template BssmapOps ops) { +function f_bssap_init(inout RAN_Adapter ba, in RAN_Configuration cfg, charstring id, + template RanOps ops) { init_pars(ba, cfg); ops.sccp_addr_local := ba.sccp_addr_own; ops.sccp_addr_peer := ba.sccp_addr_peer; @@ -87,7 +85,7 @@ /* create components */ ba.vc_SCCP := SCCP_CT.create(id & "-SCCP"); if (isvalue(ops)) { - ba.vc_BSSMAP := BSSMAP_Emulation_CT.create(id & "-BSSMAP"); + ba.vc_RAN := RAN_Emulation_CT.create(id & "-RAN"); } select (cfg.transport) { case (BSSAP_TRANSPORT_AoIP) { @@ -131,7 +129,7 @@ disconnect(ba.vc_IPA:IPA_SP_PORT, ba.vc_WAIT:IPA_SP_PORT); } case else { - setverdict(fail, "Unsuppored BSSAP_Transport"); + setverdict(fail, "Unsuppored RAN_Transport"); mtc.stop; } } @@ -142,20 +140,20 @@ //T.timeout; log("Connecting BSSMAP Emulation to SCCP_SP_PORT and starting emulation"); /* connect BSSNAP component to upper side of SCCP */ - connect(ba.vc_BSSMAP:BSSAP, ba.vc_SCCP:SCCP_SP_PORT); + connect(ba.vc_RAN:BSSAP, ba.vc_SCCP:SCCP_SP_PORT); if (cfg.transport == BSSAP_TRANSPORT_SCCPlite_SERVER or cfg.transport == BSSAP_TRANSPORT_SCCPlite_CLIENT) { /* connect IPA MGCP port with BSSMAP MGCP port */ - connect(ba.vc_IPA:IPA_MGCP_PORT, ba.vc_BSSMAP:MGCP); + connect(ba.vc_IPA:IPA_MGCP_PORT, ba.vc_RAN:MGCP); } /* start the BSSMAP emulation */ - ba.vc_BSSMAP.start(BSSMAP_Emulation.main(valueof(ops), "")); + ba.vc_RAN.start(RAN_Emulation.main(valueof(ops), "")); } } -function f_bssap_start(inout BSSAP_Adapter ba) { +function f_bssap_start(inout RAN_Adapter ba) { ba.vc_SCCP.start(SCCPStart(ba.sccp_pars)); } diff --git a/library/BSSMAP_Emulation.ttcn b/library/RAN_Emulation.ttcn similarity index 82% rename from library/BSSMAP_Emulation.ttcn rename to library/RAN_Emulation.ttcn index 3816ed7..72e2733 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/RAN_Emulation.ttcn @@ -1,16 +1,16 @@ -module BSSMAP_Emulation { +module RAN_Emulation { -/* BSSMAP Emulation, runs on top of BSSAP_CodecPort. It multiplexes/demultiplexes +/* RAN Emulation, runs on top of BSSAP_CodecPort. It multiplexes/demultiplexes * the individual connections, so there can be separate TTCN-3 components handling * each of the connections. * - * The BSSMAP_Emulation.main() function processes SCCP primitives from the SCCP + * The RAN_Emulation.main() function processes SCCP primitives from the SCCP * stack via the BSSAP_CodecPort, and dispatches them to the per-connection components. * * Outbound BSSAP/SCCP connections are initiated by sending a BSSAP_Conn_Req primitive - * to the component running the BSSMAP_Emulation.main() function. + * to the component running the RAN_Emulation.main() function. * - * For each new inbound connections, the BssmapOps.create_cb() is called. It can create + * For each new inbound connections, the RanOps.create_cb() is called. It can create * or resolve a TTCN-3 component, and returns a component reference to which that inbound * connection is routed/dispatched. * @@ -19,7 +19,7 @@ * if you are simulating BTS + MSC, and first trigger a connection from BTS/RSL side in a * component which then subsequently should also handle the MSC emulation. * - * Inbound Unit Data messages (such as are dispatched to the BssmapOps.unitdata_cb() callback, + * Inbound Unit Data messages (such as are dispatched to the RanOps.unitdata_cb() callback, * which is registered with an argument to the main() function below. * * (C) 2017-2018 by Harald Welte @@ -44,15 +44,15 @@ /* General "base class" component definition, of which specific implementations * derive themselves by means of the "extends" feature */ -type component BSSAP_ConnHdlr { +type component RAN_ConnHdlr { /* port towards MSC Emulator core / SCCP connection dispatchar */ - port BSSAP_Conn_PT BSSAP; + port RAN_Conn_PT BSSAP; /* procedure based port to register for incoming connections */ - port BSSMAPEM_PROC_PT BSSAP_PROC; + port RAN_PROC_PT BSSAP_PROC; } /* Auxiliary primitive that can happen on the port between per-connection client and this dispatcher */ -type enumerated BSSAP_Conn_Prim { +type enumerated RAN_Conn_Prim { /* SCCP tell us that connection was released */ MSC_CONN_PRIM_DISC_IND, /* we tell SCCP to release connection */ @@ -110,11 +110,11 @@ /* port between individual per-connection components and this dispatcher */ -type port BSSAP_Conn_PT message { +type port RAN_Conn_PT message { /* BSSAP or direct DTAP messages from/to clients */ inout PDU_BSSAP, PDU_DTAP_MO, PDU_DTAP_MT, /* misc indications / requests between SCCP and client */ - BSSAP_Conn_Prim, + RAN_Conn_Prim, /* Client requests us to create SCCP Connection */ BSSAP_Conn_Req, /* MGCP, only used for IPA SCCPlite (MGCP in IPA mux) */ @@ -125,7 +125,7 @@ /* represents a single BSSAP connection over SCCP */ type record ConnectionData { /* reference to the instance of the per-connection component */ - BSSAP_ConnHdlr comp_ref, + RAN_ConnHdlr comp_ref, integer sccp_conn_id, /* most recent MGCP transaction ID (Used on MSC side) */ MgcpTransId mgcp_trans_id optional, @@ -136,16 +136,16 @@ } type record ImsiMapping { - BSSAP_ConnHdlr comp_ref, + RAN_ConnHdlr comp_ref, hexstring imsi optional, OCT4 tmsi } -type component BSSMAP_Emulation_CT { +type component RAN_Emulation_CT { /* SCCP port on the bottom side, using ASP primitives */ port BSSAP_CODEC_PT BSSAP; /* BSSAP port to the per-connection clients */ - port BSSAP_Conn_PT CLIENT; + port RAN_Conn_PT CLIENT; /* MGCP port */ port IPA_MGCP_PT MGCP; @@ -159,15 +159,15 @@ var ImsiMapping ImsiTable[16]; /* procedure based port to register for incoming connections */ - port BSSMAPEM_PROC_PT PROC; + port RAN_PROC_PT PROC; - var charstring g_bssmap_id; + var charstring g_ran_id; var integer g_next_e1_ts := 1; - var BssmapOps g_bssmap_ops; + var RanOps g_ran_ops; }; private function f_conn_id_known(integer sccp_conn_id) -runs on BSSMAP_Emulation_CT return boolean { +runs on RAN_Emulation_CT return boolean { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].sccp_conn_id == sccp_conn_id){ @@ -177,8 +177,8 @@ return false; } -private function f_comp_known(BSSAP_ConnHdlr client) -runs on BSSMAP_Emulation_CT return boolean { +private function f_comp_known(RAN_ConnHdlr client) +runs on RAN_Emulation_CT return boolean { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].comp_ref == client) { @@ -189,7 +189,7 @@ } private function f_cic_known(integer cic) -runs on BSSMAP_Emulation_CT return boolean { +runs on RAN_Emulation_CT return boolean { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].cic == cic) { @@ -201,32 +201,32 @@ /* resolve component reference by connection ID */ private function f_comp_by_conn_id(integer sccp_conn_id) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { +runs on RAN_Emulation_CT return RAN_ConnHdlr { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].sccp_conn_id == sccp_conn_id) { return ConnectionTable[i].comp_ref; } } - setverdict(fail, "BSSMAP Connection table not found by SCCP Connection ID ", sccp_conn_id); + setverdict(fail, "RAN Connection table not found by SCCP Connection ID ", sccp_conn_id); mtc.stop; } /* resolve component reference by CIC */ private function f_comp_by_mgcp_tid(MgcpTransId tid) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { +runs on RAN_Emulation_CT return RAN_ConnHdlr { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].mgcp_trans_id == tid) { return ConnectionTable[i].comp_ref; } } - setverdict(fail, "BSSMAP Connection table not found by MGCP Transaction ID ", tid); + setverdict(fail, "RAN Connection table not found by MGCP Transaction ID ", tid); mtc.stop; } -private function f_comp_store_mgcp_tid(BSSAP_ConnHdlr client, MgcpTransId tid) -runs on BSSMAP_Emulation_CT { +private function f_comp_store_mgcp_tid(RAN_ConnHdlr client, MgcpTransId tid) +runs on RAN_Emulation_CT { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].comp_ref == client) { @@ -234,24 +234,24 @@ return; } } - setverdict(fail, "BSSMAP Connection table not found by component ", client); + setverdict(fail, "RAN Connection table not found by component ", client); mtc.stop; } private function f_comp_by_cic(integer cic) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { +runs on RAN_Emulation_CT return RAN_ConnHdlr { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].cic == cic) { return ConnectionTable[i].comp_ref; } } - setverdict(fail, "BSSMAP Connection table not found by CIC ", cic); + setverdict(fail, "RAN Connection table not found by CIC ", cic); mtc.stop; } -private function f_comp_store_cic(BSSAP_ConnHdlr client, integer cic) -runs on BSSMAP_Emulation_CT { +private function f_comp_store_cic(RAN_ConnHdlr client, integer cic) +runs on RAN_Emulation_CT { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].comp_ref == client) { @@ -259,36 +259,36 @@ return; } } - setverdict(fail, "BSSMAP Connection table not found by component ", client); + setverdict(fail, "RAN Connection table not found by component ", client); mtc.stop; } /* resolve connection ID by component reference */ -private function f_conn_id_by_comp(BSSAP_ConnHdlr client) -runs on BSSMAP_Emulation_CT return integer { +private function f_conn_id_by_comp(RAN_ConnHdlr client) +runs on RAN_Emulation_CT return integer { for (var integer i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].comp_ref == client) { return ConnectionTable[i].sccp_conn_id; } } - setverdict(fail, "BSSMAP Connection table not found by component ", client); + setverdict(fail, "RAN Connection table not found by component ", client); mtc.stop; } /* resolve ConnectionTable index component reference */ -private function f_idx_by_comp(BSSAP_ConnHdlr client) -runs on BSSMAP_Emulation_CT return integer { +private function f_idx_by_comp(RAN_ConnHdlr client) +runs on RAN_Emulation_CT return integer { for (var integer i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].comp_ref == client) { return i; } } - setverdict(fail, "BSSMAP Connection table not found by component ", client); + setverdict(fail, "RAN Connection table not found by component ", client); mtc.stop; } private function f_gen_conn_id() -runs on BSSMAP_Emulation_CT return integer { +runs on RAN_Emulation_CT return integer { var integer conn_id; do { @@ -299,7 +299,7 @@ } private function f_conn_table_init() -runs on BSSMAP_Emulation_CT { +runs on RAN_Emulation_CT { for (var integer i := 0; i < sizeof(ConnectionTable); i := i+1) { ConnectionTable[i].comp_ref := null; ConnectionTable[i].sccp_conn_id := -1; @@ -314,8 +314,8 @@ } } -private function f_conn_table_add(BSSAP_ConnHdlr comp_ref, integer sccp_conn_id) -runs on BSSMAP_Emulation_CT { +private function f_conn_table_add(RAN_ConnHdlr comp_ref, integer sccp_conn_id) +runs on RAN_Emulation_CT { for (var integer i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].sccp_conn_id == -1) { ConnectionTable[i].comp_ref := comp_ref; @@ -325,11 +325,11 @@ return; } } - testcase.stop("BSSMAP Connection table full!"); + testcase.stop("RAN Connection table full!"); } private function f_conn_table_del(integer sccp_conn_id) -runs on BSSMAP_Emulation_CT { +runs on RAN_Emulation_CT { for (var integer i := 0; i < sizeof(ConnectionTable); i := i+1) { if (ConnectionTable[i].sccp_conn_id == sccp_conn_id) { log("Deleted conn table entry ", i, @@ -339,12 +339,12 @@ return } } - setverdict(fail, "BSSMAP Connection table attempt to delete non-existant ", sccp_conn_id); + setverdict(fail, "RAN Connection table attempt to delete non-existant ", sccp_conn_id); mtc.stop; } private function f_imsi_table_find(hexstring imsi, template OCT4 tmsi) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { +runs on RAN_Emulation_CT return RAN_ConnHdlr { for (var integer i := 0; i < sizeof(ImsiTable); i := i+1) { if (ImsiTable[i].imsi == imsi or isvalue(tmsi) and match(ImsiTable[i].tmsi, tmsi)) { @@ -355,8 +355,8 @@ } /* handle (optional) userData portion of various primitives and dispatch it to the client */ -private function f_handle_userData(BSSAP_ConnHdlr client, PDU_BSSAP bssap) -runs on BSSMAP_Emulation_CT { +private function f_handle_userData(RAN_ConnHdlr client, PDU_BSSAP bssap) +runs on RAN_Emulation_CT { /* decode + send decoded BSSAP to client */ if (ischosen(bssap.pdu.bssmap)) { @@ -370,8 +370,8 @@ } } - if (ischosen(bssap.pdu.dtap) and g_bssmap_ops.decode_dtap) { - if (g_bssmap_ops.role_ms) { + if (ischosen(bssap.pdu.dtap) and g_ran_ops.decode_dtap) { + if (g_ran_ops.role_ms) { /* we are the MS, so any message to us must be MT */ var PDU_DTAP_MT mt := { dlci := bssap.dlci, @@ -394,16 +394,16 @@ /* call-back type, to be provided by specific implementation; called when new SCCP connection * arrives */ type function BssmapCreateCallback(BSSAP_N_CONNECT_ind conn_ind, charstring id) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr; +runs on RAN_Emulation_CT return RAN_ConnHdlr; type function BssmapUnitdataCallback(PDU_BSSAP bssap) -runs on BSSMAP_Emulation_CT return template PDU_BSSAP; +runs on RAN_Emulation_CT return template PDU_BSSAP; /* handle common Unitdata such as Paging */ private function CommonBssmapUnitdataCallback(PDU_BSSAP bssap) -runs on BSSMAP_Emulation_CT return template PDU_BSSAP { +runs on RAN_Emulation_CT return template PDU_BSSAP { if (match(bssap, tr_BSSMAP_Paging)) { - var BSSAP_ConnHdlr client := null; + var RAN_ConnHdlr client := null; client := f_imsi_table_find(bssap.pdu.bssmap.paging.iMSI.digits, bssap.pdu.bssmap.paging.tMSI.tmsiOctets); if (client != null) { @@ -417,10 +417,10 @@ log("CommonBssmapUnitdataCallback: Not a paging message"); } /* ELSE: handle in user callback */ - return g_bssmap_ops.unitdata_cb.apply(bssap); + return g_ran_ops.unitdata_cb.apply(bssap); } -type record BssmapOps { +type record RanOps { BssmapCreateCallback create_cb, BssmapUnitdataCallback unitdata_cb, boolean decode_dtap, @@ -472,7 +472,7 @@ return false; } -private altstep as_reset_ack() runs on BSSMAP_Emulation_CT { +private altstep as_reset_ack() runs on RAN_Emulation_CT { var BSSAP_N_UNITDATA_ind ud_ind; [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) -> value ud_ind { log("Respoding to inbound RESET with RESET-ACK"); @@ -483,7 +483,7 @@ } -private function f_bssap_wait_for_reset() runs on BSSMAP_Emulation_CT { +private function f_bssap_wait_for_reset() runs on RAN_Emulation_CT { var BSSAP_N_UNITDATA_ind ud_ind; timer T := 20.0; @@ -504,7 +504,7 @@ } } -function f_bssap_reset(SCCP_PAR_Address peer, SCCP_PAR_Address own) runs on BSSMAP_Emulation_CT { +function f_bssap_reset(SCCP_PAR_Address peer, SCCP_PAR_Address own) runs on RAN_Emulation_CT { timer T := 5.0; BSSAP.send(ts_BSSAP_UNITDATA_req(peer, own, ts_BSSMAP_Reset(0))); @@ -522,10 +522,10 @@ } } -function main(BssmapOps ops, charstring id) runs on BSSMAP_Emulation_CT { +function main(RanOps ops, charstring id) runs on RAN_Emulation_CT { - g_bssmap_id := id; - g_bssmap_ops := ops; + g_ran_id := id; + g_ran_ops := ops; f_conn_table_init(); f_expect_table_init(); @@ -541,13 +541,13 @@ var BSSAP_N_DATA_ind data_ind; var BSSAP_N_DISCONNECT_ind disc_ind; var BSSAP_Conn_Req creq; - var BSSAP_ConnHdlr vc_conn; + var RAN_ConnHdlr vc_conn; var PDU_BSSAP bssap; var PDU_DTAP_MO dtap_mo; var PDU_DTAP_MT dtap_mt; var MgcpCommand mgcp_req; var MgcpResponse mgcp_resp; - var BSSAP_ConnHdlr vc_hdlr; + var RAN_ConnHdlr vc_hdlr; var octetstring l3_info; var hexstring imsi; var OCT4 tmsi; @@ -590,7 +590,7 @@ f_handle_userData(vc_conn, disc_ind.userData); } /* notify client about termination */ - var BSSAP_Conn_Prim prim := MSC_CONN_PRIM_DISC_IND; + var RAN_Conn_Prim prim := MSC_CONN_PRIM_DISC_IND; CLIENT.send(prim) to vc_conn; f_conn_table_del(disc_ind.connectionId); /* TOOD: return confirm to other side? */ @@ -599,7 +599,7 @@ /* SCCP -> Client: connection confirm for outbound connection */ [] BSSAP.receive(BSSAP_N_CONNECT_cfm:?) -> value conn_cfm { vc_conn := f_comp_by_conn_id(conn_cfm.connectionId); - var BSSAP_Conn_Prim prim := MSC_CONN_PRIM_CONF_IND; + var RAN_Conn_Prim prim := MSC_CONN_PRIM_CONF_IND; CLIENT.send(prim) to vc_conn; /* handle user payload */ if (ispresent(conn_cfm.userData)) { @@ -608,7 +608,7 @@ } /* Disconnect request client -> SCCP */ - [] CLIENT.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_REQ) -> sender vc_conn { + [] CLIENT.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ) -> sender vc_conn { var integer conn_id := f_conn_id_by_comp(vc_conn); BSSAP.send(ts_BSSAP_DISC_req(conn_id, 0)); f_conn_table_del(conn_id); @@ -636,7 +636,7 @@ /* InitialL3 contains RR (PAG RESP) or MM (CM SRV REQ), we must increment * counter only on MM/CC/SS, but not on RR */ - if (g_bssmap_ops.role_ms and not f_bssap_l3_is_rr(creq.bssap)) { + if (g_ran_ops.role_ms and not f_bssap_l3_is_rr(creq.bssap)) { /* we have just sent the first MM message, increment the counter */ var integer idx := f_idx_by_comp(vc_conn); ConnectionTable[idx].n_sd[0] := 1; @@ -651,7 +651,7 @@ BSSAP.send(ts_BSSAP_DATA_req(conn_id, bssap)); } - [g_bssmap_ops.role_ms] CLIENT.receive(PDU_DTAP_MO:?) -> value dtap_mo sender vc_conn { + [g_ran_ops.role_ms] CLIENT.receive(PDU_DTAP_MO:?) -> value dtap_mo sender vc_conn { var integer idx := f_idx_by_comp(vc_conn); /* convert from decoded DTAP to encoded DTAP */ var octetstring l3_enc := enc_PDU_ML3_MS_NW(dtap_mo.dtap); @@ -663,7 +663,7 @@ BSSAP.send(ts_BSSAP_DATA_req(ConnectionTable[idx].sccp_conn_id, bssap)); } - [not g_bssmap_ops.role_ms] CLIENT.receive(PDU_DTAP_MT:?) -> value dtap_mt sender vc_conn { + [not g_ran_ops.role_ms] CLIENT.receive(PDU_DTAP_MT:?) -> value dtap_mt sender vc_conn { var integer conn_id := f_conn_id_by_comp(vc_conn); /* convert from decoded DTAP to encoded DTAP */ var octetstring l3_enc := enc_PDU_ML3_NW_MS(dtap_mt.dtap); @@ -712,14 +712,14 @@ } - [] PROC.getcall(BSSMAPEM_register:{?,?}) -> param(l3_info, vc_hdlr) { + [] PROC.getcall(RAN_register:{?,?}) -> param(l3_info, vc_hdlr) { f_create_expect(l3_info, vc_hdlr); - PROC.reply(BSSMAPEM_register:{l3_info, vc_hdlr}) to vc_hdlr; + PROC.reply(RAN_register:{l3_info, vc_hdlr}) to vc_hdlr; } - [] PROC.getcall(BSSMAPEM_register_imsi:{?,?,?}) -> param(imsi, tmsi, vc_hdlr) { + [] PROC.getcall(RAN_register_imsi:{?,?,?}) -> param(imsi, tmsi, vc_hdlr) { f_create_imsi(imsi, tmsi, vc_hdlr); - PROC.reply(BSSMAPEM_register_imsi:{imsi, tmsi, vc_hdlr}) to vc_hdlr; + PROC.reply(RAN_register_imsi:{imsi, tmsi, vc_hdlr}) to vc_hdlr; } @@ -742,23 +742,23 @@ /* L3 payload based on which we can match it */ octetstring l3_payload optional, /* component reference for this connection */ - BSSAP_ConnHdlr vc_conn + RAN_ConnHdlr vc_conn } /* procedure based port to register for incoming connections */ -signature BSSMAPEM_register(in octetstring l3, in BSSAP_ConnHdlr hdlr); +signature RAN_register(in octetstring l3, in RAN_ConnHdlr hdlr); /* procedure based port to register for incoming IMSI/TMSI */ -signature BSSMAPEM_register_imsi(in hexstring imsi, in OCT4 tmsi, in BSSAP_ConnHdlr hdlr); +signature RAN_register_imsi(in hexstring imsi, in OCT4 tmsi, in RAN_ConnHdlr hdlr); -type port BSSMAPEM_PROC_PT procedure { - inout BSSMAPEM_register, BSSMAPEM_register_imsi; +type port RAN_PROC_PT procedure { + inout RAN_register, RAN_register_imsi; } with { extension "internal" }; /* CreateCallback that can be used as create_cb and will use the expectation table */ function ExpectedCreateCallback(BSSAP_N_CONNECT_ind conn_ind, charstring id) -runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { - var BSSAP_ConnHdlr ret := null; +runs on RAN_Emulation_CT return RAN_ConnHdlr { + var RAN_ConnHdlr ret := null; var octetstring l3_info; var integer i; @@ -788,8 +788,8 @@ return ret; } -private function f_create_expect(octetstring l3, BSSAP_ConnHdlr hdlr) -runs on BSSMAP_Emulation_CT { +private function f_create_expect(octetstring l3, RAN_ConnHdlr hdlr) +runs on RAN_Emulation_CT { var integer i; for (i := 0; i < sizeof(ExpectTable); i := i+1) { if (not ispresent(ExpectTable[i].l3_payload)) { @@ -802,8 +802,8 @@ testcase.stop("No space left in ExpectTable"); } -private function f_create_imsi(hexstring imsi, OCT4 tmsi, BSSAP_ConnHdlr hdlr) -runs on BSSMAP_Emulation_CT { +private function f_create_imsi(hexstring imsi, OCT4 tmsi, RAN_ConnHdlr hdlr) +runs on RAN_Emulation_CT { for (var integer i := 0; i < sizeof(ImsiTable); i := i+1) { if (not ispresent(ImsiTable[i].imsi)) { ImsiTable[i].imsi := imsi; @@ -818,17 +818,17 @@ private function f_expect_table_init() -runs on BSSMAP_Emulation_CT { +runs on RAN_Emulation_CT { for (var integer i := 0; i < sizeof(ExpectTable); i := i+1) { ExpectTable[i].l3_payload := omit; } } /* helper function for clients to register their IMSI/TMSI */ -function f_bssmap_register_imsi(hexstring imsi, OCT4 tmsi) -runs on BSSAP_ConnHdlr { - BSSAP_PROC.call(BSSMAPEM_register_imsi:{imsi, tmsi, self}) { - [] BSSAP_PROC.getreply(BSSMAPEM_register_imsi:{?,?,?}) {}; +function f_ran_register_imsi(hexstring imsi, OCT4 tmsi) +runs on RAN_ConnHdlr { + BSSAP_PROC.call(RAN_register_imsi:{imsi, tmsi, self}) { + [] BSSAP_PROC.getreply(RAN_register_imsi:{?,?,?}) {}; } } diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 0b2344f..0eace36 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -7,7 +7,7 @@ import from IPL4asp_Types all; import from SCCPasp_Types all; import from BSSAP_Types all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from BSSMAP_Templates all; import from GSUP_Types all; @@ -42,7 +42,7 @@ import from SGsAP_Emulation all; /* this component represents a single subscriber connection */ -type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr, MGCP_ConnHdlr, SMPP_ConnHdlr, CTRL_Adapter_CT, SGsAP_ConnHdlr { +type component BSC_ConnHdlr extends RAN_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr, MGCP_ConnHdlr, SMPP_ConnHdlr, CTRL_Adapter_CT, SGsAP_ConnHdlr { var BSC_ConnHdlrPars g_pars; timer g_Tguard := 60.0; port TELNETasp_PT MSCVTY; @@ -155,10 +155,10 @@ } -/* Callback function from general BSSMAP_Emulation whenever a connectionless +/* Callback function from general RAN_Emulation whenever a connectionless * BSSMAP message arrives. Canreturn a PDU_BSSAPthat should be sent in return */ private function BscUnitdataCallback(PDU_BSSAP bssap) -runs on BSSMAP_Emulation_CT return template PDU_BSSAP { +runs on RAN_Emulation_CT return template PDU_BSSAP { var template PDU_BSSAP resp := omit; log("BSSMAP_BscUnitdataCallback"); @@ -172,9 +172,9 @@ return resp; } -const BssmapOps BSC_BssmapOps := { +const RanOps BSC_RanOps := { /* Create call-back for inbound connections from MSC (hand-over) */ - create_cb := refers(BSSMAP_Emulation.ExpectedCreateCallback), + create_cb := refers(RAN_Emulation.ExpectedCreateCallback), unitdata_cb := refers(BscUnitdataCallback), decode_dtap := true, role_ms := true, @@ -196,7 +196,7 @@ -/* Encode 'l3' and ask BSSMAP_Emulation to create new connection with COMPL L3 INFO */ +/* Encode 'l3' and ask RAN_Emulation to create new connection with COMPL L3 INFO */ function f_bssap_compl_l3(PDU_ML3_MS_NW l3) runs on BSC_ConnHdlr { log("Sending COMPL L3: ", l3); @@ -204,8 +204,8 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, l3_enc)))); alt { - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {} - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {} + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { setverdict(fail, "DISC.ind from SCCP"); mtc.stop; } @@ -386,12 +386,12 @@ /* FIXME: there could be pending SMS or other common procedures by the MSC, let's ignore them */ BSSAP.receive(tr_BSSMAP_ClearCommand); BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND); setverdict(pass); } function f_foo() runs on BSC_ConnHdlr{ - /* SCCP CC handled by BSSMAP_Emulation_CT.main() */ + /* SCCP CC handled by RAN_Emulation_CT.main() */ /* Expect auth, if enabled */ /* TODO: ISD */ @@ -484,7 +484,7 @@ var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); f_establish_fully(EST_TYPE_PAG_RESP); @@ -560,7 +560,7 @@ f_mt_call_initate(cpars); /* BSC <- MSC: Expect paging. FIXME: By TMSI or not? */ - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); /* Complete the call via BSSAP */ @@ -690,7 +690,7 @@ interleave { [] BSSAP.receive(t_clear) { BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND); } [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { if (respond_to_dlcx) { @@ -790,7 +790,7 @@ [] BSSAP.receive(tr_BSSMAP_ClearCommand) { BSSAP.send(ts_BSSMAP_ClearComplete); alt { - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { setverdict(pass); } [] BSSAP.receive { diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index df088bc..a9eb316 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -36,10 +36,10 @@ import from IPA_Emulation all; import from BSSAP_Types all; -import from BSSAP_Adapter all; +import from RAN_Adapter all; import from BSSAP_CodecPort all; import from BSSMAP_Templates all; -import from BSSMAP_Emulation all; +import from RAN_Emulation all; import from BSC_ConnectionHandler all; import from SGsAP_Templates all; @@ -66,7 +66,7 @@ import from TCCConversion_Functions all; const integer NUM_BSC := 2; -type record of BSSAP_Configuration BSSAP_Configurations; +type record of RAN_Configuration RAN_Configurations; /* Needed for SGsAP SMS */ import from MobileL3_SMS_Types all; @@ -74,7 +74,7 @@ type component MTC_CT extends CTRL_Adapter_CT { var boolean g_initialized := false; - var BSSAP_Adapter g_bssap[NUM_BSC]; + var RAN_Adapter g_bssap[NUM_BSC]; /* no 'adapter_CT' for MNCC or GSUP */ var MNCC_Emulation_CT vc_MNCC; @@ -121,7 +121,7 @@ charstring mp_mme_name := "mmec01.mmegi0001.mme.epc.mnc070.mcc901.3gppnetwork.org"; charstring mp_vlr_name := "vlr.example.net"; - BSSAP_Configurations mp_bssap_cfg := { + RAN_Configurations mp_bssap_cfg := { { sccp_service_type := "mtp3_itu", sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" }, @@ -277,7 +277,7 @@ for (var integer i := 0; i < num_bsc; i := i + 1) { if (isbound(mp_bssap_cfg[i])) { - f_bssap_init(g_bssap[i], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), BSC_BssmapOps); + f_bssap_init(g_bssap[i], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), BSC_RanOps); f_bssap_start(g_bssap[i]); } else { testcase.stop("missing BSSAP configuration"); @@ -522,8 +522,8 @@ vc_conn := BSC_ConnHdlr.create(id); /* BSSMAP part / A interface */ - connect(vc_conn:BSSAP, g_bssap[0].vc_BSSMAP:CLIENT); - connect(vc_conn:BSSAP_PROC, g_bssap[0].vc_BSSMAP:PROC); + connect(vc_conn:BSSAP, g_bssap[0].vc_RAN:CLIENT); + connect(vc_conn:BSSAP_PROC, g_bssap[0].vc_RAN:PROC); /* MNCC part */ connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT); connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC); @@ -804,7 +804,7 @@ mtc.stop; repeat; } - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} } setverdict(pass); } @@ -834,7 +834,7 @@ f_sleep(1.0); /* send clear request in the middle of the LU */ - BSSAP.send(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); + BSSAP.send(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); setverdict(pass); f_sleep(1.0); } @@ -1197,10 +1197,10 @@ timer T := 5.0; T.start; alt { - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} /* Expect LU REJECT with Cause == Illegal MS */ [] BSSAP.receive(tr_PDU_DTAP_MT(?)) { repeat; } - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) { repeat; } + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND) { repeat; } [] as_clear_cmd_compl_disc(); [] T.timeout { setverdict(fail, "Timeout waiting for ClearCommand or SCCP Release"); @@ -1236,9 +1236,9 @@ T.start; alt { /* Immediate disconnect */ - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} [] BSSAP.receive(tr_PDU_DTAP_MT(?)) { repeat; } - [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) { repeat; } + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND) { repeat; } [] as_clear_cmd_compl_disc(); [] T.timeout { setverdict(fail, "Timeout waiting for ClearCommand or SCCP Release"); @@ -1435,7 +1435,7 @@ } else { tmsi := 'FFFFFFFF'O; } - f_bssmap_register_imsi(g_pars.imsi, tmsi); + f_ran_register_imsi(g_pars.imsi, tmsi); /* Allocate call reference and send SETUP via MNCC to MSC */ cpars.mncc_callref := f_rnd_int(2147483648); @@ -2017,7 +2017,7 @@ } else { tmsi := 'FFFFFFFF'O; } - f_bssmap_register_imsi(g_pars.imsi, tmsi); + f_ran_register_imsi(g_pars.imsi, tmsi); f_vty_sms_send(hex2str(pars.imsi), "2342", "Hello SMS"); @@ -2055,7 +2055,7 @@ } else { tmsi := 'FFFFFFFF'O; } - f_bssmap_register_imsi(g_pars.imsi, tmsi); + f_ran_register_imsi(g_pars.imsi, tmsi); f_vty_sms_send(hex2str(pars.imsi), "2342", "Hello SMS"); @@ -2311,9 +2311,9 @@ /* Register an 'expect' for given IMSI (+TMSI) */ if (isvalue(g_pars.tmsi)) { - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); } else { - f_bssmap_register_imsi(g_pars.imsi, 'FFFFFFFF'O); + f_ran_register_imsi(g_pars.imsi, 'FFFFFFFF'O); } var template GSUP_PDU mt_forwardSM_res := tr_GSUP_MT_FORWARD_SM_RES( @@ -2375,9 +2375,9 @@ /* Register an 'expect' for given IMSI (+TMSI) */ if (isvalue(g_pars.tmsi)) { - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); } else { - f_bssmap_register_imsi(g_pars.imsi, 'FFFFFFFF'O); + f_ran_register_imsi(g_pars.imsi, 'FFFFFFFF'O); } var template GSUP_PDU mt_forwardSM_err := tr_GSUP_MT_FORWARD_SM_ERR( @@ -2441,9 +2441,9 @@ /* Register an 'expect' for given IMSI (+TMSI) */ if (isvalue(g_pars.tmsi)) { - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); } else { - f_bssmap_register_imsi(g_pars.imsi, 'FFFFFFFF'O); + f_ran_register_imsi(g_pars.imsi, 'FFFFFFFF'O); } /* Submit the 1st MT SMS on GSUP */ @@ -2553,9 +2553,9 @@ /* Register an 'expect' for given IMSI (+TMSI) */ if (isvalue(g_pars.tmsi)) { - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); } else { - f_bssmap_register_imsi(g_pars.imsi, 'FFFFFFFF'O); + f_ran_register_imsi(g_pars.imsi, 'FFFFFFFF'O); } /* Send CM Service Request for MO SMMA */ @@ -2656,9 +2656,9 @@ /* Register an 'expect' for given IMSI (+TMSI) */ if (isvalue(g_pars.tmsi)) { - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); } else { - f_bssmap_register_imsi(g_pars.imsi, 'FFFFFFFF'O); + f_ran_register_imsi(g_pars.imsi, 'FFFFFFFF'O); } var template GSUP_PDU mt_forwardSM_res := tr_GSUP_MT_FORWARD_SM_RES( @@ -2813,7 +2813,7 @@ } else { tmsi := 'FFFFFFFF'O; } - f_bssmap_register_imsi(g_pars.imsi, tmsi); + f_ran_register_imsi(g_pars.imsi, tmsi); var SmsParameters spars := valueof(t_SmsPars); /* TODO: test with more intelligent user data; test different coding schemes */ @@ -2964,7 +2964,7 @@ /* Perform location update */ f_perform_lu(); - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); /* We need to inspect GSUP activity */ f_create_gsup_expect(hex2str(g_pars.imsi)); @@ -3577,7 +3577,7 @@ /* Trigger a paging request and expect the paging on BSSMAP, this is * to make sure that pagings are sent throught the A-Interface again * and not throught the SGs interface.*/ - f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); f_vty_transceive(MSCVTY, "subscriber imsi " & hex2str(g_pars.imsi) & " paging"); alt { diff --git a/msc/gen_links.sh b/msc/gen_links.sh index 117564e..a29118a 100755 --- a/msc/gen_links.sh +++ b/msc/gen_links.sh @@ -89,7 +89,7 @@ FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc " FILES+="IPA_Types.ttcn IPA_Emulation.ttcnpp IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc GSUP_Types.ttcn GSUP_Emulation.ttcn " FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Common.ttcn " -FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn " +FILES+="RAN_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn RAN_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn " FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc " FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc " FILES+="SMPP_CodecPort.ttcn SMPP_CodecPort_CtrlFunct.ttcn SMPP_CodecPort_CtrlFunctDef.cc SMPP_Emulation.ttcn SMPP_Templates.ttcn " -- To view, visit https://gerrit.osmocom.org/13650 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iecbcb0c6c136baad9460eca40606bb4010d8882d Gerrit-Change-Number: 13650 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 13:08:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 13:08:13 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Add f_expect_paging() rather than using tr_BSSMAP_Paging directly In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13728 ) Change subject: Add f_expect_paging() rather than using tr_BSSMAP_Paging directly ...................................................................... Add f_expect_paging() rather than using tr_BSSMAP_Paging directly this will ease the introduction of RANAP support Change-Id: I213303337373c349676be4f8ac4175acdc701e47 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 14 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 0eace36..b3345ff 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -553,6 +553,11 @@ MNCC.receive(tr_MNCC_SETUP_cnf(cpars.mncc_callref)); } +function f_expect_paging(boolean by_tmsi := true) +runs on BSC_ConnHdlr { + BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); +} + function f_mt_call_establish(inout CallParameters cpars) runs on BSC_ConnHdlr { @@ -561,7 +566,7 @@ /* BSC <- MSC: Expect paging. FIXME: By TMSI or not? */ f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging() /* Complete the call via BSSAP */ f_mt_call_complete(cpars); diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index a9eb316..6ad8860 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -1443,7 +1443,8 @@ hex2str(cpars.called_party), hex2str(g_pars.imsi))); /* MSC->BSC: expect PAGING from MSC */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging(); + /* MS -> MSC: PAGING RESPONSE */ f_establish_fully(EST_TYPE_PAG_RESP); @@ -2022,7 +2023,8 @@ f_vty_sms_send(hex2str(pars.imsi), "2342", "Hello SMS"); /* MSC->BSC: expect PAGING from MSC */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging(); + /* Establish DTAP / BSSAP / SCCP connection */ f_establish_fully(EST_TYPE_PAG_RESP); @@ -2326,7 +2328,7 @@ f_gsup_forwardSM_req(spars); /* Expect Paging Request and Establish DTAP / BSSAP / SCCP connection */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging(); f_establish_fully(EST_TYPE_PAG_RESP); /* Wait for MT SMS on DTAP */ @@ -2391,7 +2393,7 @@ f_gsup_forwardSM_req(spars); /* Expect Paging Request and Establish DTAP / BSSAP / SCCP connection */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging(); f_establish_fully(EST_TYPE_PAG_RESP); /* Wait for MT SMS on DTAP */ @@ -2451,7 +2453,7 @@ f_gsup_forwardSM_req(spars1); /* Expect Paging Request and Establish DTAP / BSSAP / SCCP connection */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging(); f_establish_fully(EST_TYPE_PAG_RESP); /* Wait for 1st MT SMS on DTAP */ @@ -2785,7 +2787,7 @@ } /* MSC->BSC: expect PAGING from MSC */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging(); /* Establish DTAP / BSSAP / SCCP connection */ f_establish_fully(EST_TYPE_PAG_RESP); SMPP.receive(tr_SMPP(c_SMPP_command_id_alert_notification, ESME_ROK)); -- To view, visit https://gerrit.osmocom.org/13728 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I213303337373c349676be4f8ac4175acdc701e47 Gerrit-Change-Number: 13728 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 13:08:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 13:08:13 +0000 Subject: Change in osmo-ttcn3-hacks[master]: f_perform_lu(): Use f_expect_clear(), reduce code duplication In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13729 ) Change subject: f_perform_lu(): Use f_expect_clear(), reduce code duplication ...................................................................... f_perform_lu(): Use f_expect_clear(), reduce code duplication Change-Id: I64b183ad6615f2b0b9565a711de87fe4249625a1 --- M msc/BSC_ConnectionHandler.ttcn 1 file changed, 1 insertion(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index b3345ff..db0e683 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -384,9 +384,7 @@ f_expect_mm_info(); /* FIXME: there could be pending SMS or other common procedures by the MSC, let's ignore them */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + f_expect_clear(); setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/13729 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I64b183ad6615f2b0b9565a711de87fe4249625a1 Gerrit-Change-Number: 13729 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 13:08:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 13:08:13 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_Tests: Allow test cases to specify RAN index In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13730 ) Change subject: MSC_Tests: Allow test cases to specify RAN index ...................................................................... MSC_Tests: Allow test cases to specify RAN index This allows to start ConnHdlr on specific RAN connections, i.e. on different emulated BSCs (and soon RNCs). Change-Id: I3d7ec567a7b69d8c6f79d26971bf1c94e077d5f5 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 12 insertions(+), 9 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index db0e683..4534a9b 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -74,7 +74,8 @@ boolean ipa_ctrl_enable, boolean mm_info, boolean sgsap_enable, - boolean gsup_enable + boolean gsup_enable, + integer ran_idx }; /* get a one-octet bitmaks of supported algorithms based on Classmark information */ diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 6ad8860..8c221dc 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -485,7 +485,8 @@ type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; /* FIXME: move into BSC_ConnectionHandler? */ -function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup := true) runs on MTC_CT return BSC_ConnHdlrPars { +function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup := true, integer ran_idx := 0) +runs on MTC_CT return BSC_ConnHdlrPars { var BSC_ConnHdlrNetworkPars net_pars := { kc_support := '0A'O, /* A5/1 and A5/3 enabled */ expect_tmsi := true, @@ -493,8 +494,8 @@ expect_ciph := false }; var BSC_ConnHdlrPars pars := { - sccp_addr_own := g_bssap[0].sccp_addr_own, - sccp_addr_peer := g_bssap[0].sccp_addr_peer, + sccp_addr_own := g_bssap[ran_idx].sccp_addr_own, + sccp_addr_peer := g_bssap[ran_idx].sccp_addr_peer, cell_id := valueof(ts_CellId_CGI('262'H, '42'H, 23, 42)), imei := f_gen_imei(imsi_suffix), imsi := f_gen_imsi(imsi_suffix), @@ -511,7 +512,8 @@ ipa_ctrl_enable := true, mm_info := mp_mm_info, sgsap_enable := sgsap, - gsup_enable := gsup + gsup_enable := gsup, + ran_idx := ran_idx }; return pars; } @@ -522,8 +524,8 @@ vc_conn := BSC_ConnHdlr.create(id); /* BSSMAP part / A interface */ - connect(vc_conn:BSSAP, g_bssap[0].vc_RAN:CLIENT); - connect(vc_conn:BSSAP_PROC, g_bssap[0].vc_RAN:PROC); + connect(vc_conn:BSSAP, g_bssap[pars.ran_idx].vc_RAN:CLIENT); + connect(vc_conn:BSSAP_PROC, g_bssap[pars.ran_idx].vc_RAN:PROC); /* MNCC part */ connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT); connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC); @@ -550,8 +552,8 @@ return vc_conn; } -function f_start_handler(void_fn fn, integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlr { - return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix)); +function f_start_handler(void_fn fn, integer imsi_suffix, integer ran_idx := 0) runs on MTC_CT return BSC_ConnHdlr { + return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix, ran_idx := ran_idx)); } private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { -- To view, visit https://gerrit.osmocom.org/13730 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3d7ec567a7b69d8c6f79d26971bf1c94e077d5f5 Gerrit-Change-Number: 13730 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 18:50:25 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 22 Apr 2019 18:50:25 +0000 Subject: Change in osmo-mgw[master]: libosmo-mgcp: Use trunk type during endpoint allocation Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13738 Change subject: libosmo-mgcp: Use trunk type during endpoint allocation ...................................................................... libosmo-mgcp: Use trunk type during endpoint allocation This way we prepare it to add more endpoint types in the future (osmux) and also make it clear that E1 endpoint specifics allocation is still missing. Change-Id: I7633b5287a436c11f0bbbdbaef1cf59a051a2471 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 12 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/38/13738/1 diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 4121b9f..2acc7fd 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -1677,9 +1677,18 @@ tcfg->endpoints[i].cfg = tcfg->cfg; tcfg->endpoints[i].tcfg = tcfg; - /* NOTE: Currently all endpoints are of type RTP, this will - * change when new variations are implemented */ - tcfg->endpoints[i].type = &ep_typeset.rtp; + switch (tcfg->trunk_type) { + case MGCP_TRUNK_VIRTUAL: + tcfg->endpoints[i].type = &ep_typeset.rtp; + break; + case MGCP_TRUNK_E1: + /* FIXME: Implement E1 allocation */ + LOGP(DLMGCP, LOGL_FATAL, "E1 trunks not implemented!\n"); + break; + default: + osmo_panic("Cannot allocate unimplemented trunk type %d! %s:%d\n", + tcfg->trunk_type, __FILE__, __LINE__); + } } tcfg->number_endpoints = tcfg->vty_number_endpoints; -- To view, visit https://gerrit.osmocom.org/13738 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7633b5287a436c11f0bbbdbaef1cf59a051a2471 Gerrit-Change-Number: 13738 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 20:18:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Apr 2019 20:18:45 +0000 Subject: Change in osmo-mgw[master]: libosmo-mgcp: Use trunk type during endpoint allocation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13738 ) Change subject: libosmo-mgcp: Use trunk type during endpoint allocation ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13738 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7633b5287a436c11f0bbbdbaef1cf59a051a2471 Gerrit-Change-Number: 13738 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 22 Apr 2019 20:18:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 20:26:28 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 22 Apr 2019 20:26:28 +0000 Subject: Change in osmo-mgw[master]: libosmo-mgcp: Use trunk type during endpoint allocation In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13738 ) Change subject: libosmo-mgcp: Use trunk type during endpoint allocation ...................................................................... libosmo-mgcp: Use trunk type during endpoint allocation This way we prepare it to add more endpoint types in the future (osmux) and also make it clear that E1 endpoint specifics allocation is still missing. Change-Id: I7633b5287a436c11f0bbbdbaef1cf59a051a2471 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 12 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 4121b9f..2acc7fd 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -1677,9 +1677,18 @@ tcfg->endpoints[i].cfg = tcfg->cfg; tcfg->endpoints[i].tcfg = tcfg; - /* NOTE: Currently all endpoints are of type RTP, this will - * change when new variations are implemented */ - tcfg->endpoints[i].type = &ep_typeset.rtp; + switch (tcfg->trunk_type) { + case MGCP_TRUNK_VIRTUAL: + tcfg->endpoints[i].type = &ep_typeset.rtp; + break; + case MGCP_TRUNK_E1: + /* FIXME: Implement E1 allocation */ + LOGP(DLMGCP, LOGL_FATAL, "E1 trunks not implemented!\n"); + break; + default: + osmo_panic("Cannot allocate unimplemented trunk type %d! %s:%d\n", + tcfg->trunk_type, __FILE__, __LINE__); + } } tcfg->number_endpoints = tcfg->vty_number_endpoints; -- To view, visit https://gerrit.osmocom.org/13738 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7633b5287a436c11f0bbbdbaef1cf59a051a2471 Gerrit-Change-Number: 13738 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 22 22:21:42 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 22 Apr 2019 22:21:42 +0000 Subject: Change in osmo-mgw[master]: cosmetic: Fix typos in comment Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13739 Change subject: cosmetic: Fix typos in comment ...................................................................... cosmetic: Fix typos in comment Change-Id: I3c638033f1008325d2d653f00717e8c4a1bf9789 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/39/13739/1 diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 2acc7fd..ac6b4ea 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -437,8 +437,8 @@ /* Try to find a free port by attempting to bind on it. Also handle the * counter that points on the next free port. Since we have a pointer * to the next free port, binding should in work on the first attempt in - * general. In case of failure the next port is tryed until the whole port - * range is tryed once. */ + * general. In case of failure the next port is tried until the whole port + * range is tried once. */ static int allocate_port(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn) { int i; -- To view, visit https://gerrit.osmocom.org/13739 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3c638033f1008325d2d653f00717e8c4a1bf9789 Gerrit-Change-Number: 13739 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 08:15:00 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 08:15:00 +0000 Subject: Change in osmo-bts[master]: common/rsl.c: fix size argument in memcmp() call Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13740 Change subject: common/rsl.c: fix size argument in memcmp() call ...................................................................... common/rsl.c: fix size argument in memcmp() call Found using clang-8: rsl.c:1607:93: warning: size argument in 'memcmp' call is a comparison [-Wmemsize-comparison] rsl.c:1607:7: note: did you mean to compare the result of 'memcmp' instead? It looks more logical to compare the result of memcmp() against zero instead of passing 'sizeof(sysinfo_buf_t) != 0' as size. Change-Id: Ia8b95b017dbbfeb058d479fbaaf4861930569bb5 --- M src/common/rsl.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/40/13740/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index 5287201..8f5d689 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1604,7 +1604,7 @@ uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); lapdm_ui_prefix_lchan(lchan, TLVP_VAL(&tp, RSL_IE_L3_INFO), osmo_si, len); - if (memcmp(GSM_BTS_SI(bts, osmo_si), TLVP_VAL(&tp, RSL_IE_L3_INFO), sizeof(sysinfo_buf_t) != 0)) + if (memcmp(GSM_BTS_SI(bts, osmo_si), TLVP_VAL(&tp, RSL_IE_L3_INFO), sizeof(sysinfo_buf_t)) != 0) lchan->si.overridden |= (1 << osmo_si); else lchan->si.overridden &= ~(1 << osmo_si); -- To view, visit https://gerrit.osmocom.org/13740 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8b95b017dbbfeb058d479fbaaf4861930569bb5 Gerrit-Change-Number: 13740 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 08:55:25 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 08:55:25 +0000 Subject: Change in osmo-bts[master]: common/rsl.c: fix size argument in memcmp() call In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13740 ) Change subject: common/rsl.c: fix size argument in memcmp() call ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13740 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia8b95b017dbbfeb058d479fbaaf4861930569bb5 Gerrit-Change-Number: 13740 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 08:55:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 08:58:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 08:58:45 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: f_mm_auth(): Add support for UMTS AKA In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13736 to look at the new patch set (#2). Change subject: msc: f_mm_auth(): Add support for UMTS AKA ...................................................................... msc: f_mm_auth(): Add support for UMTS AKA Change-Id: Id57adcebd63a06cfa555824e493561fe08f13d6d --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 30 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/36/13736/2 -- To view, visit https://gerrit.osmocom.org/13736 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id57adcebd63a06cfa555824e493561fe08f13d6d Gerrit-Change-Number: 13736 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 08:58:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 08:58:45 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Add RANAP support In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13653 to look at the new patch set (#3). Change subject: RAN_Emulation: Add RANAP support ...................................................................... RAN_Emulation: Add RANAP support So far, RAN_Emulation only handled BSSAP and hence could be used to emulate BSCs towards the MSC. Let's extend it with RANAP support so we can also emulate RNCs towards the MSC. We try to share as much code and logic as possible betweeb the two. Related: OS#2856, OS#2857 Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33 --- M library/RAN_Adapter.ttcnpp M library/RAN_Emulation.ttcnpp 2 files changed, 345 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/53/13653/3 -- To view, visit https://gerrit.osmocom.org/13653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33 Gerrit-Change-Number: 13653 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 08:59:27 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 08:59:27 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: f_mm_auth(): Add support for UMTS AKA In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13736 ) Change subject: msc: f_mm_auth(): Add support for UMTS AKA ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13736 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id57adcebd63a06cfa555824e493561fe08f13d6d Gerrit-Change-Number: 13736 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 23 Apr 2019 08:59:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 08:59:31 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 08:59:31 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Add testcase for UMTS AKA over GERAN TC_lu_imsi_auth3g_tmsi() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13737 ) Change subject: msc: Add testcase for UMTS AKA over GERAN TC_lu_imsi_auth3g_tmsi() ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13737 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I10cc7ed214e83b4624587c60f332034d3f19b22d Gerrit-Change-Number: 13737 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 23 Apr 2019 08:59:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 09:00:07 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 09:00:07 +0000 Subject: Change in osmo-ttcn3-hacks[master]: HNBAP, RUA and RANAP protocol codecs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13652 ) Change subject: HNBAP, RUA and RANAP protocol codecs ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13652 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If4a72de9bc54d6e6a7daaca78a4d4aa5684203a5 Gerrit-Change-Number: 13652 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 23 Apr 2019 09:00:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 09:00:09 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 09:00:09 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Modularize protocol support In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13651 ) Change subject: RAN_Emulation: Modularize protocol support ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13651 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id53ba3ff05f9946230e0e4a759245de14a0f9fbd Gerrit-Change-Number: 13651 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 23 Apr 2019 09:00:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 09:01:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 09:01:21 +0000 Subject: Change in osmo-bts[master]: common/rsl.c: fix size argument in memcmp() call In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13740 ) Change subject: common/rsl.c: fix size argument in memcmp() call ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13740 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia8b95b017dbbfeb058d479fbaaf4861930569bb5 Gerrit-Change-Number: 13740 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 09:01:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 09:14:06 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 09:14:06 +0000 Subject: Change in osmo-bts[master]: osmo-bts-trx: distinguish 11-bit Access Bursts by synch. sequence In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13723 ) Change subject: osmo-bts-trx: distinguish 11-bit Access Bursts by synch. sequence ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13723 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibb6d27c6589965c8b59a6d2598a7c43fd860f284 Gerrit-Change-Number: 13723 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 23 Apr 2019 09:14:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 09:25:59 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 09:25:59 +0000 Subject: Change in osmo-bts[master]: README.md: remove OS#1865 from 'Known limitations' Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13741 Change subject: README.md: remove OS#1865 from 'Known limitations' ...................................................................... README.md: remove OS#1865 from 'Known limitations' Neither the bug has been reproduced, nor the bug reporter did respond to request for configuration files. Change-Id: Ibc9db360be1380abaa9eef4bdf6e9a6d251670da --- M README.md 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/41/13741/1 diff --git a/README.md b/README.md index 01ec0ff..b1d7961 100644 --- a/README.md +++ b/README.md @@ -121,5 +121,4 @@ osmo-bts-trx ------------ - * TCH/F_PDCH cannel not working as voice (https://osmocom.org/issues/1865) * No BER value delivered to OsmoPCU (https://osmocom.org/issues/1855) -- To view, visit https://gerrit.osmocom.org/13741 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibc9db360be1380abaa9eef4bdf6e9a6d251670da Gerrit-Change-Number: 13741 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 09:36:23 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 09:36:23 +0000 Subject: Change in osmo-bts[master]: common/rsl.c: fix size argument in memcmp() call In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13740 ) Change subject: common/rsl.c: fix size argument in memcmp() call ...................................................................... common/rsl.c: fix size argument in memcmp() call Found using clang-8: rsl.c:1607:93: warning: size argument in 'memcmp' call is a comparison [-Wmemsize-comparison] rsl.c:1607:7: note: did you mean to compare the result of 'memcmp' instead? It looks more logical to compare the result of memcmp() against zero instead of passing 'sizeof(sysinfo_buf_t) != 0' as size. Change-Id: Ia8b95b017dbbfeb058d479fbaaf4861930569bb5 --- M src/common/rsl.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/common/rsl.c b/src/common/rsl.c index 5287201..8f5d689 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1604,7 +1604,7 @@ uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); lapdm_ui_prefix_lchan(lchan, TLVP_VAL(&tp, RSL_IE_L3_INFO), osmo_si, len); - if (memcmp(GSM_BTS_SI(bts, osmo_si), TLVP_VAL(&tp, RSL_IE_L3_INFO), sizeof(sysinfo_buf_t) != 0)) + if (memcmp(GSM_BTS_SI(bts, osmo_si), TLVP_VAL(&tp, RSL_IE_L3_INFO), sizeof(sysinfo_buf_t)) != 0) lchan->si.overridden |= (1 << osmo_si); else lchan->si.overridden &= ~(1 << osmo_si); -- To view, visit https://gerrit.osmocom.org/13740 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia8b95b017dbbfeb058d479fbaaf4861930569bb5 Gerrit-Change-Number: 13740 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 09:51:57 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 09:51:57 +0000 Subject: Change in osmo-bts[master]: README.md: remove OS#1865 from 'Known limitations' In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13741 ) Change subject: README.md: remove OS#1865 from 'Known limitations' ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13741 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibc9db360be1380abaa9eef4bdf6e9a6d251670da Gerrit-Change-Number: 13741 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 09:51:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 10:36:57 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 10:36:57 +0000 Subject: Change in osmo-mgw[master]: cosmetic: tests: mgcp_client_test: clean trailing whitespace Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13742 Change subject: cosmetic: tests: mgcp_client_test: clean trailing whitespace ...................................................................... cosmetic: tests: mgcp_client_test: clean trailing whitespace Change-Id: Ie27c0a9bf7a16983f31a07c314b0a602e9fb8999 --- M tests/mgcp_client/mgcp_client_test.c 1 file changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/42/13742/1 diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 1db70cf..d610783 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -113,9 +113,9 @@ printf(" ptmap_len = %u\n", response->ptmap_len); for(i=0;iptmap_len;i++) { printf(" ptmap[%u].codec = %u\n", i, response->ptmap[i].codec); - printf(" ptmap[%u].pt = %u\n", i, response->ptmap[i].pt); + printf(" ptmap[%u].pt = %u\n", i, response->ptmap[i].pt); } - + } mgcp_trans_id_t dummy_mgcp_send(struct msgb *msg) @@ -180,7 +180,7 @@ MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); mgcp_msg.codecs_len = 2; msg = mgcp_msg_gen(mgcp, &mgcp_msg); - mgcp_msg.codecs_len = 1; + mgcp_msg.codecs_len = 1; printf("%s\n", (char *)msg->data); printf("Generated CRCX message (three codecs, one with custom pt):\n"); @@ -190,8 +190,8 @@ MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); mgcp_msg.codecs_len = 3; msg = mgcp_msg_gen(mgcp, &mgcp_msg); - mgcp_msg.codecs_len = 1; - printf("%s\n", (char *)msg->data); + mgcp_msg.codecs_len = 1; + printf("%s\n", (char *)msg->data); printf("Generated MDCX message:\n"); mgcp_msg.verb = MGCP_VERB_MDCX; @@ -210,7 +210,7 @@ MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); mgcp_msg.codecs_len = 2; msg = mgcp_msg_gen(mgcp, &mgcp_msg); - mgcp_msg.codecs_len = 1; + mgcp_msg.codecs_len = 1; printf("%s\n", (char *)msg->data); printf("Generated MDCX message (three codecs, one with custom pt):\n"); @@ -221,8 +221,8 @@ MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); mgcp_msg.codecs_len = 3; msg = mgcp_msg_gen(mgcp, &mgcp_msg); - mgcp_msg.codecs_len = 1; - printf("%s\n", (char *)msg->data); + mgcp_msg.codecs_len = 1; + printf("%s\n", (char *)msg->data); printf("Generated DLCX message:\n"); mgcp_msg.verb = MGCP_VERB_DLCX; @@ -286,7 +286,7 @@ | MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE), .ptime = 20, .codecs[0] = CODEC_AMR_8000_1, - .codecs_len = 1 + .codecs_len = 1 }; printf("\n%s():\n", __func__); -- To view, visit https://gerrit.osmocom.org/13742 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie27c0a9bf7a16983f31a07c314b0a602e9fb8999 Gerrit-Change-Number: 13742 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 10:49:41 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Tue, 23 Apr 2019 10:49:41 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling G... In-Reply-To: References: Message-ID: Mykola Shchetinin has posted comments on this change. ( https://gerrit.osmocom.org/13654 ) Change subject: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling GMM Attach Requests ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13654 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I50e8e316f06ae1a6171a6b07e4e2f0761322b779 Gerrit-Change-Number: 13654 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 10:49:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 10:51:32 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Tue, 23 Apr 2019 10:51:32 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling G... In-Reply-To: References: Message-ID: Mykola Shchetinin has posted comments on this change. ( https://gerrit.osmocom.org/13654 ) Change subject: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling GMM Attach Requests ...................................................................... Patch Set 2: It took a while for me to understand what it fixes. (Primarily through experimenting and debugging). Sorry for the late reply -- To view, visit https://gerrit.osmocom.org/13654 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I50e8e316f06ae1a6171a6b07e4e2f0761322b779 Gerrit-Change-Number: 13654 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 10:51:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 11:13:34 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 23 Apr 2019 11:13:34 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling G... In-Reply-To: References: Message-ID: lynxis lazus has submitted this change and it was merged. ( https://gerrit.osmocom.org/13654 ) Change subject: gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling GMM Attach Requests ...................................................................... gprs_gmm: reintroduce calling gsm48_gmm_authorize when not handling GMM Attach Requests A security command is part of multiple procedures to ensure integrity (optional also encryption) between MS and RNC. It should be used for all Iu connections once. With the rewrite of the GMM Attach FSM the use of the security command procedure was broken for all procedures e.g. Service Request except GMM Attach Request. Relates: OS#3920 Change-Id: I50e8e316f06ae1a6171a6b07e4e2f0761322b779 --- M src/gprs/gprs_gmm.c 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Mykola Shchetinin: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index b0c5902..358bff9 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -205,7 +205,12 @@ REQUIRE_MM /* Continue authentication here */ mm->iu.ue_ctx->integrity_active = 1; - osmo_fsm_inst_dispatch(mm->gmm_att_req.fsm, E_IU_SECURITY_CMD_COMPLETE, NULL); + + /* FIXME: remove gmm_authorize */ + if (mm->pending_req != GSM48_MT_GMM_ATTACH_REQ) + gsm48_gmm_authorize(mm); + else + osmo_fsm_inst_dispatch(mm->gmm_att_req.fsm, E_IU_SECURITY_CMD_COMPLETE, NULL); break; default: LOGP(DRANAP, LOGL_NOTICE, "Unknown event received: %i\n", type); -- To view, visit https://gerrit.osmocom.org/13654 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I50e8e316f06ae1a6171a6b07e4e2f0761322b779 Gerrit-Change-Number: 13654 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 11:14:58 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 23 Apr 2019 11:14:58 +0000 Subject: Change in osmo-sgsn[master]: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/13628 ) Change subject: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK ...................................................................... Patch Set 1: @daniel: do you want to fix it yourself? You can take over this Commit. -- To view, visit https://gerrit.osmocom.org/13628 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I20bf4db8da746e0b994bfe3f8178188831b67ed3 Gerrit-Change-Number: 13628 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 23 Apr 2019 11:14:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 11:22:23 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 23 Apr 2019 11:22:23 +0000 Subject: Change in openbsc[master]: Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/13703 ) Change subject: Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. ...................................................................... Patch Set 2: Code-Review+1 Rafael, Harald gave this a +2 so you can hit the submit button yourself if you like. Maybe reference the osmocom issue in the commit msg? -- To view, visit https://gerrit.osmocom.org/13703 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3690acebf882d3a8abbeabe0e3aefdfcd066a052 Gerrit-Change-Number: 13703 Gerrit-PatchSet: 2 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Comment-Date: Tue, 23 Apr 2019 11:22:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 11:25:12 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 11:25:12 +0000 Subject: Change in osmo-mgw[master]: mgcp_msg: Log faulty line on Osmux parsing error Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13743 Change subject: mgcp_msg: Log faulty line on Osmux parsing error ...................................................................... mgcp_msg: Log faulty line on Osmux parsing error Change-Id: I436e53963f8e7d00f3111ff81f7b08475c4b8ae9 --- M src/libosmo-mgcp/mgcp_msg.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/43/13743/1 diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index f98b9ee..5844d41 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -365,8 +365,11 @@ { int osmux_cid; - if (sscanf(line + 2, "Osmux: %u", &osmux_cid) != 1) + if (sscanf(line + 2, "Osmux: %u", &osmux_cid) != 1) { + LOGP(DLMGCP, LOGL_ERROR, "Failed parsing Osmux in MGCP msg line: %s\n", + line); return -1; + } if (osmux_cid > OSMUX_CID_MAX) { LOGP(DLMGCP, LOGL_ERROR, "Osmux ID too large: %u > %u\n", -- To view, visit https://gerrit.osmocom.org/13743 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I436e53963f8e7d00f3111ff81f7b08475c4b8ae9 Gerrit-Change-Number: 13743 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 11:25:46 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 11:25:46 +0000 Subject: Change in osmo-mgw[master]: cosmetic: Fix typos in comment In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13739 ) Change subject: cosmetic: Fix typos in comment ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13739 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3c638033f1008325d2d653f00717e8c4a1bf9789 Gerrit-Change-Number: 13739 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 23 Apr 2019 11:25:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 11:26:02 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 11:26:02 +0000 Subject: Change in osmo-mgw[master]: cosmetic: tests: mgcp_client_test: clean trailing whitespace In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13742 ) Change subject: cosmetic: tests: mgcp_client_test: clean trailing whitespace ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13742 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie27c0a9bf7a16983f31a07c314b0a602e9fb8999 Gerrit-Change-Number: 13742 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 23 Apr 2019 11:26:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 11:30:30 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 11:30:30 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH 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/13735 to look at the new patch set (#2). Change subject: BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH ...................................................................... BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH According to 3GPP TS 04.60, section 11.2.5a, the extended (11-bit) Access Burst on RACH/PRACH is used by the MS to indicate its EGPRS capability. One of the alternative synch. sequences (see 3GPP TS 05.02, TS1 and TS2) shall be used. Add a test case to verify extended (11-bit) RACH decoding. Depends: (OsmocomBB) I36fd20cd5502ce33c52f644ee4c22abb83350df8 Change-Id: I8fe156aeac9de3dc1e71a4950821d4942ba9a253 Related: OS#1854 --- M bts/BTS_Tests.ttcn M bts/expected-results.xml M library/L1CTL_PortType.ttcn 3 files changed, 88 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/35/13735/2 -- To view, visit https://gerrit.osmocom.org/13735 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8fe156aeac9de3dc1e71a4950821d4942ba9a253 Gerrit-Change-Number: 13735 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 11:32:01 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 23 Apr 2019 11:32:01 +0000 Subject: Change in osmo-msc[master]: vlr_sgs_fsm: make sure vsub is marked used when LA is present In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/13690 ) Change subject: vlr_sgs_fsm: make sure vsub is marked used when LA is present ...................................................................... Patch Set 2: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/13690/1/src/libvlr/vlr_sgs_fsm.c File src/libvlr/vlr_sgs_fsm.c: https://gerrit.osmocom.org/#/c/13690/1/src/libvlr/vlr_sgs_fsm.c at 132 PS1, Line 132: if (!vsub->lu_complete) { > I talked with dexter and we agreed that this line and the assignment should probably be encapsulated [?] Done -- To view, visit https://gerrit.osmocom.org/13690 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iba90be095569cc5212c61ab8e8a9bfd4ae51fd44 Gerrit-Change-Number: 13690 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Assignee: Pau Espin Pedrol Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 11:32:01 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 11:32:08 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 23 Apr 2019 11:32:08 +0000 Subject: Change in osmo-msc[master]: vlr_sgs_fsm: make sure vsub is marked used when LA is present In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/13690 ) Change subject: vlr_sgs_fsm: make sure vsub is marked used when LA is present ...................................................................... vlr_sgs_fsm: make sure vsub is marked used when LA is present When the LU is accepted and the subscriber (vsub) is not claimed as "in use" in the ref counting system. - Make sure vlr_subscr_get() is called when the LU is accepted. Change-Id: Iba90be095569cc5212c61ab8e8a9bfd4ae51fd44 Related OS#3934 --- M src/libvlr/vlr_sgs_fsm.c 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Daniel Willmann: Looks good to me, but someone else must approve dexter: Looks good to me, approved diff --git a/src/libvlr/vlr_sgs_fsm.c b/src/libvlr/vlr_sgs_fsm.c index ee1d748..a25d41c 100644 --- a/src/libvlr/vlr_sgs_fsm.c +++ b/src/libvlr/vlr_sgs_fsm.c @@ -128,7 +128,13 @@ vsub->loc_conf_in_hlr_ind = true; vsub->la_allowed = true; vsub->imsi_detached_flag = false; - vsub->lu_complete = true; + + if (!vsub->lu_complete) { + vsub->lu_complete = true; + /* Balanced by vlr_subscr_expire() */ + vlr_subscr_get(vsub, VSUB_USE_ATTACHED); + } + vlr_sgs_fsm_update_id(vsub); vsub->cs.attached_via_ran = OSMO_RAT_EUTRAN_SGS; -- To view, visit https://gerrit.osmocom.org/13690 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iba90be095569cc5212c61ab8e8a9bfd4ae51fd44 Gerrit-Change-Number: 13690 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Assignee: Pau Espin Pedrol Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 11:38:45 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 11:38:45 +0000 Subject: Change in osmo-mgw[master]: cosmetic: Fix typos in comment In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13739 ) Change subject: cosmetic: Fix typos in comment ...................................................................... cosmetic: Fix typos in comment Change-Id: I3c638033f1008325d2d653f00717e8c4a1bf9789 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, approved diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 2acc7fd..ac6b4ea 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -437,8 +437,8 @@ /* Try to find a free port by attempting to bind on it. Also handle the * counter that points on the next free port. Since we have a pointer * to the next free port, binding should in work on the first attempt in - * general. In case of failure the next port is tryed until the whole port - * range is tryed once. */ + * general. In case of failure the next port is tried until the whole port + * range is tried once. */ static int allocate_port(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn) { int i; -- To view, visit https://gerrit.osmocom.org/13739 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3c638033f1008325d2d653f00717e8c4a1bf9789 Gerrit-Change-Number: 13739 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 11:38:45 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 11:38:45 +0000 Subject: Change in osmo-mgw[master]: cosmetic: tests: mgcp_client_test: clean trailing whitespace In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13742 ) Change subject: cosmetic: tests: mgcp_client_test: clean trailing whitespace ...................................................................... cosmetic: tests: mgcp_client_test: clean trailing whitespace Change-Id: Ie27c0a9bf7a16983f31a07c314b0a602e9fb8999 --- M tests/mgcp_client/mgcp_client_test.c 1 file changed, 9 insertions(+), 9 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, approved diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c index 1db70cf..d610783 100644 --- a/tests/mgcp_client/mgcp_client_test.c +++ b/tests/mgcp_client/mgcp_client_test.c @@ -113,9 +113,9 @@ printf(" ptmap_len = %u\n", response->ptmap_len); for(i=0;iptmap_len;i++) { printf(" ptmap[%u].codec = %u\n", i, response->ptmap[i].codec); - printf(" ptmap[%u].pt = %u\n", i, response->ptmap[i].pt); + printf(" ptmap[%u].pt = %u\n", i, response->ptmap[i].pt); } - + } mgcp_trans_id_t dummy_mgcp_send(struct msgb *msg) @@ -180,7 +180,7 @@ MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); mgcp_msg.codecs_len = 2; msg = mgcp_msg_gen(mgcp, &mgcp_msg); - mgcp_msg.codecs_len = 1; + mgcp_msg.codecs_len = 1; printf("%s\n", (char *)msg->data); printf("Generated CRCX message (three codecs, one with custom pt):\n"); @@ -190,8 +190,8 @@ MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE); mgcp_msg.codecs_len = 3; msg = mgcp_msg_gen(mgcp, &mgcp_msg); - mgcp_msg.codecs_len = 1; - printf("%s\n", (char *)msg->data); + mgcp_msg.codecs_len = 1; + printf("%s\n", (char *)msg->data); printf("Generated MDCX message:\n"); mgcp_msg.verb = MGCP_VERB_MDCX; @@ -210,7 +210,7 @@ MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); mgcp_msg.codecs_len = 2; msg = mgcp_msg_gen(mgcp, &mgcp_msg); - mgcp_msg.codecs_len = 1; + mgcp_msg.codecs_len = 1; printf("%s\n", (char *)msg->data); printf("Generated MDCX message (three codecs, one with custom pt):\n"); @@ -221,8 +221,8 @@ MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT); mgcp_msg.codecs_len = 3; msg = mgcp_msg_gen(mgcp, &mgcp_msg); - mgcp_msg.codecs_len = 1; - printf("%s\n", (char *)msg->data); + mgcp_msg.codecs_len = 1; + printf("%s\n", (char *)msg->data); printf("Generated DLCX message:\n"); mgcp_msg.verb = MGCP_VERB_DLCX; @@ -286,7 +286,7 @@ | MGCP_MSG_PRESENCE_CONN_ID | MGCP_MSG_PRESENCE_CONN_MODE), .ptime = 20, .codecs[0] = CODEC_AMR_8000_1, - .codecs_len = 1 + .codecs_len = 1 }; printf("\n%s():\n", __func__); -- To view, visit https://gerrit.osmocom.org/13742 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie27c0a9bf7a16983f31a07c314b0a602e9fb8999 Gerrit-Change-Number: 13742 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 11:39:16 2019 From: gerrit-no-reply at lists.osmocom.org (Rafael Diniz) Date: Tue, 23 Apr 2019 11:39:16 +0000 Subject: Change in openbsc[master]: Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. In-Reply-To: References: Message-ID: Rafael Diniz has submitted this change and it was merged. ( https://gerrit.osmocom.org/13703 ) Change subject: Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. ...................................................................... Fixed MNCC_RTP_CREATE after MNCC_DISC_IND. Change-Id: I3690acebf882d3a8abbeabe0e3aefdfcd066a052 --- M openbsc/src/libmsc/gsm_04_08.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Keith Whyte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 09e35cc..732fe85 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -3787,6 +3787,9 @@ return rc; } + if (msg_type == MNCC_REL_REQ && conn->mncc_rtp_create_pending) + conn->mncc_rtp_create_pending = 0; + DEBUGP(DCC, "(bts %d trx %d ts %d ti %02x sub %s) " "Received '%s' from MNCC in state %d (%s)\n", conn->bts->nr, conn->lchan->ts->trx->nr, conn->lchan->ts->nr, -- To view, visit https://gerrit.osmocom.org/13703 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3690acebf882d3a8abbeabe0e3aefdfcd066a052 Gerrit-Change-Number: 13703 Gerrit-PatchSet: 2 Gerrit-Owner: Rafael Diniz Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Rafael Diniz -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 12:15:02 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 12:15:02 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13735 ) Change subject: BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13735 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8fe156aeac9de3dc1e71a4950821d4942ba9a253 Gerrit-Change-Number: 13735 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 23 Apr 2019 12:15:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 12:25:54 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Tue, 23 Apr 2019 12:25:54 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. Message-ID: Mykola Shchetinin has uploaded this change for review. ( https://gerrit.osmocom.org/13744 Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... gprs_gmm: send Service Reject when no PDP ctxs are available. Look at PDP Context Status IE and see if MS's view of activated/deactivated NSAPIs agrees with our view. It is checked if there are any Active NSAPIs in PDP Context Status IE which are not present on the network side. If there are any then Service Reject with the cause "NO PDP ACTIVATED" is sent back. This forces MS to reactivate the PDP contexts. 3GPP TS 24.008 Section 4.7.13.4 Service request procedure not accepted by the network. Cause # 40. Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Relates: OS#3973 --- M src/gprs/gprs_gmm.c 1 file changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/44/13744/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 358bff9..a237da3 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -1616,6 +1616,26 @@ } } +/* Returns false if any active PDP context in pdp_status is not present in the pdp_list for given MS */ +static bool all_ms_ctx_present_on_sgsn(struct sgsn_mm_ctx *mmctx, + const uint8_t *pdp_status) +{ + uint8_t pdp_nsapi; + + for (pdp_nsapi = 0; pdp_nsapi < 16; pdp_nsapi++) { + bool active; + if (pdp_nsapi < 8) + active = (1 << pdp_nsapi) & pdp_status[0]; + else + active = (1 << (pdp_nsapi - 8)) & pdp_status[1]; + + if (active && (sgsn_pdp_ctx_by_nsapi(mmctx, pdp_nsapi) == NULL)) + return false; + } + + return true; +} + /* Chapter 9.4.14: Routing area update request */ static int gsm48_rx_gmm_ra_upd_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg, struct gprs_llc_llme *llme) @@ -1902,6 +1922,16 @@ if (TLVP_PRESENT(&tp, GSM48_IE_GMM_PDP_CTX_STATUS)) { const uint8_t *pdp_status = TLVP_VAL(&tp, GSM48_IE_GMM_PDP_CTX_STATUS); process_ms_ctx_status(ctx, pdp_status); + + /* 3GPP TS 24.008 Section 4.7.13.4 Service request procedure not + * accepted by the network. Cause #40. + * If MS has PDP Contexts in Active state in pdp_status but they + * are not activated on the network side then Reject with the + * cause will force the mobile to recreate PDP contexts */ + if (!all_ms_ctx_present_on_sgsn(ctx, pdp_status)) { + reject_cause = GMM_CAUSE_NO_PDP_ACTIVATED; + goto rejected; + } } -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 1 Gerrit-Owner: Mykola Shchetinin -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 12:27:43 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Tue, 23 Apr 2019 12:27:43 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Mykola Shchetinin has posted comments on this change. ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... Patch Set 1: Open to suggestions on how to improve the code quality. Also, there is another place where PDP contexts are checked: process_ms_ctx_status() is also called for Routing are update request. I don't know whether I need to add my check all_ms_ctx_present_on_sgsn() there as well. -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 1 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Mykola Shchetinin Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 23 Apr 2019 12:27:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 12:28:06 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Tue, 23 Apr 2019 12:28:06 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Mykola Shchetinin has posted comments on this change. ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... Patch Set 1: Adding pcap and logs of this patch to the issue OS#3973 -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 1 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Mykola Shchetinin Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 23 Apr 2019 12:28:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 12:28:57 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Tue, 23 Apr 2019 12:28:57 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Mykola Shchetinin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... gprs_gmm: send Service Reject when no PDP ctxs are available. Look at PDP Context Status IE and see if MS's view of activated/deactivated NSAPIs agrees with our view. It is checked if there are any Active NSAPIs in PDP Context Status IE which are not present on the network side. If there are any then Service Reject with the cause "NO PDP ACTIVATED" is sent back. This forces MS to reactivate the PDP contexts. 3GPP TS 24.008 Section 4.7.13.4 Service request procedure not accepted by the network. Cause # 40. Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Relates: OS#3937 --- M src/gprs/gprs_gmm.c 1 file changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/44/13744/2 -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 2 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Mykola Shchetinin Gerrit-CC: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 12:29:10 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Tue, 23 Apr 2019 12:29:10 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Mykola Shchetinin has posted comments on this change. ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... Patch Set 2: > Adding pcap and logs of this patch to the issue OS#3973 *OS#3937 -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 2 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Mykola Shchetinin Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 23 Apr 2019 12:29:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 13:09:34 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 23 Apr 2019 13:09:34 +0000 Subject: Change in osmo-msc[master]: vlr subscr get/put: also check against NULL Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13745 Change subject: vlr subscr get/put: also check against NULL ...................................................................... vlr subscr get/put: also check against NULL Change-Id: I36929a4ba4abb46909181068d1d0af967b1f5a94 --- M include/osmocom/msc/vlr.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/45/13745/1 diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h index 92ebda1..ce6a232 100644 --- a/include/osmocom/msc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -399,9 +399,9 @@ #define vlr_subscr_put(VSUB, USE) vlr_subscr_put_src(VSUB, USE, __FILE__, __LINE__) #define vlr_subscr_get_src(VSUB, USE, SRCFILE, SRCLINE) \ - OSMO_ASSERT(_osmo_use_count_get_put(&(VSUB)->use_count, USE, 1, SRCFILE, SRCLINE) == 0) + OSMO_ASSERT((VSUB) && _osmo_use_count_get_put(&(VSUB)->use_count, USE, 1, SRCFILE, SRCLINE) == 0) #define vlr_subscr_put_src(VSUB, USE, SRCFILE, SRCLINE) \ - OSMO_ASSERT(_osmo_use_count_get_put(&(VSUB)->use_count, USE, -1, SRCFILE, SRCLINE) == 0) + OSMO_ASSERT((VSUB) && _osmo_use_count_get_put(&(VSUB)->use_count, USE, -1, SRCFILE, SRCLINE) == 0) void vlr_subscr_free(struct vlr_subscr *vsub); int vlr_subscr_alloc_tmsi(struct vlr_subscr *vsub); -- To view, visit https://gerrit.osmocom.org/13745 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I36929a4ba4abb46909181068d1d0af967b1f5a94 Gerrit-Change-Number: 13745 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 14:39:16 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 14:39:16 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message In-Reply-To: References: Message-ID: Harald Welte has removed a vote on this change. Change subject: library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message ...................................................................... Removed Code-Review-1 by Harald Welte -- To view, visit https://gerrit.osmocom.org/13734 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: deleteVote Gerrit-Change-Id: If037cb2f2687697f168d10a033eeb20d20183328 Gerrit-Change-Number: 13734 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 14:39:17 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 14:39:17 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13734 ) Change subject: library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13734 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If037cb2f2687697f168d10a033eeb20d20183328 Gerrit-Change-Number: 13734 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 23 Apr 2019 14:39:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 14:49:32 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 23 Apr 2019 14:49:32 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: default value for mp_ipa_up_timeout too low Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13746 Change subject: BTS_Tests: default value for mp_ipa_up_timeout too low ...................................................................... BTS_Tests: default value for mp_ipa_up_timeout too low The default value for the module parameter mp_ipa_up_timeout is set to 10 sec. Given that the sysmobts needs around 10-11 sec. to perform one restart cycle this is to low and causes tests to fail occasionally. Lets increase the default value to 15 sec to get reliable. Change-Id: I5bb290d00a02a25672305688352a03f3bf484ff3 Related: OS#3863 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/46/13746/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index e617323..63372d4 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -64,7 +64,7 @@ integer mp_ms_actual_ta_exp := 0; integer mp_timing_offset_256syms_exp := 512; /* Time to wait for RSL conn from BTS during startup of test */ - float mp_ipa_up_timeout := 10.0; + float mp_ipa_up_timeout := 15.0; } type record of RslChannelNr ChannelNrs; -- To view, visit https://gerrit.osmocom.org/13746 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5bb290d00a02a25672305688352a03f3bf484ff3 Gerrit-Change-Number: 13746 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 14:49:32 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 23 Apr 2019 14:49:32 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: wait until BTS supplies stable signal Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13747 Change subject: BTS_Tests: wait until BTS supplies stable signal ...................................................................... BTS_Tests: wait until BTS supplies stable signal When running tests with real hardware it is important to wait for some time (3 sec. should be enough) before exiting f_init(). This is to ensure that the BTS supplies a stable carrier before the test proceeds. Change-Id: Ib78633a33a15cd40514e15b6ebf9a0a8fb7b9c68 Related: OS#3863 --- M bts/BTS_Tests.ttcn 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/47/13747/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 63372d4..aaf6b70 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -364,6 +364,10 @@ f_main_trxc_connect(); ret := f_TRXC_transceive(BTS_TRXC, g_bts_trxc_conn_id, valueof(ts_TRXC_FAKE_TIMING(2*256))); } + + /* Wait some extra time to make sure the BTS emits a stable carrier. + * (this is only relevant when running the tests with a physical BTS.) */ + f_sleep(3.0); } /* Attach L1CTL to master test_CT (classic tests, non-handler mode) */ -- To view, visit https://gerrit.osmocom.org/13747 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib78633a33a15cd40514e15b6ebf9a0a8fb7b9c68 Gerrit-Change-Number: 13747 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 14:49:33 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 23 Apr 2019 14:49:33 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: skip tests that need PCU socket access Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13748 Change subject: BTS_Tests: skip tests that need PCU socket access ...................................................................... BTS_Tests: skip tests that need PCU socket access Some tests need direct access to the pcu socket, however, when working with hardware bts this socket is not always available. The tests that depend on the pci socket are then skipped by the testsuite. However, the tests TC_dyn_ipa_pdch_act_deact and TC_dyn_ipa_pdch_act_tchf_act_nack are also accessing the pcu socket, lets also exclude them when no pcu socket is available. Change-Id: I735b85d2ff3f541ebf0a558735d6172d69e7c29f Related: OS#3863 --- M bts/BTS_Tests.ttcn 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/48/13748/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index aaf6b70..0d0899a 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -4316,6 +4316,8 @@ execute( TC_pcu_data_req_imm_ass_pch() ); execute( TC_pcu_rach_content() ); execute( TC_pcu_paging_from_rsl() ); + execute( TC_dyn_ipa_pdch_act_deact() ); + execute( TC_dyn_ipa_pdch_act_tchf_act_nack() ); } else { log("PCU socket path not available, skipping PCU tests"); } @@ -4325,10 +4327,8 @@ execute( TC_dyn_osmo_pdch_double_act() ); execute( TC_dyn_osmo_pdch_tchf_act() ); execute( TC_dyn_osmo_pdch_tchh_act() ); - execute( TC_dyn_ipa_pdch_act_deact() ); execute( TC_dyn_ipa_pdch_tchf_act() ); execute( TC_dyn_ipa_pdch_tchf_act_pdch_act_nack() ); - execute( TC_dyn_ipa_pdch_act_tchf_act_nack() ); execute( TC_rll_est_ind() ); execute( TC_rll_est_req_DCCH_3() ); -- To view, visit https://gerrit.osmocom.org/13748 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I735b85d2ff3f541ebf0a558735d6172d69e7c29f Gerrit-Change-Number: 13748 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 14:49:37 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 14:49:37 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library/L1CTL_Types.ttcn: fix: add missing L1CTL_BURST_IND message In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13733 ) Change subject: library/L1CTL_Types.ttcn: fix: add missing L1CTL_BURST_IND message ...................................................................... library/L1CTL_Types.ttcn: fix: add missing L1CTL_BURST_IND message Change-Id: Ibf75792be70f694bca9222ec6568371475d193bb --- M library/L1CTL_Types.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L1CTL_Types.ttcn b/library/L1CTL_Types.ttcn index 4273ba3..ae800b0 100644 --- a/library/L1CTL_Types.ttcn +++ b/library/L1CTL_Types.ttcn @@ -42,6 +42,7 @@ L1CTL_TRAFFIC_REQ, L1CTL_TRAFFIC_CONF, L1CTL_TRAFFIC_IND, + L1CTL_BURST_IND, L1CTL_TBF_CFG_REQ, L1CTL_TBF_CFG_CONF, L1CTL_DATA_TBF_REQ, -- To view, visit https://gerrit.osmocom.org/13733 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ibf75792be70f694bca9222ec6568371475d193bb Gerrit-Change-Number: 13733 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 14:49:37 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 14:49:37 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13734 ) Change subject: library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message ...................................................................... library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message According to 3GPP TS 04.60, section 11.2.5a, the extended (11-bit) Access Burst on RACH/PRACH is used by the MS to indicate its EGPRS capability. One of the alternative synch. sequences (see 3GPP TS 05.02, TS1 and TS2) shall be used. Change-Id: If037cb2f2687697f168d10a033eeb20d20183328 Related: OS#1854 --- M library/L1CTL_Types.ttcn 1 file changed, 42 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L1CTL_Types.ttcn b/library/L1CTL_Types.ttcn index ae800b0..6ffbbb8 100644 --- a/library/L1CTL_Types.ttcn +++ b/library/L1CTL_Types.ttcn @@ -47,7 +47,8 @@ L1CTL_TBF_CFG_CONF, L1CTL_DATA_TBF_REQ, L1CTL_DATA_TBF_CONF, - L1CTL_DATA_ABS_REQ + L1CTL_EXT_RACH_REQ, + L1CTL_DATA_ABS_REQ /*!< FIXME: no such message in OsmocomBB */ } with { variant "FIELDLENGTH(8)" }; type enumerated L1ctlCcchMode { @@ -256,6 +257,19 @@ uint16_t offset } with { variant "" }; + type enumerated L1ctlRachSynchSeq { + RACH_SYNCH_SEQ_TS0 (0), + RACH_SYNCH_SEQ_TS1, + RACH_SYNCH_SEQ_TS2 + } with { variant "FIELDLENGTH(8)" }; + + type record L1ctlExtRachReq { + uint16_t ra11, + L1ctlRachSynchSeq synch_seq, + uint8_t combined, + uint16_t offset + } with { variant "" }; + type record L1ctlParReq { int8_t ta, uint8_t tx_power, @@ -317,6 +331,7 @@ L1ctlCcchModeReq ccch_mode_req, L1ctlTchModeReq tch_mode_req, L1ctlRachReq rach_req, + L1ctlExtRachReq ext_rach_req, L1ctlParReq par_req, L1ctlDmEstReq dm_est_req, L1ctlReset reset_req, @@ -337,6 +352,7 @@ L1ctlUlAbsInfo ul_info_abs optional, L1ctlUlPayload payload } with { variant (ul_info) "PRESENCE(header.msg_type = L1CTL_RACH_REQ, + header.msg_type = L1CTL_EXT_RACH_REQ, header.msg_type = L1CTL_PARAM_REQ, header.msg_type = L1CTL_CRYPTO_REQ, header.msg_type = L1CTL_DATA_REQ, @@ -350,6 +366,7 @@ ccch_mode_req, header.msg_type = L1CTL_CCCH_MODE_REQ; tch_mode_req, header.msg_type = L1CTL_TCH_MODE_REQ; rach_req, header.msg_type = L1CTL_RACH_REQ; + ext_rach_req, header.msg_type = L1CTL_EXT_RACH_REQ; par_req, header.msg_type = L1CTL_PARAM_REQ; dm_est_req, header.msg_type = L1CTL_DM_EST_REQ; reset_req, header.msg_type = L1CTL_RESET_REQ; @@ -464,6 +481,7 @@ template L1ctlUlMessage ts_L1CTL_RACH_REQ(uint8_t ra, uint8_t combined, uint16_t offset) := { header := ts_L1ctlHeader(L1CTL_RACH_REQ), ul_info := { + /* FIXME: both RSL chan_nr and link_id should be configurable */ chan_nr := t_RslChanNr_RACH(0), link_id := ts_RslLinkID_DCCH(0), padding := '0000'O @@ -479,6 +497,29 @@ } } + template L1ctlUlMessage ts_L1CTL_EXT_RACH_REQ( + uint16_t ra11, L1ctlRachSynchSeq seq, + uint8_t combined, uint16_t offset + ) := { + header := ts_L1ctlHeader(L1CTL_EXT_RACH_REQ), + ul_info := { + /* FIXME: both RSL chan_nr and link_id should be configurable */ + chan_nr := t_RslChanNr_RACH(0), + link_id := ts_RslLinkID_DCCH(0), + padding := '0000'O + }, + ul_info_tbf := omit, + ul_info_abs := omit, + payload := { + ext_rach_req := { + ra11 := ra11, + synch_seq := seq, + combined := combined, + offset := offset + } + } + } + template L1ctlUlMessage ts_L1CTL_PAR_REQ(uint8_t ta, uint8_t tx_power) := { header := ts_L1ctlHeader(L1CTL_PARAM_REQ), ul_info := { -- To view, visit https://gerrit.osmocom.org/13734 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If037cb2f2687697f168d10a033eeb20d20183328 Gerrit-Change-Number: 13734 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 14:49:38 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 14:49:38 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13735 ) Change subject: BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH ...................................................................... BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH According to 3GPP TS 04.60, section 11.2.5a, the extended (11-bit) Access Burst on RACH/PRACH is used by the MS to indicate its EGPRS capability. One of the alternative synch. sequences (see 3GPP TS 05.02, TS1 and TS2) shall be used. Add a test case to verify extended (11-bit) RACH decoding. Depends: (OsmocomBB) I36fd20cd5502ce33c52f644ee4c22abb83350df8 Change-Id: I8fe156aeac9de3dc1e71a4950821d4942ba9a253 Related: OS#1854 --- M bts/BTS_Tests.ttcn M bts/expected-results.xml M library/L1CTL_PortType.ttcn 3 files changed, 88 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index e617323..711947a 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -989,6 +989,12 @@ return ra; } +/* generate a random 11-bit RA (packet-switched only) */ +private function f_rnd_ra11_ps() return BIT11 { + var integer ra11 := f_rnd_int(bit2int('11111111111'B)); + return int2bit(ra11, 11); +} + /* Send 1000 RACH requests and check their RA+FN on the RSL side */ testcase TC_rach_content() runs on test_CT { f_init(testcasename()); @@ -2969,6 +2975,64 @@ setverdict(pass); } +/* Send extended (11-bit, TS1 & TS2) RACH bursts from the Um side, + * expect them to show up on PCU socket (with proper BURST_TYPE_*). */ +testcase TC_pcu_ext_rach_content() runs on test_CT { + var template PCUIF_Message pcu_rach_ind; + var GsmFrameNumber fn_last := 0; + var L1ctlRachSynchSeq synch_seq; + var PCUIF_BurstType pcu_bt; + var GsmFrameNumber fn; + var BIT11 ra11; + + f_init_pcu_test(); + f_init_l1ctl(); + f_l1_tune(L1CTL); + + for (var integer i := 0; i < 1000; i := i+1) { + /* We need to test both TS1 & TS2 */ + if (i rem 2 == 0) { + synch_seq := RACH_SYNCH_SEQ_TS1; + pcu_bt := BURST_TYPE_1; + } else { + synch_seq := RACH_SYNCH_SEQ_TS2; + pcu_bt := BURST_TYPE_2; + } + + ra11 := f_rnd_ra11_ps(); + fn := f_L1CTL_EXT_RACH(L1CTL, bit2int(ra11), synch_seq); + if (fn == fn_last) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "Two RACH in same FN?!?"); + } + fn_last := fn; + + /* Compose the expected message */ + pcu_rach_ind := tr_PCUIF_RACH_IND( + bts_nr := 0, + ra := bit2int(ra11), + is_11bit := 1, + burst_type := pcu_bt, + fn := fn); + + timer T := 2.0; + T.start; + alt { + [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, pcu_rach_ind)) { + T.stop; + } + [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RACH_IND)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Unexpected RACH IND"); + } + [] PCU.receive { repeat; } + [] T.timeout { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for RACH IND"); + } + } + } + setverdict(pass); +} + private function f_pad_oct(octetstring str, integer len, OCT1 pad) return octetstring { var integer strlen := lengthof(str); for (var integer i := 0; i < len-strlen; i := i+1) { @@ -4311,6 +4375,7 @@ execute( TC_pcu_data_req_agch() ); execute( TC_pcu_data_req_imm_ass_pch() ); execute( TC_pcu_rach_content() ); + execute( TC_pcu_ext_rach_content() ); execute( TC_pcu_paging_from_rsl() ); } else { log("PCU socket path not available, skipping PCU tests"); diff --git a/bts/expected-results.xml b/bts/expected-results.xml index 2eadffd..7d89da3 100644 --- a/bts/expected-results.xml +++ b/bts/expected-results.xml @@ -77,6 +77,7 @@ + diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn index 8e03c02..7dac4c3 100644 --- a/library/L1CTL_PortType.ttcn +++ b/library/L1CTL_PortType.ttcn @@ -87,6 +87,28 @@ return fn; } + function f_L1CTL_EXT_RACH( + L1CTL_PT pt, uint16_t ra11, L1ctlRachSynchSeq seq, + uint8_t combined := 1, uint16_t offset := 0 + ) return GsmFrameNumber { + var L1ctlDlMessage rc; + var GsmFrameNumber fn; + timer T := 2.0; + + T.start; + pt.send(ts_L1CTL_EXT_RACH_REQ(ra11, seq, combined, offset)); + alt { + [] pt.receive(tr_L1CTL_RACH_CONF) -> value rc { fn := rc.dl_info.frame_nr }; + [] pt.receive { repeat; }; + [] T.timeout { + setverdict(fail, "Timeout in extended RACH"); + mtc.stop; + } + } + + return fn; + } + function f_L1CTL_PARAM(L1CTL_PT pt, uint8_t ta, uint8_t tx_power) { pt.send(ts_L1CTL_PAR_REQ(ta, tx_power)); } -- To view, visit https://gerrit.osmocom.org/13735 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8fe156aeac9de3dc1e71a4950821d4942ba9a253 Gerrit-Change-Number: 13735 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:43:56 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:43:56 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Adapter: Rename functions from f_bssap_* to f_ran_adapter_* Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13749 Change subject: RAN_Adapter: Rename functions from f_bssap_* to f_ran_adapter_* ...................................................................... RAN_Adapter: Rename functions from f_bssap_* to f_ran_adapter_* Change-Id: I73818247f1dfc71c8ece11660e6c18f5f153d186 --- M bsc/BSC_Tests.ttcn M library/RAN_Adapter.ttcnpp M msc/MSC_Tests.ttcn 3 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/49/13749/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 720669b..fb43d5e 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -316,12 +316,12 @@ /* Call a function of our 'parent component' RAN_Adapter_CT to start the * MSC-side BSSAP emulation */ if (handler_mode) { - f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", MSC_RanOps); - f_bssap_start(g_bssap); + f_ran_adapter_init(g_bssap, mp_bssap_cfg, "VirtMSC", MSC_RanOps); + f_ran_adapter_start(g_bssap); } else { - f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", omit); + f_ran_adapter_init(g_bssap, mp_bssap_cfg, "VirtMSC", omit); connect(self:BSSAP, g_bssap.vc_SCCP:SCCP_SP_PORT); - f_bssap_start(g_bssap); + f_ran_adapter_start(g_bssap); f_legacy_bssap_reset(); } diff --git a/library/RAN_Adapter.ttcnpp b/library/RAN_Adapter.ttcnpp index 43b4988..a96c6ef 100644 --- a/library/RAN_Adapter.ttcnpp +++ b/library/RAN_Adapter.ttcnpp @@ -76,7 +76,7 @@ } -function f_bssap_init(inout RAN_Adapter ba, in RAN_Configuration cfg, charstring id, +function f_ran_adapter_init(inout RAN_Adapter ba, in RAN_Configuration cfg, charstring id, template RanOps ops) { init_pars(ba, cfg); ops.sccp_addr_local := ba.sccp_addr_own; @@ -157,7 +157,7 @@ } -function f_bssap_start(inout RAN_Adapter ba) { +function f_ran_adapter_start(inout RAN_Adapter ba) { ba.vc_SCCP.start(SCCPStart(ba.sccp_pars)); } diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 9a37fb0..b2503b7 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -277,8 +277,8 @@ for (var integer i := 0; i < num_bsc; i := i + 1) { if (isbound(mp_bssap_cfg[i])) { - f_bssap_init(g_bssap[i], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), BSC_RanOps); - f_bssap_start(g_bssap[i]); + f_ran_adapter_init(g_bssap[i], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), BSC_RanOps); + f_ran_adapter_start(g_bssap[i]); } else { testcase.stop("missing BSSAP configuration"); } @@ -311,7 +311,7 @@ * to f_init() when the high level functions of the BSC_ConnectionHandler are * not needed. */ function f_init_bssap_direct() runs on MTC_CT { - f_bssap_init(g_bssap[0], mp_bssap_cfg[0], "MSC_Test", omit); + f_ran_adapter_init(g_bssap[0], mp_bssap_cfg[0], "MSC_Test", omit); connect(g_bssap[0].vc_SCCP:SCCP_SP_PORT, self:BSSAP_DIRECT); /* Start guard timer and activate it as default */ @@ -1860,7 +1860,7 @@ var boolean reset_ack_seen := false; f_init_bssap_direct(); - f_bssap_start(g_bssap[0]); + f_ran_adapter_start(g_bssap[0]); f_sleep(3.0); -- To view, visit https://gerrit.osmocom.org/13749 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I73818247f1dfc71c8ece11660e6c18f5f153d186 Gerrit-Change-Number: 13749 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:43:56 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:43:56 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Adapter: Support build without IPA / BSSAP support Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13750 Change subject: RAN_Adapter: Support build without IPA / BSSAP support ...................................................................... RAN_Adapter: Support build without IPA / BSSAP support Change-Id: I5370f0ea6f2f6cfdc3370a6f3d3bf2e6c32af4d2 --- M library/RAN_Adapter.ttcnpp 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/50/13750/1 diff --git a/library/RAN_Adapter.ttcnpp b/library/RAN_Adapter.ttcnpp index a96c6ef..e62e5f6 100644 --- a/library/RAN_Adapter.ttcnpp +++ b/library/RAN_Adapter.ttcnpp @@ -22,7 +22,9 @@ import from SCTPasp_Types all; import from SCTPasp_PortType all; +#ifdef RAN_EMULATION_BSSMAP import from BSSMAP_Templates all; +#endif import from RAN_Emulation all; type record RAN_Adapter { @@ -96,6 +98,7 @@ connect(ba.vc_M3UA:MTP3_SP_PORT, ba.vc_SCCP:MTP3_SCCP_PORT); ba.vc_M3UA.start(f_M3UA_Emulation(cfg.sctp_addr, cfg.rctx)); } +#ifdef IPA_EMULATION_SCCP case (BSSAP_TRANSPORT_SCCPlite_SERVER) { ba.vc_IPA := IPA_Emulation_CT.create(id & "-IPA"); map(ba.vc_IPA:IPA_PORT, system:IPA_CODEC_PT); @@ -147,8 +150,10 @@ #endif if (cfg.transport == BSSAP_TRANSPORT_SCCPlite_SERVER or cfg.transport == BSSAP_TRANSPORT_SCCPlite_CLIENT) { +#ifdef IPA_EMULATION_MGCP /* connect IPA MGCP port with BSSMAP MGCP port */ connect(ba.vc_IPA:IPA_MGCP_PORT, ba.vc_RAN:MGCP); +#endif } /* start the BSSMAP emulation */ ba.vc_RAN.start(RAN_Emulation.main(valueof(ops), "")); -- To view, visit https://gerrit.osmocom.org/13750 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5370f0ea6f2f6cfdc3370a6f3d3bf2e6c32af4d2 Gerrit-Change-Number: 13750 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:43:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:43:57 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Add RANAP to msc tests Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13751 Change subject: msc: Add RANAP to msc tests ...................................................................... msc: Add RANAP to msc tests Integrate RANAP to MSC_Tests.ttcn Related: OS#2856 Change-Id: Idfa54b7607ad6e7016ed9411b0cc5330c901ea34 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.default M msc/MSC_Tests.ttcn M msc/gen_links.sh M msc/regen_makefile.sh 5 files changed, 319 insertions(+), 78 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/51/13751/1 diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 11baf2a..e603035 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -10,6 +10,12 @@ import from RAN_Emulation all; import from BSSMAP_Templates all; +import from RANAP_Constants all; +import from RANAP_IEs all; +import from RANAP_PDU_Contents all; +import from RANAP_PDU_Descriptions all; +import from RANAP_Templates all; + import from GSUP_Types all; import from GSUP_Emulation all; @@ -76,9 +82,29 @@ boolean sgsap_enable, boolean gsup_enable, integer ran_idx, - boolean use_umts_aka + boolean use_umts_aka, + boolean ran_is_geran }; +private function imsi_hex2oct(hexstring imsi) return octetstring { + var hexstring tmp := ''H; + var octetstring ret; + var integer i; + + /* swap nibbles and pad with F if insufficient input nibbles */ + for (i := 0; i < lengthof(imsi); i := i+1) { + if (i+1 < lengthof(imsi)) { + tmp := tmp & imsi[i+1]; + } else { + tmp := tmp & 'F'H; + } + tmp := tmp & imsi[i]; + i := i+1; + } + ret := hex2oct(tmp); + return ret; +} + /* get a one-octet bitmaks of supported algorithms based on Classmark information */ function f_alg_mask_from_cm(BSSMAP_IE_ClassmarkInformationType2 cm2) return OCT1 { var BIT8 res := '00000001'B; /* A5/0 always supported */ @@ -174,10 +200,31 @@ return resp; } +private function RncUnitdataCallback(RANAP_PDU ranap) +runs on RAN_Emulation_CT return template RANAP_PDU { + var template RANAP_PDU resp := omit; + + log("RANAP_RncUnitdataCallback"); + /* answer all RESET with RESET ACK */ + if (match(ranap, tr_RANAP_Reset)) { + log("RANAP_RncUnitdataCallback: Responding to RESET with RESET-ACK"); + var CN_DomainIndicator dom; + dom := ranap.initiatingMessage.value_.Reset.protocolIEs[1].value_.cN_DomainIndicator; + resp := ts_RANAP_ResetAck(dom); + } + + /* FIXME: Handle paging, etc. */ + return resp; +} + + const RanOps BSC_RanOps := { /* Create call-back for inbound connections from MSC (hand-over) */ create_cb := refers(RAN_Emulation.ExpectedCreateCallback), unitdata_cb := refers(BscUnitdataCallback), + ranap_create_cb := refers(RAN_Emulation.RanapExpectedCreateCallback), + ranap_unitdata_cb := refers(RncUnitdataCallback), + ps_domain := false, decode_dtap := true, role_ms := true, protocol := RAN_PROTOCOL_BSSAP, @@ -215,6 +262,55 @@ } } +/* generate Iu LAI from BSSAP CGI */ +private function f_IuLAI_from_BssmapCI(BSSMAP_IE_CellIdentifier ci) return LAI { + var LAI lai; + if (ischosen(ci.cellIdentification.cI_CGI)) { + lai.pLMNidentity := ci.cellIdentification.cI_CGI.mcc_mnc; + lai.lAC := ci.cellIdentification.cI_CGI.lac; + } else if (ischosen(ci.cellIdentification.cI_SAI)) { + lai.pLMNidentity := ci.cellIdentification.cI_SAI.mcc_mnc; + lai.lAC := ci.cellIdentification.cI_SAI.lac; + } else if (ischosen(ci.cellIdentification.ci_LAC_RNC_CI)) { + lai.pLMNidentity := ci.cellIdentification.ci_LAC_RNC_CI.mcc_mnc; + lai.lAC := ci.cellIdentification.ci_LAC_RNC_CI.lac; + } else { + mtc.stop; + } + lai.iE_Extensions := omit; + return lai; +} + +/* like f_bssap_compl_l3() but for 3G */ +function f_ranap_initial_ue(PDU_ML3_MS_NW l3) +runs on BSC_ConnHdlr { + log("Sending InitialUE: ", l3); + var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3); + var RANAP_PDU ranap; + var LAI lai := f_IuLAI_from_BssmapCI(g_pars.cell_id); + var SAI sai := { + pLMNidentity := lai.pLMNidentity, + lAC := lai.lAC, + sAC := '0000'O, /* FIXME */ + iE_Extensions := omit + }; + var IuSignallingConnectionIdentifier sigc_id := int2bit(23, 24); + var GlobalRNC_ID grnc_id := { + pLMNidentity := lai.pLMNidentity, + rNC_ID := 2342 /* FIXME */ + }; + + ranap := valueof(ts_RANAP_initialUE_CS(lai, sai, l3_enc, sigc_id, grnc_id)); + BSSAP.send(ts_RANAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, ranap)); + alt { + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {} + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + setverdict(fail, "DISC.ind from SCCP"); + mtc.stop; + } + } +} + type enumerated EstablishType { EST_TYPE_MO_CALL, EST_TYPE_EMERG_CALL, @@ -255,7 +351,11 @@ } /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_info); + if (g_pars.ran_is_geran) { + f_bssap_compl_l3(l3_info); + } else { + f_ranap_initial_ue(l3_info); + } f_mm_common(); if (g_pars.net.expect_ciph) { @@ -329,21 +429,51 @@ function f_mm_common() runs on BSC_ConnHdlr { f_mm_auth(); - if (g_pars.net.expect_ciph) { - var OCT1 a5_net := f_alg_mask_from_cm(g_pars.cm2); - var OCT1 a5_intersect := g_pars.net.kc_support and4b a5_net; - alt { - [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(a5_intersect, g_pars.vec.kc)) { - var OCT1 a5_chosen := f_best_alg_from_mask(a5_intersect); - var integer a5_nr := f_alg_from_mask(a5_chosen); - BSSAP.send(ts_BSSMAP_CipherModeCompl(int2oct(a5_nr+1, 1))); + if (g_pars.ran_is_geran) { + if (g_pars.net.expect_ciph) { + var OCT1 a5_net := f_alg_mask_from_cm(g_pars.cm2); + var OCT1 a5_intersect := g_pars.net.kc_support and4b a5_net; + alt { + [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(a5_intersect, g_pars.vec.kc)) { + var OCT1 a5_chosen := f_best_alg_from_mask(a5_intersect); + var integer a5_nr := f_alg_from_mask(a5_chosen); + BSSAP.send(ts_BSSMAP_CipherModeCompl(int2oct(a5_nr+1, 1))); + } + [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)) { + setverdict(fail, "Wrong ciphering algorithm mask in CiphModCmd"); + mtc.stop; + } } - [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)) { - setverdict(fail, "Wrong ciphering algorithm mask in CiphModCmd"); + /* FIXME: Send the best available algorithm */ + } + } else { /* UTRAN */ + alt { + [g_pars.net.expect_ciph] BSSAP.receive(tr_RANAP_SecurityModeCmdEnc(uia_algs := ?, + uia_key := oct2bit(g_pars.vec.ik), + key_sts := ?, + uea_algs := ?, + uea_key := oct2bit(g_pars.vec.ck))) { + var IntegrityProtectionAlgorithm uia_chosen := 0; /*standard_UMTS_integrity_algorithm_UIA1*/ + var EncryptionAlgorithm uea_chosen := 1; /*standard_UMTS_encryption_algorith_UEA1*/ + BSSAP.send(ts_RANAP_SecurityModeCompleteEnc(uia_chosen, uea_chosen)); + BSSAP.receive(tr_RANAP_CommonId(imsi_hex2oct(g_pars.imsi))); + } + [g_pars.net.expect_ciph] BSSAP.receive(tr_RANAP_SecurityModeCmdEnc(?,?,?,?,?)) { + setverdict(fail, "Invalid SecurityModeCommand (ciphering case)"); + mtc.stop; + } + [not g_pars.net.expect_ciph] BSSAP.receive(tr_RANAP_SecurityModeCmd(uia_algs := ?, + uia_key := oct2bit(g_pars.vec.ik), + key_sts := ?)) { + var IntegrityProtectionAlgorithm uia_chosen := 0; /*standard_UMTS_integrity_algorithm_UIA1;*/ + BSSAP.send(ts_RANAP_SecurityModeComplete(uia_chosen)); + BSSAP.receive(tr_RANAP_CommonId(imsi_hex2oct(g_pars.imsi))); + } + [not g_pars.net.expect_ciph] BSSAP.receive(tr_RANAP_SecurityModeCmd(?,?,?)) { + setverdict(fail, "Invalid SecurityModeCommand (non-ciphering case)"); mtc.stop; } } - /* FIXME: Send the best available algorithm */ } } @@ -362,10 +492,13 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); - - if (g_pars.send_early_cm) { - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (g_pars.ran_is_geran) { + f_bssap_compl_l3(l3_lu); + if (g_pars.send_early_cm) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } + } else { + f_ranap_initial_ue(l3_lu); } f_mm_common(); @@ -544,27 +677,44 @@ MGCP.send(mgcp_resp); } - var BSSMAP_IE_AoIP_TransportLayerAddress tla_ass := - valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.mgw_rtp_ip_bss),cpars.mgw_rtp_port_bss)); - interleave { - /* Second MGCP CRCX (this time for MSS/CN side) */ - [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { - var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); - MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); - /* MSC acknowledges the MNCC_CREATE to the MNCC handler */ - MNCC.receive(tr_MNCC_RTP_CREATE(cpars.mncc_callref)); + if (g_pars.ran_is_geran) { + var BSSMAP_IE_AoIP_TransportLayerAddress tla_ass := + valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.mgw_rtp_ip_bss),cpars.mgw_rtp_port_bss)); + + interleave { + /* Second MGCP CRCX (this time for MSS/CN side) */ + [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { + var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + /* MSC acknowledges the MNCC_CREATE to the MNCC handler */ + MNCC.receive(tr_MNCC_RTP_CREATE(cpars.mncc_callref)); + } + /* expect the MSC to trigger a BSSMAP ASSIGNMENT */ + [] BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass)) { + var BSSMAP_IE_AoIP_TransportLayerAddress tla; + var BSSMAP_IE_SpeechCodec codec; + + tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); + codec := valueof(ts_BSSMAP_IE_SpeechCodec({ts_CodecFR})); + + BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla, codec)); + } } + } else { + var template TransportLayerAddress rab_tla := ? /* FIXME: encode the mgw_rtp_ip_bss/mgw_rtp_port_bss */ + var template RAB_SetupOrModifyList rab_sml := tr_RAB_SML(rab_id := ?, tla := rab_tla, binding_id := ?); - /* expect the MSC to trigger a BSSMAP ASSIGNMENT */ - [] BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass)) { - var BSSMAP_IE_AoIP_TransportLayerAddress tla; - var BSSMAP_IE_SpeechCodec codec; - - tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); - codec := valueof(ts_BSSMAP_IE_SpeechCodec({ts_CodecFR})); - - BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla, codec)); + interleave { + [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { + var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + /* MSC acknowledges the MNCC_CREATE to the MNCC handler */ + MNCC.receive(tr_MNCC_RTP_CREATE(cpars.mncc_callref)); + } + [] BSSAP.receive(tr_RANAP_RabAssReq(rab_sml)) { + //BSSAP.send(ts_RANAP_RabAssResp(rab_sml)); FIXME + } } } @@ -575,7 +725,11 @@ function f_expect_paging(boolean by_tmsi := true) runs on BSC_ConnHdlr { - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + if (g_pars.ran_is_geran) { + BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + } else { + BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi), ?)); + } } function f_mt_call_establish(inout CallParameters cpars) @@ -649,27 +803,51 @@ } } - var BSSMAP_IE_AoIP_TransportLayerAddress tla_ass := - valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.mgw_rtp_ip_bss),cpars.mgw_rtp_port_bss)); - interleave { - /* Second MGCP CRCX (this time for MSS/CN side) */ - [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { - var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); - MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + if (g_pars.ran_is_geran) { + var BSSMAP_IE_AoIP_TransportLayerAddress tla_ass := + valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.mgw_rtp_ip_bss),cpars.mgw_rtp_port_bss)); - /* Alerting */ - MNCC.send(ts_MNCC_ALERT_req(cpars.mncc_callref)); - } + interleave { + /* Second MGCP CRCX (this time for MSS/CN side) */ + [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { + var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); - [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(cpars.transaction_id))) { + /* Alerting */ + MNCC.send(ts_MNCC_ALERT_req(cpars.mncc_callref)); + } + + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(cpars.transaction_id))) { + } + /* expect AoIP IP/Port to match what we returned in CRCX_ACK above */ + [] BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass)) { + var BSSMAP_IE_AoIP_TransportLayerAddress tla; + var BSSMAP_IE_SpeechCodec codec; + tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); + codec := valueof(ts_BSSMAP_IE_SpeechCodec({ts_CodecFR})); + BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla, codec)); + } } - /* expect AoIP IP/Port to match what we returned in CRCX_ACK above */ - [] BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass)) { - var BSSMAP_IE_AoIP_TransportLayerAddress tla; - var BSSMAP_IE_SpeechCodec codec; - tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); - codec := valueof(ts_BSSMAP_IE_SpeechCodec({ts_CodecFR})); - BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla, codec)); + } else { + var template TransportLayerAddress rab_tla := ?; /* FIXME: encode the mgw_rtp_ip_bss/mgw_rtp_port_bss */ + var template RAB_SetupOrModifyList rab_sml := tr_RAB_SML(rab_id := ?, tla := rab_tla, binding_id := ?); + + interleave { + /* Second MGCP CRCX (this time for MSS/CN side) */ + [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { + var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + + /* Alerting */ + MNCC.send(ts_MNCC_ALERT_req(cpars.mncc_callref)); + } + + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(cpars.transaction_id))) { + } + + [] BSSAP.receive(tr_RANAP_RabAssReq(rab_sml)) { + //BSSAP.send(ts_RANAP_RabAssResp(rab_sml)); FIXME + } } } @@ -688,12 +866,6 @@ var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; var boolean respond_to_dlcx; - var template PDU_BSSAP t_clear := tr_BSSMAP_ClearCommand; - - if (is_csfb) { - t_clear := tr_BSSMAP_ClearCommandCSFB; - } - MNCC.send(ts_MNCC_DISC_req(cpars.mncc_callref, valueof(ts_MNCC_cause(23)))); BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(cpars.transaction_id))); @@ -711,18 +883,43 @@ respond_to_dlcx := not (isbound(cpars.mgw_drop_dlcx) and valueof(cpars.mgw_drop_dlcx)); - /* clearing of radio channel */ - interleave { - [] BSSAP.receive(t_clear) { - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + /* clearing of radio channel */ + if (g_pars.ran_is_geran) { + var template PDU_BSSAP t_clear := tr_BSSMAP_ClearCommand; + if (is_csfb) { + t_clear := tr_BSSMAP_ClearCommandCSFB; } - [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { - if (respond_to_dlcx) { - /* TODO: For one or all connections on EP? */ - MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); - f_create_mgcp_delete_ep(cpars.mgcp_ep); + + interleave { + [] BSSAP.receive(t_clear) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + } + [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { + if (respond_to_dlcx) { + /* TODO: For one or all connections on EP? */ + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); + f_create_mgcp_delete_ep(cpars.mgcp_ep); + } + } } + } else { + var template RANAP_PDU t_iurel := tr_RANAP_IuReleaseCommand(?); + if (is_csfb) { + /* FIXME! */ + } + interleave { + [] BSSAP.receive(t_iurel) { + BSSAP.send(ts_RANAP_IuReleaseComplete); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + } + [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { + if (respond_to_dlcx) { + /* TODO: For one or all connections on EP? */ + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); + f_create_mgcp_delete_ep(cpars.mgcp_ep); + } + } } } @@ -809,6 +1006,7 @@ setverdict(pass); } + /* expect a clear command */ altstep as_clear_cmd_compl_disc(float t := 5.0) runs on BSC_ConnHdlr { var PDU_BSSAP bssap; @@ -830,12 +1028,34 @@ } } +/* expect a IuReleaseCommand; Confirm that; expect SCCP-level N-DISCONNET.ind */ +altstep as_iu_release_compl_disc(float t := 5.0) runs on BSC_ConnHdlr { + var RANAP_PDU ranap; + [] BSSAP.receive(tr_RANAP_IuReleaseCommand(?)) { + BSSAP.send(ts_RANAP_IuReleaseComplete); + alt { + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + setverdict(pass); + } + [] BSSAP.receive { + setverdict(fail, "Unexpected RANAP while waiting for SCCP Release "); + mtc.stop; + } + } + } + [] BSSAP.receive(RANAP_PDU:?) -> value ranap{ + setverdict(fail, "Unexpected RANAP while waiting for IuReleaseCommand", ranap); + mtc.stop; + } +} + function f_expect_clear(float t := 5.0) runs on BSC_ConnHdlr { timer T := t; T.start; alt { - [] as_clear_cmd_compl_disc(t) { } + [g_pars.ran_is_geran] as_clear_cmd_compl_disc(t) { } + [not g_pars.ran_is_geran] as_iu_release_compl_disc(t) { } [] T.timeout { setverdict(fail, "Timeout waiting for ClearCommand/Release"); mtc.stop; diff --git a/msc/MSC_Tests.default b/msc/MSC_Tests.default index a24fa38..98bf299 100644 --- a/msc/MSC_Tests.default +++ b/msc/MSC_Tests.default @@ -48,6 +48,17 @@ peer_ssn := 254, sio := '83'O, rctx := 1 + }, + { + transport := RANAP_TRANSPORT_IuCS, + sccp_service_type := "mtp3_itu", + sctp_addr := { 23908, "127.0.0.1", 2905, "127.0.0.1" }, + own_pc := 195, + own_ssn := 142, + peer_pc := 185, + peer_ssn := 142, + sio := '83'O, + rctx := 2 } }; diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index b2503b7..110c165 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -65,7 +65,7 @@ import from TCCConversion_Functions all; -const integer NUM_BSC := 2; +const integer NUM_BSC := 3; type record of RAN_Configuration RAN_Configurations; /* Needed for SGsAP SMS */ @@ -485,7 +485,8 @@ type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; /* FIXME: move into BSC_ConnectionHandler? */ -function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup := true, integer ran_idx := 0) +function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup := true, integer ran_idx := 0, + boolean ran_is_geran := true) runs on MTC_CT return BSC_ConnHdlrPars { var BSC_ConnHdlrNetworkPars net_pars := { kc_support := '0A'O, /* A5/1 and A5/3 enabled */ @@ -514,7 +515,8 @@ sgsap_enable := sgsap, gsup_enable := gsup, ran_idx := ran_idx, - use_umts_aka := false + use_umts_aka := false, + ran_is_geran := ran_is_geran }; return pars; } @@ -553,8 +555,9 @@ return vc_conn; } -function f_start_handler(void_fn fn, integer imsi_suffix, integer ran_idx := 0) runs on MTC_CT return BSC_ConnHdlr { - return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix, ran_idx := ran_idx)); +function f_start_handler(void_fn fn, integer imsi_suffix, integer ran_idx := 0, boolean ran_is_geran := true) +runs on MTC_CT return BSC_ConnHdlr { + return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix, ran_idx := ran_idx, ran_is_geran := ran_is_geran)); } private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { diff --git a/msc/gen_links.sh b/msc/gen_links.sh index e4e142b..7ba190a 100755 --- a/msc/gen_links.sh +++ b/msc/gen_links.sh @@ -85,6 +85,11 @@ FILES="SGsAP_Types.ttcn" gen_links $DIR $FILES +DIR=../library/ranap +FILES="RANAP_CommonDataTypes.asn RANAP_Constants.asn RANAP_Containers.asn RANAP_IEs.asn RANAP_PDU_Contents.asn RANAP_PDU_Descriptions.asn " +FILES+="RANAP_Types.ttcn RANAP_Templates.ttcn RANAP_CodecPort.ttcn RANAP_EncDec.cc " +gen_links $DIR $FILES + DIR=../library FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc " FILES+="IPA_Types.ttcn IPA_Emulation.ttcnpp IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc GSUP_Types.ttcn GSUP_Emulation.ttcn " diff --git a/msc/regen_makefile.sh b/msc/regen_makefile.sh index 091faf8..e89daa6 100755 --- a/msc/regen_makefile.sh +++ b/msc/regen_makefile.sh @@ -1,7 +1,9 @@ #!/bin/sh -FILES="*.ttcn *.ttcnpp SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc Native_FunctionDefs.cc SMPP_EncDec.cc SMPP_CodecPort_CtrlFunctDef.cc MAP_EncDec.cc SS_EncDec.cc TCCEncoding.cc SGsAP_CodecPort_CtrlFunctDef.cc *.c *.asn" +FILES="*.ttcn *.ttcnpp SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc Native_FunctionDefs.cc SMPP_EncDec.cc SMPP_CodecPort_CtrlFunctDef.cc MAP_EncDec.cc SS_EncDec.cc TCCEncoding.cc SGsAP_CodecPort_CtrlFunctDef.cc RANAP_EncDec.cc *.c *.asn" -export CPPFLAGS_TTCN3="-DIPA_EMULATION_MGCP -DIPA_EMULATION_GSUP -DIPA_EMULATION_SCCP -DRAN_EMULATION_BSSAP -DRAN_EMULATION_MGCP -DUSE_MTP3_DISTRIBUTOR" +export CPPFLAGS_TTCN3="-DIPA_EMULATION_MGCP -DIPA_EMULATION_GSUP -DIPA_EMULATION_SCCP -DRAN_EMULATION_BSSAP -DRAN_EMULATION_MGCP -DRAN_EMULATION_RANAP -DUSE_MTP3_DISTRIBUTOR" ../regen-makefile.sh MSC_Tests.ttcn $FILES + +sed -i -e 's/^LINUX_LIBS = -lxml2/LINUX_LIBS = -lxml2 -lfftranscode/' Makefile -- To view, visit https://gerrit.osmocom.org/13751 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Idfa54b7607ad6e7016ed9411b0cc5330c901ea34 Gerrit-Change-Number: 13751 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:43:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:43:57 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Introduce f_cl3_or_initial_ue as replacement for f_bssap_compl_l3() Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13752 Change subject: msc: Introduce f_cl3_or_initial_ue as replacement for f_bssap_compl_l3() ...................................................................... msc: Introduce f_cl3_or_initial_ue as replacement for f_bssap_compl_l3() The new function will check the RAN type and dispath to f_bssap_compl_l3() in case of 2G/GERAN and to f_ranap_initial_ue() on case of 3G/UTRAN. Change-Id: Ia27afa265d441d1a0cbb40cc2d938aff46fa25f9 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 33 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/52/13752/1 diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index e603035..1fd02aa 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -311,6 +311,16 @@ } } +/* Send BSSMAP Complete L3 or RANAP Initial UE depending on 2G/3G RAN type */ +function f_cl3_or_initial_ue(PDU_ML3_MS_NW l3) +runs on BSC_ConnHdlr { + if (g_pars.ran_is_geran) { + f_bssap_compl_l3(l3); + } else { + f_ranap_initial_ue(l3); + } +} + type enumerated EstablishType { EST_TYPE_MO_CALL, EST_TYPE_EMERG_CALL, @@ -351,11 +361,7 @@ } /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - if (g_pars.ran_is_geran) { - f_bssap_compl_l3(l3_info); - } else { - f_ranap_initial_ue(l3_info); - } + f_cl3_or_initial_ue(l3_info); f_mm_common(); if (g_pars.net.expect_ciph) { diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 110c165..af654a3 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -592,7 +592,7 @@ var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); f_create_gsup_expect(hex2str(g_pars.imsi)); - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); GSUP.send(ts_GSUP_UL_ERR(g_pars.imsi, 23)); alt { @@ -619,7 +619,7 @@ var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); f_create_gsup_expect(hex2str(g_pars.imsi)); - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); /* Normally the HLR would need to respond here, but we decide to force a timeout here */ alt { @@ -682,7 +682,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_info); + f_cl3_or_initial_ue(l3_info); timer T := 10.0; T.start; @@ -742,7 +742,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -773,7 +773,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -804,7 +804,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -847,7 +847,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -878,7 +878,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -911,7 +911,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -959,7 +959,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); + f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); /* Send Early Classmark, just for the fun of it? */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -982,7 +982,7 @@ var MobileIdentityLV mi := valueof(ts_MI_TMSI_LV('01020304'O)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); + f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); /* Send Early Classmark, just for the fun of it? */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -1005,7 +1005,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); + f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); /* Send Early Classmark, just for the fun of it? */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -1037,7 +1037,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); - f_bssap_compl_l3(l3_info); + f_cl3_or_initial_ue(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O))); f_expect_clear(); } @@ -1074,7 +1074,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VGCS, mi)); - f_bssap_compl_l3(l3_info); + f_cl3_or_initial_ue(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); f_expect_clear(); } @@ -1095,7 +1095,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VBS, mi)); - f_bssap_compl_l3(l3_info); + f_cl3_or_initial_ue(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); f_expect_clear(); } @@ -1116,7 +1116,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_LCS, mi)); - f_bssap_compl_l3(l3_info); + f_cl3_or_initial_ue(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); f_expect_clear(); } @@ -1137,7 +1137,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_REEST_REQ(0, mi)); - f_bssap_compl_l3(l3_info); + f_cl3_or_initial_ue(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); f_expect_clear(); } @@ -1159,7 +1159,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -1624,7 +1624,7 @@ /* Follow-up transactions should fail */ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); - f_bssap_compl_l3(l3_info); + f_cl3_or_initial_ue(l3_info); alt { [] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { } [] BSSAP.receive { @@ -1691,7 +1691,7 @@ /* cannot use f_perform_lu() as we expect a reject */ var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); f_create_gsup_expect(hex2str(g_pars.imsi)); - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); if (pars.send_early_cm) { BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); } else { @@ -1766,7 +1766,7 @@ /* cannot use f_perform_lu() as we expect a reject */ var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); f_create_gsup_expect(hex2str(g_pars.imsi)); - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); f_mm_auth(); alt { @@ -3502,7 +3502,7 @@ /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); f_mm_auth(); -- To view, visit https://gerrit.osmocom.org/13752 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia27afa265d441d1a0cbb40cc2d938aff46fa25f9 Gerrit-Change-Number: 13752 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:43:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:43:57 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Add Iu related tests for most existing 2G tests Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13753 Change subject: msc: Add Iu related tests for most existing 2G tests ...................................................................... msc: Add Iu related tests for most existing 2G tests This might look a bit like copy+paste programming for our testcases. However, we actually want the Iu related tests show up as separate 'testscase' in the TTCN-3 sense, so there's no way that's more elegant than this :/ Change-Id: I3b56e17487c9df839e67ed390a1ff89979683e8e --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 476 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/53/13753/1 diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 1fd02aa..b1a0491 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -86,7 +86,7 @@ boolean ran_is_geran }; -private function imsi_hex2oct(hexstring imsi) return octetstring { +function imsi_hex2oct(hexstring imsi) return octetstring { var hexstring tmp := ''H; var octetstring ret; var integer i; diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index af654a3..ea6a75e 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -41,6 +41,7 @@ import from BSSMAP_Templates all; import from RAN_Emulation all; import from BSC_ConnectionHandler all; +import from RANAP_Templates all; import from SGsAP_Templates all; import from SGsAP_Types all; @@ -518,6 +519,10 @@ use_umts_aka := false, ran_is_geran := ran_is_geran }; + if (not ran_is_geran) { + pars.use_umts_aka := true; + pars.net.expect_auth := true; + } return pars; } @@ -612,6 +617,14 @@ vc_conn := f_start_handler(refers(f_tc_lu_imsi_reject), 3); vc_conn.done; } +testcase TC_iu_lu_imsi_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_reject), 1003, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* Do LU by IMSI, timeout on GSUP */ private function f_tc_lu_imsi_timeout_gsup(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -640,6 +653,14 @@ vc_conn := f_start_handler(refers(f_tc_lu_imsi_timeout_gsup), 4); vc_conn.done; } +testcase TC_iu_lu_imsi_timeout_gsup() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_timeout_gsup), 1004, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + private function f_tc_lu_imsi_auth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { pars.net.expect_auth := true; @@ -655,6 +676,7 @@ vc_conn.done; } + private function f_tc_lu_imsi_auth3g_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { pars.net.expect_auth := true; pars.use_umts_aka := true; @@ -669,6 +691,15 @@ vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth3g_tmsi), 1005); vc_conn.done; } +testcase TC_iu_lu_imsi_auth3g_tmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_vty_config(MSCVTY, "network", "authentication required"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth3g_tmsi), 1005, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* Send CM SERVICE REQ for IMSI that has never performed LU before */ private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) @@ -711,6 +742,13 @@ vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), 6); vc_conn.done; } +testcase TC_iu_cmserv_imsi_unknown() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), 1006, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + private function f_tc_lu_and_mo_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); @@ -730,6 +768,14 @@ vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), 7); vc_conn.done; } +testcase TC_iu_lu_and_mo_call() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), 1007, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* Test LU (with authentication enabled), where HLR times out sending SAI response */ private function f_tc_lu_auth_sai_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -745,7 +791,9 @@ f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); /* The HLR would normally return an auth vector here, but we fail to do so. */ @@ -761,6 +809,15 @@ vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), 8); vc_conn.done; } +testcase TC_iu_lu_auth_sai_timeout() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_vty_config(MSCVTY, "network", "authentication required"); + + vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), 1008, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* Test LU (with authentication enabled), where HLR rejects sending SAI error */ private function f_tc_lu_auth_sai_err(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -776,7 +833,9 @@ f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); GSUP.send(ts_GSUP_SAI_ERR(g_pars.imsi, 13)); @@ -792,6 +851,15 @@ vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), 9); vc_conn.done; } +testcase TC_iu_lu_auth_sai_err() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_vty_config(MSCVTY, "network", "authentication required"); + + vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), 1009, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* Test LU but BSC will send a clear request in the middle */ private function f_tc_lu_clear_request(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -836,6 +904,47 @@ vc_conn.done; } +/* Test LU but RNC will send a Iu Release request in the middle */ +private function f_tc_iu_lu_release_request(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + f_init_handler(pars); + + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_cl3_or_initial_ue(l3_lu); + + f_sleep(1.0); + /* send release request in the middle of the LU */ + BSSAP.send(ts_RANAP_IuReleaseRequest(ts_RanapCause_om_intervention)); + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { repeat; } + [] BSSAP.receive(tr_RANAP_IuReleaseCommand(?)) {} + } + BSSAP.send(ts_RANAP_IuReleaseComplete); + alt { + /* See https://osmocom.org/issues/2862 */ + [] BSSAP.receive(tr_RANAP_IuReleaseCommand(?)) { + setverdict(fail, "Got a second Iu Release Command, only one expected"); + mtc.stop; + repeat; + } + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} + } + setverdict(pass); +} +testcase TC_iu_lu_release_request() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_iu_lu_release_request), 1010, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + + /* Test LU but BSC will send a clear request in the middle */ private function f_tc_lu_disconnect(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); @@ -850,7 +959,9 @@ f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } f_sleep(1.0); /* send clear request in the middle of the LU */ @@ -865,6 +976,13 @@ vc_conn := f_start_handler(refers(f_tc_lu_disconnect), 11); vc_conn.done; } +testcase TC_iu_lu_disconnect() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_lu_disconnect), 1011, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} /* Test LU but with illegal mobile identity type = IMEI */ @@ -881,7 +999,9 @@ f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } /* wait for LU reject, ignore any ID REQ */ alt { [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } @@ -897,6 +1017,14 @@ vc_conn := f_start_handler(refers(f_tc_lu_by_imei), 12); vc_conn.done; } +testcase TC_iu_lu_by_imei() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_lu_by_imei), 1012, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* Test LU by TMSI with unknown TMSI, expect (and answer) ID REQ. */ private function f_tc_lu_tmsi_noauth_unknown(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -962,7 +1090,9 @@ f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); /* Send Early Classmark, just for the fun of it? */ - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } /* wait for normal teardown */ f_expect_clear(); @@ -974,6 +1104,14 @@ vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imsi), 14); vc_conn.done; } +testcase TC_iu_imsi_detach_by_imsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imsi), 1014, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* Test IMSI DETACH (MI=TMSI) */ private function f_tc_imsi_detach_by_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -985,7 +1123,9 @@ f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); /* Send Early Classmark, just for the fun of it? */ - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } /* wait for normal teardown */ f_expect_clear(); @@ -997,6 +1137,14 @@ vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_tmsi), 15); vc_conn.done; } +testcase TC_iu_imsi_detach_by_tmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_tmsi), 1015, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* Test IMSI DETACH (MI=IMEI), which is illegal */ private function f_tc_imsi_detach_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -1008,7 +1156,9 @@ f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); /* Send Early Classmark, just for the fun of it? */ - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } /* wait for normal teardown */ f_expect_clear(); @@ -1020,6 +1170,13 @@ vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imei), 16); vc_conn.done; } +testcase TC_iu_imsi_detach_by_imei() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imei), 1016, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} /* helper function for an emergency call. caller passes in mobile identity to use */ @@ -1048,6 +1205,14 @@ vc_conn := f_start_handler(refers(f_tc_emerg_call_imei_reject), 17); vc_conn.done; } +testcase TC_iu_emerg_call_imei_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_emerg_call_imei_reject), 1017, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* establish an emergency call by IMSI, SIM inserted (and hence IMSI) */ private function f_tc_emerg_call_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -1064,6 +1229,14 @@ vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), 18); vc_conn.done; } +testcase TC_iu_emerg_call_imsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), 1018, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* CM Service Request for VGCS -> reject */ private function f_tc_cm_serv_req_vgcs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -1291,6 +1464,14 @@ vc_conn := f_start_handler(refers(f_tc_establish_and_nothing), 27); vc_conn.done; } +testcase TC_iu_establish_and_nothing() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_establish_and_nothing), 1027, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* Test MO Call SETUP with no response from MNCC */ private function f_tc_mo_setup_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -1321,6 +1502,14 @@ vc_conn := f_start_handler(refers(f_tc_mo_setup_and_nothing), 28); vc_conn.done; } +testcase TC_iu_mo_setup_and_nothing() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_mo_setup_and_nothing), 1028, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* Test MO Call with no response to RAN-side CRCX */ private function f_tc_mo_crcx_ran_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -1360,6 +1549,14 @@ vc_conn := f_start_handler(refers(f_tc_mo_crcx_ran_timeout), 29); vc_conn.done; } +testcase TC_iu_mo_crcx_ran_timeout() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_mo_crcx_ran_timeout), 1029, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* Test MO Call with reject to RAN-side CRCX */ private function f_tc_mo_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -1441,6 +1638,13 @@ vc_conn := f_start_handler(refers(f_tc_mo_crcx_ran_reject), 30); vc_conn.done; } +testcase TC_iu_mo_crcx_ran_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_mo_crcx_ran_reject), 1030, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} /* helper function to start a MT call: MNCC SETUP; Paging; DChan est.; DTAP SETUP */ @@ -1542,6 +1746,14 @@ vc_conn := f_start_handler(refers(f_tc_mt_crcx_ran_reject), 31); vc_conn.done; } +testcase TC_iu_mt_crcx_ran_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_mt_crcx_ran_reject), 1031, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* Test MT Call T310 timer */ @@ -1595,6 +1807,14 @@ vc_conn := f_start_handler(refers(f_tc_mt_t310), 32); vc_conn.done; } +testcase TC_iu_mt_t310() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_mt_t310), 1032, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* Perform successful LU + MO call, then GSUP LocationCancel. Subscriber must be denied CM SERV */ private function f_tc_gsup_cancel(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -1643,6 +1863,14 @@ vc_conn := f_start_handler(refers(f_tc_gsup_cancel), 33); vc_conn.done; } +testcase TC_iu_gsup_cancel() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_gsup_cancel), 1033, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* A5/1 only permitted on network side, and MS capable to do it */ private function f_tc_lu_imsi_auth_tmsi_encr_1_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -1934,6 +2162,13 @@ vc_conn := f_start_handler(refers(f_tc_mo_release_timeout), 40); vc_conn.done; } +testcase TC_iu_mo_release_timeout() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_mo_release_timeout), 1040, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} /* LU followed by MT call (including paging) */ @@ -1983,6 +2218,14 @@ setverdict(pass); } +/* Two BSSMAP resets from two different BSCs plus one IuCS RANAP Reset */ +testcase TC_reset_two_1iu() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_sleep(2.0); + setverdict(pass); +} + /*********************************************************************** * SMS Testing ***********************************************************************/ @@ -2009,6 +2252,13 @@ vc_conn := f_start_handler(refers(f_tc_lu_and_mo_sms), 42); vc_conn.done; } +testcase TC_iu_lu_and_mo_sms() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_sms), 1042, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + private function f_vty_sms_send(charstring imsi, charstring msisdn, charstring text) runs on BSC_ConnHdlr { @@ -2061,6 +2311,15 @@ vc_conn := f_start_handler_with_pars(refers(f_tc_lu_and_mt_sms), pars); vc_conn.done; } +testcase TC_iu_lu_and_mt_sms() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(3); + pars := f_init_pars(1043, ran_idx := 2, ran_is_geran := false); + vc_conn := f_start_handler_with_pars(refers(f_tc_lu_and_mt_sms), pars); + vc_conn.done; +} + /* Paging for MT SMS but no response */ private function f_tc_lu_and_mt_sms_paging_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -2082,18 +2341,22 @@ f_vty_sms_send(hex2str(pars.imsi), "2342", "Hello SMS"); /* Expect the MSC to page exactly once */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { }; + f_expect_paging(); /* Wait some time to make sure the MSC is not delivering any further * paging messages or anything else that could be unexpected. */ timer T := 20.0; T.start alt { - [] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) + [pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { setverdict(fail, "paging seems not to stop!"); mtc.stop; } + [not pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi), ?)) { + setverdict(fail, "paging seems not to stop!"); + mtc.stop; + } [] BSSAP.receive { setverdict(fail, "unexpected BSSAP message received"); self.stop; @@ -2115,6 +2378,15 @@ vc_conn := f_start_handler_with_pars(refers(f_tc_lu_and_mt_sms_paging_and_nothing), pars); vc_conn.done; } +testcase TC_iu_lu_and_mt_sms_paging_and_nothing() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(3); + pars := f_init_pars(101843, ran_idx := 2, ran_is_geran := false); + vc_conn := f_start_handler_with_pars(refers(f_tc_lu_and_mt_sms_paging_and_nothing), pars); + vc_conn.done; +} + /* mobile originated SMS from MS/BTS/BSC side to SMPP */ private function f_tc_smpp_mo_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -2174,6 +2446,15 @@ vc_conn.done; f_vty_config2(MSCVTY, { "smpp", "esme msc_tester"}, "no default-route"); } +testcase TC_iu_smpp_mo_sms() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_vty_config2(MSCVTY, { "smpp", "esme msc_tester"}, "default-route"); + vc_conn := f_start_handler(refers(f_tc_smpp_mo_sms), 1044, ran_idx := 2, ran_is_geran := false); + vc_conn.done; + f_vty_config2(MSCVTY, { "smpp", "esme msc_tester"}, "no default-route"); +} + /* Test MO-SMS from MS/BTS/BSC towards HLR (via GSUP) */ private function f_tc_gsup_mo_sms(charstring id, BSC_ConnHdlrPars pars) @@ -2243,6 +2524,15 @@ vc_conn.done; f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); } +testcase TC_iu_gsup_mo_sms() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_vty_config(MSCVTY, "msc", "sms-over-gsup"); + vc_conn := f_start_handler(refers(f_tc_gsup_mo_sms), 1088, ran_idx := 2, ran_is_geran := false); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); +} + /* Test MO-SMMA from MS/BTS/BSC towards HLR (via GSUP) */ private function f_tc_gsup_mo_smma(charstring id, BSC_ConnHdlrPars pars) @@ -2299,6 +2589,15 @@ vc_conn.done; f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); } +testcase TC_iu_gsup_mo_smma() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_vty_config(MSCVTY, "msc", "sms-over-gsup"); + vc_conn := f_start_handler(refers(f_tc_gsup_mo_smma), 1089, ran_idx := 2, ran_is_geran := false); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); +} + /* Helper for sending MT SMS over GSUP */ private function f_gsup_forwardSM_req(SmsParameters spars, OCT1 mms := '00'O) @@ -2380,6 +2679,17 @@ vc_conn.done; f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); } +testcase TC_iu_gsup_mt_sms_ack() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(3); + pars := f_init_pars(1090, ran_idx := 2, ran_is_geran := false); + f_vty_config(MSCVTY, "msc", "sms-over-gsup"); + vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mt_sms_ack), pars); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); +} + /* Test rejected MT-SMS (RP-ERROR) over GSUP */ private function f_tc_gsup_mt_sms_err(charstring id, BSC_ConnHdlrPars pars) @@ -2446,6 +2756,17 @@ vc_conn.done; f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); } +testcase TC_iu_gsup_mt_sms_err() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(3); + pars := f_init_pars(1091, ran_idx := 2, ran_is_geran := false); + f_vty_config(MSCVTY, "msc", "sms-over-gsup"); + vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mt_sms_err), pars); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); +} + /* Test SM-RP-MR assignment for MT-SMS over GSUP */ private function f_tc_gsup_mt_sms_rp_mr(charstring id, BSC_ConnHdlrPars pars) @@ -2558,6 +2879,17 @@ vc_conn.done; f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); } +testcase TC_iu_gsup_mt_sms_rp_mr() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(3); + pars := f_init_pars(1092, ran_idx := 2, ran_is_geran := false); + f_vty_config(MSCVTY, "msc", "sms-over-gsup"); + vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mt_sms_rp_mr), pars); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); +} + /* Test SM-RP-MR assignment for MT-SMS over GSUP */ private function f_tc_gsup_mo_mt_sms_rp_mr(charstring id, BSC_ConnHdlrPars pars) @@ -2662,6 +2994,17 @@ vc_conn.done; f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); } +testcase TC_iu_gsup_mo_mt_sms_rp_mr() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(3); + pars := f_init_pars(1093, ran_idx := 2, ran_is_geran := false); + f_vty_config(MSCVTY, "msc", "sms-over-gsup"); + vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mo_mt_sms_rp_mr), pars); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); +} + /* Test multi-part MT-SMS over GSUP */ private function f_tc_gsup_mt_multi_part_sms(charstring id, BSC_ConnHdlrPars pars) @@ -2696,7 +3039,7 @@ /* Expect Paging Request and Establish connection */ if (i == 3) { /* ... only once! */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging(); f_establish_fully(EST_TYPE_PAG_RESP); } @@ -2977,6 +3320,13 @@ vc_conn := f_start_handler(refers(f_tc_lu_and_mo_ussd_single_request), 46); vc_conn.done; } +testcase TC_iu_lu_and_mo_ussd_single_request() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_ussd_single_request), 1046, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* LU followed by MT USSD notification */ private function f_tc_lu_and_mt_ussd_notification(charstring id, BSC_ConnHdlrPars pars) @@ -3021,7 +3371,10 @@ /* Send it to MSC and expect Paging Request */ GSUP.send(gsup_req); alt { - [] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { + [pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { + setverdict(pass); + } + [not pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi), ?)) { setverdict(pass); } /* We don't expect anything else */ @@ -3080,6 +3433,13 @@ vc_conn := f_start_handler(refers(f_tc_lu_and_mt_ussd_notification), 47); vc_conn.done; } +testcase TC_iu_lu_and_mt_ussd_notification() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + vc_conn := f_start_handler(refers(f_tc_lu_and_mt_ussd_notification), 1047, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* LU followed by MT call and MO USSD request during this call */ private function f_tc_lu_and_mo_ussd_during_mt_call(charstring id, BSC_ConnHdlrPars pars) @@ -3166,6 +3526,12 @@ vc_conn := f_start_handler(refers(f_tc_lu_and_mo_ussd_during_mt_call), 48); vc_conn.done; } +testcase TC_iu_lu_and_mo_ussd_during_mt_call() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_ussd_during_mt_call), 1048, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} /* BSSMAP Clear Request in the middle of a call, see OS#3062 */ private function f_tc_mo_cc_bssmap_clear(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -3192,15 +3558,28 @@ MGCP.receive(tr_CRCX); f_sleep(1.0); - BSSAP.send(ts_BSSMAP_ClearRequest(0)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClearRequest(0)); + } else { + BSSAP.send(ts_RANAP_IuReleaseRequest(ts_RanapCause_om_intervention)); + } var default ccrel := activate(as_optional_cc_rel(cpars)); - interleave { - [] MNCC.receive(tr_MNCC_REL_ind(?, ?)) { }; - [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + if (pars.ran_is_geran) { + interleave { + [] MNCC.receive(tr_MNCC_REL_ind(?, ?)) { }; + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { BSSAP.send(ts_BSSMAP_ClearComplete); - }; + }; + } + } else { + interleave { + [] MNCC.receive(tr_MNCC_REL_ind(?, ?)) { }; + [] BSSAP.receive(tr_RANAP_IuReleaseCommand(?)) { + BSSAP.send(ts_RANAP_IuReleaseComplete); + }; + } } deactivate(ccrel); @@ -3214,6 +3593,14 @@ vc_conn := f_start_handler(refers(f_tc_mo_cc_bssmap_clear), 43); vc_conn.done; } +testcase TC_mo_cc_iu_release() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_mo_cc_bssmap_clear), 1043, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* LU followed by MT call and MT USSD request during this call */ private function f_tc_lu_and_mt_ussd_during_mt_call(charstring id, BSC_ConnHdlrPars pars) @@ -3316,6 +3703,13 @@ vc_conn := f_start_handler(refers(f_tc_lu_and_mt_ussd_during_mt_call), 49); vc_conn.done; } +testcase TC_iu_lu_and_mt_ussd_during_mt_call() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + vc_conn := f_start_handler(refers(f_tc_lu_and_mt_ussd_during_mt_call), 1049, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* LU followed by MO USSD request and MO Release during transaction */ private function f_tc_lu_and_mo_ussd_mo_release(charstring id, BSC_ConnHdlrPars pars) @@ -3413,6 +3807,13 @@ vc_conn := f_start_handler(refers(f_tc_lu_and_mo_ussd_mo_release), 50); vc_conn.done; } +testcase TC_iu_lu_and_mo_ussd_mo_release() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_ussd_mo_release), 1050, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + /* LU followed by MO USSD request and MT Release due to timeout */ private function f_tc_lu_and_ss_session_timeout(charstring id, BSC_ConnHdlrPars pars) @@ -3485,6 +3886,15 @@ vc_conn.done; f_vty_config(MSCVTY, "msc", "ncss guard-timeout 0"); } +testcase TC_iu_lu_and_ss_session_timeout() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_vty_config(MSCVTY, "msc", "ncss guard-timeout 3"); + vc_conn := f_start_handler(refers(f_tc_lu_and_ss_session_timeout), 1051, ran_idx := 2, ran_is_geran := false); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "ncss guard-timeout 0"); +} + /* A5/1 only permitted on network side; attempt an invalid CIPHER MODE COMPLETE with A5/3 which MSC should reject. */ private function f_tc_cipher_complete_with_invalid_cipher(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -3571,6 +3981,10 @@ * too long / short TLV values */ +/*********************************************************************** + * SGsAP Testing + ***********************************************************************/ + /* Check if a subscriber exists in the VLR */ private function f_ctrl_subscr_in_vlr(charstring imsi_or_msisdn) runs on BSC_ConnHdlr return boolean { @@ -3603,7 +4017,10 @@ f_vty_transceive(MSCVTY, "subscriber imsi " & hex2str(g_pars.imsi) & " paging"); alt { - [] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); { + [g_pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); { + setverdict(pass); + } + [not g_pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi), ?)) { setverdict(pass); } [] SGsAP.receive { @@ -4682,22 +5099,37 @@ execute( TC_lu_imsi_noauth_tmsi() ); execute( TC_lu_imsi_noauth_notmsi() ); execute( TC_lu_imsi_reject() ); + execute( TC_iu_lu_imsi_reject() ); execute( TC_lu_imsi_timeout_gsup() ); + execute( TC_iu_lu_imsi_timeout_gsup() ); execute( TC_lu_imsi_auth_tmsi() ); execute( TC_lu_imsi_auth3g_tmsi() ); + execute( TC_iu_lu_imsi_auth3g_tmsi() ); execute( TC_cmserv_imsi_unknown() ); + execute( TC_iu_cmserv_imsi_unknown() ); execute( TC_lu_and_mo_call() ); + execute( TC_iu_lu_and_mo_call() ); execute( TC_lu_auth_sai_timeout() ); + execute( TC_iu_lu_auth_sai_timeout() ); execute( TC_lu_auth_sai_err() ); + execute( TC_iu_lu_auth_sai_err() ); execute( TC_lu_clear_request() ); + execute( TC_iu_lu_release_request() ); execute( TC_lu_disconnect() ); + execute( TC_iu_lu_disconnect() ); execute( TC_lu_by_imei() ); + execute( TC_iu_lu_by_imei() ); execute( TC_lu_by_tmsi_noauth_unknown() ); execute( TC_imsi_detach_by_imsi() ); + execute( TC_iu_imsi_detach_by_imsi() ); execute( TC_imsi_detach_by_tmsi() ); + execute( TC_iu_imsi_detach_by_tmsi() ); execute( TC_imsi_detach_by_imei() ); + execute( TC_iu_imsi_detach_by_imei() ); execute( TC_emerg_call_imei_reject() ); + execute( TC_iu_emerg_call_imei_reject() ); execute( TC_emerg_call_imsi() ); + execute( TC_iu_emerg_call_imsi() ); execute( TC_cm_serv_req_vgcs_reject() ); execute( TC_cm_serv_req_vbs_reject() ); execute( TC_cm_serv_req_lcs_reject() ); @@ -4707,13 +5139,19 @@ execute( TC_cl3_no_payload() ); execute( TC_cl3_rnd_payload() ); execute( TC_establish_and_nothing() ); + execute( TC_iu_establish_and_nothing() ); execute( TC_mo_setup_and_nothing() ); + execute( TC_iu_mo_setup_and_nothing() ); execute( TC_mo_crcx_ran_timeout() ); + execute( TC_iu_mo_crcx_ran_timeout() ); execute( TC_mo_crcx_ran_reject() ); + execute( TC_iu_mo_crcx_ran_reject() ); execute( TC_mt_crcx_ran_reject() ); + execute( TC_iu_mt_crcx_ran_reject() ); execute( TC_mo_setup_and_dtmf_dup() ); //execute( TC_mt_t310() ); execute( TC_gsup_cancel() ); + execute( TC_iu_gsup_cancel() ); execute( TC_lu_imsi_auth_tmsi_encr_1_13() ); execute( TC_lu_imsi_auth_tmsi_encr_3_13() ); execute( TC_lu_imsi_auth_tmsi_encr_3_1() ); @@ -4721,30 +5159,48 @@ execute( TC_lu_imsi_auth_tmsi_encr_13_2() ); execute( TC_lu_imsi_auth_tmsi_encr_013_2() ); execute( TC_mo_release_timeout() ); + execute( TC_iu_mo_release_timeout() ); execute( TC_lu_and_mt_call_no_dlcx_resp() ); execute( TC_reset_two() ); + execute( TC_reset_two_1iu() ); execute( TC_lu_and_mt_call() ); execute( TC_lu_and_mo_sms() ); + execute( TC_iu_lu_and_mo_sms() ); execute( TC_lu_and_mt_sms() ); + execute( TC_iu_lu_and_mt_sms() ); execute( TC_lu_and_mt_sms_paging_and_nothing() ); + execute( TC_iu_lu_and_mt_sms_paging_and_nothing() ); execute( TC_smpp_mo_sms() ); + execute( TC_iu_smpp_mo_sms() ); execute( TC_smpp_mt_sms() ); execute( TC_gsup_mo_sms() ); + execute( TC_iu_gsup_mo_sms() ); execute( TC_gsup_mo_smma() ); + execute( TC_iu_gsup_mo_smma() ); execute( TC_gsup_mt_sms_ack() ); + execute( TC_iu_gsup_mt_sms_ack() ); execute( TC_gsup_mt_sms_err() ); + execute( TC_iu_gsup_mt_sms_err() ); execute( TC_gsup_mt_sms_rp_mr() ); + execute( TC_iu_gsup_mt_sms_rp_mr() ); execute( TC_gsup_mo_mt_sms_rp_mr() ); + execute( TC_iu_gsup_mo_mt_sms_rp_mr() ); execute( TC_lu_and_mo_ussd_single_request() ); + execute( TC_iu_lu_and_mo_ussd_single_request() ); execute( TC_lu_and_mt_ussd_notification() ); + execute( TC_iu_lu_and_mt_ussd_notification() ); execute( TC_lu_and_mo_ussd_during_mt_call() ); + execute( TC_iu_lu_and_mo_ussd_during_mt_call() ); execute( TC_lu_and_mt_ussd_during_mt_call() ); + execute( TC_iu_lu_and_mt_ussd_during_mt_call() ); execute( TC_lu_and_mo_ussd_mo_release() ); + execute( TC_iu_lu_and_mo_ussd_mo_release() ); execute( TC_lu_and_ss_session_timeout() ); + execute( TC_iu_lu_and_ss_session_timeout() ); execute( TC_cipher_complete_with_invalid_cipher() ); @@ -4770,11 +5226,13 @@ execute( TC_bssap_lu_sgsap_lu_and_mt_call() ); execute( TC_sgsap_lu_and_mt_call() ); execute( TC_sgsap_vlr_failure() ); + /* TODO: Iu + SGsAP related tests, e.g. paging on IuCS */ /* Run this last: at the time of writing this test crashes the MSC */ execute( TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug() ); execute( TC_gsup_mt_multi_part_sms() ); execute( TC_mo_cc_bssmap_clear() ); + execute( TC_mo_cc_iu_release() ); } -- To view, visit https://gerrit.osmocom.org/13753 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3b56e17487c9df839e67ed390a1ff89979683e8e Gerrit-Change-Number: 13753 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:44:35 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:44:35 +0000 Subject: Change in osmo-msc[master]: vlr subscr get/put: also check against NULL In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13745 ) Change subject: vlr subscr get/put: also check against NULL ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13745 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I36929a4ba4abb46909181068d1d0af967b1f5a94 Gerrit-Change-Number: 13745 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 23 Apr 2019 15:44:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:48:36 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 23 Apr 2019 15:48:36 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: skip tests that need PCU socket access In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13748 to look at the new patch set (#2). Change subject: BTS_Tests: skip tests that need PCU socket access ...................................................................... BTS_Tests: skip tests that need PCU socket access Some tests need direct access to the pcu socket, however, when working with hardware bts this socket is not always available. The tests that depend on the pci socket are then skipped by the testsuite. The following tests are not automatically excluded, but requre direkt PCU access. Lets exclude them as well: - TC_dyn_osmo_pdch_act_deact - TC_dyn_osmo_pdch_double_act - TC_dyn_ipa_pdch_act_deact - TC_dyn_ipa_pdch_act_tchf_act_nack Change-Id: I735b85d2ff3f541ebf0a558735d6172d69e7c29f Related: OS#3863 --- M bts/BTS_Tests.ttcn 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/48/13748/2 -- To view, visit https://gerrit.osmocom.org/13748 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I735b85d2ff3f541ebf0a558735d6172d69e7c29f Gerrit-Change-Number: 13748 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:50:24 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:50:24 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Adapter: Support build without IPA / BSSAP support In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13750 to look at the new patch set (#2). Change subject: RAN_Adapter: Support build without IPA / BSSAP support ...................................................................... RAN_Adapter: Support build without IPA / BSSAP support Change-Id: I5370f0ea6f2f6cfdc3370a6f3d3bf2e6c32af4d2 --- M library/RAN_Adapter.ttcnpp 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/50/13750/2 -- To view, visit https://gerrit.osmocom.org/13750 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5370f0ea6f2f6cfdc3370a6f3d3bf2e6c32af4d2 Gerrit-Change-Number: 13750 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:50:24 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:50:24 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Add RANAP support In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13653 to look at the new patch set (#5). Change subject: RAN_Emulation: Add RANAP support ...................................................................... RAN_Emulation: Add RANAP support So far, RAN_Emulation only handled BSSAP and hence could be used to emulate BSCs towards the MSC. Let's extend it with RANAP support so we can also emulate RNCs towards the MSC. We try to share as much code and logic as possible betweeb the two. Related: OS#2856, OS#2857 Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33 --- M library/RAN_Adapter.ttcnpp M library/RAN_Emulation.ttcnpp 2 files changed, 346 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/53/13653/5 -- To view, visit https://gerrit.osmocom.org/13653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33 Gerrit-Change-Number: 13653 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:50:25 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:50:25 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Integrate RANAP Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13754 Change subject: sgsn: Integrate RANAP ...................................................................... sgsn: Integrate RANAP Integrate RANAP support to SGSN_Tests.ttcn. Related: OS#2857 Change-Id: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22 --- M library/ranap/RANAP_CodecPort.ttcn M sgsn/SGSN_Tests.ttcn M sgsn/gen_links.sh M sgsn/regen_makefile.sh 4 files changed, 91 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/54/13754/1 diff --git a/library/ranap/RANAP_CodecPort.ttcn b/library/ranap/RANAP_CodecPort.ttcn index d9cd40e..07e1b00 100644 --- a/library/ranap/RANAP_CodecPort.ttcn +++ b/library/ranap/RANAP_CodecPort.ttcn @@ -17,6 +17,7 @@ import from SCCPasp_Types all; import from SCCP_Types all; +import from RANAP_PDU_Descriptions all; import from RANAP_Types all; type record RANAP_N_CONNECT_req diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 74cdece..0dff040 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -19,6 +19,12 @@ import from GSUP_Types all; import from IPA_Emulation all; +import from RAN_Adapter all; +import from RAN_Emulation all; +import from RANAP_Templates all; +import from RANAP_PDU_Descriptions all; +import from RANAP_IEs all; + import from GTP_Emulation all; import from GTP_Templates all; import from GTP_CodecPort all; @@ -76,6 +82,19 @@ handle_sns := false } }; + + RAN_Configurations mp_ranap_cfg := { + { + sccp_service_type := "mtp3_itu", + sctp_addr := { 23908, "127.0.0.1", 2905, "127.0.0.1" }, + own_pc := 195, + own_ssn := 142, + peer_pc := 185, + peer_ssn := 142, + sio := '83'O, + rctx := 2 + } + } }; type record GbInstance { @@ -88,8 +107,12 @@ type record length(3) of NSConfiguration NSConfigurations; type record length(3) of BssgpCellId BssgpCellIds; +const integer NUM_RNC := 1; +type record of RAN_Configuration RAN_Configurations; + type component test_CT { var GbInstances g_gb; + var RAN_Adapter g_ranap[NUM_RNC]; var GSUP_Emulation_CT vc_GSUP; var IPA_Emulation_CT vc_GSUP_IPA; @@ -228,6 +251,8 @@ /* mcc_mnc is 24.008 10.5.5.15 encoded. 262 42 */ function f_init(BcdMccMnc mcc_mnc := '262F42'H) runs on test_CT { + var integer i; + if (g_initialized == true) { return; } @@ -276,11 +301,42 @@ f_init_gb(g_gb[0], "SGSN_Test-Gb0", 0); f_init_gb(g_gb[1], "SGSN_Test-Gb1", 1); f_init_gb(g_gb[2], "SGSN_Test-Gb2", 2); + + for (i := 0; i < NUM_RNC; i := i+1) { + f_ran_adapter_init(g_ranap[i], mp_ranap_cfg[i], "SGSN_Test_" & int2str(i), RNC_RanOps); + f_ran_adapter_start(g_ranap[i]); + } f_init_gsup("SGSN_Test"); f_init_gtp("SGSN_Test"); f_vty_enable_echo_interval(g_use_echo); } +private function RncUnitdataCallback(RANAP_PDU ranap) +runs on RAN_Emulation_CT return template RANAP_PDU { + var template RANAP_PDU resp := omit; + + log ("RANAP_RncUnitDataCallback"); + /* answer all RESET with RESET ACK */ + if (match(ranap, tr_RANAP_Reset)) { + log("RANAP_RncUnitdataCallback: Responding to RESET with RESET-ACK"); + var CN_DomainIndicator dom; + dom := ranap.initiatingMessage.value_.Reset.protocolIEs[1].value_.cN_DomainIndicator; + resp := ts_RANAP_ResetAck(dom); + } + return resp; +} + +const RanOps RNC_RanOps := { + ranap_create_cb := refers(RAN_Emulation.RanapExpectedCreateCallback), + ranap_unitdata_cb := refers(RncUnitdataCallback), + ps_domain := true, + decode_dtap := true, + role_ms := true, + protocol := RAN_PROTOCOL_RANAP, + sccp_addr_local := omit, + sccp_addr_peer := omit +}; + type function void_fn(charstring id) runs on BSSGP_ConnHdlr; /* helper function to create, connect and start a BSSGP_ConnHdlr component */ diff --git a/sgsn/gen_links.sh b/sgsn/gen_links.sh index fe09726..3552bc2 100755 --- a/sgsn/gen_links.sh +++ b/sgsn/gen_links.sh @@ -53,6 +53,35 @@ FILES="GTPC_EncDec.cc GTPC_Types.ttcn GTPU_EncDec.cc GTPU_Types.ttcn" gen_links $DIR $FILES +# required by M3UA_Emulation +DIR=$BASEDIR/titan.ProtocolModules.M3UA/src +FILES="M3UA_Types.ttcn" +gen_links $DIR $FILES + +# required by M3UA_Emulation +DIR=$BASEDIR/titan.TestPorts.SCTPasp/src +FILES="SCTPasp_PT.cc SCTPasp_PT.hh SCTPasp_PortType.ttcn SCTPasp_Types.ttcn" +gen_links $DIR $FILES + +# required by M3UA Emulation +DIR=$BASEDIR/titan.TestPorts.MTP3asp/src +FILES="MTP3asp_PortType.ttcn MTP3asp_Types.ttcn" +gen_links $DIR $FILES + +# required by SCCP Emulation +DIR=$BASEDIR/titan.ProtocolEmulations.M3UA/src +FILES="M3UA_Emulation.ttcn" +gen_links $DIR $FILES + +DIR=$BASEDIR/titan.ProtocolEmulations.SCCP/src +FILES="SCCP_Emulation.ttcn SCCP_EncDec.cc SCCP_Mapping.ttcnpp SCCP_Types.ttcn SCCPasp_Types.ttcn" +gen_links $DIR $FILES + +DIR=../library/ranap +FILES="RANAP_CommonDataTypes.asn RANAP_Constants.asn RANAP_Containers.asn RANAP_IEs.asn RANAP_PDU_Contents.asn RANAP_PDU_Descriptions.asn " +FILES+="RANAP_Types.ttcn RANAP_Templates.ttcn RANAP_CodecPort.ttcn RANAP_EncDec.cc " +gen_links $DIR $FILES + DIR=../library FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_Types.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc " FILES+="NS_Emulation.ttcn NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc " @@ -60,6 +89,7 @@ FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn " FILES+="Osmocom_VTY_Functions.ttcn " FILES+="LLC_Templates.ttcn L3_Templates.ttcn L3_Common.ttcn " +FILES+="RAN_Emulation.ttcnpp RAN_Adapter.ttcnpp SCCP_Templates.ttcn " # IPA_Emulation + dependencies FILES+="IPA_Types.ttcn IPA_Emulation.ttcnpp IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc Native_Functions.ttcn Native_FunctionDefs.cc GSUP_Types.ttcn GSUP_Emulation.ttcn " FILES+="GTP_CodecPort.ttcn GTP_CodecPort_CtrlFunct.ttcn GTP_CodecPort_CtrlFunctDef.cc GTP_Emulation.ttcn diff --git a/sgsn/regen_makefile.sh b/sgsn/regen_makefile.sh index a85f79c..a65d27d 100755 --- a/sgsn/regen_makefile.sh +++ b/sgsn/regen_makefile.sh @@ -1,7 +1,9 @@ #!/bin/sh -FILES="*.ttcn *.ttcnpp BSSGP_EncDec.cc LLC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc NS_CodecPort_CtrlFunctDef.cc RLCMAC_EncDec.cc Native_FunctionDefs.cc TELNETasp_PT.cc IPA_CodecPort_CtrlFunctDef.cc GTPU_EncDec.cc GTPC_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc" +FILES="*.ttcn *.ttcnpp *.asn BSSGP_EncDec.cc LLC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc NS_CodecPort_CtrlFunctDef.cc RLCMAC_EncDec.cc Native_FunctionDefs.cc TELNETasp_PT.cc IPA_CodecPort_CtrlFunctDef.cc GTPU_EncDec.cc GTPC_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc SCCP_EncDec.cc SCTPasp_PT.cc RANAP_EncDec.cc " -export CPPFLAGS_TTCN3="-DIPA_EMULATION_GSUP" +export CPPFLAGS_TTCN3="-DIPA_EMULATION_GSUP -DUSE_MTP3_DISTRIBUTOR -DRAN_EMULATION_RANAP" ../regen-makefile.sh SGSN_Tests.ttcn $FILES + +sed -i -e 's/^LINUX_LIBS = -lxml2/LINUX_LIBS = -lxml2 -lfftranscode/' Makefile -- To view, visit https://gerrit.osmocom.org/13754 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22 Gerrit-Change-Number: 13754 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:53:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:53:51 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Adapter: Support build without IPA / BSSAP support In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13750 to look at the new patch set (#3). Change subject: RAN_Adapter: Support build without IPA / BSSAP support ...................................................................... RAN_Adapter: Support build without IPA / BSSAP support Change-Id: I5370f0ea6f2f6cfdc3370a6f3d3bf2e6c32af4d2 --- M library/RAN_Adapter.ttcnpp 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/50/13750/3 -- To view, visit https://gerrit.osmocom.org/13750 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5370f0ea6f2f6cfdc3370a6f3d3bf2e6c32af4d2 Gerrit-Change-Number: 13750 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:53:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:53:51 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Add RANAP to msc tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13751 to look at the new patch set (#3). Change subject: msc: Add RANAP to msc tests ...................................................................... msc: Add RANAP to msc tests Integrate RANAP to MSC_Tests.ttcn Related: OS#2856 Change-Id: Idfa54b7607ad6e7016ed9411b0cc5330c901ea34 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.default M msc/MSC_Tests.ttcn M msc/gen_links.sh M msc/regen_makefile.sh 5 files changed, 319 insertions(+), 78 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/51/13751/3 -- To view, visit https://gerrit.osmocom.org/13751 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idfa54b7607ad6e7016ed9411b0cc5330c901ea34 Gerrit-Change-Number: 13751 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:53:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:53:51 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Introduce f_cl3_or_initial_ue as replacement for f_bssap_compl_l3() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13752 to look at the new patch set (#3). Change subject: msc: Introduce f_cl3_or_initial_ue as replacement for f_bssap_compl_l3() ...................................................................... msc: Introduce f_cl3_or_initial_ue as replacement for f_bssap_compl_l3() The new function will check the RAN type and dispath to f_bssap_compl_l3() in case of 2G/GERAN and to f_ranap_initial_ue() on case of 3G/UTRAN. Change-Id: Ia27afa265d441d1a0cbb40cc2d938aff46fa25f9 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 33 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/52/13752/3 -- To view, visit https://gerrit.osmocom.org/13752 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia27afa265d441d1a0cbb40cc2d938aff46fa25f9 Gerrit-Change-Number: 13752 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:53:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:53:51 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Add Iu related tests for most existing 2G tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13753 to look at the new patch set (#3). Change subject: msc: Add Iu related tests for most existing 2G tests ...................................................................... msc: Add Iu related tests for most existing 2G tests This might look a bit like copy+paste programming for our testcases. However, we actually want the Iu related tests show up as separate 'testscase' in the TTCN-3 sense, so there's no way that's more elegant than this :/ Change-Id: I3b56e17487c9df839e67ed390a1ff89979683e8e --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 476 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/53/13753/3 -- To view, visit https://gerrit.osmocom.org/13753 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3b56e17487c9df839e67ed390a1ff89979683e8e Gerrit-Change-Number: 13753 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:53:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:53:51 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Integrate RANAP In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13754 to look at the new patch set (#2). Change subject: sgsn: Integrate RANAP ...................................................................... sgsn: Integrate RANAP Integrate RANAP support to SGSN_Tests.ttcn. Related: OS#2857 Change-Id: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22 --- M library/ranap/RANAP_CodecPort.ttcn M sgsn/SGSN_Tests.ttcn M sgsn/gen_links.sh M sgsn/regen_makefile.sh 4 files changed, 91 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/54/13754/2 -- To view, visit https://gerrit.osmocom.org/13754 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib62fc4c6007f6f4c47db7ca096a8d629bc72bb22 Gerrit-Change-Number: 13754 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:54:09 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:54:09 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Adapter: Rename functions from f_bssap_* to f_ran_adapter_* In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13749 ) Change subject: RAN_Adapter: Rename functions from f_bssap_* to f_ran_adapter_* ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13749 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I73818247f1dfc71c8ece11660e6c18f5f153d186 Gerrit-Change-Number: 13749 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 23 Apr 2019 15:54:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:54:23 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:54:23 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Adapter: Support build without IPA / BSSAP support In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13750 ) Change subject: RAN_Adapter: Support build without IPA / BSSAP support ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13750 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5370f0ea6f2f6cfdc3370a6f3d3bf2e6c32af4d2 Gerrit-Change-Number: 13750 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 23 Apr 2019 15:54:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:54:50 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:54:50 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Add RANAP support In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13653 ) Change subject: RAN_Emulation: Add RANAP support ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33 Gerrit-Change-Number: 13653 Gerrit-PatchSet: 6 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 23 Apr 2019 15:54:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:57:33 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:57:33 +0000 Subject: Change in osmo-ttcn3-hacks[master]: HNBAP, RUA and RANAP protocol codecs In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13652 to look at the new patch set (#8). Change subject: HNBAP, RUA and RANAP protocol codecs ...................................................................... HNBAP, RUA and RANAP protocol codecs This patch introduces protocol codecs for the HNBAP, RUA and RANAP protocols, which is mandatory for testing IuCS, IuPS or Iuh in the future. As Eclipse TITAN ASN.1 only supports the BER codec and the above protocols all use APER, we need to use an external transcoder from APER to BER and vice-versa. This was implemented using a proprietary ASN.1 compiler / trnaslator which sysmocom is packaging as libfftranscode, which is made available as binary package for Debian 9 at https://ftp.osmocom.org/binaries/libfftranscode/ Related: OS#2856, OS#2857, OS#2858 Change-Id: If4a72de9bc54d6e6a7daaca78a4d4aa5684203a5 --- A asn-test/ttcn3_asn1_rename.sh A library/hnbap/HNBAP_CommonDataTypes.asn A library/hnbap/HNBAP_Constants.asn A library/hnbap/HNBAP_Containers.asn A library/hnbap/HNBAP_EncDec.cc A library/hnbap/HNBAP_IEs.asn A library/hnbap/HNBAP_PDU_Contents.asn A library/hnbap/HNBAP_PDU_Descriptions.asn A library/hnbap/HNBAP_Types.ttcn A library/hnbap/regen_makefile.sh A library/ranap/RANAP_CodecPort.ttcn A library/ranap/RANAP_CommonDataTypes.asn A library/ranap/RANAP_Constants.asn A library/ranap/RANAP_Containers.asn A library/ranap/RANAP_EncDec.cc A library/ranap/RANAP_IEs.asn A library/ranap/RANAP_PDU_Contents.asn A library/ranap/RANAP_PDU_Descriptions.asn A library/ranap/RANAP_Selftests.ttcn A library/ranap/RANAP_Templates.ttcn A library/ranap/RANAP_Types.ttcn A library/ranap/regen_makefile.sh A library/rua/RUA_CommonDataTypes.asn A library/rua/RUA_Constants.asn A library/rua/RUA_Containers.asn A library/rua/RUA_EncDec.cc A library/rua/RUA_IEs.asn A library/rua/RUA_PDU_Contents.asn A library/rua/RUA_PDU_Descriptions.asn A library/rua/RUA_Types.ttcn A library/rua/regen_makefile.sh 31 files changed, 12,411 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/52/13652/8 -- To view, visit https://gerrit.osmocom.org/13652 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If4a72de9bc54d6e6a7daaca78a4d4aa5684203a5 Gerrit-Change-Number: 13652 Gerrit-PatchSet: 8 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 15:57:59 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 15:57:59 +0000 Subject: Change in osmo-ttcn3-hacks[master]: HNBAP, RUA and RANAP protocol codecs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13652 ) Change subject: HNBAP, RUA and RANAP protocol codecs ...................................................................... Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13652 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If4a72de9bc54d6e6a7daaca78a4d4aa5684203a5 Gerrit-Change-Number: 13652 Gerrit-PatchSet: 8 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 23 Apr 2019 15:57:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 16:00:37 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 16:00:37 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: wait until BTS supplies stable signal In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13747 ) Change subject: BTS_Tests: wait until BTS supplies stable signal ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13747/1/bts/BTS_Tests.ttcn File bts/BTS_Tests.ttcn: https://gerrit.osmocom.org/#/c/13747/1/bts/BTS_Tests.ttcn at 370 PS1, Line 370: 3.0 I think we should rather make this delay configurable from the module parameters. -- To view, visit https://gerrit.osmocom.org/13747 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib78633a33a15cd40514e15b6ebf9a0a8fb7b9c68 Gerrit-Change-Number: 13747 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 23 Apr 2019 16:00:37 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 16:03:10 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 16:03:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: skip tests that need PCU socket access In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13748 ) Change subject: BTS_Tests: skip tests that need PCU socket access ...................................................................... Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/13748/2//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13748/2//COMMIT_MSG at 11 PS2, Line 11: pci typo: PCU https://gerrit.osmocom.org/#/c/13748/2//COMMIT_MSG at 13 PS2, Line 13: direkt direct -- To view, visit https://gerrit.osmocom.org/13748 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I735b85d2ff3f541ebf0a558735d6172d69e7c29f Gerrit-Change-Number: 13748 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 23 Apr 2019 16:03:10 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 17:06:29 2019 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Tue, 23 Apr 2019 17:06:29 +0000 Subject: Change in osmo-bts[master]: osmo-bts-trx: distinguish 11-bit Access Bursts by synch. sequence In-Reply-To: References: Message-ID: Alexander Chemeris has posted comments on this change. ( https://gerrit.osmocom.org/13723 ) Change subject: osmo-bts-trx: distinguish 11-bit Access Bursts by synch. sequence ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/13723/4/src/osmo-bts-trx/scheduler_trx.c File src/osmo-bts-trx/scheduler_trx.c: https://gerrit.osmocom.org/#/c/13723/4/src/osmo-bts-trx/scheduler_trx.c at 750 PS4, Line 750: (synch_seq_ref[i][j] == '1' ? -1 : 1) Why not just have an array of 1/-1's instead of a string? This is probably not a very hot code path but still, it's better to avoid conditional branching in DSP code. -- To view, visit https://gerrit.osmocom.org/13723 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibb6d27c6589965c8b59a6d2598a7c43fd860f284 Gerrit-Change-Number: 13723 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 23 Apr 2019 17:06:29 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 17:54:35 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 17:54:35 +0000 Subject: Change in osmocom-bb[master]: trx_toolkit/data_msg.py: fix TOA256 MIN/MAX constants Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13755 Change subject: trx_toolkit/data_msg.py: fix TOA256 MIN/MAX constants ...................................................................... trx_toolkit/data_msg.py: fix TOA256 MIN/MAX constants The old TOA256 range was bigger than we can actually store: struct.error: 'h' format requires -32768 <= number <= 32767 Change-Id: I5d4e1fea9d07f2c49f01e6644d1c0d1dc8cf4e40 --- M src/target/trx_toolkit/data_msg.py 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/55/13755/1 diff --git a/src/target/trx_toolkit/data_msg.py b/src/target/trx_toolkit/data_msg.py index 62fd29b..cd6796d 100644 --- a/src/target/trx_toolkit/data_msg.py +++ b/src/target/trx_toolkit/data_msg.py @@ -297,9 +297,9 @@ RSSI_MIN = -120 RSSI_MAX = -50 - # TODO: verify this range - TOA256_MIN = -256 * 200 - TOA256_MAX = 256 * 200 + # -32768 <= TOA256 <= 32767 + TOA256_MIN = -32768 + TOA256_MAX = 32767 # Specific message fields rssi = None -- To view, visit https://gerrit.osmocom.org/13755 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5d4e1fea9d07f2c49f01e6644d1c0d1dc8cf4e40 Gerrit-Change-Number: 13755 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 18:39:45 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 23 Apr 2019 18:39:45 +0000 Subject: Change in libosmocore[master]: Add expect script: 'vty' for easy access to all vtys Message-ID: Keith Whyte has uploaded this change for review. ( https://gerrit.osmocom.org/13756 Change subject: Add expect script: 'vty' for easy access to all vtys ...................................................................... Add expect script: 'vty' for easy access to all vtys This expect script can be run as: ./vty bsc ./vty msc ./vty sip ... etc (no need to remember ports) Change-Id: Ice4532be7cb3139da29cb9d84dd4769e8d826dfa --- A contrib/vty 1 file changed, 87 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/56/13756/1 diff --git a/contrib/vty b/contrib/vty new file mode 100755 index 0000000..14c4336 --- /dev/null +++ b/contrib/vty @@ -0,0 +1,87 @@ +#!/usr/bin/expect -f + +# This expect script can be run as: +# ./vty bsc +# ./vty msc +# ./vty sip ... etc +# (no need to remember ports) +# +# One can edit the script itself to configure the preferred +# logging configuration for each component. +# +# The last command to be issued will be logging filter all 1 +# This allows for easy recall and issuing of +# 'logging filter all 0' to disable logging. +# As an alternative one call call this script as +# ./vty bsc 0 to disable logging on startup via the filter. +# +# Requires expect, available on most distributions. + +set host localhost +set vty [lindex $argv 0] +set lf [lindex $argv 1] +if { $lf < 0 } { set lf 1 } +set host localhost + +switch $vty { + hlr { set port 4258 } ; # Short names + bsc { set port 4242 } + mgw { set port 4243 } + mgw2 { + set host 127.0.0.2 + set port 4243 + } + sg { set port 4245 } + msc { set port 4254 } + sip { set port 4256 } + gg { set port 4260 } + ggsn { set port 4260 } + hnbgw { set port 4261 } + + osmo-hlr { set port 4258 } ; # Same but with full names of osmo-daemons: + osmo-bsc { set port 4242 } + osmo-mgw { set port 4243 } + osmo-mgw-for-bsc { set port 4243 } + osmo-mgw-for-msc { + set host 127.0.0.2 + set port 4243 + } + osmo-sgsn { set port 4245 } + osmo-msc { set port 4254 } + osmo-sip-connector { set port 4256 } + osmo-ggsn { set port 4260 } + osmo-hnbgw { set port 4262 } + default { set port 4242 } ; # Default to osmo-bsc / osmo-nitb +} + +spawn -noecho telnet localhost $port +expect ">" +send "enable\r" +expect "#" +send "logging enable\r" +expect "#" +send "logging print category 1\r" +expect "#" +send "logging print category-hex 0\r" +expect "#" +send "logging print level 1\r" +expect "#" +send "logging print file basename last\r" +expect "#" +send "logging print extended-timestamp 1\r" +expect "#" +send "logging level set-all notice\r" +expect "#" + +# Customise logging configuration per daemon here: +switch $vty { + msc { + send "logging level mm info\r" + expect "#" + send "logging level cc info\r" + expect "#" + } +} +send "logging filter all $lf\r" +expect "#" +interact -- To view, visit https://gerrit.osmocom.org/13756 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ice4532be7cb3139da29cb9d84dd4769e8d826dfa Gerrit-Change-Number: 13756 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 18:41:54 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 23 Apr 2019 18:41:54 +0000 Subject: Change in osmo-dev[master]: Add expect script: 'vty' for easy access to all vtys In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/11811 ) Change subject: Add expect script: 'vty' for easy access to all vtys ...................................................................... Patch Set 2: Code-Review-1 posted to libosmocore as Ice4532be7cb3139da29cb9d84dd4769e8d826dfa -- To view, visit https://gerrit.osmocom.org/11811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I64ec5f2a8e04f3a8ea9cd0910ba9614fcd37ecec Gerrit-Change-Number: 11811 Gerrit-PatchSet: 2 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Tue, 23 Apr 2019 18:41:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 18:42:15 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 23 Apr 2019 18:42:15 +0000 Subject: Change in osmo-dev[master]: Add expect script: 'vty' for easy access to all vtys In-Reply-To: References: Message-ID: Keith Whyte has abandoned this change. ( https://gerrit.osmocom.org/11811 ) Change subject: Add expect script: 'vty' for easy access to all vtys ...................................................................... Abandoned Moved to libosmocore -- To view, visit https://gerrit.osmocom.org/11811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I64ec5f2a8e04f3a8ea9cd0910ba9614fcd37ecec Gerrit-Change-Number: 11811 Gerrit-PatchSet: 2 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 18:56:08 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 18:56:08 +0000 Subject: Change in osmo-bts[master]: osmo-bts-trx: distinguish 11-bit Access Bursts by synch. sequence In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13723 ) Change subject: osmo-bts-trx: distinguish 11-bit Access Bursts by synch. sequence ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/13723/4/src/osmo-bts-trx/scheduler_trx.c File src/osmo-bts-trx/scheduler_trx.c: https://gerrit.osmocom.org/#/c/13723/4/src/osmo-bts-trx/scheduler_trx.c at 750 PS4, Line 750: (synch_seq_ref[i][j] == '1' ? -1 : 1) > Why not just have an array of 1/-1's instead of a string? This is probably not a very hot code path [?] In general, I am agree. This adds one cmp and a few more instructions to the loop (at least in GDB 4.8, Clang 8 somehow avoids them). But IMHO, strings in this particular case look way more readable and closer to the specs, than an array of +1/-1. Access Bursts are not as frequent as Normal Bursts, for example, so there should be no valuable performance impact. -- To view, visit https://gerrit.osmocom.org/13723 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibb6d27c6589965c8b59a6d2598a7c43fd860f284 Gerrit-Change-Number: 13723 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 23 Apr 2019 18:56:08 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 19:02:20 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 19:02:20 +0000 Subject: Change in osmocom-bb[master]: trx_toolkit/data_msg.py: fix TOA256 MIN/MAX constants In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13755 ) Change subject: trx_toolkit/data_msg.py: fix TOA256 MIN/MAX constants ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13755 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5d4e1fea9d07f2c49f01e6644d1c0d1dc8cf4e40 Gerrit-Change-Number: 13755 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 23 Apr 2019 19:02:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 19:15:12 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 19:15:12 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... Patch Set 2: (5 comments) https://gerrit.osmocom.org/#/c/13744/2/src/gprs/gprs_gmm.c File src/gprs/gprs_gmm.c: https://gerrit.osmocom.org/#/c/13744/2/src/gprs/gprs_gmm.c at 1620 PS2, Line 1620: static bool all_ms_ctx_present_on_sgsn(struct sgsn_mm_ctx *mmctx, You probably want to add spec chapter and section in this comment too. https://gerrit.osmocom.org/#/c/13744/2/src/gprs/gprs_gmm.c at 1625 PS2, Line 1625: for (pdp_nsapi = 0; pdp_nsapi < 16; pdp_nsapi++) { where does this 16 come from? Can we please have a define (if we don't have already) for it? https://gerrit.osmocom.org/#/c/13744/2/src/gprs/gprs_gmm.c at 1628 PS2, Line 1628: active = (1 << pdp_nsapi) & pdp_status[0]; While fine at runtime, you are actually assigning an integer value (bitmask) to a bool here, that's weird. Either have active an uint16_t or add some " != 0" at the end. https://gerrit.osmocom.org/#/c/13744/2/src/gprs/gprs_gmm.c at 1630 PS2, Line 1630: active = (1 << (pdp_nsapi - 8)) & pdp_status[1]; Can we actually have something like: for (pdp_nsapi = 0; pdp_nsapi < 16; pdp_nsapi++) { if (!(pdp_status[pdp_nsapi/8] & (1 << pdp_nsapi))) continue; /* not active in MS */ if (!sgsn_pdp_ctx_by_nsapi(mmctx, pdp_nsapi)) return false; /* active in MS but not in sgsn */ } return true; https://gerrit.osmocom.org/#/c/13744/2/src/gprs/gprs_gmm.c at 1920 PS2, Line 1920: /* Look at PDP Context Status IE and see if MS's view of You probably need to drop this comment too right? -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 2 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 19:15:12 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 19:17:23 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 19:17:23 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: default value for mp_ipa_up_timeout too low In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13746 ) Change subject: BTS_Tests: default value for mp_ipa_up_timeout too low ...................................................................... Patch Set 1: This file is not used osmo-gsm-tester+sysmobts ttcn3 job, you rather need to change it in this file: https://git.osmocom.org/osmo-gsm-tester/tree/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl -- To view, visit https://gerrit.osmocom.org/13746 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5bb290d00a02a25672305688352a03f3bf484ff3 Gerrit-Change-Number: 13746 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 19:17:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 19:18:41 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 19:18:41 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: default value for mp_ipa_up_timeout too low In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13746 ) Change subject: BTS_Tests: default value for mp_ipa_up_timeout too low ...................................................................... Patch Set 1: Code-Review+1 Still, I guess it's handy if somebody runs it with a sysmobts manually, and doesn't really harm usual tests run under osmo-bts-trx, so fine for me. -- To view, visit https://gerrit.osmocom.org/13746 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5bb290d00a02a25672305688352a03f3bf484ff3 Gerrit-Change-Number: 13746 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 19:18:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 19:18:43 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 19:18:43 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: default value for mp_ipa_up_timeout too low In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13746 ) Change subject: BTS_Tests: default value for mp_ipa_up_timeout too low ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13746 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5bb290d00a02a25672305688352a03f3bf484ff3 Gerrit-Change-Number: 13746 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 19:18:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 19:19:16 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 19:19:16 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: wait until BTS supplies stable signal In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13747 ) Change subject: BTS_Tests: wait until BTS supplies stable signal ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13747/1/bts/BTS_Tests.ttcn File bts/BTS_Tests.ttcn: https://gerrit.osmocom.org/#/c/13747/1/bts/BTS_Tests.ttcn at 370 PS1, Line 370: 3.0 > I think we should rather make this delay configurable from the module parameters. Agree -- To view, visit https://gerrit.osmocom.org/13747 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib78633a33a15cd40514e15b6ebf9a0a8fb7b9c68 Gerrit-Change-Number: 13747 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 23 Apr 2019 19:19:16 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 19:20:14 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 19:20:14 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: skip tests that need PCU socket access In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13748 ) Change subject: BTS_Tests: skip tests that need PCU socket access ...................................................................... Patch Set 2: Code-Review+1 +2 after you fix typos. -- To view, visit https://gerrit.osmocom.org/13748 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I735b85d2ff3f541ebf0a558735d6172d69e7c29f Gerrit-Change-Number: 13748 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 23 Apr 2019 19:20:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 19:29:04 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 19:29:04 +0000 Subject: Change in osmo-bts[master]: common/oml.c: fix: properly encode NM_ATT_SW_CONFIG In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13709 ) Change subject: common/oml.c: fix: properly encode NM_ATT_SW_CONFIG ...................................................................... Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/13709/2/src/common/oml.c File src/common/oml.c: https://gerrit.osmocom.org/#/c/13709/2/src/common/oml.c at 164 PS2, Line 164: *len = htons(total_len); better use osmo_store16be, len may not be aligned? https://gerrit.osmocom.org/#/c/13709/2/src/common/oml.c at 190 PS2, Line 190: *len = htons(total_len); same as comment above. -- To view, visit https://gerrit.osmocom.org/13709 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id26104719891944f3e2151df362bd45bb057a9c5 Gerrit-Change-Number: 13709 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 23 Apr 2019 19:29:04 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 19:32:09 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 19:32:09 +0000 Subject: Change in libosmocore[master]: Add expect script: 'vty' for easy access to all vtys In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13756 ) Change subject: Add expect script: 'vty' for easy access to all vtys ...................................................................... Patch Set 1: Code-Review+1 Not sure if this really belongs to libosmocore, but I cannot think of any better place neither, so fine. -- To view, visit https://gerrit.osmocom.org/13756 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice4532be7cb3139da29cb9d84dd4769e8d826dfa Gerrit-Change-Number: 13756 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 19:32:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 19:34:25 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 19:34:25 +0000 Subject: Change in osmocom-bb[master]: trx_toolkit/data_msg.py: fix TOA256 MIN/MAX constants In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13755 ) Change subject: trx_toolkit/data_msg.py: fix TOA256 MIN/MAX constants ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13755/1/src/target/trx_toolkit/data_msg.py File src/target/trx_toolkit/data_msg.py: https://gerrit.osmocom.org/#/c/13755/1/src/target/trx_toolkit/data_msg.py at 301 PS1, Line 301: TOA256_MIN = -32768 You could explain in the comment above where do these values come from rather than repeating them. -- To view, visit https://gerrit.osmocom.org/13755 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5d4e1fea9d07f2c49f01e6644d1c0d1dc8cf4e40 Gerrit-Change-Number: 13755 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 19:34:25 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 19:49:55 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 23 Apr 2019 19:49:55 +0000 Subject: Change in libosmocore[master]: Add expect script: 'vty' for easy access to all vtys In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13756 ) Change subject: Add expect script: 'vty' for easy access to all vtys ...................................................................... Patch Set 1: > [...] but I cannot think of any better place neither [...] How about https://git.osmocom.org/osmo-dev/ ? -- To view, visit https://gerrit.osmocom.org/13756 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice4532be7cb3139da29cb9d84dd4769e8d826dfa Gerrit-Change-Number: 13756 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 23 Apr 2019 19:49:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 20:37:49 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 20:37:49 +0000 Subject: Change in osmo-ttcn3-hacks[master]: LLC_Templates: Add SABM, UA, FRMR, DM templates Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13757 Change subject: LLC_Templates: Add SABM, UA, FRMR, DM templates ...................................................................... LLC_Templates: Add SABM, UA, FRMR, DM templates Change-Id: Idb40dcd53310b76ea9df6c0090e31175a4382460 --- M library/LLC_Templates.ttcn 1 file changed, 59 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/57/13757/1 diff --git a/library/LLC_Templates.ttcn b/library/LLC_Templates.ttcn index 086207c..1ea238e 100644 --- a/library/LLC_Templates.ttcn +++ b/library/LLC_Templates.ttcn @@ -10,6 +10,14 @@ cR := cr, pD := '0'B } +template (value) Address_field ts_LLC_Addr(template (value) BIT4 sapi, + template (value) BIT1 cr, + template (value) BIT1 pd := '0'B) := { + sAPI := sapi, + spare := '00'B, + cR := cr, + pD := '0'B +} template (value) Control_field_UI ts_LLC_CtrlUI(uint9_t n_u, boolean encrypted := false, boolean protected := false) := { @@ -20,7 +28,7 @@ pM := bool2bit(protected) } -template (value) Control_field_U ts_LLC_CtrlU(BIT4 m_bits, BIT1 p_f) := { +template (value) Control_field_U ts_LLC_CtrlU(template (value) BIT4 m_bits, template (value) BIT1 p_f) := { mBits := m_bits, pF := p_f, format := '111'B @@ -47,7 +55,7 @@ template PDU_LLC ts_LLC_UI(octetstring payload, BIT4 sapi, BIT1 cr, uint9_t n_u, boolean encrypted := false, boolean protected := false) := { pDU_LLC_UI := { - address_field := t_LLC_Addr(sapi, cr), + address_field := ts_LLC_Addr(sapi, cr), control_field := ts_LLC_CtrlUI(n_u, encrypted, protected), information_field_UI := payload, fCS := omit /* causes encoder to generate FCS */ @@ -77,6 +85,55 @@ } } +template PDU_LLC tr_LLC_U(template BIT4 m_bits, template BIT1 p_f, template Information_field_U u, + template BIT4 sapi, template BIT1 cr) := { + pDU_LLC_U := { + address_field := t_LLC_Addr(sapi, cr), + control_field := tr_LLC_CtrlU(m_bits, p_f), + information_field_U := u, + fCS := omit /* causes encoder to generate FCS */ + } +} +template (value) PDU_LLC ts_LLC_U(template (value) BIT4 m_bits, template (value) BIT1 p_f, + template (value) Information_field_U u, + template (value) BIT4 sapi, template (value) BIT1 cr) := { + pDU_LLC_U := { + address_field := ts_LLC_Addr(sapi, cr), + control_field := ts_LLC_CtrlU(m_bits, p_f), + information_field_U := u, + fCS := omit /* causes encoder to generate FCS */ + } +} + +template PDU_LLC tr_LLC_SABM(template SABM_Information sabm_xid, template BIT1 p_f, + template BIT4 sapi, template BIT1 cr) := + tr_LLC_U('0111'B, p_f, Information_field_U:{sABM := sabm_xid}, sapi, cr); +template (value) PDU_LLC ts_LLC_SABM(template (value) SABM_Information sabm_xid, + template (value) BIT1 p_f, + template (value) BIT4 sapi, template (value) BIT1 cr) := + ts_LLC_U('0111'B, p_f, Information_field_U:{sABM := sabm_xid}, sapi, cr); + +template PDU_LLC tr_LLC_UA(template UA_Information ua_xid, template BIT1 p_f, + template BIT4 sapi, template BIT1 cr) := + tr_LLC_U('0110'B, p_f, Information_field_U:{uA := ua_xid}, sapi, cr); +template (value) PDU_LLC ts_LLC_UA(template (value) UA_Information ua_xid, + template (value) BIT1 p_f, + template (value) BIT4 sapi, template (value) BIT1 cr) := + ts_LLC_U('0110'B, p_f, Information_field_U:{uA := ua_xid}, sapi, cr); + +template PDU_LLC tr_LLC_FRMR(template FRMR_Information frmr, template BIT1 p_f, + template BIT4 sapi, template BIT1 cr) := + tr_LLC_U('1000'B, p_f, Information_field_U:{fRMR := frmr}, sapi, cr); +template (value) PDU_LLC ts_LLC_FRMR(template (value) FRMR_Information frmr, + template (value) BIT1 p_f, + template (value) BIT4 sapi, template (value) BIT1 cr) := + ts_LLC_U('1000'B, p_f, Information_field_U:{fRMR := frmr}, sapi, cr); + +template PDU_LLC tr_LLC_DM(template BIT1 p_f, template BIT4 sapi, template BIT1 cr) := + tr_LLC_U('1000'B, p_f, Information_field_U:{dM := ''O}, sapi, cr); +template (value) PDU_LLC ts_LLC_DM(template (value) BIT1 p_f, template (value) BIT4 sapi, + template (value) BIT1 cr) := + ts_LLC_U('1000'B, p_f, Information_field_U:{dM := ''O}, sapi, cr); const BIT4 c_LLC_SAPI_LLGMM := '0001'B; const BIT4 c_LLC_SAPI_TOM2 := '0010'B; -- To view, visit https://gerrit.osmocom.org/13757 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Idb40dcd53310b76ea9df6c0090e31175a4382460 Gerrit-Change-Number: 13757 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 20:37:49 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 20:37:49 +0000 Subject: Change in osmo-ttcn3-hacks[master]: deps/Makefile: Use osmocom fork of LLC protocol module Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13758 Change subject: deps/Makefile: Use osmocom fork of LLC protocol module ...................................................................... deps/Makefile: Use osmocom fork of LLC protocol module Change-Id: I8b9f107f0a99dcbd8148a3d431a101d194dfe788 --- M deps/Makefile 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/58/13758/1 diff --git a/deps/Makefile b/deps/Makefile index 7cf9300..6b19cf3 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -37,13 +37,13 @@ titan.ProtocolModules.GTP_v13.5.0 \ titan.ProtocolModules.GTPv2_v13.7.0 \ titan.ProtocolModules.ISUP_Q.762 \ - titan.ProtocolModules.LLC_v7.1.0 \ titan.ProtocolModules.MobileL3_v13.4.0 \ titan.ProtocolModules.NS_v7.3.0 \ titan.ProtocolModules.SNDCP_v7.0.0 \ titan.ProtocolEmulations.SCCP OSMOGITHUB_REPOS= titan.TestPorts.SCTPasp \ + titan.ProtocolModules.LLC_v7.1.0 \ titan.ProtocolModules.SGsAP_13.2.0 \ titan.TestPorts.MTP3asp \ titan.ProtocolEmulations.M3UA @@ -69,7 +69,7 @@ titan.ProtocolModules.IP_commit= R.10.B-1-g99d0ec9 titan.ProtocolModules.ISUP_Q.762_commit= R.8.A titan.ProtocolModules.L2TP_commit= R.2.A -titan.ProtocolModules.LLC_v7.1.0_commit= R.2.A +titan.ProtocolModules.LLC_v7.1.0_commit= 2a3c09fbf7bae22f802aa88689800f38a1f3732d titan.ProtocolModules.MAP_commit= R.2.A-1-g79c6a3d titan.ProtocolModules.M2PA_commit= R.2.A titan.ProtocolModules.M3UA_commit= R.2.A -- To view, visit https://gerrit.osmocom.org/13758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8b9f107f0a99dcbd8148a3d431a101d194dfe788 Gerrit-Change-Number: 13758 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 20:37:49 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 20:37:49 +0000 Subject: Change in osmo-ttcn3-hacks[master]: LLC_Templates: Add templates for NULL and DISC Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13759 Change subject: LLC_Templates: Add templates for NULL and DISC ...................................................................... LLC_Templates: Add templates for NULL and DISC Change-Id: Ia5b350990379bba1677a0c1c99cf37e6651ba84d --- M library/LLC_Templates.ttcn 1 file changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/59/13759/1 diff --git a/library/LLC_Templates.ttcn b/library/LLC_Templates.ttcn index 1ea238e..0431a70 100644 --- a/library/LLC_Templates.ttcn +++ b/library/LLC_Templates.ttcn @@ -135,6 +135,19 @@ template (value) BIT1 cr) := ts_LLC_U('1000'B, p_f, Information_field_U:{dM := ''O}, sapi, cr); +template PDU_LLC tr_LLC_NULL(template BIT1 p_f, template BIT4 sapi, template BIT1 cr) := + tr_LLC_U('0000'B, p_f, Information_field_U:{nULL := ''O}, sapi, cr); +template (value) PDU_LLC ts_LLC_NULL(template (value) BIT1 p_f, template (value) BIT4 sapi, + template (value) BIT1 cr) := + ts_LLC_U('0000'B, p_f, Information_field_U:{nULL := ''O}, sapi, cr); + +template PDU_LLC tr_LLC_DISC(template BIT1 p_f, template BIT4 sapi, template BIT1 cr) := + tr_LLC_U('0100'B, p_f, Information_field_U:{dISC := ''O}, sapi, cr); +template (value) PDU_LLC ts_LLC_DISC(template (value) BIT1 p_f, template (value) BIT4 sapi, + template (value) BIT1 cr) := + ts_LLC_U('0100'B, p_f, Information_field_U:{dISC := ''O}, sapi, cr); + + const BIT4 c_LLC_SAPI_LLGMM := '0001'B; const BIT4 c_LLC_SAPI_TOM2 := '0010'B; const BIT4 c_LLC_SAPI_LL3 := '0011'B; -- To view, visit https://gerrit.osmocom.org/13759 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia5b350990379bba1677a0c1c99cf37e6651ba84d Gerrit-Change-Number: 13759 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 20:37:50 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 20:37:50 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13760 Change subject: sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet ...................................................................... sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet This test case reproduces a bug in OsmoSGSN where it would crash as a result to sending LLC NULL frames. Change-Id: I38326f2ebaaff009d4357edad9511ce2ce7736fd Related: OS#3952 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 25 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/60/13760/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 74cdece..5280e50 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -375,12 +375,16 @@ f_sleep(20.0); } +function f_send_llc(template (value) PDU_LLC llc_pdu, integer gb_index := 0) runs on BSSGP_ConnHdlr { + var octetstring llc_enc := enc_PDU_LLC(valueof(llc_pdu)); + BSSGP[gb_index].send(ts_BSSGP_UL_UD(g_pars.tlli, g_pars.bssgp_cell_id[gb_index], llc_enc)); +} + function f_send_l3_gmm_llc(template PDU_L3_MS_SGSN l3_mo, integer gb_index := 0) runs on BSSGP_ConnHdlr { var octetstring l3_enc := enc_PDU_L3_MS_SGSN(valueof(l3_mo)); var BIT4 sapi := f_llc_sapi_by_l3_mo(valueof(l3_mo)); var integer n_u := f_llc_get_n_u_tx(llc[bit2int(sapi)]); - var octetstring llc_enc := enc_PDU_LLC(valueof(ts_LLC_UI(l3_enc, sapi, '0'B, n_u))); - BSSGP[gb_index].send(ts_BSSGP_UL_UD(g_pars.tlli, g_pars.bssgp_cell_id[gb_index], llc_enc)); + f_send_llc(ts_LLC_UI(l3_enc, sapi, '0'B, n_u)); } altstep as_mm_identity() runs on BSSGP_ConnHdlr { @@ -2153,6 +2157,23 @@ vc_conn.done; } + +/* Send LLC NULL to see if the SGSN survives it (OS#3952) */ +private function f_TC_llc_null(charstring id) runs on BSSGP_ConnHdlr { + f_gmm_attach(false, false); + f_sleep(1.0); + f_send_llc(ts_LLC_NULL('0'B, c_LLC_SAPI_LLGMM, LLC_CR_UL_CMD)); + /* try another attach to see if SGSN is still alive */ + f_gmm_attach(false, false); +} +testcase TC_llc_null() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_llc_null), testcasename(), g_gb, 41); + vc_conn.done; +} + control { execute( TC_attach() ); execute( TC_attach_mnc3() ); @@ -2197,6 +2218,8 @@ execute( TC_attach_pdp_act_deact_mt_t3395_expire() ); execute( TC_attach_pdp_act_user_error_ind_ggsn() ); execute( TC_attach_gmm_attach_req_while_gmm_attach() ); + + execute( TC_llc_null() ); } -- To view, visit https://gerrit.osmocom.org/13760 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I38326f2ebaaff009d4357edad9511ce2ce7736fd Gerrit-Change-Number: 13760 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 20:44:23 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 20:44:23 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13760 to look at the new patch set (#2). Change subject: sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet ...................................................................... sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet This test case reproduces a bug in OsmoSGSN where it would crash as a result to sending LLC NULL frames. Change-Id: I38326f2ebaaff009d4357edad9511ce2ce7736fd Related: OS#3952 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 25 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/60/13760/2 -- To view, visit https://gerrit.osmocom.org/13760 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I38326f2ebaaff009d4357edad9511ce2ce7736fd Gerrit-Change-Number: 13760 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 20:49:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 20:49:12 +0000 Subject: Change in osmo-sgsn[master]: gb_proxy.h: Add missing comments; improve comments Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13761 Change subject: gb_proxy.h: Add missing comments; improve comments ...................................................................... gb_proxy.h: Add missing comments; improve comments When the patching and routing features were introduced, a lot of the new structures were not documented at the same level as the pre-existing code. Let's fix that. Change-Id: I61bdd3b1cec037bce825c234a8a274b70629adc8 --- M include/osmocom/sgsn/gb_proxy.h 1 file changed, 46 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/61/13761/1 diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h index 7e2ae42..740579f 100644 --- a/include/osmocom/sgsn/gb_proxy.h +++ b/include/osmocom/sgsn/gb_proxy.h @@ -70,29 +70,30 @@ }; enum gbproxy_keep_mode { - GBPROX_KEEP_NEVER, - GBPROX_KEEP_REATTACH, - GBPROX_KEEP_IDENTIFIED, - GBPROX_KEEP_ALWAYS, + GBPROX_KEEP_NEVER, /* don't ever keep TLLI/IMSI state of de-registered subscribers */ + GBPROX_KEEP_REATTACH, /* keep if re-attach has been requested by SGSN */ + GBPROX_KEEP_IDENTIFIED, /* keep if we had resolved an IMSI */ + GBPROX_KEEP_ALWAYS, /* always keep */ }; enum gbproxy_match_id { - GBPROX_MATCH_PATCHING, - GBPROX_MATCH_ROUTING, + GBPROX_MATCH_PATCHING, /* match rule on whether or not we should patch */ + GBPROX_MATCH_ROUTING, /* match rule on whether or not we should route (2-SGSN) */ GBPROX_MATCH_LAST }; struct gbproxy_match { - int enable; - char *re_str; - regex_t re_comp; + int enable; /* is this match enabled? */ + char *re_str; /* regular expression (for IMSI) in string format */ + regex_t re_comp; /* compiled regular expression (for IMSI) */ }; +/* global gb-proxy configuration */ struct gbproxy_config { /* parsed from config file */ uint16_t nsip_sgsn_nsei; - /* misc */ + /* NS instance of libosmogb */ struct gprs_ns_inst *nsi; /* Linked list of all Gb peers (except SGSN) */ @@ -101,10 +102,13 @@ /* Counter */ struct rate_ctr_group *ctrg; - /* force mcc/mnc */ + /* MCC/MNC to be patched into RA-ID on the way from BSS to SGSN? */ struct osmo_plmn_id core_plmn; + + /* APN to be patched into PDP CTX ACT REQ on the way from BSS to SGSN */ uint8_t* core_apn; size_t core_apn_size; + /* Frequency (sec) at which timer to clean stale links is fired (0 disabled) */ unsigned int clean_stale_timer_freq; /* If !0, Max age to consider a struct gbproxy_link_info as stale */ @@ -114,14 +118,18 @@ /* If !0, Max len of gbproxy_link_info->stored_msgs (list of msgb) */ uint32_t stored_msgs_max_len; - /* Experimental config */ + /* Should the P-TMSI be patched on the fly (required for 2-SGSN config) */ int patch_ptmsi; + /* Should the IMSI be acquired by the proxy (required for 2-SGSN config) */ int acquire_imsi; + /* Should we route subscribers to two different SGSNs? */ int route_to_sgsn2; + /* NSEI of the second SGSN */ uint16_t nsip_sgsn2_nsei; + /* should we keep per-subscriber state even after de-registration? */ enum gbproxy_keep_mode keep_link_infos; - /* IMSI checking/matching */ + /* IMSI checking/matching for 2-SGSN routing and patching */ struct gbproxy_match matches[GBPROX_MATCH_LAST]; }; @@ -133,7 +141,9 @@ int logical_link_count; }; +/* one peer at NS level that we interact with (BSS/PCU) */ struct gbproxy_peer { + /* linked to gbproxy_config.bts_peers */ struct llist_head list; /* point back to the config */ @@ -152,6 +162,7 @@ /* Counter */ struct rate_ctr_group *ctrg; + /* State related to on-the-fly patching of certain messages */ struct gbproxy_patch_state patch_state; /* Fired periodically to clean up stale links from list */ @@ -159,32 +170,54 @@ }; struct gbproxy_tlli_state { + /* currently active TLLI */ uint32_t current; + /* newly-assigned TLLI (e.g. during P-TMSI allocation procedure) */ uint32_t assigned; + /* has the BSS side validated (confirmed) the new TLLI? */ int bss_validated; + /* has the SGSN side validated (confirmed) the new TLLI? */ int net_validated; + /* NOTE: once both are validated, we set current = assigned and assigned = 0 */ + /* The P-TMSI for this subscriber */ uint32_t ptmsi; }; +/* One TLLI (= UE, = Subscriber) served via this proxy */ struct gbproxy_link_info { + /* link to gbproxy_peer.patch_state.logical_links */ struct llist_head list; + /* TLLI on the BSS/PCU side */ struct gbproxy_tlli_state tlli; + /* TLLI on the SGSN side (can be different in case of P-TMSI patching */ struct gbproxy_tlli_state sgsn_tlli; + /* NSEI of the SGSN serving this link */ uint32_t sgsn_nsei; + /* timestamp when we last saw any contact with this UE */ time_t timestamp; + + /* IMSI of the subscriber (if/once known) */ uint8_t *imsi; size_t imsi_len; + /* is the IMSI acquisition still pending? */ int imsi_acq_pending; + + /* queue of stored UL messages (until IMSI acquisition completes and we can + * determine which of the SGSNs we should route this to */ struct llist_head stored_msgs; uint32_t stored_msgs_len; + + /* generated N(U) we use (required due to IMSI acquisition */ unsigned vu_gen_tx_bss; + /* is this subscriber deregistered (TLLI invalidated)? */ int is_deregistered; + /* does this link match either the (2-SGSN) routing or the patching rule? */ int is_matching[GBPROX_MATCH_LAST]; }; -- To view, visit https://gerrit.osmocom.org/13761 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I61bdd3b1cec037bce825c234a8a274b70629adc8 Gerrit-Change-Number: 13761 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 20:49:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 20:49:13 +0000 Subject: Change in osmo-sgsn[master]: gb_proxy: cosmetic: Use 'bool' in data structures where applicable Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13762 Change subject: gb_proxy: cosmetic: Use 'bool' in data structures where applicable ...................................................................... gb_proxy: cosmetic: Use 'bool' in data structures where applicable If we ever only use 0/1 in an 'int', we should have used 'bool'. Change-Id: I63876f52d5de87e4c99d92669270fd1f487e217c --- M include/osmocom/sgsn/gb_proxy.h M src/gprs/gb_proxy.c M src/gprs/gb_proxy_patch.c M src/gprs/gb_proxy_tlli.c M src/gprs/gb_proxy_vty.c 5 files changed, 36 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/62/13762/1 diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h index 740579f..ff247d8 100644 --- a/include/osmocom/sgsn/gb_proxy.h +++ b/include/osmocom/sgsn/gb_proxy.h @@ -10,6 +10,7 @@ #include #include +#include #define GBPROXY_INIT_VU_GEN_TX 256 @@ -83,7 +84,7 @@ }; struct gbproxy_match { - int enable; /* is this match enabled? */ + bool enable; /* is this match enabled? */ char *re_str; /* regular expression (for IMSI) in string format */ regex_t re_comp; /* compiled regular expression (for IMSI) */ }; @@ -119,11 +120,11 @@ uint32_t stored_msgs_max_len; /* Should the P-TMSI be patched on the fly (required for 2-SGSN config) */ - int patch_ptmsi; + bool patch_ptmsi; /* Should the IMSI be acquired by the proxy (required for 2-SGSN config) */ - int acquire_imsi; + bool acquire_imsi; /* Should we route subscribers to two different SGSNs? */ - int route_to_sgsn2; + bool route_to_sgsn2; /* NSEI of the second SGSN */ uint16_t nsip_sgsn2_nsei; /* should we keep per-subscriber state even after de-registration? */ @@ -154,7 +155,7 @@ /* BVCI used for Point-to-Point to this peer */ uint16_t bvci; - int blocked; + bool blocked; /* Routeing Area that this peer is part of (raw 04.08 encoding) */ uint8_t ra[6]; @@ -175,9 +176,9 @@ /* newly-assigned TLLI (e.g. during P-TMSI allocation procedure) */ uint32_t assigned; /* has the BSS side validated (confirmed) the new TLLI? */ - int bss_validated; + bool bss_validated; /* has the SGSN side validated (confirmed) the new TLLI? */ - int net_validated; + bool net_validated; /* NOTE: once both are validated, we set current = assigned and assigned = 0 */ /* The P-TMSI for this subscriber */ @@ -204,7 +205,7 @@ size_t imsi_len; /* is the IMSI acquisition still pending? */ - int imsi_acq_pending; + bool imsi_acq_pending; /* queue of stored UL messages (until IMSI acquisition completes and we can * determine which of the SGSNs we should route this to */ @@ -215,10 +216,10 @@ unsigned vu_gen_tx_bss; /* is this subscriber deregistered (TLLI invalidated)? */ - int is_deregistered; + bool is_deregistered; /* does this link match either the (2-SGSN) routing or the patching rule? */ - int is_matching[GBPROX_MATCH_LAST]; + bool is_matching[GBPROX_MATCH_LAST]; }; diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index 0b5758a..3da7bfd 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -310,7 +310,7 @@ in_progress = 1; gbproxy_link_info_discard_messages(link_info); - link_info->imsi_acq_pending = 0; + link_info->imsi_acq_pending = false; return in_progress; } @@ -531,7 +531,7 @@ * implementation relies on the MS doing proper retransmissions * of the triggering message instead */ - link_info->imsi_acq_pending = 1; + link_info->imsi_acq_pending = true; } return 0; @@ -836,11 +836,11 @@ switch (pdu_type) { case BSSGP_PDUT_BVC_BLOCK_ACK: - peer->blocked = 1; + peer->blocked = true; rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_BLOCKED]); break; case BSSGP_PDUT_BVC_UNBLOCK_ACK: - peer->blocked = 0; + peer->blocked = false; rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_UNBLOCKED]); break; default: diff --git a/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c index 251bb67..6235b04 100644 --- a/src/gprs/gb_proxy_patch.c +++ b/src/gprs/gb_proxy_patch.c @@ -398,7 +398,7 @@ { if (match->enable) { regfree(&match->re_comp); - match->enable = 0; + match->enable = false; } talloc_free(match->re_str); match->re_str = NULL; @@ -419,7 +419,7 @@ REG_EXTENDED | REG_NOSUB | REG_ICASE); if (rc == 0) { - match->enable = 1; + match->enable = true; match->re_str = talloc_strdup(tall_sgsn_ctx, filter); return 0; } diff --git a/src/gprs/gb_proxy_tlli.c b/src/gprs/gb_proxy_tlli.c index 0c027d5..4e21ede 100644 --- a/src/gprs/gb_proxy_tlli.c +++ b/src/gprs/gb_proxy_tlli.c @@ -284,8 +284,8 @@ /* Remember assigned TLLI */ tlli_state->assigned = new_tlli; - tlli_state->bss_validated = 0; - tlli_state->net_validated = 0; + tlli_state->bss_validated = false; + tlli_state->net_validated = false; } uint32_t gbproxy_map_tlli(uint32_t other_tlli, @@ -325,9 +325,9 @@ /* See GSM 04.08, 4.7.1.5 */ if (to_bss) - tlli_state->net_validated = 1; + tlli_state->net_validated = true; else - tlli_state->bss_validated = 1; + tlli_state->bss_validated = true; if (!tlli_state->bss_validated || !tlli_state->net_validated) return; @@ -367,7 +367,7 @@ link_info->sgsn_tlli.current = 0; link_info->sgsn_tlli.assigned = 0; - link_info->is_deregistered = 1; + link_info->is_deregistered = true; gbproxy_reset_link(link_info); @@ -424,7 +424,7 @@ &peer->cfg->matches[match_id], parse_ctx->imsi, parse_ctx->imsi_len); if (imsi_matches >= 0) - link_info->is_matching[match_id] = imsi_matches; + link_info->is_matching[match_id] = imsi_matches ? true : false; } } @@ -498,7 +498,7 @@ if (!link_info) return NULL; - link_info->is_deregistered = 0; + link_info->is_deregistered = false; return link_info; } @@ -577,7 +577,7 @@ peer, parse_ctx->imsi, parse_ctx->imsi_len); if (link_info) - link_info->is_deregistered = 0; + link_info->is_deregistered = false; return link_info; } diff --git a/src/gprs/gb_proxy_vty.c b/src/gprs/gb_proxy_vty.c index 52c39fd..5c4f454 100644 --- a/src/gprs/gb_proxy_vty.c +++ b/src/gprs/gb_proxy_vty.c @@ -241,7 +241,7 @@ return CMD_WARNING; } - g_cfg->acquire_imsi = 1; + g_cfg->acquire_imsi = true; return CMD_SUCCESS; } @@ -256,7 +256,7 @@ for (match_id = 0; match_id < ARRAY_SIZE(g_cfg->matches); ++match_id) gbproxy_clear_patch_filter(&g_cfg->matches[match_id]); - g_cfg->acquire_imsi = 0; + g_cfg->acquire_imsi = false; return CMD_SUCCESS; } @@ -329,7 +329,7 @@ "patch-ptmsi", GBPROXY_PATCH_PTMSI_STR) { - g_cfg->patch_ptmsi = 1; + g_cfg->patch_ptmsi = true; return CMD_SUCCESS; } @@ -339,7 +339,7 @@ "no patch-ptmsi", NO_STR GBPROXY_PATCH_PTMSI_STR) { - g_cfg->patch_ptmsi = 0; + g_cfg->patch_ptmsi = false; return CMD_SUCCESS; } @@ -355,7 +355,7 @@ "acquire-imsi", GBPROXY_ACQUIRE_IMSI_STR) { - g_cfg->acquire_imsi = 1; + g_cfg->acquire_imsi = true; return CMD_SUCCESS; } @@ -365,7 +365,7 @@ "no acquire-imsi", NO_STR GBPROXY_ACQUIRE_IMSI_STR) { - g_cfg->acquire_imsi = 0; + g_cfg->acquire_imsi = false; return CMD_SUCCESS; } @@ -387,10 +387,10 @@ return CMD_WARNING; } - g_cfg->route_to_sgsn2 = 1; + g_cfg->route_to_sgsn2 = true; g_cfg->nsip_sgsn2_nsei = nsei; - g_cfg->patch_ptmsi = 1; + g_cfg->patch_ptmsi = true; return CMD_SUCCESS; } @@ -400,10 +400,10 @@ "no secondary-sgsn", NO_STR GBPROXY_SECOND_SGSN_STR) { - g_cfg->route_to_sgsn2 = 0; + g_cfg->route_to_sgsn2 = false; g_cfg->nsip_sgsn2_nsei = 0xFFFF; - g_cfg->patch_ptmsi = 0; + g_cfg->patch_ptmsi = false; return CMD_SUCCESS; } @@ -849,7 +849,7 @@ return CMD_WARNING; } - g_cfg->acquire_imsi = 1; + g_cfg->acquire_imsi = true; return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/13762 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I63876f52d5de87e4c99d92669270fd1f487e217c Gerrit-Change-Number: 13762 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 20:49:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 20:49:13 +0000 Subject: Change in osmo-sgsn[master]: WIP: OsmoGbPROXY user manual Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13763 Change subject: WIP: OsmoGbPROXY user manual ...................................................................... WIP: OsmoGbPROXY user manual Change-Id: I80d4ea016376c59995ccfcd8685c7c0e86745bd2 --- M doc/manuals/Makefile.am A doc/manuals/chapters/gbproxy.adoc A doc/manuals/osmogbproxy-usermanual-docinfo.xml A doc/manuals/osmogbproxy-usermanual.adoc 4 files changed, 212 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/63/13763/1 diff --git a/doc/manuals/Makefile.am b/doc/manuals/Makefile.am index 00a08c8..f11acb3 100644 --- a/doc/manuals/Makefile.am +++ b/doc/manuals/Makefile.am @@ -1,11 +1,13 @@ EXTRA_DIST = osmosgsn-usermanual.adoc \ osmosgsn-usermanual-docinfo.xml \ osmosgsn-vty-reference.xml \ + osmogbproxy-usermanual.adoc \ + osmogbproxy-usermanual-docinfo.xml \ chapters \ vty if BUILD_MANUALS - ASCIIDOC = osmosgsn-usermanual.adoc + ASCIIDOC = osmosgsn-usermanual.adoc osmogbproxy-usermanual.adoc ASCIIDOC_DEPS = $(srcdir)/chapters/*.adoc include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.asciidoc.inc diff --git a/doc/manuals/chapters/gbproxy.adoc b/doc/manuals/chapters/gbproxy.adoc new file mode 100644 index 0000000..41debe2 --- /dev/null +++ b/doc/manuals/chapters/gbproxy.adoc @@ -0,0 +1,125 @@ +[[chapter_overview]] +== Overview + +== About OsmoGbPROXY + +OsmoGbPROXY is the Osmocom proxy for the 3GPP Gb interface. The Gb +interface is defined by 3GPP as the protocol between the BSS and the +SGSN inside the 2G/2.5G/2.75G packet switched network domain. + +As Osmocom implements a BTS-colocated PCU, there are potentially many +Gb interface connections between all those many PCUs in the network +and the SGSN. This can be cumbersome to configure/maintain at the +SGSN sine. + +OsmoGbPROXY aggregates many PCU-facing Gb connections into one Gb +connection to the SGSN. This is achieved by + +* maintaining sepaate NS-VCs on the PCU side and on the SGSN side +* more or less transparently routing BSSGP peer-to-peer Virtual Circuits + (BVCs) through the proxy +* having some special handling for the signaling BVC (BVCI=0) which is + shared among all the PCUs connected to the proxy + +== Data Model + +=== gbproxy_config + +=== gproxy_peer + +A "peer" is any remote NS-entity that the proxy interacts with. A peer +includes information about: + +* the [unique] NSEI of the peer +* the [unique] BVCI of the peer +* the Routeing Area (RA) of the peer + +=== gbproxy_tlli_state + +One of the (unique) TLLI of any of the subscribers/UEs attached to any of +the BTSs/PCUs served by the proxy. + +=== gbproxy_link_info + +One of the [unique] subscribers/connections that are served through this +proxy. The information includes + +* the TLLI on BSS side +* the TLLI on SGSN side (may be different due to P-TMSI rewriting) +* the NSEI of the SGSN for this link +* a timestamp when we last conversed with this subscriber +* state related to IMSI acquisition +** a temporary queue of stored messages (until IMSI acquisition succeeds) +** N(U) rewriting state (inserting IDENTTIY REQ changes LLC sequence numbers) + +=== gbproxy_match + +A single matching rule against which IMSIs are matched. The matching rule +is expressed as regular expression. There can be one such matching rule for +each + +* routing between two different SGSNs, see below +* patching of messages (e.g. APN, PLMN) + + +== Advanced Features + +=== PLMN patching + +This feature permits to modify the PLMN inside any BSSGP messages +containing the Routing Area ID (RAID). + +The configured core-mcc and core-mnc will be used towards the SGSN, +irrespective of which MCC/MNC the PCU is using/reporting on Gb. + +=== APN patching + +This will transparently re-write the APN name inside SM ACTIVATE PDP +REQUEST messages on the way from the MS to the SGSN. The patching is +performed based on matching on the IMSI of the subscriber. + +The configured core-apn will be used towards the SGSN, irrespective +of which APN the MS is requesting in its Layer3 signaling. + +APN patching can only be performed if no GPRS encryption is enabled in +the network! + +APN patching is useful in case a valid APN cannot reliably be +provisioned via other means, such as via the SIM Card, OTA-DM or via +CAMEL rewriting in the SGSN. + +=== P-TMSI patching + +This feature transparently rewrite the P-TMSI between MS and SGSN. This +is required when using the Secondary SGSN support, as both SGSNs could +allocate overlapping TMSIs and we must make sure they're unique across +both SGSNs. + +P-TMSI patching is required by (and hence automatically enablede if +secondary SGSN support is enabled. + +P-TMSI patching can only be performed if no GPRS encryption is enabled in +the network! + +=== IMSI Acquisition + +This is a special feature where the proxy will by itself inject GMM IDENTITY +REQUEST messages for the IMSI into the downlink BSSGP traffic in order +to establish the IMSI of subscribers for which it is not otherwise known + +IMSI acquisition is automatically enabled if secondary SGSN support is +enabled. + +=== Secondary SGSN Support + +This allows the proxy to connect not only to one SGSN, but to two +different SGSNs. IMSI matching rules are applied to determine which of +the SGSNs is to be used for traffic of this subscriber. + +One possible use case of this feature is to have a "local break-out" for +subscribers who are native to this network (and hence save +latencies/overhead of back-hauling all related traffic via the +SGSN+GGSN) while at the same time maintaining the classic behavior for +inbound roaming subscribers, where the roaming agreements mandate that +data traffic is brought back to the GGSN in the HPLMN via the SGSN of +the VPLMN. diff --git a/doc/manuals/osmogbproxy-usermanual-docinfo.xml b/doc/manuals/osmogbproxy-usermanual-docinfo.xml new file mode 100644 index 0000000..29bb2aa --- /dev/null +++ b/doc/manuals/osmogbproxy-usermanual-docinfo.xml @@ -0,0 +1,46 @@ + + + 1 + March 21, 2019 + HW + + Initial version. + + + + + + + Harald + Welte + hwelte at sysmocom.de + HW + + sysmocom + sysmocom - s.f.m.c. GmbH + Managing Director + + + + + + 2013-2019 + 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 + + https://git.osmocom.org/osmo-sgsn/doc/ + + + diff --git a/doc/manuals/osmogbproxy-usermanual.adoc b/doc/manuals/osmogbproxy-usermanual.adoc new file mode 100644 index 0000000..0b5bed9 --- /dev/null +++ b/doc/manuals/osmogbproxy-usermanual.adoc @@ -0,0 +1,38 @@ +:gfdl-enabled: + +OsmoGbPROXY User Manual +==================== +Harald Welte + + +include::./common/chapters/preface.adoc[] + +//include::{srcdir}/chapters/overview.adoc[] + +//include::{srcdir}/chapters/running.adoc[] + +//include::{srcdir}/chapters/control.adoc[] + +include::./common/chapters/vty.adoc[] + +include::./common/chapters/logging.adoc[] + +//include::{srcdir}/chapters/configuration.adoc[] + +include::./common/chapters/gb.adoc[] + +include::./common/chapters/control_if.adoc[] + +//include::./common/chapters/oap.adoc[] + +//include::./common/chapters/gsup.adoc[] + +//include::{srcdir}/chapters/counters.adoc[] + +include::./common/chapters/port_numbers.adoc[] + +include::./common/chapters/bibliography.adoc[] + +include::./common/chapters/glossary.adoc[] + +include::./common/chapters/gfdl.adoc[] -- To view, visit https://gerrit.osmocom.org/13763 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I80d4ea016376c59995ccfcd8685c7c0e86745bd2 Gerrit-Change-Number: 13763 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 20:49:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 20:49:13 +0000 Subject: Change in osmo-sgsn[master]: LLC: Don't blindly assume all LLC frames have data payload Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13764 Change subject: LLC: Don't blindly assume all LLC frames have data payload ...................................................................... LLC: Don't blindly assume all LLC frames have data payload In reality, only UI, I, SABM, UA and XID frames carry payload. All other frames will have llhp.data == NULL. Let's therefore not do any msgb adjustments unless we actually know there is a user payload field. Change-Id: I51bbd0f2c618d477a037af343ff41de1c8a5a3ae Closes: OS#3952 --- M src/gprs/gprs_llc.c 1 file changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/64/13764/1 diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 2111e10..685460d 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -946,9 +946,6 @@ LOGP(DLLC, LOGL_INFO, "Dropping frame with invalid FCS\n"); return -EIO; } - /* set l3 layer & remove the fcs */ - msg->l3h = llhp.data; - msgb_l3trim(msg, llhp.data_len); /* Update LLE's (BVCI, NSEI) tuple */ lle->llme->bvci = msgb_bvci(msg); @@ -959,6 +956,14 @@ if (rc < 0) return rc; + /* there are many frame types that don't carry user information + * and which hence have llhp.data = NULL */ + if (llhp.data) { + /* set l3 layer & remove the fcs */ + msg->l3h = llhp.data; + msgb_l3trim(msg, llhp.data_len); + } + rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_LLC_UL_PACKETS]); rate_ctr_add(&sgsn->rate_ctrs->ctr[CTR_LLC_UL_BYTES], msg->len); -- To view, visit https://gerrit.osmocom.org/13764 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I51bbd0f2c618d477a037af343ff41de1c8a5a3ae Gerrit-Change-Number: 13764 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 20:49:14 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 20:49:14 +0000 Subject: Change in osmo-sgsn[master]: LLC: Avoid NOTICE message on LLC NULL Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13765 Change subject: LLC: Avoid NOTICE message on LLC NULL ...................................................................... LLC: Avoid NOTICE message on LLC NULL A MS sending LLC NULL frames on cell change is a perfectly normal event, and we shouldn't log any cryptic NOTICE messages about it. Change-Id: I6be0b9c8813dfb40a7955422fd8e7cebf94d189c --- M src/gprs/gprs_llc.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/65/13765/1 diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 685460d..9edafdb 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -861,6 +861,9 @@ if ((gph->seq_tx + 1) / 512) lle->oc_ui_recv += 512; break; + case GPRS_LLC_NULL: + LOGP(DLLC, LOGL_DEBUG, "TLLI=%08x sends us LLC NULL\n", lle->llme ? lle->llme->tlli : -1); + break; default: LOGP(DLLC, LOGL_NOTICE, "Unhandled command: %d\n", gph->cmd); break; -- To view, visit https://gerrit.osmocom.org/13765 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6be0b9c8813dfb40a7955422fd8e7cebf94d189c Gerrit-Change-Number: 13765 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 20:51:36 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 20:51:36 +0000 Subject: Change in osmo-sgsn[master]: LLC XID: Fix string representation of N201_U In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13622 ) Change subject: LLC XID: Fix string representation of N201_U ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13622 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8799e3a3c47377aeeb9923d9d73f5d0b73cd8d0b Gerrit-Change-Number: 13622 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 20:51:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 20:51:37 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 20:51:37 +0000 Subject: Change in osmo-sgsn[master]: LLC XID: Fix string representation of N201_U In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13622 ) Change subject: LLC XID: Fix string representation of N201_U ...................................................................... LLC XID: Fix string representation of N201_U Change-Id: I8799e3a3c47377aeeb9923d9d73f5d0b73cd8d0b --- M src/gprs/gprs_llc_xid.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gprs_llc_xid.c b/src/gprs/gprs_llc_xid.c index de60e49..b91fa6b 100644 --- a/src/gprs/gprs_llc_xid.c +++ b/src/gprs/gprs_llc_xid.c @@ -41,7 +41,7 @@ { GPRS_LLC_XID_T_IOV_I, "IOV_I"}, { GPRS_LLC_XID_T_T200, "T200"}, { GPRS_LLC_XID_T_N200, "N200"}, - { GPRS_LLC_XID_T_N201_U, "N201_"}, + { GPRS_LLC_XID_T_N201_U, "N201_U"}, { GPRS_LLC_XID_T_N201_I, "N201_I"}, { GPRS_LLC_XID_T_mD, "mD"}, { GPRS_LLC_XID_T_mU, "mU"}, -- To view, visit https://gerrit.osmocom.org/13622 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8799e3a3c47377aeeb9923d9d73f5d0b73cd8d0b Gerrit-Change-Number: 13622 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 20:56:18 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 20:56:18 +0000 Subject: Change in osmo-sgsn[master]: gb_proxy.h: Add missing comments; improve comments In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13761 ) Change subject: gb_proxy.h: Add missing comments; improve comments ...................................................................... Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/13761/1/include/osmocom/sgsn/gb_proxy.h File include/osmocom/sgsn/gb_proxy.h: https://gerrit.osmocom.org/#/c/13761/1/include/osmocom/sgsn/gb_proxy.h at 129 PS1, Line 129: /* should we keep per-subscriber state even after de-registration? */ perhaps adding the word "cached" here makes sense to understand better what the storing is aimed at, and also to understand caching too much means lots of memory :) https://gerrit.osmocom.org/#/c/13761/1/include/osmocom/sgsn/gb_proxy.h at 194 PS1, Line 194: /* TLLI on the SGSN side (can be different in case of P-TMSI patching */ missing ")" https://gerrit.osmocom.org/#/c/13761/1/include/osmocom/sgsn/gb_proxy.h at 199 PS1, Line 199: /* timestamp when we last saw any contact with this UE */ "had any contact" -- To view, visit https://gerrit.osmocom.org/13761 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I61bdd3b1cec037bce825c234a8a274b70629adc8 Gerrit-Change-Number: 13761 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 20:56:18 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 20:58:02 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 20:58:02 +0000 Subject: Change in osmo-sgsn[master]: gb_proxy: cosmetic: Use 'bool' in data structures where applicable In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13762 ) Change subject: gb_proxy: cosmetic: Use 'bool' in data structures where applicable ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13762 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I63876f52d5de87e4c99d92669270fd1f487e217c Gerrit-Change-Number: 13762 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 23 Apr 2019 20:58:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 21:03:02 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 21:03:02 +0000 Subject: Change in osmo-sgsn[master]: LLC: Don't blindly assume all LLC frames have data payload In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13764 ) Change subject: LLC: Don't blindly assume all LLC frames have data payload ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13764/2/src/gprs/gprs_llc.c File src/gprs/gprs_llc.c: https://gerrit.osmocom.org/#/c/13764/2/src/gprs/gprs_llc.c at 961 PS2, Line 961: /* set l3 layer & remove the fcs */ so do we need the fcs for kind of messages where there's not l3? Othewise I don't see the benefit from doing this. Because in the previous code msg->l3h would still be set to NULL and message be empty (which is fine I guess if we don't care about lower layers anymore). -- To view, visit https://gerrit.osmocom.org/13764 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I51bbd0f2c618d477a037af343ff41de1c8a5a3ae Gerrit-Change-Number: 13764 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 21:03:02 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 21:04:05 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Apr 2019 21:04:05 +0000 Subject: Change in osmo-sgsn[master]: LLC: Avoid NOTICE message on LLC NULL In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13765 ) Change subject: LLC: Avoid NOTICE message on LLC NULL ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13765 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6be0b9c8813dfb40a7955422fd8e7cebf94d189c Gerrit-Change-Number: 13765 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 23 Apr 2019 21:04:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 21:20:55 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 21:20:55 +0000 Subject: Change in osmo-ttcn3-hacks[master]: LLC_Templates: Add SABM, UA, FRMR, DM templates In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13757 to look at the new patch set (#2). Change subject: LLC_Templates: Add SABM, UA, FRMR, DM templates ...................................................................... LLC_Templates: Add SABM, UA, FRMR, DM templates Change-Id: Idb40dcd53310b76ea9df6c0090e31175a4382460 --- M library/LLC_Templates.ttcn 1 file changed, 59 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/57/13757/2 -- To view, visit https://gerrit.osmocom.org/13757 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idb40dcd53310b76ea9df6c0090e31175a4382460 Gerrit-Change-Number: 13757 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 21:20:56 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 21:20:56 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add test cases to verify SABM handling on LLGMM + LL5 Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13766 Change subject: sgsn: Add test cases to verify SABM handling on LLGMM + LL5 ...................................................................... sgsn: Add test cases to verify SABM handling on LLGMM + LL5 As OsmoSGSN doesn't implement ABM, the correct resposne to any SABM is DM. Change-Id: Ib0d371a3356d6cb481b794945476ab40f5e0f02a --- M sgsn/SGSN_Tests.ttcn 1 file changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/66/13766/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 78bee58..889a16f 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -2174,6 +2174,40 @@ vc_conn.done; } +/* Send LLC SABM to see if the SGSN rejects it properly with DM */ +private function f_TC_llc_sabm_dm_llgmm(charstring id) runs on BSSGP_ConnHdlr { + f_gmm_attach(false, false); + f_sleep(1.0); + f_send_llc(ts_LLC_SABM({}, '1'B, c_LLC_SAPI_LLGMM, LLC_CR_UL_CMD)); + BSSGP[0].receive(tr_BD_LLC(tr_LLC_DM(?, c_LLC_SAPI_LLGMM, LLC_CR_DL_RSP))); + setverdict(pass); +} +testcase TC_llc_sabm_dm_llgmm() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_llc_sabm_dm_llgmm), testcasename(), g_gb, 42); + vc_conn.done; +} + +/* Send LLC SABM to see if the SGSN rejects it properly with DM */ +private function f_TC_llc_sabm_dm_ll5(charstring id) runs on BSSGP_ConnHdlr { + f_gmm_attach(false, false); + f_sleep(1.0); + f_send_llc(ts_LLC_SABM({}, '1'B, c_LLC_SAPI_LL5, LLC_CR_UL_CMD)); + BSSGP[0].receive(tr_BD_LLC(tr_LLC_DM(?, c_LLC_SAPI_LL5, LLC_CR_DL_RSP))); + setverdict(pass); +} +testcase TC_llc_sabm_dm_ll5() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_llc_sabm_dm_ll5), testcasename(), g_gb, 43); + vc_conn.done; +} + + + control { execute( TC_attach() ); execute( TC_attach_mnc3() ); @@ -2220,6 +2254,8 @@ execute( TC_attach_gmm_attach_req_while_gmm_attach() ); execute( TC_llc_null() ); + execute( TC_llc_sabm_dm_llgmm() ); + execute( TC_llc_sabm_dm_ll5() ); } -- To view, visit https://gerrit.osmocom.org/13766 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib0d371a3356d6cb481b794945476ab40f5e0f02a Gerrit-Change-Number: 13766 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 23 21:22:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Apr 2019 21:22:57 +0000 Subject: Change in osmo-sgsn[master]: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13767 Change subject: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM ...................................................................... gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM According to Section 6.4.1.4 of 3GPP TS 04.64 The DM unnumbered response shall be used by an LLE to report to its peer that the LLE is in a state such that ABM operation cannot be performed. An LLE shall transmit a DM response to any valid command received that it cannot action. Change-Id: Ie8b8e16d5a68f19f21dc4fdb5703c8a794e0173c --- M src/gprs/gprs_llc.c 1 file changed, 21 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/67/13767/1 diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 654f2c0..099b258 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -44,6 +44,7 @@ static struct gprs_llc_llme *llme_alloc(uint32_t tlli); static int gprs_llc_tx_xid(struct gprs_llc_lle *lle, struct msgb *msg, int command); +static int gprs_llc_tx_dm(struct gprs_llc_lle *lle); static int gprs_llc_tx_u(struct msgb *msg, uint8_t sapi, int command, enum gprs_llc_u_cmd u_cmd, int pf_bit); @@ -676,6 +677,18 @@ return gprs_llc_tx_u(msg, lle->sapi, command, GPRS_LLC_U_XID, 1); } +static int gprs_llc_tx_dm(struct gprs_llc_lle *lle) +{ + struct msgb *msg = msgb_alloc_headroom(4096, 1024, "LLC_DM"); + + /* copy identifiers from LLE to ensure lower layers can route */ + msgb_tlli(msg) = lle->llme->tlli; + msgb_bvci(msg) = lle->llme->bvci; + msgb_nsei(msg) = lle->llme->nsei; + + return gprs_llc_tx_u(msg, lle->sapi, 0, GPRS_LLC_U_DM_RESP, 1); +} + /* encrypt information field + FCS, if needed! */ static int apply_gea(struct gprs_llc_lle *lle, uint16_t crypt_len, uint16_t nu, uint32_t oc, uint8_t sapi, uint8_t *fcs, uint8_t *data) @@ -802,6 +815,7 @@ struct gprs_llc_lle *lle) { switch (gph->cmd) { +#if 0 case GPRS_LLC_SABM: /* Section 6.4.1.1 */ lle->v_sent = lle->v_ack = lle->v_recv = 0; if (lle->state == GPRS_LLES_ASSIGNED_ADM) { @@ -827,6 +841,13 @@ break; case GPRS_LLC_FRMR: /* Section 6.4.1.5 */ break; +#else + case GPRS_LLC_SABM: + case GPRS_LLC_DISC: + /* send DM to properly signal we don't do ABM */ + gprs_llc_tx_dm(lle); + break; +#endif case GPRS_LLC_XID: /* Section 6.4.1.6 */ rx_llc_xid(lle, gph); break; -- To view, visit https://gerrit.osmocom.org/13767 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie8b8e16d5a68f19f21dc4fdb5703c8a794e0173c Gerrit-Change-Number: 13767 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 07:34:38 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 07:34:38 +0000 Subject: Change in osmo-bts[master]: common/rsl.c: fix unaligned pointers in rsl_add_rtp_stats() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13768 Change subject: common/rsl.c: fix unaligned pointers in rsl_add_rtp_stats() ...................................................................... common/rsl.c: fix unaligned pointers in rsl_add_rtp_stats() Found using clang-8: rsl.c:1646:7: warning: taking address of packed member 'packets_sent' of class or structure 'ipa_stats' may result in an unaligned pointer value rsl.c:1646:28: warning: taking address of packed member 'octets_sent' of class or structure 'ipa_stats' may result in an unaligned pointer value rsl.c:1647:7: warning: taking address of packed member 'packets_recv' of class or structure 'ipa_stats' may result in an unaligned pointer value rsl.c:1647:28: warning: taking address of packed member 'octets_recv' of class or structure 'ipa_stats' may result in an unaligned pointer value rsl.c:1648:7: warning: taking address of packed member 'packets_lost' of class or structure 'ipa_stats' may result in an unaligned pointer value rsl.c:1648:28: warning: taking address of packed member 'arrival_jitter' of class or structure 'ipa_stats' may result in an unaligned pointer value Change-Id: Ifba33cfd8edeccc99a21c7d076db7119c29d4f40 --- M src/common/rsl.c 1 file changed, 23 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/68/13768/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index 8f5d689..c2a7db6 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1627,33 +1627,33 @@ */ static void rsl_add_rtp_stats(struct gsm_lchan *lchan, struct msgb *msg) { - struct ipa_stats { - uint32_t packets_sent; - uint32_t octets_sent; - uint32_t packets_recv; - uint32_t octets_recv; - uint32_t packets_lost; - uint32_t arrival_jitter; - uint32_t avg_tx_delay; - } __attribute__((packed)); + uint32_t packets_sent, octets_sent; + uint32_t packets_recv, octets_recv; + uint32_t packets_lost; + uint32_t arrival_jitter; - struct ipa_stats stats; + msgb_tv_put(msg, RSL_IE_IPAC_CONN_STAT, sizeof(uint32_t) * 7); - memset(&stats, 0, sizeof(stats)); - - if (lchan->abis_ip.rtp_socket) + if (lchan->abis_ip.rtp_socket) { osmo_rtp_socket_stats(lchan->abis_ip.rtp_socket, - &stats.packets_sent, &stats.octets_sent, - &stats.packets_recv, &stats.octets_recv, - &stats.packets_lost, &stats.arrival_jitter); - /* convert to network byte order */ - stats.packets_sent = htonl(stats.packets_sent); - stats.octets_sent = htonl(stats.octets_sent); - stats.packets_recv = htonl(stats.packets_recv); - stats.octets_recv = htonl(stats.octets_recv); - stats.packets_lost = htonl(stats.packets_lost); + &packets_sent, &octets_sent, + &packets_recv, &octets_recv, + &packets_lost, &arrival_jitter); - msgb_tlv_put(msg, RSL_IE_IPAC_CONN_STAT, sizeof(stats), (uint8_t *) &stats); + /* msgb_put_u32() uses osmo_store32be(), + * so we don't need to call htonl(). */ + msgb_put_u32(msg, packets_sent); + msgb_put_u32(msg, octets_sent); + msgb_put_u32(msg, packets_recv); + msgb_put_u32(msg, octets_recv); + msgb_put_u32(msg, packets_lost); + msgb_put_u32(msg, arrival_jitter); + /* FIXME: AVG Tx delay is always 0 */ + msgb_put_u32(msg, 0); + } else { + msgb_put(msg, sizeof(uint32_t) * 7); + memset(msg->tail, 0x00, sizeof(uint32_t) * 7); + } } int rsl_tx_ipac_dlcx_ind(struct gsm_lchan *lchan, uint8_t cause) -- To view, visit https://gerrit.osmocom.org/13768 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ifba33cfd8edeccc99a21c7d076db7119c29d4f40 Gerrit-Change-Number: 13768 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 07:47:17 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 07:47:17 +0000 Subject: Change in osmo-bts[master]: common/rsl.c: fix unaligned pointers in rsl_add_rtp_stats() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13768 ) Change subject: common/rsl.c: fix unaligned pointers in rsl_add_rtp_stats() ...................................................................... Patch Set 1: I actually think this is bogus. We are not type-casting uint32_t values (or structs containing uint32_t) to random locations in memory. Rather, we are puting a struct if uint32_t on the stack and then passing pointers to members of it. I would have assumed that the compiler puts the structure on the stack in a way that the uint32_t are properly aligned. After all, if you had all those uint32_t individually on the stack, you would also expect they're all 32bit aligned and you could use them as uint32_t. Maybe it's the __attribute((packed)) which is putting clang off? It's not really needed here, as all (I hope at least) architectures are putting two uint32_t next to each other in a struct, without any padding. Maybe there were any early "true" 64bit architectures like ppc64 or itanium or sparc65 that would align them on 64bit boundaries, but I somehow doubt it. -- To view, visit https://gerrit.osmocom.org/13768 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ifba33cfd8edeccc99a21c7d076db7119c29d4f40 Gerrit-Change-Number: 13768 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 24 Apr 2019 07:47:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 07:50:26 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 07:50:26 +0000 Subject: Change in osmo-sgsn[master]: LLC: Don't blindly assume all LLC frames have data payload In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13764 ) Change subject: LLC: Don't blindly assume all LLC frames have data payload ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13764/2/src/gprs/gprs_llc.c File src/gprs/gprs_llc.c: https://gerrit.osmocom.org/#/c/13764/2/src/gprs/gprs_llc.c at 961 PS2, Line 961: /* set l3 layer & remove the fcs */ > so do we need the fcs for kind of messages where there's not l3? [?] there is FCS in any LLC frame, as the FCS covers both header and payload, right? The problam is not setting msg->l3h to NULL. The problem is to then call a msgb_l3trim() on a msgb that has l3h set to ?NULL. Of course we could also make msgb_l3trim() handle the l3 case == NULL. But I actually think that would be hiding unintended behavior. If at all, I would make msgb_l3trim() ASSERT in case somebody passes a msgb with l3h = NULL. The only thing that one *could* improve here is to remove the 3 byte FCS even for those messages without user data (i.e. llhp.data = NULL). Right now we don't do that, but then any downstream code (even future one) doesn't care on what's in the msgb, as the only relevant information is in the already-parsed llhp. -- To view, visit https://gerrit.osmocom.org/13764 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I51bbd0f2c618d477a037af343ff41de1c8a5a3ae Gerrit-Change-Number: 13764 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 07:50:26 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 07:50:43 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 07:50:43 +0000 Subject: Change in osmo-sgsn[master]: LLC: Don't blindly assume all LLC frames have data payload In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13764 ) Change subject: LLC: Don't blindly assume all LLC frames have data payload ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13764 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I51bbd0f2c618d477a037af343ff41de1c8a5a3ae Gerrit-Change-Number: 13764 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 07:50:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 07:50:48 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 07:50:48 +0000 Subject: Change in osmo-sgsn[master]: LLC: Avoid NOTICE message on LLC NULL In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13765 ) Change subject: LLC: Avoid NOTICE message on LLC NULL ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13765 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6be0b9c8813dfb40a7955422fd8e7cebf94d189c Gerrit-Change-Number: 13765 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 07:50:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 07:51:35 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 07:51:35 +0000 Subject: Change in osmo-sgsn[master]: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13767 ) Change subject: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM ...................................................................... Patch Set 1: Code-Review+2 this has been tested against the newly-developed SGSN_Tests.ttcn test case testing the SABM -> DM behavior which was broken before this patch. -- To view, visit https://gerrit.osmocom.org/13767 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8b8e16d5a68f19f21dc4fdb5703c8a794e0173c Gerrit-Change-Number: 13767 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Wed, 24 Apr 2019 07:51:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 07:55:54 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 07:55:54 +0000 Subject: Change in osmo-bts[master]: common/paging.c: fix unaligned pointer access Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13769 Change subject: common/paging.c: fix unaligned pointer access ...................................................................... common/paging.c: fix unaligned pointer access Passing a pointer to a packed structure to tmsi_mi_to_uint() may result in unaligned pointer value. Found with clang-8. Change-Id: Ief69854973a098e6da7c05f4417dc11988edd777 --- M src/common/paging.c 1 file changed, 22 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/69/13769/1 diff --git a/src/common/paging.c b/src/common/paging.c index aa604e7..d5e99bf 100644 --- a/src/common/paging.c +++ b/src/common/paging.c @@ -302,7 +302,9 @@ uint8_t cneed2, const uint8_t *identity3_lv) { struct gsm48_paging2 *pt2 = (struct gsm48_paging2 *) out_buf; + uint32_t tmsi1, tmsi2; uint8_t *cur; + int rc; memset(out_buf, 0, sizeof(*pt2)); @@ -311,8 +313,12 @@ pt2->pag_mode = GSM48_PM_NORMAL; pt2->cneed1 = cneed1; pt2->cneed2 = cneed2; - tmsi_mi_to_uint(&pt2->tmsi1, tmsi1_lv); - tmsi_mi_to_uint(&pt2->tmsi2, tmsi2_lv); + rc = tmsi_mi_to_uint(&tmsi1, tmsi1_lv); + if (rc == 0) + pt2->tmsi1 = tmsi1; + rc = tmsi_mi_to_uint(&tmsi2, tmsi2_lv); + if (rc == 0) + pt2->tmsi2 = tmsi2; cur = out_buf + sizeof(*pt2); if (identity3_lv) @@ -329,6 +335,8 @@ const uint8_t *tmsi4_lv, uint8_t cneed4) { struct gsm48_paging3 *pt3 = (struct gsm48_paging3 *) out_buf; + uint32_t tmsi1, tmsi2, tmsi3, tmsi4; + int rc; memset(out_buf, 0, sizeof(*pt3)); @@ -337,10 +345,18 @@ pt3->pag_mode = GSM48_PM_NORMAL; pt3->cneed1 = cneed1; pt3->cneed2 = cneed2; - tmsi_mi_to_uint(&pt3->tmsi1, tmsi1_lv); - tmsi_mi_to_uint(&pt3->tmsi2, tmsi2_lv); - tmsi_mi_to_uint(&pt3->tmsi3, tmsi3_lv); - tmsi_mi_to_uint(&pt3->tmsi4, tmsi4_lv); + rc = tmsi_mi_to_uint(&tmsi1, tmsi1_lv); + if (rc == 0) + pt3->tmsi1 = tmsi1; + rc = tmsi_mi_to_uint(&tmsi2, tmsi2_lv); + if (rc == 0) + pt3->tmsi2 = tmsi2; + rc = tmsi_mi_to_uint(&tmsi3, tmsi3_lv); + if (rc == 0) + pt3->tmsi3 = tmsi3; + rc = tmsi_mi_to_uint(&tmsi4, tmsi4_lv); + if (rc == 0) + pt3->tmsi4 = tmsi4; /* The structure definition in libosmocore is wrong. It includes as last * byte some invalid definition of chneed3/chneed4, so we must do this by hand -- To view, visit https://gerrit.osmocom.org/13769 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ief69854973a098e6da7c05f4417dc11988edd777 Gerrit-Change-Number: 13769 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 07:59:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 07:59:30 +0000 Subject: Change in osmo-ttcn3-hacks[master]: LLC_Templates: Add SABM, UA, FRMR, DM templates In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13757 to look at the new patch set (#3). Change subject: LLC_Templates: Add SABM, UA, FRMR, DM templates ...................................................................... LLC_Templates: Add SABM, UA, FRMR, DM templates Related: OS#3953 Change-Id: Idb40dcd53310b76ea9df6c0090e31175a4382460 --- M library/LLC_Templates.ttcn 1 file changed, 59 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/57/13757/3 -- To view, visit https://gerrit.osmocom.org/13757 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idb40dcd53310b76ea9df6c0090e31175a4382460 Gerrit-Change-Number: 13757 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 07:59:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 07:59:30 +0000 Subject: Change in osmo-ttcn3-hacks[master]: deps/Makefile: Use osmocom fork of LLC protocol module In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13758 to look at the new patch set (#3). Change subject: deps/Makefile: Use osmocom fork of LLC protocol module ...................................................................... deps/Makefile: Use osmocom fork of LLC protocol module Change-Id: I8b9f107f0a99dcbd8148a3d431a101d194dfe788 --- M deps/Makefile 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/58/13758/3 -- To view, visit https://gerrit.osmocom.org/13758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8b9f107f0a99dcbd8148a3d431a101d194dfe788 Gerrit-Change-Number: 13758 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 07:59:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 07:59:30 +0000 Subject: Change in osmo-ttcn3-hacks[master]: LLC_Templates: Add templates for NULL and DISC In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13759 to look at the new patch set (#3). Change subject: LLC_Templates: Add templates for NULL and DISC ...................................................................... LLC_Templates: Add templates for NULL and DISC Change-Id: Ia5b350990379bba1677a0c1c99cf37e6651ba84d --- M library/LLC_Templates.ttcn 1 file changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/59/13759/3 -- To view, visit https://gerrit.osmocom.org/13759 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia5b350990379bba1677a0c1c99cf37e6651ba84d Gerrit-Change-Number: 13759 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 07:59:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 07:59:30 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13760 to look at the new patch set (#4). Change subject: sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet ...................................................................... sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet This test case reproduces a bug in OsmoSGSN where it would crash as a result to sending LLC NULL frames. Change-Id: I38326f2ebaaff009d4357edad9511ce2ce7736fd Related: OS#3952 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 25 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/60/13760/4 -- To view, visit https://gerrit.osmocom.org/13760 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I38326f2ebaaff009d4357edad9511ce2ce7736fd Gerrit-Change-Number: 13760 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 07:59:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 07:59:30 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add test cases to verify SABM handling on LLGMM + LL5 In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13766 to look at the new patch set (#2). Change subject: sgsn: Add test cases to verify SABM handling on LLGMM + LL5 ...................................................................... sgsn: Add test cases to verify SABM handling on LLGMM + LL5 As OsmoSGSN doesn't implement ABM, the correct resposne to any SABM is DM. RelateD: OS#3953 Change-Id: Ib0d371a3356d6cb481b794945476ab40f5e0f02a --- M sgsn/SGSN_Tests.ttcn 1 file changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/66/13766/2 -- To view, visit https://gerrit.osmocom.org/13766 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib0d371a3356d6cb481b794945476ab40f5e0f02a Gerrit-Change-Number: 13766 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:07:18 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 08:07:18 +0000 Subject: Change in osmo-bts[master]: common/rsl.c: fix unaligned pointers in rsl_add_rtp_stats() In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13768 ) Change subject: common/rsl.c: fix unaligned pointers in rsl_add_rtp_stats() ...................................................................... Patch Set 1: > Maybe it's the __attribute((packed)) which is putting clang off? Yep, exactly. All warnings are triggered by policy -Waddress-of-packed-member. In general, I don't see big advantages of using a struct here, no matter is it packed or not. We still have to memset() it, and still need to convert all its members to big-endian... -- To view, visit https://gerrit.osmocom.org/13768 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ifba33cfd8edeccc99a21c7d076db7119c29d4f40 Gerrit-Change-Number: 13768 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 24 Apr 2019 08:07:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:08:43 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 08:08:43 +0000 Subject: Change in osmo-bts[master]: common/paging.c: fix unaligned pointer access In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13769 ) Change subject: common/paging.c: fix unaligned pointer access ...................................................................... Patch Set 1: I think here the warnings make much more sense. -- To view, visit https://gerrit.osmocom.org/13769 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief69854973a098e6da7c05f4417dc11988edd777 Gerrit-Change-Number: 13769 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 08:08:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:12:20 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 08:12:20 +0000 Subject: Change in osmocom-bb[master]: trx_toolkit/data_msg.py: fix TOA256 MIN/MAX constants In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13755 ) Change subject: trx_toolkit/data_msg.py: fix TOA256 MIN/MAX constants ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13755 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5d4e1fea9d07f2c49f01e6644d1c0d1dc8cf4e40 Gerrit-Change-Number: 13755 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 08:12:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:18:08 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 08:18:08 +0000 Subject: Change in osmo-sgsn[master]: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13767 ) Change subject: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13767/1/src/gprs/gprs_llc.c File src/gprs/gprs_llc.c: https://gerrit.osmocom.org/#/c/13767/1/src/gprs/gprs_llc.c at 47 PS1, Line 47: gprs_llc_tx_dm Do we really need this forward-declaration? -- To view, visit https://gerrit.osmocom.org/13767 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8b8e16d5a68f19f21dc4fdb5703c8a794e0173c Gerrit-Change-Number: 13767 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 08:18:08 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:18:33 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 08:18:33 +0000 Subject: Change in osmo-sgsn[master]: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13767 to look at the new patch set (#2). Change subject: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM ...................................................................... gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM According to Section 6.4.1.4 of 3GPP TS 04.64 The DM unnumbered response shall be used by an LLE to report to its peer that the LLE is in a state such that ABM operation cannot be performed. An LLE shall transmit a DM response to any valid command received that it cannot action. Closes: OS#3953 Change-Id: Ie8b8e16d5a68f19f21dc4fdb5703c8a794e0173c --- M src/gprs/gprs_llc.c 1 file changed, 21 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/67/13767/2 -- To view, visit https://gerrit.osmocom.org/13767 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie8b8e16d5a68f19f21dc4fdb5703c8a794e0173c Gerrit-Change-Number: 13767 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:18:33 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 08:18:33 +0000 Subject: Change in osmo-sgsn[master]: gb_proxy.h: Add missing comments; improve comments In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13761 to look at the new patch set (#3). Change subject: gb_proxy.h: Add missing comments; improve comments ...................................................................... gb_proxy.h: Add missing comments; improve comments When the patching and routing features were introduced, a lot of the new structures were not documented at the same level as the pre-existing code. Let's fix that. Change-Id: I61bdd3b1cec037bce825c234a8a274b70629adc8 --- M include/osmocom/sgsn/gb_proxy.h 1 file changed, 46 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/61/13761/3 -- To view, visit https://gerrit.osmocom.org/13761 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I61bdd3b1cec037bce825c234a8a274b70629adc8 Gerrit-Change-Number: 13761 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:20:15 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 08:20:15 +0000 Subject: Change in osmo-sgsn[master]: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13767 ) Change subject: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13767/1/src/gprs/gprs_llc.c File src/gprs/gprs_llc.c: https://gerrit.osmocom.org/#/c/13767/1/src/gprs/gprs_llc.c at 47 PS1, Line 47: gprs_llc_tx_dm > Do we really need this forward-declaration? No, I just added it alongside the other forward-declarations to follow the existing style in this file. -- To view, visit https://gerrit.osmocom.org/13767 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8b8e16d5a68f19f21dc4fdb5703c8a794e0173c Gerrit-Change-Number: 13767 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 08:20:15 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:22:50 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 08:22:50 +0000 Subject: Change in osmo-sgsn[master]: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13767 ) Change subject: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13767/2/src/gprs/gprs_llc.c File src/gprs/gprs_llc.c: https://gerrit.osmocom.org/#/c/13767/2/src/gprs/gprs_llc.c at 818 PS2, Line 818: #if 0 Please add a comment explaining why this block is disabled. It's clean for me because I read OS#3953. Otherwise one would need to guess. Something like: /* We don't support ABM, so we refuse it */ would be great. -- To view, visit https://gerrit.osmocom.org/13767 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8b8e16d5a68f19f21dc4fdb5703c8a794e0173c Gerrit-Change-Number: 13767 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 08:22:50 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:38:05 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 08:38:05 +0000 Subject: Change in libosmocore[master]: Add expect script: 'vty' for easy access to all vtys In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13756 ) Change subject: Add expect script: 'vty' for easy access to all vtys ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13756/1/contrib/vty File contrib/vty: https://gerrit.osmocom.org/#/c/13756/1/contrib/vty at 26 PS1, Line 26: switch $vty { might make sense to ensure all port numbers listed in https://osmocom.org/projects/cellular-infrastructure/wiki/Port_Numbers are covered (possibly sort them in numerical order to spot if some are missed) -- To view, visit https://gerrit.osmocom.org/13756 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice4532be7cb3139da29cb9d84dd4769e8d826dfa Gerrit-Change-Number: 13756 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Harald Welte Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 08:38:05 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:42:25 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 08:42:25 +0000 Subject: Change in libosmocore[master]: Add expect script: 'vty' for easy access to all vtys In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13756 ) Change subject: Add expect script: 'vty' for easy access to all vtys ...................................................................... Patch Set 1: The more "canonical" way for the port numbers part is of course to add them to /etc/services so that you can do something like "telnet localhost osmo-msc". I used to do that. However,adding records to that file during package installation isn't very elegant, and there is no /etc/services.d or something along those lines. Another approach would be to write a NSS module (see http://www.gnu.org/software/libc/manual/html_node/Name-Service-Switch.html#Name-Service-Switch) which would either have a compiled-in list of service name/port mappings, or (even better) parse the /etc/osmocom/osmo*.cfg files to create those mappings from the config files. In that case you would automatically get aliases for the port numbers that you configured. Yet another approach is to use http://git.osmocom.org/libtelnet/ to create an osmocom-extended telnet client program which would have capabilities specific to the osmcoom vty, including finding the port numbers from the config files (or compiled-in defaults) and issue the VTY commands for logging, etc. using some local commands, maybe prefixed by @. -- To view, visit https://gerrit.osmocom.org/13756 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice4532be7cb3139da29cb9d84dd4769e8d826dfa Gerrit-Change-Number: 13756 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Harald Welte Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 08:42:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:45:45 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Wed, 24 Apr 2019 08:45:45 +0000 Subject: Change in libosmocore[master]: Add expect script: 'vty' for easy access to all vtys In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/13756 ) Change subject: Add expect script: 'vty' for easy access to all vtys ...................................................................... Patch Set 1: > > [...] but I cannot think of any better place neither [...] > > How about https://git.osmocom.org/osmo-dev/ ? Hi Guys. please see comments under https://gerrit.osmocom.org/#/c/osmo-dev/+/11811/ -- To view, visit https://gerrit.osmocom.org/13756 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice4532be7cb3139da29cb9d84dd4769e8d826dfa Gerrit-Change-Number: 13756 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Harald Welte Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 08:45:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:46:10 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 08:46:10 +0000 Subject: Change in libosmocore[master]: Add expect script: 'vty' for easy access to all vtys In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13756 ) Change subject: Add expect script: 'vty' for easy access to all vtys ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13756 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice4532be7cb3139da29cb9d84dd4769e8d826dfa Gerrit-Change-Number: 13756 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 08:46:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:47:01 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 08:47:01 +0000 Subject: Change in osmo-bts[master]: common/rsl.c: fix unaligned pointers in rsl_add_rtp_stats() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13768 ) Change subject: common/rsl.c: fix unaligned pointers in rsl_add_rtp_stats() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13768 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ifba33cfd8edeccc99a21c7d076db7119c29d4f40 Gerrit-Change-Number: 13768 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 08:47:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:49:26 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 08:49:26 +0000 Subject: Change in osmo-bts[master]: common/paging.c: fix unaligned pointer access In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13769 ) Change subject: common/paging.c: fix unaligned pointer access ...................................................................... Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/13769/1/src/common/paging.c File src/common/paging.c: https://gerrit.osmocom.org/#/c/13769/1/src/common/paging.c at 305 PS1, Line 305: uint32_t tmsi1, tmsi2; you could have simply used one "uint32_t tmsi_tmp" variable, as you never use multiple of them in parallell. I hope compilers are good enough these days to notice those variables are not all used in parallel. -- To view, visit https://gerrit.osmocom.org/13769 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief69854973a098e6da7c05f4417dc11988edd777 Gerrit-Change-Number: 13769 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 08:49:26 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:57:36 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 08:57:36 +0000 Subject: Change in osmo-bts[master]: common/paging.c: fix unaligned pointer access In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13769 ) Change subject: common/paging.c: fix unaligned pointer access ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13769 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief69854973a098e6da7c05f4417dc11988edd777 Gerrit-Change-Number: 13769 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 08:57:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 08:57:42 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Wed, 24 Apr 2019 08:57:42 +0000 Subject: Change in libosmocore[master]: Add expect script: 'vty' for easy access to all vtys In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/13756 ) Change subject: Add expect script: 'vty' for easy access to all vtys ...................................................................... Patch Set 1: > The more "canonical" way for the port numbers part is of course to > add them to /etc/services Right. This is meant to be non system-intrusive. > > Another approach would be to write a NSS module (see > http://www.gnu.org/software/libc/manual/html_node/Name-Service-Switch.html#Name-Service-Switch) Sounds great. I don't think I am going to turn this patch into that though. This (at least for my part) is going to remain a scripting based helper solution for now. My idea is this is a highly customisable script and you change it yourself to your [current] needs in terms of desired logging messages from each program. What I do intend to do is create "sets" using tmux or suchlike, so one command ./vty data for example would give you a four way split, say ggsn, sgsn, bts, pcu. > > Yet another approach is to use http://git.osmocom.org/libtelnet/ to > create an osmocom-extended telnet client program which would have > capabilities specific to the osmcoom vty, and tab completion + persistent readline/history capability, as was discussed some other place/time IIRC. :) -- To view, visit https://gerrit.osmocom.org/13756 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice4532be7cb3139da29cb9d84dd4769e8d826dfa Gerrit-Change-Number: 13756 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 08:57:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 09:16:59 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 24 Apr 2019 09:16:59 +0000 Subject: Change in osmo-sgsn[master]: LLC: Don't blindly assume all LLC frames have data payload In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13764 ) Change subject: LLC: Don't blindly assume all LLC frames have data payload ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13764/2/src/gprs/gprs_llc.c File src/gprs/gprs_llc.c: https://gerrit.osmocom.org/#/c/13764/2/src/gprs/gprs_llc.c at 961 PS2, Line 961: /* set l3 layer & remove the fcs */ > there is FCS in any LLC frame, as the FCS covers both header and payload, right? [?] Makes sense, thanks for the explanation. -- To view, visit https://gerrit.osmocom.org/13764 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I51bbd0f2c618d477a037af343ff41de1c8a5a3ae Gerrit-Change-Number: 13764 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 09:16:59 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 09:17:08 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 24 Apr 2019 09:17:08 +0000 Subject: Change in osmo-sgsn[master]: LLC: Don't blindly assume all LLC frames have data payload In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13764 ) Change subject: LLC: Don't blindly assume all LLC frames have data payload ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13764 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I51bbd0f2c618d477a037af343ff41de1c8a5a3ae Gerrit-Change-Number: 13764 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 09:17:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 09:19:37 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 24 Apr 2019 09:19:37 +0000 Subject: Change in osmocom-bb[master]: trx_toolkit/data_msg.py: fix TOA256 MIN/MAX constants In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13755 ) Change subject: trx_toolkit/data_msg.py: fix TOA256 MIN/MAX constants ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13755 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5d4e1fea9d07f2c49f01e6644d1c0d1dc8cf4e40 Gerrit-Change-Number: 13755 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 09:19:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 09:20:40 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 24 Apr 2019 09:20:40 +0000 Subject: Change in osmo-sgsn[master]: gb_proxy.h: Add missing comments; improve comments In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13761 ) Change subject: gb_proxy.h: Add missing comments; improve comments ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13761 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I61bdd3b1cec037bce825c234a8a274b70629adc8 Gerrit-Change-Number: 13761 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 09:20:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 09:36:06 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Wed, 24 Apr 2019 09:36:06 +0000 Subject: Change in osmo-sgsn[master]: LLC: Don't blindly assume all LLC frames have data payload In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/13764 ) Change subject: LLC: Don't blindly assume all LLC frames have data payload ...................................................................... Patch Set 3: Code-Review+1 This solves #OS3952 of course. I did get a SIGSEGV almost immediately on bringing this up, (didn't catch the details. - but not related to this. (currently waiting for it again) -- To view, visit https://gerrit.osmocom.org/13764 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I51bbd0f2c618d477a037af343ff41de1c8a5a3ae Gerrit-Change-Number: 13764 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 09:36:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 09:36:59 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Wed, 24 Apr 2019 09:36:59 +0000 Subject: Change in osmo-sgsn[master]: LLC: Avoid NOTICE message on LLC NULL In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/13765 ) Change subject: LLC: Avoid NOTICE message on LLC NULL ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13765 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6be0b9c8813dfb40a7955422fd8e7cebf94d189c Gerrit-Change-Number: 13765 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 09:36:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 10:04:01 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 24 Apr 2019 10:04:01 +0000 Subject: Change in osmo-mgw[master]: cosmetic: handle_modify_con: Fix indentation level Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13770 Change subject: cosmetic: handle_modify_con: Fix indentation level ...................................................................... cosmetic: handle_modify_con: Fix indentation level Change-Id: Ieb1e07d667a9fc1ff1e2fd367cbdb3c0dbfd4607 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/70/13770/1 diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index ac6b4ea..9be4eda 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -1151,7 +1151,7 @@ goto error3; } } else - conn->conn->mode = conn->conn->mode_orig; + conn->conn->mode = conn->conn->mode_orig; /* Set local connection options, if present */ if (local_options) { -- To view, visit https://gerrit.osmocom.org/13770 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb1e07d667a9fc1ff1e2fd367cbdb3c0dbfd4607 Gerrit-Change-Number: 13770 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 11:14:09 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Wed, 24 Apr 2019 11:14:09 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Hello lynxis lazus, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13744 to look at the new patch set (#3). Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... gprs_gmm: send Service Reject when no PDP ctxs are available. Look at PDP Context Status IE and see if MS's view of activated/deactivated NSAPIs agrees with our view. It is checked if there are any Active NSAPIs in PDP Context Status IE which are not present on the network side. If there are any then Service Reject with the cause "NO PDP ACTIVATED" is sent back. This forces MS to reactivate the PDP contexts. 3GPP TS 24.008 Section 4.7.13.4 Service request procedure not accepted by the network. Cause # 40. Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Relates: OS#3973 --- M src/gprs/gprs_gmm.c M tests/sgsn/sgsn_test.c M tests/sgsn/sgsn_test.ok 3 files changed, 81 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/44/13744/3 -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 3 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 11:15:39 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Wed, 24 Apr 2019 11:15:39 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Hello lynxis lazus, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13744 to look at the new patch set (#4). Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... gprs_gmm: send Service Reject when no PDP ctxs are available. Look at PDP Context Status IE and see if MS's view of activated/deactivated NSAPIs agrees with our view. It is checked if there are any Active NSAPIs in PDP Context Status IE which are not present on the network side. If there are any then Service Reject with the cause "NO PDP ACTIVATED" is sent back. This forces MS to reactivate the PDP contexts. 3GPP TS 24.008 Section 4.7.13.4 Service request procedure not accepted by the network. Cause # 40. Relates: OS#3937 Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 --- M src/gprs/gprs_gmm.c M tests/sgsn/sgsn_test.c M tests/sgsn/sgsn_test.ok 3 files changed, 81 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/44/13744/4 -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 4 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 11:21:00 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Wed, 24 Apr 2019 11:21:00 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Mykola Shchetinin has posted comments on this change. ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... Patch Set 4: > (5 comments) Thanks for the comments, Pau. They've been very useful. I've added a unit test as well. -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 4 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 11:21:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 11:34:27 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Wed, 24 Apr 2019 11:34:27 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Mykola Shchetinin has posted comments on this change. ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... Patch Set 4: (5 comments) https://gerrit.osmocom.org/#/c/13744/2/src/gprs/gprs_gmm.c File src/gprs/gprs_gmm.c: https://gerrit.osmocom.org/#/c/13744/2/src/gprs/gprs_gmm.c at 1620 PS2, Line 1620: bool all_ms_ctx_present_on_sgsn(struct sgsn_mm_ctx *mmctx, > You probably want to add spec chapter and section in this comment too. Not sure about this place. The function does only perform a check. Well, do you mean the same section which mentioned in the change below? About "Service request procedure not accepted by the network". Yeah, that makes sense, as the function seems to be only related to that "part" of behavior https://gerrit.osmocom.org/#/c/13744/2/src/gprs/gprs_gmm.c at 1625 PS2, Line 1625: size_t i; > where does this 16 come from? Can we please have a define (if we don't have already) for it? Done https://gerrit.osmocom.org/#/c/13744/2/src/gprs/gprs_gmm.c at 1628 PS2, Line 1628: if (!(pdp_status[pdp_nsapi / 8] & (1 << (pdp_nsapi - 8 * i)))) > While fine at runtime, you are actually assigning an integer value (bitmask) to a bool here, that's [?] Done https://gerrit.osmocom.org/#/c/13744/2/src/gprs/gprs_gmm.c at 1630 PS2, Line 1630: > Can we actually have something like: [?] Done https://gerrit.osmocom.org/#/c/13744/2/src/gprs/gprs_gmm.c at 1920 PS2, Line 1920: if (TLVP_PRESENT(&tp, GSM48_IE_GMM_PDP_CTX_STATUS)) { > You probably need to drop this comment too right? Hm, it seems fair to leave it as it correctly describes what is happening inside the condition. And it doesn't add redundancy to my comment below, does it? -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 4 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 11:34:27 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 11:37:03 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Wed, 24 Apr 2019 11:37:03 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Hello lynxis lazus, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13744 to look at the new patch set (#5). Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... gprs_gmm: send Service Reject when no PDP ctxs are available. Look at PDP Context Status IE and see if MS's view of activated/deactivated NSAPIs agrees with our view. It is checked if there are any Active NSAPIs in PDP Context Status IE which are not present on the network side. If there are any then Service Reject with the cause "NO PDP ACTIVATED" is sent back. This forces MS to reactivate the PDP contexts. 3GPP TS 24.008 Section 4.7.13.4 Service request procedure not accepted by the network. Cause # 40. Relates: OS#3937 Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 --- M src/gprs/gprs_gmm.c M tests/sgsn/sgsn_test.c M tests/sgsn/sgsn_test.ok 3 files changed, 82 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/44/13744/5 -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 5 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 11:58:22 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 24 Apr 2019 11:58:22 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... Patch Set 5: (2 comments) Only minor stuff, thanks! https://gerrit.osmocom.org/#/c/13744/5/src/gprs/gprs_gmm.c File src/gprs/gprs_gmm.c: https://gerrit.osmocom.org/#/c/13744/5/src/gprs/gprs_gmm.c at 1620 PS5, Line 1620: * network. */ Please also leave the old comment together with the new additions, it's handy to understand what the function does quickly before looking at it: "Returns false if any active PDP context in pdp_status is not present in the pdp_list for given MS". https://gerrit.osmocom.org/#/c/13744/5/src/gprs/gprs_gmm.c at 1628 PS5, Line 1628: for (pdp_nsapi = 0, i = 0; i < pdp_status_len; i = (++pdp_nsapi) / 8) { Probably much clear to have simple pdp_nsapi++ in the foor loop clause, then in body have: i = pdp_nsapi / 8; if (!(pdp_status[i] & (1 << (pdp_nsapi - 8 * i)))) -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 5 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 11:58:22 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 12:09:02 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Wed, 24 Apr 2019 12:09:02 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Hello lynxis lazus, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13744 to look at the new patch set (#6). Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... gprs_gmm: send Service Reject when no PDP ctxs are available. Look at PDP Context Status IE and see if MS's view of activated/deactivated NSAPIs agrees with our view. It is checked if there are any Active NSAPIs in PDP Context Status IE which are not present on the network side. If there are any then Service Reject with the cause "NO PDP ACTIVATED" is sent back. This forces MS to reactivate the PDP contexts. 3GPP TS 24.008 Section 4.7.13.4 Service request procedure not accepted by the network. Cause # 40. Relates: OS#3937 Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 --- M src/gprs/gprs_gmm.c M tests/sgsn/sgsn_test.c M tests/sgsn/sgsn_test.ok 3 files changed, 84 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/44/13744/6 -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 6 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 12:09:15 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Wed, 24 Apr 2019 12:09:15 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Mykola Shchetinin has posted comments on this change. ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... Patch Set 6: (2 comments) https://gerrit.osmocom.org/#/c/13744/5/src/gprs/gprs_gmm.c File src/gprs/gprs_gmm.c: https://gerrit.osmocom.org/#/c/13744/5/src/gprs/gprs_gmm.c at 1620 PS5, Line 1620: * network. > Please also leave the old comment together with the new additions, it's handy to understand what the [?] Done https://gerrit.osmocom.org/#/c/13744/5/src/gprs/gprs_gmm.c at 1628 PS5, Line 1628: size_t i; > Probably much clear to have simple pdp_nsapi++ in the foor loop clause, then in body have: [?] Yes, I should have used "i" for indexing pdp_status. "i" is also used in the loop condition, so it is better to leave it there. I could put it in the end of the loop, but then due to "continue" it doesn't get changed always. -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 6 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: lynxis lazus Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 12:09:15 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 12:11:20 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 24 Apr 2019 12:11:20 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... Patch Set 6: Code-Review+1 Fine for me, leaving +2 to a second reviewer. -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 6 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Wed, 24 Apr 2019 12:11:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 12:17:33 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 12:17:33 +0000 Subject: Change in osmocom-bb[master]: trx_toolkit/data_msg.py: fix TOA256 MIN/MAX constants In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13755 ) Change subject: trx_toolkit/data_msg.py: fix TOA256 MIN/MAX constants ...................................................................... trx_toolkit/data_msg.py: fix TOA256 MIN/MAX constants The old TOA256 range was bigger than we can actually store: struct.error: 'h' format requires -32768 <= number <= 32767 Change-Id: I5d4e1fea9d07f2c49f01e6644d1c0d1dc8cf4e40 --- M src/target/trx_toolkit/data_msg.py 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/target/trx_toolkit/data_msg.py b/src/target/trx_toolkit/data_msg.py index 62fd29b..3393ddb 100644 --- a/src/target/trx_toolkit/data_msg.py +++ b/src/target/trx_toolkit/data_msg.py @@ -297,9 +297,9 @@ RSSI_MIN = -120 RSSI_MAX = -50 - # TODO: verify this range - TOA256_MIN = -256 * 200 - TOA256_MAX = 256 * 200 + # Min and max values of int16_t + TOA256_MIN = -32768 + TOA256_MAX = 32767 # Specific message fields rssi = None -- To view, visit https://gerrit.osmocom.org/13755 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5d4e1fea9d07f2c49f01e6644d1c0d1dc8cf4e40 Gerrit-Change-Number: 13755 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 12:58:36 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 24 Apr 2019 12:58:36 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: wait until BTS supplies stable signal In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13747 to look at the new patch set (#2). Change subject: BTS_Tests: wait until BTS supplies stable signal ...................................................................... BTS_Tests: wait until BTS supplies stable signal When running tests with real hardware it is important to wait for some time (3 sec. should be enough) before exiting f_init(). This is to ensure that the BTS supplies a stable carrier before the test proceeds. Change-Id: Ib78633a33a15cd40514e15b6ebf9a0a8fb7b9c68 Related: OS#3863 --- M bts/BTS_Tests.ttcn 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/47/13747/2 -- To view, visit https://gerrit.osmocom.org/13747 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib78633a33a15cd40514e15b6ebf9a0a8fb7b9c68 Gerrit-Change-Number: 13747 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:06:30 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 13:06:30 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: wait until BTS supplies stable signal In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13747 ) Change subject: BTS_Tests: wait until BTS supplies stable signal ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13747 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib78633a33a15cd40514e15b6ebf9a0a8fb7b9c68 Gerrit-Change-Number: 13747 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 13:06:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:06:46 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 13:06:46 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: default value for mp_ipa_up_timeout too low In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13746 ) Change subject: BTS_Tests: default value for mp_ipa_up_timeout too low ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13746 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5bb290d00a02a25672305688352a03f3bf484ff3 Gerrit-Change-Number: 13746 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 13:06:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:09:47 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 13:09:47 +0000 Subject: Change in osmo-mgw[master]: cosmetic: handle_modify_con: Fix indentation level In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13770 ) Change subject: cosmetic: handle_modify_con: Fix indentation level ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13770 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieb1e07d667a9fc1ff1e2fd367cbdb3c0dbfd4607 Gerrit-Change-Number: 13770 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 13:09:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:10:24 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 13:10:24 +0000 Subject: Change in osmo-mgw[master]: mgcp_msg: Log faulty line on Osmux parsing error In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13743 ) Change subject: mgcp_msg: Log faulty line on Osmux parsing error ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13743 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I436e53963f8e7d00f3111ff81f7b08475c4b8ae9 Gerrit-Change-Number: 13743 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 13:10:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:30:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 13:30:54 +0000 Subject: Change in osmo-mgw[master]: mgcp_msg: Log faulty line on Osmux parsing error In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13743 ) Change subject: mgcp_msg: Log faulty line on Osmux parsing error ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13743 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I436e53963f8e7d00f3111ff81f7b08475c4b8ae9 Gerrit-Change-Number: 13743 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 13:30:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:31:07 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 13:31:07 +0000 Subject: Change in osmo-mgw[master]: cosmetic: handle_modify_con: Fix indentation level In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13770 ) Change subject: cosmetic: handle_modify_con: Fix indentation level ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13770 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieb1e07d667a9fc1ff1e2fd367cbdb3c0dbfd4607 Gerrit-Change-Number: 13770 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 13:31:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:31:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 13:31:08 +0000 Subject: Change in osmo-mgw[master]: mgcp_msg: Log faulty line on Osmux parsing error In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13743 ) Change subject: mgcp_msg: Log faulty line on Osmux parsing error ...................................................................... mgcp_msg: Log faulty line on Osmux parsing error Change-Id: I436e53963f8e7d00f3111ff81f7b08475c4b8ae9 --- M src/libosmo-mgcp/mgcp_msg.c 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index f98b9ee..5844d41 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -365,8 +365,11 @@ { int osmux_cid; - if (sscanf(line + 2, "Osmux: %u", &osmux_cid) != 1) + if (sscanf(line + 2, "Osmux: %u", &osmux_cid) != 1) { + LOGP(DLMGCP, LOGL_ERROR, "Failed parsing Osmux in MGCP msg line: %s\n", + line); return -1; + } if (osmux_cid > OSMUX_CID_MAX) { LOGP(DLMGCP, LOGL_ERROR, "Osmux ID too large: %u > %u\n", -- To view, visit https://gerrit.osmocom.org/13743 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I436e53963f8e7d00f3111ff81f7b08475c4b8ae9 Gerrit-Change-Number: 13743 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:31:09 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 13:31:09 +0000 Subject: Change in osmo-mgw[master]: cosmetic: handle_modify_con: Fix indentation level In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13770 ) Change subject: cosmetic: handle_modify_con: Fix indentation level ...................................................................... cosmetic: handle_modify_con: Fix indentation level Change-Id: Ieb1e07d667a9fc1ff1e2fd367cbdb3c0dbfd4607 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, approved Harald Welte: Looks good to me, approved diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index ac6b4ea..9be4eda 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -1151,7 +1151,7 @@ goto error3; } } else - conn->conn->mode = conn->conn->mode_orig; + conn->conn->mode = conn->conn->mode_orig; /* Set local connection options, if present */ if (local_options) { -- To view, visit https://gerrit.osmocom.org/13770 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ieb1e07d667a9fc1ff1e2fd367cbdb3c0dbfd4607 Gerrit-Change-Number: 13770 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:31:49 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 13:31:49 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: default value for mp_ipa_up_timeout too low In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13746 ) Change subject: BTS_Tests: default value for mp_ipa_up_timeout too low ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13746 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5bb290d00a02a25672305688352a03f3bf484ff3 Gerrit-Change-Number: 13746 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 13:31:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:31:50 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 13:31:50 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: default value for mp_ipa_up_timeout too low In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13746 ) Change subject: BTS_Tests: default value for mp_ipa_up_timeout too low ...................................................................... BTS_Tests: default value for mp_ipa_up_timeout too low The default value for the module parameter mp_ipa_up_timeout is set to 10 sec. Given that the sysmobts needs around 10-11 sec. to perform one restart cycle this is to low and causes tests to fail occasionally. Lets increase the default value to 15 sec to get reliable. Change-Id: I5bb290d00a02a25672305688352a03f3bf484ff3 Related: OS#3863 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 711947a..68c85fb 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -64,7 +64,7 @@ integer mp_ms_actual_ta_exp := 0; integer mp_timing_offset_256syms_exp := 512; /* Time to wait for RSL conn from BTS during startup of test */ - float mp_ipa_up_timeout := 10.0; + float mp_ipa_up_timeout := 15.0; } type record of RslChannelNr ChannelNrs; -- To view, visit https://gerrit.osmocom.org/13746 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5bb290d00a02a25672305688352a03f3bf484ff3 Gerrit-Change-Number: 13746 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:31:53 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 24 Apr 2019 13:31:53 +0000 Subject: Change in osmo-gsm-tester[master]: BTS_Tests.cfg.tmpl: rename BTS_Tests.mp_bb_trxc_port Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13771 Change subject: BTS_Tests.cfg.tmpl: rename BTS_Tests.mp_bb_trxc_port ...................................................................... BTS_Tests.cfg.tmpl: rename BTS_Tests.mp_bb_trxc_port The module parameter BTS_Tests.mp_bb_trxc_port got renamed to BTS_Tests.mp_bts_trxc_port. Lets change the config template accordingly. Change-Id: I776a27642a5024919fe9f882a3d695246a8ce0f7 Related: OS#3863 --- M ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/71/13771/1 diff --git a/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl b/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl index 03d2721..cb25794 100644 --- a/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl +++ b/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl @@ -15,7 +15,7 @@ %else: BTS_Tests.mp_pcu_socket := "" %endif -BTS_Tests.mp_bb_trxc_port := -1 +BTS_Tests.mp_bts_trxc_port := -1 L1CTL_PortType.m_l1ctl_sock_path := "/data/unix_l2/osmocom_l2" BTS_Tests.mp_ctrl_ip := "${btsvty_ctrl_hostname}" BTS_Tests.mp_rxlev_exp := 1 -- To view, visit https://gerrit.osmocom.org/13771 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I776a27642a5024919fe9f882a3d695246a8ce0f7 Gerrit-Change-Number: 13771 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:32:20 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 13:32:20 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: wait until BTS supplies stable signal In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13747 ) Change subject: BTS_Tests: wait until BTS supplies stable signal ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13747 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib78633a33a15cd40514e15b6ebf9a0a8fb7b9c68 Gerrit-Change-Number: 13747 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 13:32:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:32:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 13:32:21 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: wait until BTS supplies stable signal In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13747 ) Change subject: BTS_Tests: wait until BTS supplies stable signal ...................................................................... BTS_Tests: wait until BTS supplies stable signal When running tests with real hardware it is important to wait for some time (3 sec. should be enough) before exiting f_init(). This is to ensure that the BTS supplies a stable carrier before the test proceeds. Change-Id: Ib78633a33a15cd40514e15b6ebf9a0a8fb7b9c68 Related: OS#3863 --- M bts/BTS_Tests.ttcn 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, approved Harald Welte: Looks good to me, approved diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 68c85fb..35f51a1 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -65,6 +65,7 @@ integer mp_timing_offset_256syms_exp := 512; /* Time to wait for RSL conn from BTS during startup of test */ float mp_ipa_up_timeout := 15.0; + float mp_ipa_up_delay := 3.0; } type record of RslChannelNr ChannelNrs; @@ -364,6 +365,10 @@ f_main_trxc_connect(); ret := f_TRXC_transceive(BTS_TRXC, g_bts_trxc_conn_id, valueof(ts_TRXC_FAKE_TIMING(2*256))); } + + /* Wait some extra time to make sure the BTS emits a stable carrier. + * (this is only relevant when running the tests with a physical BTS.) */ + f_sleep(mp_ipa_up_delay); } /* Attach L1CTL to master test_CT (classic tests, non-handler mode) */ -- To view, visit https://gerrit.osmocom.org/13747 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib78633a33a15cd40514e15b6ebf9a0a8fb7b9c68 Gerrit-Change-Number: 13747 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:33:24 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 13:33:24 +0000 Subject: Change in osmo-bts[master]: common/paging.c: fix unaligned pointer access In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13769 ) Change subject: common/paging.c: fix unaligned pointer access ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13769 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief69854973a098e6da7c05f4417dc11988edd777 Gerrit-Change-Number: 13769 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 13:33:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:40:07 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 13:40:07 +0000 Subject: Change in osmo-sgsn[master]: LLC: Don't blindly assume all LLC frames have data payload In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13764 ) Change subject: LLC: Don't blindly assume all LLC frames have data payload ...................................................................... LLC: Don't blindly assume all LLC frames have data payload In reality, only UI, I, SABM, UA and XID frames carry payload. All other frames will have llhp.data == NULL. Let's therefore not do any msgb adjustments unless we actually know there is a user payload field. Change-Id: I51bbd0f2c618d477a037af343ff41de1c8a5a3ae Closes: OS#3952 --- M src/gprs/gprs_llc.c 1 file changed, 8 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved Keith Whyte: Looks good to me, but someone else must approve diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index abbb742..c222bc2 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -945,9 +945,6 @@ LOGP(DLLC, LOGL_INFO, "Dropping frame with invalid FCS\n"); return -EIO; } - /* set l3 layer & remove the fcs */ - msg->l3h = llhp.data; - msgb_l3trim(msg, llhp.data_len); /* Update LLE's (BVCI, NSEI) tuple */ lle->llme->bvci = msgb_bvci(msg); @@ -958,6 +955,14 @@ if (rc < 0) return rc; + /* there are many frame types that don't carry user information + * and which hence have llhp.data = NULL */ + if (llhp.data) { + /* set l3 layer & remove the fcs */ + msg->l3h = llhp.data; + msgb_l3trim(msg, llhp.data_len); + } + rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_LLC_UL_PACKETS]); rate_ctr_add(&sgsn->rate_ctrs->ctr[CTR_LLC_UL_BYTES], msg->len); -- To view, visit https://gerrit.osmocom.org/13764 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I51bbd0f2c618d477a037af343ff41de1c8a5a3ae Gerrit-Change-Number: 13764 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:40:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 13:40:08 +0000 Subject: Change in osmo-sgsn[master]: LLC: Avoid NOTICE message on LLC NULL In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13765 ) Change subject: LLC: Avoid NOTICE message on LLC NULL ...................................................................... LLC: Avoid NOTICE message on LLC NULL A MS sending LLC NULL frames on cell change is a perfectly normal event, and we shouldn't log any cryptic NOTICE messages about it. Change-Id: I6be0b9c8813dfb40a7955422fd8e7cebf94d189c --- M src/gprs/gprs_llc.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Keith Whyte: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index c222bc2..654f2c0 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -860,6 +860,9 @@ if ((gph->seq_tx + 1) / 512) lle->oc_ui_recv += 512; break; + case GPRS_LLC_NULL: + LOGP(DLLC, LOGL_DEBUG, "TLLI=%08x sends us LLC NULL\n", lle->llme ? lle->llme->tlli : -1); + break; default: LOGP(DLLC, LOGL_NOTICE, "Unhandled command: %d\n", gph->cmd); break; -- To view, visit https://gerrit.osmocom.org/13765 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6be0b9c8813dfb40a7955422fd8e7cebf94d189c Gerrit-Change-Number: 13765 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:43:46 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 13:43:46 +0000 Subject: Change in osmo-sgsn[master]: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13767 to look at the new patch set (#3). Change subject: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM ...................................................................... gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM According to Section 6.4.1.4 of 3GPP TS 04.64 The DM unnumbered response shall be used by an LLE to report to its peer that the LLE is in a state such that ABM operation cannot be performed. An LLE shall transmit a DM response to any valid command received that it cannot action. Closes: OS#3953 Change-Id: Ie8b8e16d5a68f19f21dc4fdb5703c8a794e0173c --- M src/gprs/gprs_llc.c 1 file changed, 22 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/67/13767/3 -- To view, visit https://gerrit.osmocom.org/13767 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie8b8e16d5a68f19f21dc4fdb5703c8a794e0173c Gerrit-Change-Number: 13767 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:44:46 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Apr 2019 13:44:46 +0000 Subject: Change in osmo-sgsn[master]: LLC: Store the XID inside the LLC Entity, not LLC Mgmg Entity In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13623 ) Change subject: LLC: Store the XID inside the LLC Entity, not LLC Mgmg Entity ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13623 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaeb54ca5ac58391be45e56c2e721f531969f3a9e Gerrit-Change-Number: 13623 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 13:44:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 13:46:18 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 13:46:18 +0000 Subject: Change in osmo-sgsn[master]: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13767 ) Change subject: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13767 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8b8e16d5a68f19f21dc4fdb5703c8a794e0173c Gerrit-Change-Number: 13767 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 13:46:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 14:35:01 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 24 Apr 2019 14:35:01 +0000 Subject: Change in osmo-gsm-tester[master]: BTS_Tests.cfg.tmpl: rename BTS_Tests.mp_bb_trxc_port In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13771 ) Change subject: BTS_Tests.cfg.tmpl: rename BTS_Tests.mp_bb_trxc_port ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13771 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I776a27642a5024919fe9f882a3d695246a8ce0f7 Gerrit-Change-Number: 13771 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 14:35:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 14:58:20 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 24 Apr 2019 14:58:20 +0000 Subject: Change in osmo-gsm-tester[master]: BTS_Tests.cfg.tmpl: rename BTS_Tests.mp_bb_trxc_port In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/13771 ) Change subject: BTS_Tests.cfg.tmpl: rename BTS_Tests.mp_bb_trxc_port ...................................................................... BTS_Tests.cfg.tmpl: rename BTS_Tests.mp_bb_trxc_port The module parameter BTS_Tests.mp_bb_trxc_port got renamed to BTS_Tests.mp_bts_trxc_port. Lets change the config template accordingly. Change-Id: I776a27642a5024919fe9f882a3d695246a8ce0f7 Related: OS#3863 --- M ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl b/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl index 03d2721..cb25794 100644 --- a/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl +++ b/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl @@ -15,7 +15,7 @@ %else: BTS_Tests.mp_pcu_socket := "" %endif -BTS_Tests.mp_bb_trxc_port := -1 +BTS_Tests.mp_bts_trxc_port := -1 L1CTL_PortType.m_l1ctl_sock_path := "/data/unix_l2/osmocom_l2" BTS_Tests.mp_ctrl_ip := "${btsvty_ctrl_hostname}" BTS_Tests.mp_rxlev_exp := 1 -- To view, visit https://gerrit.osmocom.org/13771 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I776a27642a5024919fe9f882a3d695246a8ce0f7 Gerrit-Change-Number: 13771 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 15:26:59 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 24 Apr 2019 15:26:59 +0000 Subject: Change in osmo-gsm-tester[master]: BTS_Tests.cfg.tmpl rename BTS_Tests.mp_bb_trxc_ip Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13772 Change subject: BTS_Tests.cfg.tmpl rename BTS_Tests.mp_bb_trxc_ip ...................................................................... BTS_Tests.cfg.tmpl rename BTS_Tests.mp_bb_trxc_ip The module parameter BTS_Tests.mp_bb_trxc_ip got renamed to +BTS_Tests.mp_bts_trxc_ip. Lets change the config template accordingly. Change-Id: I49da16361a4f770852e7046edd457ad0101306bb Related: OS#3863 --- M ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/72/13772/1 diff --git a/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl b/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl index cb25794..92f0faa 100644 --- a/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl +++ b/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl @@ -9,7 +9,7 @@ [MODULE_PARAMETERS] BTS_Tests.mp_rsl_ip := "172.18.9.10" -BTS_Tests.mp_bb_trxc_ip := "127.0.0.1" +BTS_Tests.mp_bts_trxc_ip := "127.0.0.1" %if pcu_available: BTS_Tests.mp_pcu_socket := "/data/unix_pcu/pcu_bts" %else: -- To view, visit https://gerrit.osmocom.org/13772 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I49da16361a4f770852e7046edd457ad0101306bb Gerrit-Change-Number: 13772 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 15:47:00 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 24 Apr 2019 15:47:00 +0000 Subject: Change in osmo-gsm-tester[master]: BTS_Tests.cfg.tmpl rename BTS_Tests.mp_bb_trxc_ip In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13772 ) Change subject: BTS_Tests.cfg.tmpl rename BTS_Tests.mp_bb_trxc_ip ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13772 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I49da16361a4f770852e7046edd457ad0101306bb Gerrit-Change-Number: 13772 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 15:47:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 15:48:48 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 24 Apr 2019 15:48:48 +0000 Subject: Change in osmo-gsm-tester[master]: BTS_Tests.cfg.tmpl rename BTS_Tests.mp_bb_trxc_ip In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/13772 ) Change subject: BTS_Tests.cfg.tmpl rename BTS_Tests.mp_bb_trxc_ip ...................................................................... BTS_Tests.cfg.tmpl rename BTS_Tests.mp_bb_trxc_ip The module parameter BTS_Tests.mp_bb_trxc_ip got renamed to +BTS_Tests.mp_bts_trxc_ip. Lets change the config template accordingly. Change-Id: I49da16361a4f770852e7046edd457ad0101306bb Related: OS#3863 --- M ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl b/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl index cb25794..92f0faa 100644 --- a/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl +++ b/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl @@ -9,7 +9,7 @@ [MODULE_PARAMETERS] BTS_Tests.mp_rsl_ip := "172.18.9.10" -BTS_Tests.mp_bb_trxc_ip := "127.0.0.1" +BTS_Tests.mp_bts_trxc_ip := "127.0.0.1" %if pcu_available: BTS_Tests.mp_pcu_socket := "/data/unix_pcu/pcu_bts" %else: -- To view, visit https://gerrit.osmocom.org/13772 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I49da16361a4f770852e7046edd457ad0101306bb Gerrit-Change-Number: 13772 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 16:58:05 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 24 Apr 2019 16:58:05 +0000 Subject: Change in osmo-mgw[master]: Introduce log fmt helpers LOGPENDP and LOGPCONN Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13773 Change subject: Introduce log fmt helpers LOGPENDP and LOGPCONN ...................................................................... Introduce log fmt helpers LOGPENDP and LOGPCONN Let's define macro once and use it everywhere instead of passing endp information in different ways everywhere. Furthermore, use conn whenever appropiate to have more information. Change-Id: I1c49b1eb16bc5f1010376da5cf407ca6e31d81f2 --- M include/osmocom/mgcp/mgcp_endp.h M include/osmocom/mgcp/mgcp_internal.h M src/libosmo-mgcp/mgcp_codec.c M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_endp.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_sdp.c 9 files changed, 339 insertions(+), 431 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/73/13773/1 diff --git a/include/osmocom/mgcp/mgcp_endp.h b/include/osmocom/mgcp/mgcp_endp.h index a23e192..75f093d 100644 --- a/include/osmocom/mgcp/mgcp_endp.h +++ b/include/osmocom/mgcp/mgcp_endp.h @@ -99,4 +99,3 @@ #define ENDPOINT_NUMBER(endp) abs((int)(endp - endp->tcfg->endpoints)) void mgcp_endp_release(struct mgcp_endpoint *endp); - diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index ec94584..3defc4c 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -335,3 +335,13 @@ void mgcp_get_local_addr(char *addr, struct mgcp_conn_rtp *conn); void mgcp_conn_watchdog_kick(struct mgcp_conn *conn); + +#define LOGPENDP(endp, cat, level, fmt, args...) \ +LOGP(cat, level, "endpoint:0x%x " fmt, \ + ENDPOINT_NUMBER(endp), \ + ## args) + +#define LOGPCONN(conn, cat, level, fmt, args...) \ +LOGPENDP((conn)->endp, cat, level, "CI:%s " fmt, \ + (conn)->id, \ + ## args) diff --git a/src/libosmo-mgcp/mgcp_codec.c b/src/libosmo-mgcp/mgcp_codec.c index 933284d..8bf0564 100644 --- a/src/libosmo-mgcp/mgcp_codec.c +++ b/src/libosmo-mgcp/mgcp_codec.c @@ -56,8 +56,8 @@ endp = conn->conn->endp; if (rtp->codecs_assigned == 0) { - LOGP(DLMGCP, LOGL_ERROR, "endpoint:0x%x conn:%s no codecs available\n", ENDPOINT_NUMBER(endp), - mgcp_conn_dump(conn->conn)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "conn:%s no codecs available\n", + mgcp_conn_dump(conn->conn)); return; } @@ -65,8 +65,8 @@ for (i = 0; i < rtp->codecs_assigned; i++) { codec = &rtp->codecs[i]; - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:0x%x conn:%s codecs[%u]:%s", ENDPOINT_NUMBER(endp), - mgcp_conn_dump(conn->conn), i, dump_codec(codec)); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "conn:%s codecs[%u]:%s", + mgcp_conn_dump(conn->conn), i, dump_codec(codec)); if (codec == rtp->codec) LOGPC(DLMGCP, LOGL_DEBUG, " [selected]"); diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index a8341d6..bfaa111 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -75,8 +75,7 @@ } } - LOGP(DLMGCP, LOGL_ERROR, "endpoint:0x%x, unable to generate a unique connectionIdentifier\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "unable to generate a unique connectionIdentifier\n"); return -1; } @@ -129,7 +128,7 @@ void mgcp_conn_watchdog_cb(void *data) { struct mgcp_conn *conn = data; - LOGP(DLMGCP, LOGL_ERROR, "endpoint:0x%x CI:%s connection timed out!\n", ENDPOINT_NUMBER(conn->endp), conn->id); + LOGPCONN(conn, DLMGCP, LOGL_ERROR, "connection timed out!\n"); mgcp_conn_free(conn->endp, conn->id); } @@ -139,7 +138,7 @@ if (!timeout) return; - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:0x%x CI:%s watchdog kicked\n", ENDPOINT_NUMBER(conn->endp), conn->id); + LOGPCONN(conn, DLMGCP, LOGL_DEBUG, "watchdog kicked\n"); osmo_timer_schedule(&conn->watchdog, timeout, 0); } diff --git a/src/libosmo-mgcp/mgcp_endp.c b/src/libosmo-mgcp/mgcp_endp.c index fa2dd28..eec46bf 100644 --- a/src/libosmo-mgcp/mgcp_endp.c +++ b/src/libosmo-mgcp/mgcp_endp.c @@ -36,8 +36,7 @@ * \param[in] endp endpoint to release */ void mgcp_endp_release(struct mgcp_endpoint *endp) { - LOGP(DLMGCP, LOGL_DEBUG, "Releasing endpoint:0x%x\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "Releasing endpoint\n"); /* Normally this function should only be called when * all connections have been removed already. In case diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 5844d41..5dae5a2 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -82,9 +82,8 @@ int ret = 0; if (!mode) { - LOGP(DLMGCP, LOGL_ERROR, - "endpoint:0x%x missing connection mode\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn, DLMGCP, LOGL_ERROR, + "missing connection mode\n"); return -1; } if (!conn) @@ -101,9 +100,8 @@ else if (strcmp(mode, "loopback") == 0) conn->mode = MGCP_CONN_LOOPBACK; else { - LOGP(DLMGCP, LOGL_ERROR, - "endpoint:0x%x unknown connection mode: '%s'\n", - ENDPOINT_NUMBER(endp), mode); + LOGPCONN(conn, DLMGCP, LOGL_ERROR, + "unknown connection mode: '%s'\n", mode); ret = -1; } @@ -113,18 +111,15 @@ conn->mode & MGCP_CONN_SEND_ONLY ? 1 : 0; } - LOGP(DLMGCP, LOGL_DEBUG, - "endpoint:0x%x conn:%s\n", - ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn)); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "conn:%s\n", mgcp_conn_dump(conn)); - LOGP(DLMGCP, LOGL_DEBUG, - "endpoint:0x%x connection mode '%s' %d\n", - ENDPOINT_NUMBER(endp), mode, conn->mode); + LOGPCONN(conn, DLMGCP, LOGL_DEBUG, "connection mode '%s' %d\n", + mode, conn->mode); /* Special handling f?r RTP connections */ if (conn->type == MGCP_CONN_TYPE_RTP) { - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:0x%x output_enabled %d\n", - ENDPOINT_NUMBER(endp), conn->u.rtp.end.output_enabled); + LOGPCONN(conn, DLMGCP, LOGL_DEBUG, "output_enabled %d\n", + conn->u.rtp.end.output_enabled); } /* The VTY might change the connection mode at any time, so we have @@ -197,9 +192,8 @@ for (i = 0; i < number_endpoints; i++) { if (endpoints[i].callid == NULL) { endp = &endpoints[i]; - LOGP(DLMGCP, LOGL_DEBUG, - "endpoint:0x%x found free endpoint\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, + "found free endpoint\n"); endp->wildcarded_req = true; return endp; } @@ -422,9 +416,9 @@ return -1; if (strcmp(endp->callid, callid) != 0) { - LOGP(DLMGCP, LOGL_ERROR, - "endpoint:0x%x CallIDs mismatch: '%s' != '%s'\n", - ENDPOINT_NUMBER(endp), endp->callid, callid); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "CallIDs mismatch: '%s' != '%s'\n", + endp->callid, callid); return -1; } @@ -443,25 +437,23 @@ /* Check for null identifiers */ if (!conn_id) { - LOGP(DLMGCP, LOGL_ERROR, - "endpoint:0x%x invalid ConnectionIdentifier (missing)\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "invalid ConnectionIdentifier (missing)\n"); return 510; } /* Check for empty connection identifiers */ if (strlen(conn_id) == 0) { - LOGP(DLMGCP, LOGL_ERROR, - "endpoint:0x%x invalid ConnectionIdentifier (empty)\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "invalid ConnectionIdentifier (empty)\n"); return 510; } /* Check for over long connection identifiers */ if (strlen(conn_id) > (MGCP_CONN_ID_MAXLEN-1)) { - LOGP(DLMGCP, LOGL_ERROR, - "endpoint:0x%x invalid ConnectionIdentifier (too long: %zu > %d) 0x%s\n", - ENDPOINT_NUMBER(endp), strlen(conn_id), MGCP_CONN_ID_MAXLEN-1, conn_id); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "invalid ConnectionIdentifier (too long: %zu > %d) 0x%s\n", + strlen(conn_id), MGCP_CONN_ID_MAXLEN-1, conn_id); return 510; } @@ -469,9 +461,8 @@ if (mgcp_conn_get(endp, conn_id)) return 0; - LOGP(DLMGCP, LOGL_ERROR, - "endpoint:0x%x no connection found under ConnectionIdentifier 0x%s\n", - ENDPOINT_NUMBER(endp), conn_id); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "no connection found under ConnectionIdentifier 0x%s\n", conn_id); /* When the conn_id was not found, return error code 515 "The transaction refers to an incorrect * connection-id (may have been already deleted)." */ diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 2c6c571..4d92051 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -76,14 +76,12 @@ if (endp->cfg->net_ports.bind_addr_probe && conn->end.addr.s_addr != 0) { rc = osmo_sock_local_ip(addr, inet_ntoa(conn->end.addr)); if (rc < 0) - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x CI:%s local interface auto detection failed, using configured addresses...\n", - ENDPOINT_NUMBER(endp), conn->conn->id); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "local interface auto detection failed, using configured addresses...\n"); else { - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x CI:%s selected local rtp bind ip %s by probing using remote ip %s\n", - ENDPOINT_NUMBER(endp), conn->conn->id, addr, - inet_ntoa(conn->end.addr)); + LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, + "selected local rtp bind ip %s by probing using remote ip %s\n", + addr, inet_ntoa(conn->end.addr)); return; } } @@ -93,17 +91,16 @@ /* Check there is a bind IP for the RTP traffic configured, * if so, use that IP-Address */ osmo_strlcpy(addr, endp->cfg->net_ports.bind_addr, INET_ADDRSTRLEN); - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x CI:%s using configured rtp bind ip as local bind ip %s\n", - ENDPOINT_NUMBER(endp), conn->conn->id, addr); + LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, + "using configured rtp bind ip as local bind ip %s\n", + addr); } else { /* No specific bind IP is configured for the RTP traffic, so * assume the IP where we listen for incoming MGCP messages * as bind IP */ osmo_strlcpy(addr, endp->cfg->source_addr, INET_ADDRSTRLEN); - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x CI:%s using mgcp bind ip as local rtp bind ip: %s\n", - ENDPOINT_NUMBER(endp), conn->conn->id, addr); + LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, + "using mgcp bind ip as local rtp bind ip: %s\n", addr); } } @@ -165,10 +162,8 @@ OSMO_ASSERT(endp); OSMO_ASSERT(conn); - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x sending dummy packet...\n", ENDPOINT_NUMBER(endp)); - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x conn:%s\n", - ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); + LOGPCONN(conn->conn, DRTP, LOGL_DEBUG,"sending dummy packet... %s\n", + mgcp_conn_dump(conn->conn)); rc = mgcp_udp_send(conn->end.rtp.fd, &conn->end.addr, conn->end.rtp_port, buf, 1); @@ -187,9 +182,9 @@ return rc; failed: - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x Failed to send dummy %s packet.\n", - ENDPOINT_NUMBER(endp), was_rtcp ? "RTCP" : "RTP"); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "Failed to send dummy %s packet.\n", + was_rtcp ? "RTCP" : "RTP"); return -1; } @@ -228,16 +223,16 @@ if (seq == sstate->last_seq) { if (timestamp != sstate->last_timestamp) { rate_ctr_inc(sstate->err_ts_ctr); - LOGP(DRTP, LOGL_ERROR, - "The %s timestamp delta is != 0 but the sequence " - "number %d is the same, " - "TS offset: %d, SeqNo offset: %d " - "on 0x%x SSRC: %u timestamp: %u " - "from %s:%d\n", - text, seq, - state->patch.timestamp_offset, state->patch.seq_offset, - ENDPOINT_NUMBER(endp), sstate->ssrc, timestamp, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "The %s timestamp delta is != 0 but the sequence " + "number %d is the same, " + "TS offset: %d, SeqNo offset: %d " + "on SSRC: %u timestamp: %u " + "from %s:%d\n", + text, seq, + state->patch.timestamp_offset, state->patch.seq_offset, + sstate->ssrc, timestamp, inet_ntoa(addr->sin_addr), + ntohs(addr->sin_port)); } return 0; } @@ -248,25 +243,25 @@ if (tsdelta == 0) { /* Don't update *tsdelta_out */ - LOGP(DRTP, LOGL_NOTICE, - "The %s timestamp delta is %d " - "on 0x%x SSRC: %u timestamp: %u " - "from %s:%d\n", - text, tsdelta, - ENDPOINT_NUMBER(endp), sstate->ssrc, timestamp, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "The %s timestamp delta is %d " + "on SSRC: %u timestamp: %u " + "from %s:%d\n", + text, tsdelta, + sstate->ssrc, timestamp, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); return 0; } if (sstate->last_tsdelta != tsdelta) { if (sstate->last_tsdelta) { - LOGP(DRTP, LOGL_INFO, - "The %s timestamp delta changes from %d to %d " - "on 0x%x SSRC: %u timestamp: %u from %s:%d\n", - text, sstate->last_tsdelta, tsdelta, - ENDPOINT_NUMBER(endp), sstate->ssrc, timestamp, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_INFO, + "The %s timestamp delta changes from %d to %d " + "on SSRC: %u timestamp: %u from %s:%d\n", + text, sstate->last_tsdelta, tsdelta, + sstate->ssrc, timestamp, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } } @@ -278,18 +273,18 @@ if (timestamp_error) { rate_ctr_inc(sstate->err_ts_ctr); - LOGP(DRTP, LOGL_NOTICE, - "The %s timestamp has an alignment error of %d " - "on 0x%x SSRC: %u " - "SeqNo delta: %d, TS delta: %d, dTS/dSeq: %d " - "from %s:%d. ptime: %d\n", - text, timestamp_error, - ENDPOINT_NUMBER(endp), sstate->ssrc, - (int16_t)(seq - sstate->last_seq), - (int32_t)(timestamp - sstate->last_timestamp), - tsdelta, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port), - state->packet_duration); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "The %s timestamp has an alignment error of %d " + "on SSRC: %u " + "SeqNo delta: %d, TS delta: %d, dTS/dSeq: %d " + "from %s:%d. ptime: %d\n", + text, timestamp_error, + sstate->ssrc, + (int16_t)(seq - sstate->last_seq), + (int32_t)(timestamp - sstate->last_timestamp), + tsdelta, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port), + state->packet_duration); } return 1; } @@ -308,21 +303,19 @@ if (tsdelta == 0) { tsdelta = state->out_stream.last_tsdelta; if (tsdelta != 0) { - LOGP(DRTP, LOGL_NOTICE, - "A fixed packet duration is not available on 0x%x, " - "using last output timestamp delta instead: %d " - "from %s:%d\n", - ENDPOINT_NUMBER(endp), tsdelta, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "A fixed packet duration is not available, " + "using last output timestamp delta instead: %d " + "from %s:%d\n", tsdelta, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } else { tsdelta = rtp_end->codec->rate * 20 / 1000; - LOGP(DRTP, LOGL_NOTICE, - "Fixed packet duration and last timestamp delta " - "are not available on 0x%x, " - "using fixed 20ms instead: %d " - "from %s:%d\n", - ENDPOINT_NUMBER(endp), tsdelta, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "Fixed packet duration and last timestamp delta " + "are not available, " + "using fixed 20ms instead: %d " + "from %s:%d\n", tsdelta, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } } @@ -332,13 +325,12 @@ if (state->patch.timestamp_offset != timestamp_offset) { state->patch.timestamp_offset = timestamp_offset; - LOGP(DRTP, LOGL_NOTICE, - "Timestamp offset change on 0x%x SSRC: %u " - "SeqNo delta: %d, TS offset: %d, " - "from %s:%d\n", - ENDPOINT_NUMBER(endp), state->in_stream.ssrc, - delta_seq, state->patch.timestamp_offset, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "Timestamp offset change on SSRC: %u " + "SeqNo delta: %d, TS offset: %d, " + "from %s:%d\n", state->in_stream.ssrc, + delta_seq, state->patch.timestamp_offset, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } return timestamp_offset; @@ -364,14 +356,13 @@ if (ts_error) { state->patch.timestamp_offset += ptime - ts_error; - LOGP(DRTP, LOGL_NOTICE, - "Corrected timestamp alignment error of %d on 0x%x SSRC: %u " - "new TS offset: %d, " - "from %s:%d\n", - ts_error, - ENDPOINT_NUMBER(endp), state->in_stream.ssrc, - state->patch.timestamp_offset, inet_ntoa(addr->sin_addr), - ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "Corrected timestamp alignment error of %d on SSRC: %u " + "new TS offset: %d, " + "from %s:%d\n", + ts_error, state->in_stream.ssrc, + state->patch.timestamp_offset, inet_ntoa(addr->sin_addr), + ntohs(addr->sin_port)); } /* Check we really managed to compensate the timestamp @@ -397,8 +388,7 @@ struct mgcp_rtp_end *dst_end, char *data, int *len, int buf_size) { - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x transcoding disabled\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "transcoding disabled\n"); return 0; } @@ -411,8 +401,7 @@ struct mgcp_conn_rtp *conn_dst, struct mgcp_conn_rtp *conn_src) { - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x transcoding disabled\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "transcoding disabled\n"); return 0; } @@ -421,9 +410,8 @@ const char **fmtp_extra, struct mgcp_conn_rtp *conn) { - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x conn:%s using format defaults\n", - ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "conn:%s using format defaults\n", + mgcp_conn_dump(conn->conn)); *codec = conn->end.codec; *fmtp_extra = conn->end.fmtp_extra; @@ -459,9 +447,9 @@ if (seq < state->stats.max_seq) state->stats.cycles += RTP_SEQ_MOD; } else if (udelta <= RTP_SEQ_MOD - RTP_MAX_MISORDER) { - LOGP(DRTP, LOGL_NOTICE, - "RTP seqno made a very large jump on 0x%x delta: %u\n", - ENDPOINT_NUMBER(endp), udelta); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "RTP seqno made a very large jump on delta: %u\n", + udelta); } } @@ -541,28 +529,27 @@ state->out_stream.last_tsdelta = 0; state->out_stream.last_timestamp = timestamp; state->out_stream.ssrc = ssrc - 1; /* force output SSRC change */ - LOGP(DRTP, LOGL_INFO, - "endpoint:0x%x initializing stream, SSRC: %u timestamp: %u " - "pkt-duration: %d, from %s:%d\n", - ENDPOINT_NUMBER(endp), state->in_stream.ssrc, - state->patch.seq_offset, state->packet_duration, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_INFO, + "initializing stream, SSRC: %u timestamp: %u " + "pkt-duration: %d, from %s:%d\n", + state->in_stream.ssrc, + state->patch.seq_offset, state->packet_duration, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); if (state->packet_duration == 0) { state->packet_duration = rtp_end->codec->rate * 20 / 1000; - LOGP(DRTP, LOGL_NOTICE, - "endpoint:0x%x fixed packet duration is not available, " - "using fixed 20ms instead: %d from %s:%d\n", - ENDPOINT_NUMBER(endp), state->packet_duration, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "fixed packet duration is not available, " + "using fixed 20ms instead: %d from %s:%d\n", + state->packet_duration, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } } else if (state->in_stream.ssrc != ssrc) { - LOGP(DRTP, LOGL_NOTICE, - "endpoint:0x%x SSRC changed: %u -> %u " - "from %s:%d\n", - ENDPOINT_NUMBER(endp), - state->in_stream.ssrc, rtp_hdr->ssrc, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "SSRC changed: %u -> %u " + "from %s:%d\n", + state->in_stream.ssrc, rtp_hdr->ssrc, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); state->in_stream.ssrc = ssrc; if (rtp_end->force_constant_ssrc) { @@ -586,13 +573,12 @@ if (rtp_end->force_constant_ssrc != -1) rtp_end->force_constant_ssrc -= 1; - LOGP(DRTP, LOGL_NOTICE, - "endpoint:0x%x SSRC patching enabled, SSRC: %u " - "SeqNo offset: %d, TS offset: %d " - "from %s:%d\n", - ENDPOINT_NUMBER(endp), state->in_stream.ssrc, - state->patch.seq_offset, state->patch.timestamp_offset, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "SSRC patching enabled, SSRC: %u " + "SeqNo offset: %d, TS offset: %d " + "from %s:%d\n", state->in_stream.ssrc, + state->patch.seq_offset, state->patch.timestamp_offset, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } state->in_stream.last_tsdelta = 0; @@ -679,9 +665,8 @@ } else { /* It is possible that multiple payloads occur in one RTP * packet. This is not supported yet. */ - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x cannot figure out how to convert RTP packet\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "cannot figure out how to convert RTP packet\n"); } } @@ -726,9 +711,8 @@ rc = payload_len; } if (rc < 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x AMR RTP packet conversion failed\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "AMR RTP packet conversion failed\n"); return -EINVAL; } @@ -810,19 +794,14 @@ OSMO_ASSERT(conn_dst); if (is_rtp) { - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x delivering RTP packet...\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "delivering RTP packet...\n"); } else { - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x delivering RTCP packet...\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "delivering RTCP packet...\n"); } - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x loop:%d, mode:%d%s\n", - ENDPOINT_NUMBER(endp), tcfg->audio_loop, conn_src->conn->mode, - conn_src->conn->mode == MGCP_CONN_LOOPBACK ? " (loopback)" : ""); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "loop:%d, mode:%d%s\n", + tcfg->audio_loop, conn_src->conn->mode, + conn_src->conn->mode == MGCP_CONN_LOOPBACK ? " (loopback)" : ""); /* FIXME: It is legal that the payload type on the egress connection is * different from the payload type that has been negotiated on the @@ -835,9 +814,8 @@ if (is_rtp) { rc = mgcp_patch_pt(conn_src, conn_dst, buf, len); if (rc < 0) { - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x can not patch PT because no suitable egress codec was found.\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, + "can not patch PT because no suitable egress codec was found.\n"); } } @@ -849,13 +827,12 @@ if (!rtp_end->output_enabled) { rate_ctr_inc(&conn_dst->rate_ctr_group->ctr[RTP_DROPPED_PACKETS_CTR]); - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x output disabled, drop to %s %s " - "rtp_port:%u rtcp_port:%u\n", - ENDPOINT_NUMBER(endp), - dest_name, - inet_ntoa(rtp_end->addr), - ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) + LOGPENDP(endp, DRTP, LOGL_DEBUG, + "output disabled, drop to %s %s " + "rtp_port:%u rtcp_port:%u\n", + dest_name, + inet_ntoa(rtp_end->addr), + ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) ); } else if (is_rtp) { int cont; @@ -882,13 +859,12 @@ "GSM-HR-08") == 0) rfc5993_hr_convert(endp, buf, &buflen); - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x process/send to %s %s " - "rtp_port:%u rtcp_port:%u\n", - ENDPOINT_NUMBER(endp), dest_name, - inet_ntoa(rtp_end->addr), ntohs(rtp_end->rtp_port), - ntohs(rtp_end->rtcp_port) - ); + LOGPENDP(endp, DRTP, LOGL_DEBUG, + "process/send to %s %s " + "rtp_port:%u rtcp_port:%u\n", + dest_name, inet_ntoa(rtp_end->addr), + ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) + ); /* Forward a copy of the RTP data to a debug ip/port */ forward_data(rtp_end->rtp.fd, &conn_src->tap_out, @@ -906,10 +882,9 @@ data[0] = 0xe4; data[1] = 0x00; rtp_state->patched_first_rtp_payload = true; - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x Patching over first two bytes" - " to fake an IuUP Initialization Ack\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, + "Patching over first two bytes" + " to fake an IuUP Initialization Ack\n"); } } @@ -928,13 +903,11 @@ } while (buflen > 0); return nbytes; } else if (!tcfg->omit_rtcp) { - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x send to %s %s rtp_port:%u rtcp_port:%u\n", - ENDPOINT_NUMBER(endp), - dest_name, - inet_ntoa(rtp_end->addr), - ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) - ); + LOGPENDP(endp, DRTP, LOGL_DEBUG, + "send to %s %s rtp_port:%u rtcp_port:%u\n", + dest_name, inet_ntoa(rtp_end->addr), + ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) + ); len = mgcp_udp_send(rtp_end->rtcp.fd, &rtp_end->addr, @@ -970,20 +943,19 @@ rc = recvfrom(fd, buf, bufsize, 0, (struct sockaddr *)addr, &slen); - LOGP(DRTP, LOGL_DEBUG, + LOGPENDP(endp, DRTP, LOGL_DEBUG, "receiving %u bytes length packet from %s:%u ...\n", rc, inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); if (rc < 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x failed to receive packet, errno: %d/%s\n", - ENDPOINT_NUMBER(endp), errno, strerror(errno)); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "failed to receive packet, errno: %d/%s\n", + errno, strerror(errno)); return -1; } if (tossed) { - LOGP(DRTP, LOGL_ERROR, "endpoint:0x%x packet tossed\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_ERROR, "packet tossed\n"); } return rc; @@ -994,9 +966,6 @@ static int check_rtp_origin(struct mgcp_conn_rtp *conn, struct sockaddr_in *addr) { - struct mgcp_endpoint *endp; - endp = conn->conn->endp; - if (conn->end.addr.s_addr == 0) { switch (conn->conn->mode) { case MGCP_CONN_LOOPBACK: @@ -1007,20 +976,18 @@ * Response is received, but the nano3G expects an IuUP Initialization Ack before it even * sends the RAB Assignment Response. Hence, if the remote address is 0.0.0.0 and the * MGCP port is in loopback mode, allow looping back the packet to any source. */ - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x In loopback mode and remote address not set:" - " allowing data from address: %s\n", - ENDPOINT_NUMBER(endp), inet_ntoa(addr->sin_addr)); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "In loopback mode and remote address not set:" + " allowing data from address: %s\n", inet_ntoa(addr->sin_addr)); return 0; default: /* Receiving early media before the endpoint is configured. Instead of logging * this as an error that occurs on every call, keep it more low profile to not * confuse humans with expected errors. */ - LOGP(DRTP, LOGL_INFO, - "endpoint:0x%x I:%s Rx RTP from %s, but remote address not set:" - " dropping early media\n", - ENDPOINT_NUMBER(endp), conn->conn->id, inet_ntoa(addr->sin_addr)); + LOGPCONN(conn->conn, DRTP, LOGL_INFO, + "Rx RTP from %s, but remote address not set:" + " dropping early media\n", inet_ntoa(addr->sin_addr)); return -1; } } @@ -1028,13 +995,11 @@ /* Note: Check if the inbound RTP data comes from the same host to * which we send our outgoing RTP traffic. */ if (conn->end.addr.s_addr != addr->sin_addr.s_addr) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x data from wrong address: %s, ", - ENDPOINT_NUMBER(endp), inet_ntoa(addr->sin_addr)); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "data from wrong address: %s, ", inet_ntoa(addr->sin_addr)); LOGPC(DRTP, LOGL_ERROR, "expected: %s\n", inet_ntoa(conn->end.addr)); - LOGP(DRTP, LOGL_ERROR, "endpoint:0x%x packet tossed\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, "packet tossed\n"); return -1; } @@ -1044,14 +1009,12 @@ * plausibility. */ if (conn->end.rtp_port != addr->sin_port && conn->end.rtcp_port != addr->sin_port) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x data from wrong source port: %d, ", - ENDPOINT_NUMBER(endp), ntohs(addr->sin_port)); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "data from wrong source port: %d, ", ntohs(addr->sin_port)); LOGPC(DRTP, LOGL_ERROR, "expected: %d for RTP or %d for RTCP\n", ntohs(conn->end.rtp_port), ntohs(conn->end.rtcp_port)); - LOGP(DRTP, LOGL_ERROR, "endpoint:0x%x packet tossed\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, "packet tossed\n"); return -1; } @@ -1062,29 +1025,26 @@ * makes sense */ static int check_rtp_destin(struct mgcp_conn_rtp *conn) { - struct mgcp_endpoint *endp; - endp = conn->conn->endp; - /* Note: it is legal to create a connection but never setting a port * and IP-address for outgoing data. */ if (strcmp(inet_ntoa(conn->end.addr), "0.0.0.0") == 0 && conn->end.rtp_port == 0) { - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x destination IP-address and rtp port is (not yet) known (%s:%u)\n", - ENDPOINT_NUMBER(endp), inet_ntoa(conn->end.addr), conn->end.rtp_port); + LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, + "destination IP-address and rtp port is (not yet) known (%s:%u)\n", + inet_ntoa(conn->end.addr), conn->end.rtp_port); return -1; } if (strcmp(inet_ntoa(conn->end.addr), "0.0.0.0") == 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x destination IP-address is invalid (%s:%u)\n", - ENDPOINT_NUMBER(endp), inet_ntoa(conn->end.addr), conn->end.rtp_port); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "destination IP-address is invalid (%s:%u)\n", + inet_ntoa(conn->end.addr), conn->end.rtp_port); return -1; } if (conn->end.rtp_port == 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x destination rtp port is invalid (%s:%u)\n", - ENDPOINT_NUMBER(endp), inet_ntoa(conn->end.addr), conn->end.rtp_port); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "destination rtp port is invalid (%s:%u)\n", + inet_ntoa(conn->end.addr), conn->end.rtp_port); return -1; } @@ -1152,8 +1112,7 @@ endp = conn->conn->endp; tcfg = endp->tcfg; - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x receiving RTP/RTCP packet...\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, "receiving RTP/RTCP packet...\n"); rc = receive_from(endp, fd->fd, addr, buf, buf_size); if (rc <= 0) @@ -1167,26 +1126,23 @@ if (*proto == MGCP_PROTO_RTP) { if (check_rtp(buf, rc) < 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x invalid RTP packet received -- packet tossed\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "invalid RTP packet received -- packet tossed\n"); return -1; } } else if (*proto == MGCP_PROTO_RTCP) { if (check_rtcp(buf, rc) < 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x invalid RTCP packet received -- packet tossed\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "invalid RTCP packet received -- packet tossed\n"); return -1; } } - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x ", ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, ""); LOGPC(DRTP, LOGL_DEBUG, "receiving from %s %s %d\n", conn->conn->name, inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x conn:%s\n", ENDPOINT_NUMBER(endp), - mgcp_conn_dump(conn->conn)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "conn:%s\n", mgcp_conn_dump(conn->conn)); /* Check if the origin of the RTP packet seems plausible */ if (tcfg->rtp_accept_all == 0) { @@ -1196,11 +1152,10 @@ /* Filter out dummy message */ if (rc == 1 && buf[0] == MGCP_DUMMY_LOAD) { - LOGP(DRTP, LOGL_NOTICE, - "endpoint:0x%x dummy message received\n", - ENDPOINT_NUMBER(endp)); - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x packet tossed\n", ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DRTP, LOGL_NOTICE, + "dummy message received\n"); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "packet tossed\n"); return 0; } @@ -1224,8 +1179,8 @@ struct mgcp_endpoint *endp; endp = conn_src->conn->endp; - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x destin conn:%s\n", - ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn_dst->conn)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "destin conn:%s\n", + mgcp_conn_dump(conn_dst->conn)); /* Before we try to deliver the packet, we check if the destination * port and IP-Address make sense at all. If not, we will be unable @@ -1237,27 +1192,23 @@ * destination connection. */ switch (conn_dst->type) { case MGCP_RTP_DEFAULT: - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x endpoint type is MGCP_RTP_DEFAULT, " - "using mgcp_send() to forward data directly\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, + "endpoint type is MGCP_RTP_DEFAULT, " + "using mgcp_send() to forward data directly\n"); return mgcp_send(endp, proto == MGCP_PROTO_RTP, addr, buf, buf_size, conn_src, conn_dst); case MGCP_OSMUX_BSC_NAT: case MGCP_OSMUX_BSC: - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x endpoint type is MGCP_OSMUX_BSC_NAT, " - "using osmux_xfrm_to_osmux() to forward data through OSMUX\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, + "endpoint type is MGCP_OSMUX_BSC_NAT, " + "using osmux_xfrm_to_osmux() to forward data through OSMUX\n"); return osmux_xfrm_to_osmux(buf, buf_size, conn_dst); } /* If the data has not been handled/forwarded until here, it will * be discarded, this should not happen, normally the MGCP type * should be properly set */ - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x bad MGCP type -- data discarded!\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_ERROR, "bad MGCP type -- data discarded!\n"); return -1; } @@ -1273,8 +1224,6 @@ unsigned int buf_size, struct mgcp_conn *conn) { struct mgcp_conn *conn_dst; - struct mgcp_endpoint *endp; - endp = conn->endp; /*! NOTE: This callback function implements the endpoint specific * dispatch bahviour of an rtp bridge/proxy endpoint. It is assumed @@ -1300,17 +1249,15 @@ /* There is no destination conn, stop here */ if (!conn_dst) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x unable to find destination conn\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn, DRTP, LOGL_ERROR, + "unable to find destination conn\n"); return -1; } /* The destination conn is not an RTP connection */ if (conn_dst->type != MGCP_CONN_TYPE_RTP) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x unable to find suitable destination conn\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn, DRTP, LOGL_ERROR, + "unable to find suitable destination conn\n"); return -1; } @@ -1362,8 +1309,8 @@ endp = conn_src->conn->endp; OSMO_ASSERT(endp); - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x source conn:%s\n", - ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn_src->conn)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "source conn:%s\n", + mgcp_conn_dump(conn_src->conn)); /* Receive packet */ len = mgcp_recv(&proto, &addr, buf, sizeof(buf), fd); @@ -1444,20 +1391,21 @@ { /* NOTE: The port that is used for RTCP is the RTP port incremented by one * (e.g. RTP-Port = 16000 ==> RTCP-Port = 16001) */ + struct mgcp_endpoint *endp = &cfg->trunk.endpoints[endpno]; if (mgcp_create_bind(source_addr, &rtp_end->rtp, rtp_end->local_port) != 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x failed to create RTP port: %s:%d\n", endpno, - source_addr, rtp_end->local_port); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "failed to create RTP port: %s:%d\n", + source_addr, rtp_end->local_port); goto cleanup0; } if (mgcp_create_bind(source_addr, &rtp_end->rtcp, rtp_end->local_port + 1) != 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x failed to create RTCP port: %s:%d\n", endpno, - source_addr, rtp_end->local_port + 1); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "failed to create RTCP port: %s:%d\n", + source_addr, rtp_end->local_port + 1); goto cleanup1; } @@ -1467,17 +1415,17 @@ rtp_end->rtp.when = BSC_FD_READ; if (osmo_fd_register(&rtp_end->rtp) != 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x failed to register RTP port %d\n", endpno, - rtp_end->local_port); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "failed to register RTP port %d\n", + rtp_end->local_port); goto cleanup2; } rtp_end->rtcp.when = BSC_FD_READ; if (osmo_fd_register(&rtp_end->rtcp) != 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x failed to register RTCP port %d\n", endpno, - rtp_end->local_port + 1); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "failed to register RTCP port %d\n", + rtp_end->local_port + 1); goto cleanup3; } @@ -1511,10 +1459,8 @@ end = &conn->end; if (end->rtp.fd != -1 || end->rtcp.fd != -1) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x %u was already bound on conn:%s\n", - ENDPOINT_NUMBER(endp), rtp_port, - mgcp_conn_dump(conn->conn)); + LOGPENDP(endp, DRTP, LOGL_ERROR, "%u was already bound on conn:%s\n", + rtp_port, mgcp_conn_dump(conn->conn)); /* Double bindings should never occour! Since we always allocate * connections dynamically and free them when they are not diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 9be4eda..be161ad 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -148,16 +148,14 @@ struct mgcp_conn *_conn; if (conn->type != MGCP_RTP_DEFAULT) { - LOGP(DLMGCP, LOGL_NOTICE, - "endpoint:%x RTP-setup: Endpoint is not configured as RTP default, stopping here!\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "RTP-setup: Endpoint is not configured as RTP default, stopping here!\n"); return 0; } if (conn->conn->mode == MGCP_CONN_LOOPBACK) { - LOGP(DLMGCP, LOGL_NOTICE, - "endpoint:%x RTP-setup: Endpoint is in loopback mode, stopping here!\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "RTP-setup: Endpoint is in loopback mode, stopping here!\n"); return 0; } @@ -225,13 +223,13 @@ len = snprintf((char *)res->data, 2048, "%d %s%s%s\r\n%s", code, trans, txt, param ? param : "", sdp ? sdp : ""); if (len < 0) { - LOGP(DLMGCP, LOGL_ERROR, "Failed to sprintf MGCP response.\n"); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "Failed to sprintf MGCP response.\n"); msgb_free(res); return NULL; } res->l2h = msgb_put(res, len); - LOGP(DLMGCP, LOGL_DEBUG, "Generated response: code=%d\n", code); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "Generated response: code=%d\n", code); mgcp_disp_msg(res->l2h, msgb_l2len(res), "Generated response"); /* @@ -430,7 +428,7 @@ /* AUEP command handler, processes the received command */ static struct msgb *handle_audit_endpoint(struct mgcp_parse_data *p) { - LOGP(DLMGCP, LOGL_NOTICE, "AUEP: auditing endpoint ...\n"); + LOGPENDP(p->endp, DLMGCP, LOGL_NOTICE, "AUEP: auditing endpoint ...\n"); return create_ok_response(p->endp, 200, "AUEP", p->trans); } @@ -469,9 +467,9 @@ } - LOGP(DLMGCP, LOGL_ERROR, - "Allocating a RTP/RTCP port failed %u times 0x%x.\n", - tries, ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "Allocating a RTP/RTCP port failed %u times.\n", + tries); return -1; } @@ -654,11 +652,11 @@ rtp->force_constant_ssrc = patch_ssrc ? 1 : 0; rtp->rfc5993_hr_convert = tcfg->rfc5993_hr_convert; - LOGP(DLMGCP, LOGL_DEBUG, - "Configuring RTP endpoint: local port %d%s%s\n", - ntohs(rtp->rtp_port), - rtp->force_aligned_timing ? ", force constant timing" : "", - rtp->force_constant_ssrc ? ", force constant ssrc" : ""); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, + "Configuring RTP endpoint: local port %d%s%s\n", + ntohs(rtp->rtp_port), + rtp->force_aligned_timing ? ", force constant timing" : "", + rtp->force_constant_ssrc ? ", force constant ssrc" : ""); } uint32_t mgcp_rtp_packet_duration(struct mgcp_endpoint *endp, @@ -684,10 +682,10 @@ { if (!endp->cfg->osmux_init) { if (osmux_init(OSMUX_ROLE_BSC, endp->cfg) < 0) { - LOGP(DLMGCP, LOGL_ERROR, "Cannot init OSMUX\n"); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "Cannot init OSMUX\n"); return -1; } - LOGP(DLMGCP, LOGL_NOTICE, "OSMUX socket has been set up\n"); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, "OSMUX socket has been set up\n"); } return mgcp_parse_osmux_cid(line); @@ -713,9 +711,8 @@ mgcp_codec_reset_all(conn); rc = mgcp_parse_sdp_data(endp, conn, p); if (rc != 0) { - LOGP(DLMGCP, LOGL_ERROR, - "%s: endpoint:%x sdp not parseable\n", cmd, - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, + "%s: sdp not parseable\n", cmd); /* See also RFC 3661: Protocol error */ return 510; @@ -747,9 +744,8 @@ return 0; error: - LOGP(DLMGCP, LOGL_ERROR, - "%s: endpoint:0x%x codec negotiation failure\n", cmd, - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, + "%s: codec negotiation failure\n", cmd); /* See also RFC 3661: Codec negotiation failure */ return 534; @@ -772,8 +768,7 @@ if (!strcmp(token, "C")) endp->x_osmo_ign |= MGCP_X_OSMO_IGN_CALLID; else - LOGP(DLMGCP, LOGL_ERROR, "endpoint 0x%x: received unknown X-Osmo-IGN item '%s'\n", - ENDPOINT_NUMBER(endp), token); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "received unknown X-Osmo-IGN item '%s'\n", token); } return true; @@ -796,7 +791,7 @@ char conn_name[512]; int rc; - LOGP(DLMGCP, LOGL_NOTICE, "CRCX: creating new connection ...\n"); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, "CRCX: creating new connection ...\n"); /* parse CallID C: and LocalParameters L: */ for_each_line(line, p->save) { @@ -838,9 +833,8 @@ have_sdp = 1; goto mgcp_header_done; default: - LOGP(DLMGCP, LOGL_NOTICE, - "CRCX: endpoint:%x unhandled option: '%c'/%d\n", - ENDPOINT_NUMBER(endp), *line, *line); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "CRCX: unhandled option: '%c'/%d\n", *line, *line); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_UNHANDLED_PARAM]); return create_err_response(NULL, 539, "CRCX", p->trans); break; @@ -850,26 +844,24 @@ mgcp_header_done: /* Check parameters */ if (!callid) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:%x insufficient parameters, missing callid\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "CRCX: insufficient parameters, missing callid\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_MISSING_CALLID]); return create_err_response(endp, 516, "CRCX", p->trans); } if (!mode) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:%x insufficient parameters, missing mode\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "CRCX: insufficient parameters, missing mode\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_INVALID_MODE]); return create_err_response(endp, 517, "CRCX", p->trans); } /* Check if we are able to accept the creation of another connection */ if (llist_count(&endp->conns) >= endp->type->max_conns) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:%x endpoint full, max. %i connections allowed!\n", - endp->type->max_conns, ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "CRCX: endpoint full, max. %i connections allowed!\n", + endp->type->max_conns); if (tcfg->force_realloc) { /* There is no more room for a connection, make some * room by blindly tossing the oldest of the two two @@ -886,9 +878,9 @@ /* Check if this endpoint already serves a call, if so, check if the * callids match up so that we are sure that this is our call */ if (endp->callid && mgcp_verify_call_id(endp, callid)) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:0x%x allready seized by other call (%s)\n", - ENDPOINT_NUMBER(endp), endp->callid); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "CRCX: already seized by other call (%s)\n", + endp->callid); if (tcfg->force_realloc) /* This is not our call, toss everything by releasing * the entire endpoint. (rude!) */ @@ -909,9 +901,8 @@ snprintf(conn_name, sizeof(conn_name), "%s", callid); _conn = mgcp_conn_alloc(NULL, endp, MGCP_CONN_TYPE_RTP, conn_name); if (!_conn) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:0x%x unable to allocate RTP connection\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "CRCX: unable to allocate RTP connection\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_ALLOC_CONN]); goto error2; @@ -932,9 +923,8 @@ conn->osmux.cid = osmux_cid; conn->osmux.state = OSMUX_STATE_NEGOTIATING; } else if (endp->cfg->osmux == OSMUX_USAGE_ONLY) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:0x%x osmux only and no osmux offered\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(_conn, DLMGCP, LOGL_ERROR, + "CRCX: osmux only and no osmux offered\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_NO_OSMUX]); goto error2; } @@ -944,9 +934,8 @@ rc = set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, local_options); if (rc != 0) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:%x inavlid local connection options!\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(_conn, DLMGCP, LOGL_ERROR, + "CRCX: inavlid local connection options!\n"); error_code = rc; rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_INVALID_CONN_OPTIONS]); goto error2; @@ -976,9 +965,8 @@ if (conn->conn->mode != MGCP_CONN_LOOPBACK && conn->conn->mode != MGCP_CONN_RECV_ONLY && conn->end.rtp_port == 0) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:%x selected connection mode type requires an opposite end!\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(_conn, DLMGCP, LOGL_ERROR, + "CRCX: selected connection mode type requires an opposite end!\n"); error_code = 527; rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_NO_REMOTE_CONN_DESC]); goto error2; @@ -990,9 +978,8 @@ } if (setup_rtp_processing(endp, conn) != 0) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:0x%x could not start RTP processing!\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(_conn, DLMGCP, LOGL_ERROR, + "CRCX: could not start RTP processing!\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_START_RTP]); goto error2; } @@ -1004,9 +991,8 @@ MGCP_ENDP_CRCX, p->trans); switch (rc) { case MGCP_POLICY_REJECT: - LOGP(DLMGCP, LOGL_NOTICE, - "CRCX: endpoint:0x%x CRCX rejected by policy\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(_conn, DLMGCP, LOGL_NOTICE, + "CRCX: CRCX rejected by policy\n"); mgcp_endp_release(endp); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_REJECTED_BY_POLICY]); return create_err_response(endp, 400, "CRCX", p->trans); @@ -1021,9 +1007,8 @@ } } - LOGP(DLMGCP, LOGL_DEBUG, - "CRCX: endpoint:0x%x Creating connection: CI: %s port: %u\n", - ENDPOINT_NUMBER(endp), conn->conn->id, conn->end.local_port); + LOGPCONN(conn->conn, DLMGCP, LOGL_DEBUG, + "CRCX: Creating connection: port: %u\n", conn->end.local_port); if (p->cfg->change_cb) p->cfg->change_cb(tcfg, ENDPOINT_NUMBER(endp), MGCP_ENDP_CRCX); @@ -1033,16 +1018,14 @@ && tcfg->keepalive_interval != MGCP_KEEPALIVE_NEVER) send_dummy(endp, conn); - LOGP(DLMGCP, LOGL_NOTICE, - "CRCX: endpoint:0x%x connection successfully created\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(_conn, DLMGCP, LOGL_NOTICE, + "CRCX: connection successfully created\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_SUCCESS]); return create_response_with_sdp(endp, conn, "CRCX", p->trans, true); error2: mgcp_endp_release(endp); - LOGP(DLMGCP, LOGL_NOTICE, - "CRCX: endpoint:0x%x unable to create connection\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "CRCX: unable to create connection\n"); return create_err_response(endp, error_code, "CRCX", p->trans); } @@ -1066,21 +1049,19 @@ const char *conn_id = NULL; int rc; - LOGP(DLMGCP, LOGL_NOTICE, "MDCX: modifying existing connection ...\n"); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, "MDCX: modifying existing connection ...\n"); /* Prohibit wildcarded requests */ if (endp->wildcarded_req) { - LOGP(DLMGCP, LOGL_ERROR, - "MDCX: endpoint:0x%x wildcarded endpoint names not supported.\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "MDCX: wildcarded endpoint names not supported.\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_WILDCARD]); return create_err_response(endp, 507, "MDCX", p->trans); } if (llist_count(&endp->conns) <= 0) { - LOGP(DLMGCP, LOGL_ERROR, - "MDCX: endpoint:0x%x endpoint is not holding a connection.\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "MDCX: endpoint is not holding a connection.\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_NO_CONN]); return create_err_response(endp, 400, "MDCX", p->trans); } @@ -1118,9 +1099,9 @@ goto mgcp_header_done; break; default: - LOGP(DLMGCP, LOGL_NOTICE, - "MDCX: endpoint:0x%x Unhandled MGCP option: '%c'/%d\n", - ENDPOINT_NUMBER(endp), line[0], line[0]); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "MDCX: Unhandled MGCP option: '%c'/%d\n", + line[0], line[0]); rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_UNHANDLED_PARAM]); return create_err_response(NULL, 539, "MDCX", p->trans); break; @@ -1129,9 +1110,8 @@ mgcp_header_done: if (!conn_id) { - LOGP(DLMGCP, LOGL_ERROR, - "MDCX: endpoint:0x%x insufficient parameters, missing ci (connectionIdentifier)\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "MDCX: insufficient parameters, missing ci (connectionIdentifier)\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_NO_CONNID]); return create_err_response(endp, 515, "MDCX", p->trans); } @@ -1158,9 +1138,8 @@ rc = set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, local_options); if (rc != 0) { - LOGP(DLMGCP, LOGL_ERROR, - "MDCX: endpoint:%x invalid local connection options!\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, + "MDCX: invalid local connection options!\n"); error_code = rc; rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_INVALID_CONN_OPTIONS]); goto error3; @@ -1179,9 +1158,8 @@ if (conn->conn->mode != MGCP_CONN_LOOPBACK && conn->conn->mode != MGCP_CONN_RECV_ONLY && conn->end.rtp_port == 0) { - LOGP(DLMGCP, LOGL_ERROR, - "MDCX: endpoint:%x selected connection mode type requires an opposite end!\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, + "MDCX: selected connection mode type requires an opposite end!\n"); error_code = 527; rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_NO_REMOTE_CONN_DESC]); goto error3; @@ -1201,9 +1179,8 @@ MGCP_ENDP_MDCX, p->trans); switch (rc) { case MGCP_POLICY_REJECT: - LOGP(DLMGCP, LOGL_NOTICE, - "MDCX: endpoint:0x%x rejected by policy\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DLMGCP, LOGL_NOTICE, + "MDCX: rejected by policy\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_REJECTED_BY_POLICY]); if (silent) goto out_silent; @@ -1211,9 +1188,8 @@ break; case MGCP_POLICY_DEFER: /* stop processing */ - LOGP(DLMGCP, LOGL_DEBUG, - "MDCX: endpoint:0x%x deferred by policy\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DLMGCP, LOGL_DEBUG, + "MDCX: deferred by policy\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_DEFERRED_BY_POLICY]); return NULL; break; @@ -1226,9 +1202,8 @@ mgcp_rtp_end_config(endp, 1, &conn->end); /* modify */ - LOGP(DLMGCP, LOGL_DEBUG, - "MDCX: endpoint:0x%x modified conn:%s\n", - ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); + LOGPCONN(conn->conn, DLMGCP, LOGL_DEBUG, + "MDCX: modified conn:%s\n", mgcp_conn_dump(conn->conn)); if (p->cfg->change_cb) p->cfg->change_cb(endp->tcfg, ENDPOINT_NUMBER(endp), MGCP_ENDP_MDCX); @@ -1243,16 +1218,14 @@ if (silent) goto out_silent; - LOGP(DLMGCP, LOGL_NOTICE, - "MDCX: endpoint:0x%x connection successfully modified\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DLMGCP, LOGL_NOTICE, + "MDCX: connection successfully modified\n"); return create_response_with_sdp(endp, conn, "MDCX", p->trans, false); error3: return create_err_response(endp, error_code, "MDCX", p->trans); out_silent: - LOGP(DLMGCP, LOGL_DEBUG, "MDCX: endpoint:0x%x silent exit\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "MDCX: silent exit\n"); return NULL; } @@ -1269,23 +1242,20 @@ const char *conn_id = NULL; struct mgcp_conn_rtp *conn = NULL; - LOGP(DLMGCP, LOGL_NOTICE, - "DLCX: endpoint:0x%x deleting connection ...\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "DLCX: deleting connection ...\n"); /* Prohibit wildcarded requests */ if (endp->wildcarded_req) { - LOGP(DLMGCP, LOGL_ERROR, - "DLCX: endpoint:0x%x wildcarded endpoint names not supported.\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "DLCX: wildcarded endpoint names not supported.\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_DLCX_FAIL_WILDCARD]); return create_err_response(endp, 507, "DLCX", p->trans); } if (llist_count(&endp->conns) <= 0) { - LOGP(DLMGCP, LOGL_ERROR, - "DLCX: endpoint:0x%x endpoint is not holding a connection.\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "DLCX: endpoint is not holding a connection.\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_DLCX_FAIL_NO_CONN]); return create_err_response(endp, 515, "DLCX", p->trans); } @@ -1313,9 +1283,9 @@ silent = strcmp("noanswer", line + 3) == 0; break; default: - LOGP(DLMGCP, LOGL_NOTICE, - "DLCX: endpoint:0x%x Unhandled MGCP option: '%c'/%d\n", - ENDPOINT_NUMBER(endp), line[0], line[0]); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "DLCX: Unhandled MGCP option: '%c'/%d\n", + line[0], line[0]); rate_ctr_inc(&rate_ctrs->ctr[MGCP_DLCX_FAIL_UNHANDLED_PARAM]); return create_err_response(NULL, 539, "DLCX", p->trans); break; @@ -1329,9 +1299,7 @@ MGCP_ENDP_DLCX, p->trans); switch (rc) { case MGCP_POLICY_REJECT: - LOGP(DLMGCP, LOGL_NOTICE, - "DLCX: endpoint:0x%x rejected by policy\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, "DLCX: rejected by policy\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_DLCX_FAIL_REJECTED_BY_POLICY]); if (silent) goto out_silent; @@ -1353,9 +1321,9 @@ * RFC3435 Section F.7) */ if (!conn_id) { int num_conns = llist_count(&endp->conns); - LOGP(DLMGCP, LOGL_NOTICE, - "DLCX: endpoint:0x%x missing ci (connectionIdentifier), will remove all connections (%d total) at once\n", - num_conns, ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "DLCX: missing ci (connectionIdentifier), will remove all connections (%d total) at once\n", + num_conns); if (num_conns > 0) rate_ctr_add(&rate_ctrs->ctr[MGCP_DLCX_SUCCESS], num_conns); @@ -1378,20 +1346,17 @@ mgcp_format_stats(stats, sizeof(stats), conn->conn); /* delete connection */ - LOGP(DLMGCP, LOGL_DEBUG, "DLCX: endpoint:0x%x deleting conn:%s\n", - ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); + LOGPCONN(conn->conn, DLMGCP, LOGL_DEBUG, "DLCX: deleting conn:%s\n", + mgcp_conn_dump(conn->conn)); mgcp_conn_free(endp, conn_id); - LOGP(DLMGCP, LOGL_NOTICE, - "DLCX: endpoint:0x%x connection successfully deleted\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "DLCX: connection successfully deleted\n"); /* When all connections are closed, the endpoint will be released * in order to be ready to be used by another call. */ if (llist_count(&endp->conns) <= 0) { mgcp_endp_release(endp); - LOGP(DLMGCP, LOGL_DEBUG, - "DLCX: endpoint:0x%x endpoint released\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "DLCX: endpoint released\n"); } if (p->cfg->change_cb) @@ -1407,8 +1372,7 @@ return create_err_response(endp, error_code, "DLCX", p->trans); out_silent: - LOGP(DLMGCP, LOGL_DEBUG, "DLCX: endpoint:0x%x silent exit\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "DLCX: silent exit\n"); return NULL; } diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c index 02b9695..6b41f50 100644 --- a/src/libosmo-mgcp/mgcp_sdp.c +++ b/src/libosmo-mgcp/mgcp_sdp.c @@ -376,7 +376,7 @@ talloc_free(tmp_ctx); - LOGP(DLMGCP, LOGL_NOTICE, + LOGPCONN(conn->conn, DLMGCP, LOGL_NOTICE, "Got media info via SDP: port:%d, addr:%s, duration:%d, payload-types:", ntohs(rtp->rtp_port), inet_ntoa(rtp->addr), rtp->packet_duration_ms); @@ -571,6 +571,6 @@ return 0; buffer_too_small: - LOGP(DLMGCP, LOGL_ERROR, "SDP messagebuffer too small\n"); + LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, "SDP messagebuffer too small\n"); return -1; } -- To view, visit https://gerrit.osmocom.org/13773 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1c49b1eb16bc5f1010376da5cf407ca6e31d81f2 Gerrit-Change-Number: 13773 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 17:39:36 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 24 Apr 2019 17:39:36 +0000 Subject: Change in osmo-mgw[master]: osmux: Cleanup of CID alloc pool APIs Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13774 Change subject: osmux: Cleanup of CID alloc pool APIs ...................................................................... osmux: Cleanup of CID alloc pool APIs * Cleanup naming to make it far more clear * Drop 2 variables holding CID values (allocated_cid, cid), in favour of 1 value holdinf the value and one bool stating whether the value is used. * Change conn_osmux_allocate_cid to allow allocating either next available CID or a specific one, in preparation for forthcoming patches. This commit can be merged straight away because anyway osmux cannot be enabled in current status (blocked by vty config) and (conn_)osmux_allocate_cid was/is not called anywhere. However, it helps improving code base for future re-introduction of Osmux as it is envisioned. Change-Id: I737a248ac6c74add8e917fe2e2f36779d0f1d685 --- M include/osmocom/mgcp/mgcp_internal.h M include/osmocom/mgcp/osmux.h M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c 6 files changed, 80 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/74/13774/1 diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index ec94584..c0a1b92 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -188,9 +188,9 @@ struct { /* Osmux state: disabled, activating, active */ enum osmux_state state; - /* Allocated Osmux circuit ID for this endpoint */ - int allocated_cid; - /* Used Osmux circuit ID for this endpoint */ + /* Is cid holding valid data? is it allocated from pool? */ + bool cid_allocated; + /* Allocated Osmux circuit ID for this conn */ uint8_t cid; /* handle to batch messages */ struct osmux_in_handle *in; diff --git a/include/osmocom/mgcp/osmux.h b/include/osmocom/mgcp/osmux.h index 685be9c..c080c85 100644 --- a/include/osmocom/mgcp/osmux.h +++ b/include/osmocom/mgcp/osmux.h @@ -15,13 +15,16 @@ int osmux_enable_conn(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, struct in_addr *addr, uint16_t port); void osmux_disable_conn(struct mgcp_conn_rtp *conn); -void osmux_allocate_cid(struct mgcp_conn_rtp *conn); -void osmux_release_cid(struct mgcp_conn_rtp *conn); +int conn_osmux_allocate_cid(struct mgcp_conn_rtp *conn, int osmux_cid); +void conn_osmux_release_cid(struct mgcp_conn_rtp *conn); int osmux_xfrm_to_osmux(char *buf, int buf_len, struct mgcp_conn_rtp *conn); int osmux_send_dummy(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn); -int osmux_get_cid(void); -void osmux_put_cid(uint8_t osmux_cid); -int osmux_used_cid(void); + +void osmux_cid_pool_get(uint8_t osmux_cid); +int osmux_cid_pool_get_next(void); +void osmux_cid_pool_put(uint8_t osmux_cid); +bool osmux_cid_pool_allocated(uint8_t osmux_cid); +int osmux_cid_pool_count_used(void); enum osmux_state { OSMUX_STATE_DISABLED = 0, /* Osmux not being currently used by endp */ diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index a8341d6..fc70231 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -91,7 +91,8 @@ static unsigned int rate_ctr_index = 0; conn_rtp->type = MGCP_RTP_DEFAULT; - conn_rtp->osmux.allocated_cid = -1; + conn_rtp->osmux.cid_allocated = false; + conn_rtp->osmux.cid = 0; /* backpointer to the generic part of the connection */ conn->u.rtp.conn = conn; @@ -121,7 +122,6 @@ static void mgcp_rtp_conn_cleanup(struct mgcp_conn_rtp *conn_rtp) { osmux_disable_conn(conn_rtp); - osmux_release_cid(conn_rtp); mgcp_free_rtp_port(&conn_rtp->end); rate_ctr_group_free(conn_rtp->rate_ctr_group); } diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c index a2c138d..3bd765e 100644 --- a/src/libosmo-mgcp/mgcp_osmux.c +++ b/src/libosmo-mgcp/mgcp_osmux.c @@ -614,31 +614,46 @@ osmux_xfrm_input_close_circuit(conn->osmux.in, conn->osmux.cid); conn->osmux.state = OSMUX_STATE_DISABLED; - conn->osmux.cid = -1; + conn_osmux_release_cid(conn); osmux_handle_put(conn->osmux.in); } /*! relase OSXMUX cid, that had been allocated to this connection. * \param[in] conn connection with OSMUX cid to release */ -void osmux_release_cid(struct mgcp_conn_rtp *conn) +void conn_osmux_release_cid(struct mgcp_conn_rtp *conn) { - if (!conn) - return; - - if (conn->osmux.state != OSMUX_STATE_ENABLED) - return; - - if (conn->osmux.allocated_cid >= 0) - osmux_put_cid(conn->osmux.allocated_cid); - conn->osmux.allocated_cid = -1; + if (conn->osmux.cid_allocated) + osmux_cid_pool_put(conn->osmux.cid); + conn->osmux.cid = 0; + conn->osmux.cid_allocated = false; } /*! allocate OSXMUX cid to connection. - * \param[in] conn connection for which we allocate the OSMUX cid*/ -void osmux_allocate_cid(struct mgcp_conn_rtp *conn) + * \param[in] conn connection for which we allocate the OSMUX cid + * \param[in] osmux_cid OSMUX cid to allocate. -1 Means take next available one. + * \returns Allocated OSMUX cid, -1 on error (no free cids avail, or selected one is already taken). + */ +int conn_osmux_allocate_cid(struct mgcp_conn_rtp *conn, int osmux_cid) { - osmux_release_cid(conn); - conn->osmux.allocated_cid = osmux_get_cid(); + if (osmux_cid != -1 && osmux_cid_pool_allocated((uint8_t) osmux_cid)) { + LOGP(DLMGCP, LOGL_INFO, "Conn %s: Osmux CID %d already allocated!\n", + conn->conn->id, osmux_cid); + return -1; + } + + if (osmux_cid == -1) { + osmux_cid = osmux_cid_pool_get_next(); + if (osmux_cid == -1) { + LOGP(DLMGCP, LOGL_INFO, "Conn %s: no available Osmux CID to allocate!\n", + conn->conn->id); + return -1; + } + } else + osmux_cid_pool_get(osmux_cid); + + conn->osmux.cid = (uint8_t) osmux_cid; + conn->osmux.cid_allocated = true; + return osmux_cid; } /*! send RTP dummy packet to OSMUX connection port. @@ -682,7 +697,7 @@ /*! count the number of taken OSMUX cids. * \returns number of OSMUX cids in use */ -int osmux_used_cid(void) +int osmux_cid_pool_count_used(void) { int i, j, used = 0; @@ -698,7 +713,7 @@ /*! take a free OSMUX cid. * \returns OSMUX cid */ -int osmux_get_cid(void) +int osmux_cid_pool_get_next(void) { int i, j; @@ -718,10 +733,24 @@ return -1; } +/*! take a specific OSMUX cid. + * \param[in] osmux_cid OSMUX cid */ +void osmux_cid_pool_get(uint8_t osmux_cid) +{ + LOGP(DLMGCP, LOGL_DEBUG, "Allocating Osmux CID %u from pool\n", osmux_cid); + osmux_cid_bitmap[osmux_cid / 8] |= (1 << (osmux_cid % 8)); +} + /*! put back a no longer used OSMUX cid. * \param[in] osmux_cid OSMUX cid */ -void osmux_put_cid(uint8_t osmux_cid) +void osmux_cid_pool_put(uint8_t osmux_cid) { LOGP(DLMGCP, LOGL_DEBUG, "Osmux CID %u is back to the pool\n", osmux_cid); osmux_cid_bitmap[osmux_cid / 8] &= ~(1 << (osmux_cid % 8)); } + +/*! check if OSMUX cid is already taken */ +bool osmux_cid_pool_allocated(uint8_t osmux_cid) +{ + return !!(osmux_cid_bitmap[osmux_cid / 8] & (1 << (osmux_cid % 8))); +} diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index a47376b..25d7a67 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -297,7 +297,7 @@ dump_trunk(vty, trunk, show_stats); if (g_cfg->osmux) - vty_out(vty, "Osmux used CID: %d%s", osmux_used_cid(), + vty_out(vty, "Osmux used CID: %d%s", osmux_cid_pool_count_used(), VTY_NEWLINE); return CMD_SUCCESS; diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index be45598..c4931b2 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -1554,25 +1554,34 @@ { int id, i; - OSMO_ASSERT(osmux_used_cid() == 0); - id = osmux_get_cid(); + OSMO_ASSERT(osmux_cid_pool_count_used() == 0); + + id = osmux_cid_pool_get_next(); OSMO_ASSERT(id == 0); - OSMO_ASSERT(osmux_used_cid() == 1); - osmux_put_cid(id); - OSMO_ASSERT(osmux_used_cid() == 0); + OSMO_ASSERT(osmux_cid_pool_count_used() == 1); + + osmux_cid_pool_get(30); + OSMO_ASSERT(osmux_cid_pool_count_used() == 2); + osmux_cid_pool_get(30); + OSMO_ASSERT(osmux_cid_pool_count_used() == 2); + + osmux_cid_pool_put(id); + OSMO_ASSERT(osmux_cid_pool_count_used() == 1); + osmux_cid_pool_put(30); + OSMO_ASSERT(osmux_cid_pool_count_used() == 0); for (i = 0; i < 256; ++i) { - id = osmux_get_cid(); + id = osmux_cid_pool_get_next(); OSMO_ASSERT(id == i); - OSMO_ASSERT(osmux_used_cid() == i + 1); + OSMO_ASSERT(osmux_cid_pool_count_used() == i + 1); } - id = osmux_get_cid(); + id = osmux_cid_pool_get_next(); OSMO_ASSERT(id == -1); for (i = 0; i < 256; ++i) - osmux_put_cid(i); - OSMO_ASSERT(osmux_used_cid() == 0); + osmux_cid_pool_put(i); + OSMO_ASSERT(osmux_cid_pool_count_used() == 0); } static const struct log_info_cat log_categories[] = { -- To view, visit https://gerrit.osmocom.org/13774 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I737a248ac6c74add8e917fe2e2f36779d0f1d685 Gerrit-Change-Number: 13774 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 17:59:44 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 24 Apr 2019 17:59:44 +0000 Subject: Change in osmo-mgw[master]: create_response_with_sdp: Fix inclusion of X-Osmux Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13775 Change subject: create_response_with_sdp: Fix inclusion of X-Osmux ...................................................................... create_response_with_sdp: Fix inclusion of X-Osmux In previous code, 2 blocks were handling osmux inclusion one after the other under same osmux.state. However, first block changes osmux.state so second block can never be true and X-Osmux is never added. Change-Id: Iceee8b64978651f1fe6bb883923561b081f73d9b --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 2 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/75/13775/1 diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 9be4eda..82d98f7 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -306,7 +306,6 @@ struct msgb *sdp; int rc; struct msgb *result; - char osmux_extension[strlen("X-Osmux: 255") + 1]; char local_ip_addr[INET_ADDRSTRLEN]; sdp = msgb_alloc_headroom(4096, 128, "sdp record"); @@ -318,13 +317,6 @@ addr = local_ip_addr; } - if (conn->osmux.state == OSMUX_STATE_NEGOTIATING) { - sprintf(osmux_extension, "X-Osmux: %u", conn->osmux.cid); - conn->osmux.state = OSMUX_STATE_ACTIVATING; - } else { - osmux_extension[0] = '\0'; - } - /* Attach optional connection parameters */ if (add_conn_params) { rc = add_params(sdp, endp, conn); @@ -334,9 +326,10 @@ /* Attach optional OSMUX parameters */ if (conn->osmux.state == OSMUX_STATE_NEGOTIATING) { - rc = msgb_printf(sdp, "%s\r\n", osmux_extension); + rc = msgb_printf(sdp, "X-Osmux: %u\r\n", conn->osmux.cid); if (rc < 0) goto error; + conn->osmux.state = OSMUX_STATE_ACTIVATING; } /* Attach line break to separate the parameters from the SDP block */ -- To view, visit https://gerrit.osmocom.org/13775 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iceee8b64978651f1fe6bb883923561b081f73d9b Gerrit-Change-Number: 13775 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 19:24:10 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 19:24:10 +0000 Subject: Change in libosmocore[master]: application.c: drop wrong \references of osmo_init_ignore_signals() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13776 Change subject: application.c: drop wrong \references of osmo_init_ignore_signals() ...................................................................... application.c: drop wrong \references of osmo_init_ignore_signals() Change-Id: Ib08e15dd5d811662de46a1dfdb676b9a5b66b529 --- M src/application.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/13776/1 diff --git a/src/application.c b/src/application.c index d912eb7..7fd6280 100644 --- a/src/application.c +++ b/src/application.c @@ -89,7 +89,7 @@ log_targets_reopen(); } -/*! Ignore \ref SIGPIPE, \ref SIGALRM, \ref SIGHUP and \ref SIGIO */ +/*! Ignore SIGPIPE, SIGALRM, SIGHUP and SIGIO */ void osmo_init_ignore_signals(void) { /* Signals that by default would terminate */ -- To view, visit https://gerrit.osmocom.org/13776 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib08e15dd5d811662de46a1dfdb676b9a5b66b529 Gerrit-Change-Number: 13776 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 19:24:11 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 24 Apr 2019 19:24:11 +0000 Subject: Change in libosmocore[master]: bitcomp.c: fix missing Doxygen group closing tag Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13777 Change subject: bitcomp.c: fix missing Doxygen group closing tag ...................................................................... bitcomp.c: fix missing Doxygen group closing tag Change-Id: I01f837ac4c8644c0851c77c3f42eb44353cef0d7 --- M src/bitcomp.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/13777/1 diff --git a/src/bitcomp.c b/src/bitcomp.c index d5a9310..6f2fb62 100644 --- a/src/bitcomp.c +++ b/src/bitcomp.c @@ -351,4 +351,4 @@ return -1; } - +/*! @} */ -- To view, visit https://gerrit.osmocom.org/13777 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I01f837ac4c8644c0851c77c3f42eb44353cef0d7 Gerrit-Change-Number: 13777 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 20:01:43 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 24 Apr 2019 20:01:43 +0000 Subject: Change in libosmocore[master]: application.c: drop wrong \references of osmo_init_ignore_signals() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13776 ) Change subject: application.c: drop wrong \references of osmo_init_ignore_signals() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13776 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib08e15dd5d811662de46a1dfdb676b9a5b66b529 Gerrit-Change-Number: 13776 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 20:01:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 20:02:01 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 24 Apr 2019 20:02:01 +0000 Subject: Change in libosmocore[master]: bitcomp.c: fix missing Doxygen group closing tag In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13777 ) Change subject: bitcomp.c: fix missing Doxygen group closing tag ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13777 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I01f837ac4c8644c0851c77c3f42eb44353cef0d7 Gerrit-Change-Number: 13777 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 24 Apr 2019 20:02:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Apr 24 20:44:48 2019 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 24 Apr 2019 20:44:48 +0000 Subject: Change in osmo-bts[master]: osmo-bts-trx: distinguish 11-bit Access Bursts by synch. sequence In-Reply-To: References: Message-ID: Alexander Chemeris has posted comments on this change. ( https://gerrit.osmocom.org/13723 ) Change subject: osmo-bts-trx: distinguish 11-bit Access Bursts by synch. sequence ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/13723/4/src/osmo-bts-trx/scheduler_trx.c File src/osmo-bts-trx/scheduler_trx.c: https://gerrit.osmocom.org/#/c/13723/4/src/osmo-bts-trx/scheduler_trx.c at 750 PS4, Line 750: (synch_seq_ref[i][j] == '1' ? -1 : 1) > In general, I am agree. [?] Just add the 0/1 sequence as a comment. Given that 1/-1 sequence can be produced from a 0/1 sequence with a regexp, I don't see any practical issues with this - comparing 1/-1 to 0/1 sequence is super easy and straightforward, and if you want to see it with your eyes - here it is, in the comment. You can do this but it's ugly: #define b0 1 #define b1 -1 [RACH_SYNCH_SEQ_TS2] = [b1,b1,b1,b0,b1,b1,b1,b1,b0,b0,b1,b0,b0,b1,b1,b1,b0,b1,b0,b1,b0,b1,b1,b0,b0,b0,b0,b0,b1,b1,b0,b1,b1,b0,b1,b1,b1,b0,b1,b1,b1] #undef b0 #undef b1 or (no less ugly): #define O 1 #define I -1 [RACH_SYNCH_SEQ_TS2] = [I,I,I,O,I,I,I,I,O,O,I,O,O,I,I,I,O,I,O,I,O,I,I,O,O,O,O,O,I,I,O,I,I,O,I,I,I,O,I,I,I] #undef O #undef I Just an 1/-1 array and a comment with 0/1 string is the best choice. -- To view, visit https://gerrit.osmocom.org/13723 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibb6d27c6589965c8b59a6d2598a7c43fd860f284 Gerrit-Change-Number: 13723 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 24 Apr 2019 20:44:48 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Thu Apr 25 02:59:30 2019 From: admin at opensuse.org (OBS Notification) Date: Thu, 25 Apr 2019 02:59:30 +0000 Subject: Build failure of network:osmocom:nightly/osmo-iuh in xUbuntu_18.04/i586 In-Reply-To: References: Message-ID: <5cc122a366ce8_436baa05f027854b0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/xUbuntu_18.04/i586 Package network:osmocom:nightly/osmo-iuh failed to build in xUbuntu_18.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-iuh Last lines of build log: [ 680s] make[1]: Entering directory '/usr/src/packages/BUILD' [ 680s] dh_strip --dbg-package=libosmo-ranap-dbg [ 680s] dh_strip --dbg-package=osmo-hnbgw [ 680s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 680s] dh_makeshlibs [ 680s] dh_shlibdeps [ 682s] dh_installdeb [ 682s] dh_gencontrol [ 682s] dh_md5sums [ 682s] dh_builddeb [ 682s] dpkg-deb: building package 'osmo-hnbgw-dbg' in '../osmo-hnbgw-dbg_0.4.0.8.11b1_i386.deb'. [ 682s] dpkg-deb: building package 'libosmo-ranap2' in '../libosmo-ranap2_0.4.0.8.11b1_i386.deb'. [ 682s] dpkg-deb: building package 'libosmo-ranap-dev' in '../libosmo-ranap-dev_0.4.0.8.11b1_i386.deb'. [ 682s] dpkg-deb: building package 'libosmo-ranap-dbg' in '../libosmo-ranap-dbg_0.4.0.8.11b1_i386.deb'. [ 682s] dpkg-deb: building package 'osmo-hnbgw' in '../osmo-hnbgw_0.4.0.8.11b1_i386.deb'. [ 683s] dpkg-genbuildinfo [ 683s] dpkg-genchanges >../osmo-iuh_0.4.0.8.11b1_i386.changes [ 683s] dpkg-genchanges: error: file ../osmo-iuh_0.4.0.8.11b1.tar.xz has checksum b430a7d998ba88b2345fac745bb3e500 instead of expected 37a976a30bb056f138dfabd3d88271dd (algorithm md5) [ 683s] dpkg-buildpackage: error: dpkg-genchanges subprocess returned exit status 25 [ 683s] [ 683s] lamb01 failed "build osmo-iuh_0.4.0.8.11b1.dsc" at Thu Apr 25 02:59:20 UTC 2019. [ 683s] [ 683s] ### VM INTERACTION START ### [ 687s] [ 674.951860] sysrq: SysRq : Power Off [ 687s] [ 674.960761] reboot: Power down [ 687s] ### VM INTERACTION END ### [ 687s] [ 687s] lamb01 failed "build osmo-iuh_0.4.0.8.11b1.dsc" at Thu Apr 25 02:59:24 UTC 2019. [ 687s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Thu Apr 25 04:44:07 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 25 Apr 2019 04:44:07 +0000 Subject: Change in libosmocore[master]: application.c: drop wrong \references of osmo_init_ignore_signals() In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13776 ) Change subject: application.c: drop wrong \references of osmo_init_ignore_signals() ...................................................................... application.c: drop wrong \references of osmo_init_ignore_signals() Change-Id: Ib08e15dd5d811662de46a1dfdb676b9a5b66b529 --- M src/application.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/application.c b/src/application.c index d912eb7..7fd6280 100644 --- a/src/application.c +++ b/src/application.c @@ -89,7 +89,7 @@ log_targets_reopen(); } -/*! Ignore \ref SIGPIPE, \ref SIGALRM, \ref SIGHUP and \ref SIGIO */ +/*! Ignore SIGPIPE, SIGALRM, SIGHUP and SIGIO */ void osmo_init_ignore_signals(void) { /* Signals that by default would terminate */ -- To view, visit https://gerrit.osmocom.org/13776 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib08e15dd5d811662de46a1dfdb676b9a5b66b529 Gerrit-Change-Number: 13776 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 04:44:07 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 25 Apr 2019 04:44:07 +0000 Subject: Change in libosmocore[master]: bitcomp.c: fix missing Doxygen group closing tag In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13777 ) Change subject: bitcomp.c: fix missing Doxygen group closing tag ...................................................................... bitcomp.c: fix missing Doxygen group closing tag Change-Id: I01f837ac4c8644c0851c77c3f42eb44353cef0d7 --- M src/bitcomp.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/bitcomp.c b/src/bitcomp.c index d5a9310..6f2fb62 100644 --- a/src/bitcomp.c +++ b/src/bitcomp.c @@ -351,4 +351,4 @@ return -1; } - +/*! @} */ -- To view, visit https://gerrit.osmocom.org/13777 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I01f837ac4c8644c0851c77c3f42eb44353cef0d7 Gerrit-Change-Number: 13777 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 08:03:30 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Thu, 25 Apr 2019 08:03:30 +0000 Subject: Change in openbsc[master]: osmo-bsc_nat: Parse MGCP Connection ID as hex Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13778 Change subject: osmo-bsc_nat: Parse MGCP Connection ID as hex ...................................................................... osmo-bsc_nat: Parse MGCP Connection ID as hex Our ttcn3-bscnat-tests would randomly fail. After the CRCX ACK returns from the MSC the bsc-nat reports it could not find a CI it it and deletes the connection on the BSC-side. This happens because the field is parsed as a decimal value instead of hexadecimal. So a value of 00FED122 is parsed as '0' which is a reserved value in our program. This fix parses the field as hexadecimal value and also logs an error if the value happens to be 0. make check will now test if a hexadecimal CI is parsed correctly. Fixes: OS#3951 Change-Id: I49b8b61644bf706162102dce268cae2265536fc5 --- M openbsc/src/libmgcp/mgcp_protocol.c M openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c M openbsc/tests/bsc-nat/bsc_data.c M openbsc/tests/bsc-nat/bsc_nat_test.c 4 files changed, 11 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/78/13778/1 diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c index 84dbc1f..689c91f 100644 --- a/openbsc/src/libmgcp/mgcp_protocol.c +++ b/openbsc/src/libmgcp/mgcp_protocol.c @@ -208,7 +208,7 @@ len = snprintf(sdp_record, size, "v=0\r\n" - "o=- %u 23 IN IP4 %s\r\n" + "o=- %x 23 IN IP4 %s\r\n" "s=-\r\n" "c=IN IP4 %s\r\n" "t=0 0\r\n", @@ -285,7 +285,7 @@ } len = snprintf(sdp_record, sizeof(sdp_record), - "I: %u%s\n\n", endp->ci, osmux_extension); + "I: %x%s\n\n", endp->ci, osmux_extension); if (len < 0) return NULL; @@ -512,7 +512,7 @@ uint32_t ci = strtoul(_ci, NULL, 10); if (ci != endp->ci) { - LOGP(DMGCP, LOGL_ERROR, "ConnectionIdentifiers do not match on 0x%x. %u != %s\n", + LOGP(DMGCP, LOGL_ERROR, "ConnectionIdentifiers do not match on 0x%x. %x != %x\n", ENDPOINT_NUMBER(endp), endp->ci, _ci); return -1; } @@ -891,7 +891,7 @@ osmo_jibuf_set_dequeue_cb(endp->bts_jb, mgcp_dejitter_udp_send, &endp->net_end); } - LOGP(DMGCP, LOGL_DEBUG, "Creating endpoint on: 0x%x CI: %u port: %u/%u\n", + LOGP(DMGCP, LOGL_DEBUG, "Creating endpoint on: 0x%x CI: %x port: %u/%u\n", ENDPOINT_NUMBER(endp), endp->ci, endp->net_end.local_port, endp->bts_end.local_port); if (p->cfg->change_cb) diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c index 311ab94..17dc659 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -812,11 +812,14 @@ return CI_UNUSED; } - if (sscanf(res, "I: %u", &ci) != 1) { + if (sscanf(res, "I: %x", &ci) != 1) { LOGP(DMGCP, LOGL_ERROR, "Failed to parse CI in msg '%s'\n", str); return CI_UNUSED; } + if (ci == CI_UNUSED) + LOGP(DMGCP, LOGL_ERROR, "CI field '%s' parsed as reserved value CI_UNUSED\n", str); + return ci; } diff --git a/openbsc/tests/bsc-nat/bsc_data.c b/openbsc/tests/bsc-nat/bsc_data.c index 71d5391..d29caef 100644 --- a/openbsc/tests/bsc-nat/bsc_data.c +++ b/openbsc/tests/bsc-nat/bsc_data.c @@ -157,8 +157,8 @@ /* patch the ip and port */ -static const char crcx_resp[] = "200 23265295\r\nI: 1\r\n\r\nv=0\r\nc=IN IP4 172.16.18.2\r\nm=audio 4002 RTP/AVP 98 3\r\na=rtpmap:98 AMR/8000\r\n"; -static const char crcx_resp_patched[] = "200 23265295\r\nI: 1\r\n\r\nv=0\r\nc=IN IP4 10.0.0.1\r\nm=audio 999 RTP/AVP 98 3\r\na=rtpmap:98 AMR/8000\r\na=fmtp:98 mode-set=2 octet-align=1\r\n"; +static const char crcx_resp[] = "200 23265295\r\nI: 0F\r\n\r\nv=0\r\nc=IN IP4 172.16.18.2\r\nm=audio 4002 RTP/AVP 98 3\r\na=rtpmap:98 AMR/8000\r\n"; +static const char crcx_resp_patched[] = "200 23265295\r\nI: 0F\r\n\r\nv=0\r\nc=IN IP4 10.0.0.1\r\nm=audio 999 RTP/AVP 98 3\r\na=rtpmap:98 AMR/8000\r\na=fmtp:98 mode-set=2 octet-align=1\r\n"; /* patch the ip and port */ static const char mdcx[] = "MDCX 23330829 8 at mgw MGCP 1.0\r\nC: 394b0439fb\r\nI: 1\r\nL: p:20, a:AMR, nt:IN\r\nM: recvonly\r\n\r\nv=0\r\no=- 1049380491 0 IN IP4 172.16.18.2\r\ns=-\r\nc=IN IP4 172.16.18.2\r\nt=0 0\r\nm=audio 4410 RTP/AVP 126\r\na=rtpmap:126 AMR/8000/1\r\na=fmtp:126 mode-set=2 octet-align=1;start-mode=0\r\na=ptime:20\r\na=recvonly\r\nm=image 4412 udptl t38\r\na=T38FaxVersion:0\r\na=T38MaxBitRate:14400\r\n"; diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c index 2914a01..e0d0051 100644 --- a/openbsc/tests/bsc-nat/bsc_nat_test.c +++ b/openbsc/tests/bsc-nat/bsc_nat_test.c @@ -683,7 +683,7 @@ } ci = bsc_mgcp_extract_ci(crcx_resp); - if (ci != 1) { + if (ci != 0x0F) { printf("Failed to parse the CI. Got: %d\n", ci); abort(); } -- To view, visit https://gerrit.osmocom.org/13778 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I49b8b61644bf706162102dce268cae2265536fc5 Gerrit-Change-Number: 13778 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 08:34:11 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 25 Apr 2019 08:34:11 +0000 Subject: Change in openbsc[master]: osmo-bsc_nat: Parse MGCP Connection ID as hex In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/13778 ) Change subject: osmo-bsc_nat: Parse MGCP Connection ID as hex ...................................................................... Patch Set 1: Code-Review+2 > Build Successful > > https://jenkins.osmocom.org/jenkins/job/gerrit-openbsc/210/ : > SUCCESS' --verified 1 --code-review 0 -- To view, visit https://gerrit.osmocom.org/13778 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I49b8b61644bf706162102dce268cae2265536fc5 Gerrit-Change-Number: 13778 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 25 Apr 2019 08:34:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 12:01:26 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Thu, 25 Apr 2019 12:01:26 +0000 Subject: Change in docker-playground[master]: Add OSMO_*_BRANCH environment variables for build args Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13779 Change subject: Add OSMO_*_BRANCH environment variables for build args ...................................................................... Add OSMO_*_BRANCH environment variables for build args Previously we could only set OSMO_TTCN3_BRANCH as environment variable to build a test other than master. This patch adds environment variables for all osmo-*-master images which allow docker tests to be executed for an arbitrary commit. The origin/ prefix from the git checkout command is removed so the *_BRANCH variable doesn't have to contain branch names, but van also contain arbitrary commits. This shouldn't have any adverse effect as we only have one remote in the checkout. Change-Id: If3bc5fae07cf63c4fef68306be4c4328660bc869 --- M make/Makefile M osmo-bsc-master/Dockerfile M osmo-bts-master/Dockerfile M osmo-ggsn-master/Dockerfile M osmo-hlr-master/Dockerfile M osmo-hnbgw-master/Dockerfile M osmo-mgw-master/Dockerfile M osmo-msc-master/Dockerfile M osmo-nitb-master/Dockerfile M osmo-pcu-master/Dockerfile M osmo-sgsn-master/Dockerfile M osmo-sip-master/Dockerfile M osmo-stp-master/Dockerfile 13 files changed, 40 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/79/13779/1 diff --git a/make/Makefile b/make/Makefile index 7dfa795..000db25 100644 --- a/make/Makefile +++ b/make/Makefile @@ -17,6 +17,18 @@ USERNAME?=$(USER) NAME?=$(shell basename $(CURDIR)) OSMO_TTCN3_BRANCH?=master +OSMO_BSC_BRANCH?=master +OSMO_BTS_BRANCH?=master +OSMO_GGSN_BRANCH?=master +OSMO_HLR_BRANCH?=master +OSMO_IUH_BRANCH?=master +OSMO_MGW_BRANCH?=master +OSMO_MSC_BRANCH?=master +OSMO_NITB_BRANCH?=master +OSMO_PCU_BRANCH?=master +OSMO_SGSN_BRANCH?=master +OSMO_SIP_BRANCH?=master +OSMO_STP_BRANCH?=master PULL?= RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support @@ -42,6 +54,18 @@ docker-build: .release docker build --build-arg USER=$(USERNAME) --build-arg OSMO_TTCN3_BRANCH=$(OSMO_TTCN3_BRANCH) \ + --build-arg OSMO_BSC_BRANCH=$(OSMO_BSC_BRANCH) \ + --build-arg OSMO_BTS_BRANCH=$(OSMO_BTS_BRANCH) \ + --build-arg OSMO_GGSN_BRANCH=$(OSMO_GGSN_BRANCH) \ + --build-arg OSMO_HLR_BRANCH=$(OSMO_HLR_BRANCH) \ + --build-arg OSMO_IUH_BRANCH=$(OSMO_IUH_BRANCH) \ + --build-arg OSMO_MGW_BRANCH=$(OSMO_MGW_BRANCH) \ + --build-arg OSMO_MSC_BRANCH=$(OSMO_MSC_BRANCH) \ + --build-arg OSMO_NITB_BRANCH=$(OSMO_NITB_BRANCH) \ + --build-arg OSMO_PCU_BRANCH=$(OSMO_PCU_BRANCH) \ + --build-arg OSMO_SGSN_BRANCH=$(OSMO_SGSN_BRANCH) \ + --build-arg OSMO_SIP_BRANCH=$(OSMO_SIP_BRANCH) \ + --build-arg OSMO_STP_BRANCH=$(OSMO_STP_BRANCH) \ $(PULL) -t $(IMAGE):latest . @DOCKER_MAJOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f1) ; \ DOCKER_MINOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f2) ; \ diff --git a/osmo-bsc-master/Dockerfile b/osmo-bsc-master/Dockerfile index 61ac8e4..bcd0573 100644 --- a/osmo-bsc-master/Dockerfile +++ b/osmo-bsc-master/Dockerfile @@ -32,7 +32,7 @@ ADD http://git.osmocom.org/osmo-bsc/patch?h=$OSMO_BSC_BRANCH /tmp/commit-osmo-bsc RUN cd osmo-bsc && \ - git fetch && git checkout -f -B $OSMO_BSC_BRANCH origin/$OSMO_BSC_BRANCH && \ + git fetch && git checkout -f -B $OSMO_BSC_BRANCH $OSMO_BSC_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-bts-master/Dockerfile b/osmo-bts-master/Dockerfile index be58081..f4ddf3a 100644 --- a/osmo-bts-master/Dockerfile +++ b/osmo-bts-master/Dockerfile @@ -33,7 +33,7 @@ ADD http://git.osmocom.org/osmo-bts/patch?h=$OSMO_BTS_BRANCH /tmp/commit-osmo-bts RUN cd osmo-bts && \ - git fetch && git checkout -f -B $OSMO_BTS_BRANCH origin/$OSMO_BTS_BRANCH && \ + git fetch && git checkout -f -B $OSMO_BTS_BRANCH $OSMO_BTS_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-trx && \ diff --git a/osmo-ggsn-master/Dockerfile b/osmo-ggsn-master/Dockerfile index ca4f111..cf84d02 100644 --- a/osmo-ggsn-master/Dockerfile +++ b/osmo-ggsn-master/Dockerfile @@ -25,7 +25,7 @@ RUN git clone git://git.osmocom.org/osmo-ggsn.git ADD http://git.osmocom.org/osmo-ggsn/patch/?h=$OSMO_GGSN_BRANCH /tmp/commit RUN cd osmo-ggsn && \ - git fetch && git checkout -f -B $OSMO_GGSN_BRANCH origin/$OSMO_GGSN_BRANCH && \ + git fetch && git checkout -f -B $OSMO_GGSN_BRANCH $OSMO_GGSN_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-hlr-master/Dockerfile b/osmo-hlr-master/Dockerfile index 75f29d9..2da7c08 100644 --- a/osmo-hlr-master/Dockerfile +++ b/osmo-hlr-master/Dockerfile @@ -30,7 +30,7 @@ ADD http://git.osmocom.org/osmo-hlr/patch?h=$OSMO_HLR_BRANCH /tmp/commit-osmo-hlr RUN cd osmo-hlr && \ - git fetch && git checkout -f -B $OSMO_HLR_BRANCH origin/$OSMO_HLR_BRANCH && \ + git fetch && git checkout -f -B $OSMO_HLR_BRANCH $OSMO_HLR_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-hnbgw-master/Dockerfile b/osmo-hnbgw-master/Dockerfile index 4334e4f..c89502b 100644 --- a/osmo-hnbgw-master/Dockerfile +++ b/osmo-hnbgw-master/Dockerfile @@ -30,7 +30,7 @@ ADD http://git.osmocom.org/osmo-iuh/patch?h=$OSMO_IUH_BRANCH /tmp/commit-osmo-mgw RUN cd osmo-iuh && \ - git fetch && git checkout -f -B $OSMO_IUH_BRANCH origin/$OSMO_IUH_BRANCH && \ + git fetch && git checkout -f -B $OSMO_IUH_BRANCH $OSMO_IUH_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-mgw-master/Dockerfile b/osmo-mgw-master/Dockerfile index c333b1d..4c6d32a 100644 --- a/osmo-mgw-master/Dockerfile +++ b/osmo-mgw-master/Dockerfile @@ -30,7 +30,7 @@ RUN cd osmo-mgw && \ - git fetch && git checkout -f -B $OSMO_MGW_BRANCH origin/$OSMO_MGW_BRANCH && \ + git fetch && git checkout -f -B $OSMO_MGW_BRANCH $OSMO_MGW_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-msc-master/Dockerfile b/osmo-msc-master/Dockerfile index 49be9c8..c8cfd62 100644 --- a/osmo-msc-master/Dockerfile +++ b/osmo-msc-master/Dockerfile @@ -37,7 +37,7 @@ ADD http://git.osmocom.org/osmo-msc/patch?h=$OSMO_MSC_BRANCH /tmp/commit-osmo-msc RUN cd osmo-msc && \ - git fetch && git checkout -f -B $OSMO_MSC_BRANCH origin/$OSMO_MSC_BRANCH && \ + git fetch && git checkout -f -B $OSMO_MSC_BRANCH $OSMO_MSC_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-smpp --enable-iu && \ diff --git a/osmo-nitb-master/Dockerfile b/osmo-nitb-master/Dockerfile index bed228e..d3774da 100644 --- a/osmo-nitb-master/Dockerfile +++ b/osmo-nitb-master/Dockerfile @@ -25,11 +25,14 @@ WORKDIR /tmp +ARG OSMO_NITB_BRANCH="master" + RUN git clone git://git.osmocom.org/openbsc.git -ADD http://git.osmocom.org/openbsc/patch /tmp/commit-openbsc +ADD http://git.osmocom.org/openbsc/patch?h=$OSMO_NITB_BRANCH /tmp/commit-openbsc RUN cd openbsc/openbsc && \ - git fetch && git checkout -f -B master origin/master && \ + git fetch && git checkout -f -B $OSMO_NITB_BRANCH $OSMO_NITB_BRANCH && \ + git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-nat --enable-osmo-bsc --enable-smpp && \ make -j8 install && \ diff --git a/osmo-pcu-master/Dockerfile b/osmo-pcu-master/Dockerfile index e33748a..7a294a4 100644 --- a/osmo-pcu-master/Dockerfile +++ b/osmo-pcu-master/Dockerfile @@ -28,7 +28,7 @@ ADD http://git.osmocom.org/osmo-pcu/patch?h=$OSMO_PCU_BRANCH /tmp/commit-osmo-pcu RUN cd osmo-pcu && \ - git fetch && git checkout -f -B $OSMO_PCU_BRANCH origin/$OSMO_PCU_BRANCH && \ + git fetch && git checkout -f -B $OSMO_PCU_BRANCH $OSMO_PCU_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-trx && \ diff --git a/osmo-sgsn-master/Dockerfile b/osmo-sgsn-master/Dockerfile index 87513cc..c373564 100644 --- a/osmo-sgsn-master/Dockerfile +++ b/osmo-sgsn-master/Dockerfile @@ -32,7 +32,7 @@ ADD http://git.osmocom.org/osmo-sgsn/patch?h=$OSMO_SGSN_BRANCH /tmp/commit RUN cd osmo-sgsn && \ - git fetch && git checkout -f -B $OSMO_SGSN_BRANCH origin/$OSMO_SGSN_BRANCH && \ + git fetch && git checkout -f -B $OSMO_SGSN_BRANCH $OSMO_SGSN_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-sip-master/Dockerfile b/osmo-sip-master/Dockerfile index 5854221..258b1fe 100644 --- a/osmo-sip-master/Dockerfile +++ b/osmo-sip-master/Dockerfile @@ -36,7 +36,7 @@ ADD http://git.osmocom.org/osmo-sip-connector/patch?h=$OSMO_SIP_BRANCH /tmp/commit-osmo-sip-connector RUN cd osmo-sip-connector && \ - git fetch && git checkout -f -B $OSMO_SIP_BRANCH origin/$OSMO_SIP_BRANCH && \ + git fetch && git checkout -f -B $OSMO_SIP_BRANCH $OSMO_SIP_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-smpp --enable-iu && \ diff --git a/osmo-stp-master/Dockerfile b/osmo-stp-master/Dockerfile index 7c59fb0..0a62ed7 100644 --- a/osmo-stp-master/Dockerfile +++ b/osmo-stp-master/Dockerfile @@ -26,7 +26,7 @@ RUN git clone git://git.osmocom.org/libosmo-sccp.git ADD http://git.osmocom.org/libosmo-sccp/patch?h=$OSMO_STP_BRANCH /tmp/commit RUN cd libosmo-sccp && \ - git fetch && git checkout -f -B $OSMO_STP_BRANCH origin/$OSMO_STP_BRANCH && \ + git fetch && git checkout -f -B $OSMO_STP_BRANCH $OSMO_STP_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ -- To view, visit https://gerrit.osmocom.org/13779 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If3bc5fae07cf63c4fef68306be4c4328660bc869 Gerrit-Change-Number: 13779 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 14:08:30 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Thu, 25 Apr 2019 14:08:30 +0000 Subject: Change in osmo-ccid-firmware[master]: output 50 MHz for RMII Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13780 Change subject: output 50 MHz for RMII ...................................................................... output 50 MHz for RMII in hardware revision 2 the Ethernet PHY RMII_CLOCK input clock is connected to the MCU pin PA10. GCLK4 of the MCU now outputs the required 50 MHz clock on this pin. the same clock is re-used for UART debug to generate the 921600 bps baud rate. Change-Id: Id3a3dee15c3986536b0623d0f39ca62e94acd1fd --- M sysmoOCTSIM/atmel_start_config.atstart M sysmoOCTSIM/atmel_start_pins.h M sysmoOCTSIM/config/hpl_gclk_config.h M sysmoOCTSIM/config/peripheral_clk_config.h M sysmoOCTSIM/driver_init.c 5 files changed, 63 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/80/13780/1 diff --git a/sysmoOCTSIM/atmel_start_config.atstart b/sysmoOCTSIM/atmel_start_config.atstart index 4fda2f8..6357a74 100644 --- a/sysmoOCTSIM/atmel_start_config.atstart +++ b/sysmoOCTSIM/atmel_start_config.atstart @@ -702,7 +702,7 @@ gclk_arch_gen_3_runstdby: false gclk_arch_gen_4_enable: true gclk_arch_gen_4_idc: false - gclk_arch_gen_4_oe: false + gclk_arch_gen_4_oe: true gclk_arch_gen_4_oov: false gclk_arch_gen_4_runstdby: false gclk_arch_gen_5_enable: true @@ -748,7 +748,7 @@ gclk_gen_3_div: 1 gclk_gen_3_div_sel: false gclk_gen_3_oscillator: 32kHz External Crystal Oscillator (XOSC32K) - gclk_gen_4_div: 1 + gclk_gen_4_div: 2 gclk_gen_4_div_sel: false gclk_gen_4_oscillator: Digital Phase Locked Loop (DPLL1) gclk_gen_5_div: 5 @@ -1462,6 +1462,16 @@ mode: Peripheral IO user_label: SIM2_IO configuration: null + RMII_CLOCK: + name: PA10 + definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PA10 + mode: Advanced + user_label: RMII_CLOCK + configuration: + pad_direction: Out + pad_function: M + pad_initial_level: Low + pad_pull_config: 'Off' SIMCLK_20MHZ: name: PA11 definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PA11 diff --git a/sysmoOCTSIM/atmel_start_pins.h b/sysmoOCTSIM/atmel_start_pins.h index 0264736..7cbaed5 100644 --- a/sysmoOCTSIM/atmel_start_pins.h +++ b/sysmoOCTSIM/atmel_start_pins.h @@ -31,6 +31,7 @@ #define SIM5_INT GPIO(GPIO_PORTA, 3) #define SIM0_IO GPIO(GPIO_PORTA, 4) #define SIM2_IO GPIO(GPIO_PORTA, 9) +#define RMII_CLOCK GPIO(GPIO_PORTA, 10) #define SIMCLK_20MHZ GPIO(GPIO_PORTA, 11) #define SIM1_IO GPIO(GPIO_PORTA, 16) #define VB0 GPIO(GPIO_PORTA, 20) diff --git a/sysmoOCTSIM/config/hpl_gclk_config.h b/sysmoOCTSIM/config/hpl_gclk_config.h index 71c26e1..81a1f03 100644 --- a/sysmoOCTSIM/config/hpl_gclk_config.h +++ b/sysmoOCTSIM/config/hpl_gclk_config.h @@ -349,7 +349,7 @@ // Indicates whether Output Enable is enabled or not // gclk_arch_gen_4_oe #ifndef CONF_GCLK_GEN_4_OE -#define CONF_GCLK_GEN_4_OE 0 +#define CONF_GCLK_GEN_4_OE 1 #endif // Output Off Value @@ -378,7 +378,7 @@ // Generic clock generator 4 division <0x0000-0xFFFF> // gclk_gen_4_div #ifndef CONF_GCLK_GEN_4_DIV -#define CONF_GCLK_GEN_4_DIV 1 +#define CONF_GCLK_GEN_4_DIV 2 #endif // // diff --git a/sysmoOCTSIM/config/peripheral_clk_config.h b/sysmoOCTSIM/config/peripheral_clk_config.h index 4bff6ff..2ae1f63 100644 --- a/sysmoOCTSIM/config/peripheral_clk_config.h +++ b/sysmoOCTSIM/config/peripheral_clk_config.h @@ -641,7 +641,7 @@ * \brief SERCOM7's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM7_CORE_FREQUENCY -#define CONF_GCLK_SERCOM7_CORE_FREQUENCY 100000000 +#define CONF_GCLK_SERCOM7_CORE_FREQUENCY 50000000 #endif /** diff --git a/sysmoOCTSIM/driver_init.c b/sysmoOCTSIM/driver_init.c index 0b6b190..1233d02 100644 --- a/sysmoOCTSIM/driver_init.c +++ b/sysmoOCTSIM/driver_init.c @@ -503,6 +503,53 @@ gpio_set_pin_function(SIM5_INT, GPIO_PIN_FUNCTION_OFF); + // GPIO on PA10 + + gpio_set_pin_direction(RMII_CLOCK, + // Pin direction + // pad_direction + // Off + // In + // Out + GPIO_DIRECTION_OUT); + + gpio_set_pin_level(RMII_CLOCK, + // Initial level + // pad_initial_level + // Low + // High + false); + + gpio_set_pin_pull_mode(RMII_CLOCK, + // Pull configuration + // pad_pull_config + // Off + // Pull-up + // Pull-down + GPIO_PULL_OFF); + + gpio_set_pin_function(RMII_CLOCK, + // Pin function + // pad_function + // Auto : use driver pinmux if signal is imported by driver, else turn off function + // Auto + // Off + // A + // B + // C + // D + // E + // F + // G + // H + // I + // J + // K + // L + // M + // N + GPIO_PIN_FUNCTION_M); + // GPIO on PA11 gpio_set_pin_direction(SIMCLK_20MHZ, -- To view, visit https://gerrit.osmocom.org/13780 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id3a3dee15c3986536b0623d0f39ca62e94acd1fd Gerrit-Change-Number: 13780 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 14:08:31 2019 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Thu, 25 Apr 2019 14:08:31 +0000 Subject: Change in osmo-ccid-firmware[master]: configure GCLK for ISO baud rates Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/13781 Change subject: configure GCLK for ISO baud rates ...................................................................... configure GCLK for ISO baud rates the SERCOMM clock triplet 0.5 MHz (100 MHz / 200), 7.0588 MHz (120 MHz / 17), and 50 MHz (100 MHz / 2) allows to generate all possible ISO 7816 baud rates (from F = 2048 / D = 1 @ f = 2.5 MHz -> 1220 bps to F = 372 / D = 64 @ f = 20 MHz -> 3.4 Mbps) with a maximum baud rate error of 2.57 %, for available SIM clocks 2.5, 5, 10, 20 MHz. 2.57% means a bit more than quarter a bit might be wrong after the 11 bits ISO transmission (still less than half a bit). This triplet is one of the optimum when 3 clocks are used. An additional clock would be required for higher accuracy. The 50 MHz clock is re-used from the RMII clock output. Change-Id: I2c69848582e49031fa6453f535a2bf1408f8e22e --- M sysmoOCTSIM/atmel_start_config.atstart M sysmoOCTSIM/config/hpl_gclk_config.h M sysmoOCTSIM/config/peripheral_clk_config.h 3 files changed, 17 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/81/13781/1 diff --git a/sysmoOCTSIM/atmel_start_config.atstart b/sysmoOCTSIM/atmel_start_config.atstart index 6357a74..3854fb5 100644 --- a/sysmoOCTSIM/atmel_start_config.atstart +++ b/sysmoOCTSIM/atmel_start_config.atstart @@ -666,7 +666,7 @@ enable_gclk_gen_3: true enable_gclk_gen_4: true enable_gclk_gen_5: true - enable_gclk_gen_6: false + enable_gclk_gen_6: true enable_gclk_gen_7: false enable_gclk_gen_8: false enable_gclk_gen_9: false @@ -710,7 +710,7 @@ gclk_arch_gen_5_oe: true gclk_arch_gen_5_oov: false gclk_arch_gen_5_runstdby: false - gclk_arch_gen_6_enable: false + gclk_arch_gen_6_enable: true gclk_arch_gen_6_idc: false gclk_arch_gen_6_oe: false gclk_arch_gen_6_oov: false @@ -742,7 +742,7 @@ gclk_gen_1_div: 1 gclk_gen_1_div_sel: false gclk_gen_1_oscillator: Digital Frequency Locked Loop (DFLL48M) - gclk_gen_2_div: 30 + gclk_gen_2_div: 200 gclk_gen_2_div_sel: false gclk_gen_2_oscillator: Digital Phase Locked Loop (DPLL1) gclk_gen_3_div: 1 @@ -754,9 +754,9 @@ gclk_gen_5_div: 5 gclk_gen_5_div_sel: false gclk_gen_5_oscillator: Digital Phase Locked Loop (DPLL1) - gclk_gen_6_div: 1 + gclk_gen_6_div: 17 gclk_gen_6_div_sel: false - gclk_gen_6_oscillator: External Crystal Oscillator 8-48MHz (XOSC1) + gclk_gen_6_oscillator: Digital Phase Locked Loop (DPLL0) gclk_gen_7_div: 1 gclk_gen_7_div_sel: false gclk_gen_7_oscillator: External Crystal Oscillator 8-48MHz (XOSC1) diff --git a/sysmoOCTSIM/config/hpl_gclk_config.h b/sysmoOCTSIM/config/hpl_gclk_config.h index 81a1f03..158fc93 100644 --- a/sysmoOCTSIM/config/hpl_gclk_config.h +++ b/sysmoOCTSIM/config/hpl_gclk_config.h @@ -226,7 +226,7 @@ // Generic clock generator 2 division <0x0000-0xFFFF> // gclk_gen_2_div #ifndef CONF_GCLK_GEN_2_DIV -#define CONF_GCLK_GEN_2_DIV 30 +#define CONF_GCLK_GEN_2_DIV 200 #endif // // @@ -463,7 +463,7 @@ // Indicates whether generic clock 6 configuration is enabled or not // enable_gclk_gen_6 #ifndef CONF_GCLK_GENERATOR_6_CONFIG -#define CONF_GCLK_GENERATOR_6_CONFIG 0 +#define CONF_GCLK_GENERATOR_6_CONFIG 1 #endif // Generic Clock Generator Control @@ -480,7 +480,7 @@ // This defines the clock source for generic clock generator 6 // gclk_gen_6_oscillator #ifndef CONF_GCLK_GEN_6_SOURCE -#define CONF_GCLK_GEN_6_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#define CONF_GCLK_GEN_6_SOURCE GCLK_GENCTRL_SRC_DPLL0 #endif // Run in Standby @@ -522,7 +522,7 @@ // Indicates whether Generic Clock Generator Enable is enabled or not // gclk_arch_gen_6_enable #ifndef CONF_GCLK_GEN_6_GENEN -#define CONF_GCLK_GEN_6_GENEN 0 +#define CONF_GCLK_GEN_6_GENEN 1 #endif // @@ -530,7 +530,7 @@ // Generic clock generator 6 division <0x0000-0xFFFF> // gclk_gen_6_div #ifndef CONF_GCLK_GEN_6_DIV -#define CONF_GCLK_GEN_6_DIV 1 +#define CONF_GCLK_GEN_6_DIV 17 #endif // // diff --git a/sysmoOCTSIM/config/peripheral_clk_config.h b/sysmoOCTSIM/config/peripheral_clk_config.h index 2ae1f63..f794792 100644 --- a/sysmoOCTSIM/config/peripheral_clk_config.h +++ b/sysmoOCTSIM/config/peripheral_clk_config.h @@ -81,7 +81,7 @@ * \brief SERCOM0's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM0_CORE_FREQUENCY -#define CONF_GCLK_SERCOM0_CORE_FREQUENCY 3333333 +#define CONF_GCLK_SERCOM0_CORE_FREQUENCY 500000 #endif /** @@ -161,7 +161,7 @@ * \brief SERCOM1's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM1_CORE_FREQUENCY -#define CONF_GCLK_SERCOM1_CORE_FREQUENCY 3333333 +#define CONF_GCLK_SERCOM1_CORE_FREQUENCY 500000 #endif /** @@ -241,7 +241,7 @@ * \brief SERCOM2's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM2_CORE_FREQUENCY -#define CONF_GCLK_SERCOM2_CORE_FREQUENCY 3333333 +#define CONF_GCLK_SERCOM2_CORE_FREQUENCY 500000 #endif /** @@ -321,7 +321,7 @@ * \brief SERCOM3's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM3_CORE_FREQUENCY -#define CONF_GCLK_SERCOM3_CORE_FREQUENCY 3333333 +#define CONF_GCLK_SERCOM3_CORE_FREQUENCY 500000 #endif /** @@ -401,7 +401,7 @@ * \brief SERCOM4's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM4_CORE_FREQUENCY -#define CONF_GCLK_SERCOM4_CORE_FREQUENCY 3333333 +#define CONF_GCLK_SERCOM4_CORE_FREQUENCY 500000 #endif /** @@ -481,7 +481,7 @@ * \brief SERCOM5's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM5_CORE_FREQUENCY -#define CONF_GCLK_SERCOM5_CORE_FREQUENCY 3333333 +#define CONF_GCLK_SERCOM5_CORE_FREQUENCY 500000 #endif /** @@ -561,7 +561,7 @@ * \brief SERCOM6's Core Clock frequency */ #ifndef CONF_GCLK_SERCOM6_CORE_FREQUENCY -#define CONF_GCLK_SERCOM6_CORE_FREQUENCY 3333333 +#define CONF_GCLK_SERCOM6_CORE_FREQUENCY 500000 #endif /** -- To view, visit https://gerrit.osmocom.org/13781 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2c69848582e49031fa6453f535a2bf1408f8e22e Gerrit-Change-Number: 13781 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 16:59:49 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Thu, 25 Apr 2019 16:59:49 +0000 Subject: Change in docker-playground[master]: Add OSMO_*_BRANCH environment variables for build args In-Reply-To: References: Message-ID: Daniel Willmann has removed Harald Welte from this change. ( https://gerrit.osmocom.org/13779 ) Change subject: Add OSMO_*_BRANCH environment variables for build args ...................................................................... Removed reviewer Harald Welte. -- To view, visit https://gerrit.osmocom.org/13779 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: deleteReviewer Gerrit-Change-Id: If3bc5fae07cf63c4fef68306be4c4328660bc869 Gerrit-Change-Number: 13779 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 17:02:28 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Thu, 25 Apr 2019 17:02:28 +0000 Subject: Change in docker-playground[master]: Add OSMO_*_BRANCH environment variables for build args In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13779 ) Change subject: Add OSMO_*_BRANCH environment variables for build args ...................................................................... Patch Set 1: Verified+1 I didn't run all the tests, but ttcn3-bsc-test and ttcn3-msc-test ran successfully on my machine. -- To view, visit https://gerrit.osmocom.org/13779 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If3bc5fae07cf63c4fef68306be4c4328660bc869 Gerrit-Change-Number: 13779 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Thu, 25 Apr 2019 17:02:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:22:41 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 25 Apr 2019 19:22:41 +0000 Subject: Change in osmo-msc[master]: configure.ac: drop useless SQLite3 dependency In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13639 ) Change subject: configure.ac: drop useless SQLite3 dependency ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13639 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibf4eb53e60a2957eca99a2c8e613f75a8c43ac89 Gerrit-Change-Number: 13639 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 25 Apr 2019 19:22:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:22:46 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 25 Apr 2019 19:22:46 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: print info about database name and libdbi version In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13641 ) Change subject: libmsc/db.c: print info about database name and libdbi version ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13641 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaed452548eb2d847738b78d3489bf6f507a2e3c1 Gerrit-Change-Number: 13641 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 25 Apr 2019 19:22:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:33:37 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 25 Apr 2019 19:33:37 +0000 Subject: Change in osmo-msc[master]: configure.ac: drop useless SQLite3 dependency In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13639 ) Change subject: configure.ac: drop useless SQLite3 dependency ...................................................................... configure.ac: drop useless SQLite3 dependency We don't use SQLite3 directly, we use libdbi and libdbdsqlite3. Change-Id: Ibf4eb53e60a2957eca99a2c8e613f75a8c43ac89 --- M configure.ac M src/utils/Makefile.am 2 files changed, 0 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Vadim Yanitskiy: Looks good to me, approved diff --git a/configure.ac b/configure.ac index e500375..8ab6021 100644 --- a/configure.ac +++ b/configure.ac @@ -112,11 +112,6 @@ AC_HEADER_STDC AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed)) -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 AX_CHECK_COMPILE_FLAG([-Werror=implicit], [CFLAGS="$CFLAGS -Werror=implicit"]) diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 2d67102..cb0faf6 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -10,7 +10,6 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(COVERAGE_CFLAGS) \ - $(SQLITE3_CFLAGS) \ $(LIBSMPP34_CFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/13639 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ibf4eb53e60a2957eca99a2c8e613f75a8c43ac89 Gerrit-Change-Number: 13639 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:33:37 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 25 Apr 2019 19:33:37 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: print info about database name and libdbi version In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13641 ) Change subject: libmsc/db.c: print info about database name and libdbi version ...................................................................... libmsc/db.c: print info about database name and libdbi version Change-Id: Iaed452548eb2d847738b78d3489bf6f507a2e3c1 --- M src/libmsc/db.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Vadim Yanitskiy: Looks good to me, approved diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 0384320..a9aaf94 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -615,6 +615,9 @@ { dbi_initialize_r(NULL, &inst); + LOGP(DDB, LOGL_NOTICE, "Init database connection to '%s' using %s\n", + name, dbi_version()); + conn = dbi_conn_new_r("sqlite3", inst); if (conn == NULL) { LOGP(DDB, LOGL_FATAL, "Failed to create database connection to sqlite3 db '%s'; " -- To view, visit https://gerrit.osmocom.org/13641 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iaed452548eb2d847738b78d3489bf6f507a2e3c1 Gerrit-Change-Number: 13641 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:49:00 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 25 Apr 2019 19:49:00 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... Patch Set 6: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/13744/6/src/gprs/gprs_gmm.c File src/gprs/gprs_gmm.c: https://gerrit.osmocom.org/#/c/13744/6/src/gprs/gprs_gmm.c at 1935 PS6, Line 1935: reject_cause = GMM_CAUSE_NO_PDP_ACTIVATED; If you sent the GMM_CAUSE_NO_PDP_ACTIVATED: You have to disable all PDP Context active on the SGSN side _without_ communicating with the MS. This means the SGSN must talk to the GGSN to disable the PDP Contexts and remove also the internal state of all active PDP Contexts. The MS will invalidate all PDP Contexts when receiving this cause code. There is also another solution, you could try to do the RAB asignment and if there are missing RAB, accept the service request and attach a GMM_PDP_CTX_STATUS IE to it. The MS will use this Status and discard all non-listed PDP Contexts. Now the MS & SGSN is in sync again. -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 6 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Thu, 25 Apr 2019 19:49:00 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:50:20 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 19:50:20 +0000 Subject: Change in osmo-ccid-firmware[master]: output 50 MHz for RMII In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13780 ) Change subject: output 50 MHz for RMII ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13780 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id3a3dee15c3986536b0623d0f39ca62e94acd1fd Gerrit-Change-Number: 13780 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 25 Apr 2019 19:50:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:51:04 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 19:51:04 +0000 Subject: Change in osmo-ccid-firmware[master]: configure GCLK for ISO baud rates In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13781 ) Change subject: configure GCLK for ISO baud rates ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13781 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ccid-firmware Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2c69848582e49031fa6453f535a2bf1408f8e22e Gerrit-Change-Number: 13781 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 25 Apr 2019 19:51:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:53:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 19:53:08 +0000 Subject: Change in docker-playground[master]: Add OSMO_*_BRANCH environment variables for build args In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13779 ) Change subject: Add OSMO_*_BRANCH environment variables for build args ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13779 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If3bc5fae07cf63c4fef68306be4c4328660bc869 Gerrit-Change-Number: 13779 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Thu, 25 Apr 2019 19:53:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:54:43 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 19:54:43 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_04_11.c: clarify implicit CP-ACK handling In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13633 ) Change subject: libmsc/gsm_04_11.c: clarify implicit CP-ACK handling ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13633 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3c5327a5019590c65d0ccb33a52f07b3988ea952 Gerrit-Change-Number: 13633 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 25 Apr 2019 19:54:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:55:10 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 19:55:10 +0000 Subject: Change in openbsc[master]: osmo-bsc_nat: Parse MGCP Connection ID as hex In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13778 ) Change subject: osmo-bsc_nat: Parse MGCP Connection ID as hex ...................................................................... osmo-bsc_nat: Parse MGCP Connection ID as hex Our ttcn3-bscnat-tests would randomly fail. After the CRCX ACK returns from the MSC the bsc-nat reports it could not find a CI it it and deletes the connection on the BSC-side. This happens because the field is parsed as a decimal value instead of hexadecimal. So a value of 00FED122 is parsed as '0' which is a reserved value in our program. This fix parses the field as hexadecimal value and also logs an error if the value happens to be 0. make check will now test if a hexadecimal CI is parsed correctly. Fixes: OS#3951 Change-Id: I49b8b61644bf706162102dce268cae2265536fc5 --- M openbsc/src/libmgcp/mgcp_protocol.c M openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c M openbsc/tests/bsc-nat/bsc_data.c M openbsc/tests/bsc-nat/bsc_nat_test.c 4 files changed, 11 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified dexter: Looks good to me, approved Harald Welte: Looks good to me, approved diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c index 84dbc1f..689c91f 100644 --- a/openbsc/src/libmgcp/mgcp_protocol.c +++ b/openbsc/src/libmgcp/mgcp_protocol.c @@ -208,7 +208,7 @@ len = snprintf(sdp_record, size, "v=0\r\n" - "o=- %u 23 IN IP4 %s\r\n" + "o=- %x 23 IN IP4 %s\r\n" "s=-\r\n" "c=IN IP4 %s\r\n" "t=0 0\r\n", @@ -285,7 +285,7 @@ } len = snprintf(sdp_record, sizeof(sdp_record), - "I: %u%s\n\n", endp->ci, osmux_extension); + "I: %x%s\n\n", endp->ci, osmux_extension); if (len < 0) return NULL; @@ -512,7 +512,7 @@ uint32_t ci = strtoul(_ci, NULL, 10); if (ci != endp->ci) { - LOGP(DMGCP, LOGL_ERROR, "ConnectionIdentifiers do not match on 0x%x. %u != %s\n", + LOGP(DMGCP, LOGL_ERROR, "ConnectionIdentifiers do not match on 0x%x. %x != %x\n", ENDPOINT_NUMBER(endp), endp->ci, _ci); return -1; } @@ -891,7 +891,7 @@ osmo_jibuf_set_dequeue_cb(endp->bts_jb, mgcp_dejitter_udp_send, &endp->net_end); } - LOGP(DMGCP, LOGL_DEBUG, "Creating endpoint on: 0x%x CI: %u port: %u/%u\n", + LOGP(DMGCP, LOGL_DEBUG, "Creating endpoint on: 0x%x CI: %x port: %u/%u\n", ENDPOINT_NUMBER(endp), endp->ci, endp->net_end.local_port, endp->bts_end.local_port); if (p->cfg->change_cb) diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c index 311ab94..17dc659 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -812,11 +812,14 @@ return CI_UNUSED; } - if (sscanf(res, "I: %u", &ci) != 1) { + if (sscanf(res, "I: %x", &ci) != 1) { LOGP(DMGCP, LOGL_ERROR, "Failed to parse CI in msg '%s'\n", str); return CI_UNUSED; } + if (ci == CI_UNUSED) + LOGP(DMGCP, LOGL_ERROR, "CI field '%s' parsed as reserved value CI_UNUSED\n", str); + return ci; } diff --git a/openbsc/tests/bsc-nat/bsc_data.c b/openbsc/tests/bsc-nat/bsc_data.c index 71d5391..d29caef 100644 --- a/openbsc/tests/bsc-nat/bsc_data.c +++ b/openbsc/tests/bsc-nat/bsc_data.c @@ -157,8 +157,8 @@ /* patch the ip and port */ -static const char crcx_resp[] = "200 23265295\r\nI: 1\r\n\r\nv=0\r\nc=IN IP4 172.16.18.2\r\nm=audio 4002 RTP/AVP 98 3\r\na=rtpmap:98 AMR/8000\r\n"; -static const char crcx_resp_patched[] = "200 23265295\r\nI: 1\r\n\r\nv=0\r\nc=IN IP4 10.0.0.1\r\nm=audio 999 RTP/AVP 98 3\r\na=rtpmap:98 AMR/8000\r\na=fmtp:98 mode-set=2 octet-align=1\r\n"; +static const char crcx_resp[] = "200 23265295\r\nI: 0F\r\n\r\nv=0\r\nc=IN IP4 172.16.18.2\r\nm=audio 4002 RTP/AVP 98 3\r\na=rtpmap:98 AMR/8000\r\n"; +static const char crcx_resp_patched[] = "200 23265295\r\nI: 0F\r\n\r\nv=0\r\nc=IN IP4 10.0.0.1\r\nm=audio 999 RTP/AVP 98 3\r\na=rtpmap:98 AMR/8000\r\na=fmtp:98 mode-set=2 octet-align=1\r\n"; /* patch the ip and port */ static const char mdcx[] = "MDCX 23330829 8 at mgw MGCP 1.0\r\nC: 394b0439fb\r\nI: 1\r\nL: p:20, a:AMR, nt:IN\r\nM: recvonly\r\n\r\nv=0\r\no=- 1049380491 0 IN IP4 172.16.18.2\r\ns=-\r\nc=IN IP4 172.16.18.2\r\nt=0 0\r\nm=audio 4410 RTP/AVP 126\r\na=rtpmap:126 AMR/8000/1\r\na=fmtp:126 mode-set=2 octet-align=1;start-mode=0\r\na=ptime:20\r\na=recvonly\r\nm=image 4412 udptl t38\r\na=T38FaxVersion:0\r\na=T38MaxBitRate:14400\r\n"; diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c index 2914a01..e0d0051 100644 --- a/openbsc/tests/bsc-nat/bsc_nat_test.c +++ b/openbsc/tests/bsc-nat/bsc_nat_test.c @@ -683,7 +683,7 @@ } ci = bsc_mgcp_extract_ci(crcx_resp); - if (ci != 1) { + if (ci != 0x0F) { printf("Failed to parse the CI. Got: %d\n", ci); abort(); } -- To view, visit https://gerrit.osmocom.org/13778 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I49b8b61644bf706162102dce268cae2265536fc5 Gerrit-Change-Number: 13778 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:55:09 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 19:55:09 +0000 Subject: Change in openbsc[master]: osmo-bsc_nat: Parse MGCP Connection ID as hex In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13778 ) Change subject: osmo-bsc_nat: Parse MGCP Connection ID as hex ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13778 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I49b8b61644bf706162102dce268cae2265536fc5 Gerrit-Change-Number: 13778 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 25 Apr 2019 19:55:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:56:12 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 25 Apr 2019 19:56:12 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... Patch Set 6: (1 comment) https://gerrit.osmocom.org/#/c/13744/6/src/gprs/gprs_gmm.c File src/gprs/gprs_gmm.c: https://gerrit.osmocom.org/#/c/13744/6/src/gprs/gprs_gmm.c at 1935 PS6, Line 1935: reject_cause = GMM_CAUSE_NO_PDP_ACTIVATED; > If you sent the GMM_CAUSE_NO_PDP_ACTIVATED: [?] At the moment you check if the MS & SGSN is out of sync. But if you on check if there are no PDP Contexts on SGSN, you can directly sent this reject_cause. -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 6 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Thu, 25 Apr 2019 19:56:12 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:56:03 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 19:56:03 +0000 Subject: Change in osmo-mgw[master]: create_response_with_sdp: Fix inclusion of X-Osmux In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13775 ) Change subject: create_response_with_sdp: Fix inclusion of X-Osmux ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13775 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iceee8b64978651f1fe6bb883923561b081f73d9b Gerrit-Change-Number: 13775 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 25 Apr 2019 19:56:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:57:31 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 19:57:31 +0000 Subject: Change in osmo-mgw[master]: osmux: Cleanup of CID alloc pool APIs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13774 ) Change subject: osmux: Cleanup of CID alloc pool APIs ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13774 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I737a248ac6c74add8e917fe2e2f36779d0f1d685 Gerrit-Change-Number: 13774 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 25 Apr 2019 19:57:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:59:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 19:59:21 +0000 Subject: Change in osmo-mgw[master]: Introduce log fmt helpers LOGPENDP and LOGPCONN In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13773 ) Change subject: Introduce log fmt helpers LOGPENDP and LOGPCONN ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13773 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1c49b1eb16bc5f1010376da5cf407ca6e31d81f2 Gerrit-Change-Number: 13773 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 25 Apr 2019 19:59:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:59:37 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 19:59:37 +0000 Subject: Change in osmo-sgsn[master]: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13767 ) Change subject: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13767 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8b8e16d5a68f19f21dc4fdb5703c8a794e0173c Gerrit-Change-Number: 13767 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 25 Apr 2019 19:59:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:59:41 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 19:59:41 +0000 Subject: Change in osmo-sgsn[master]: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13767 ) Change subject: gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM ...................................................................... gprs_llc: Correctly refuse any ABM command (SABM, DISC) with DM According to Section 6.4.1.4 of 3GPP TS 04.64 The DM unnumbered response shall be used by an LLE to report to its peer that the LLE is in a state such that ABM operation cannot be performed. An LLE shall transmit a DM response to any valid command received that it cannot action. Closes: OS#3953 Change-Id: Ie8b8e16d5a68f19f21dc4fdb5703c8a794e0173c --- M src/gprs/gprs_llc.c 1 file changed, 22 insertions(+), 0 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 654f2c0..2ec7100 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -44,6 +44,7 @@ static struct gprs_llc_llme *llme_alloc(uint32_t tlli); static int gprs_llc_tx_xid(struct gprs_llc_lle *lle, struct msgb *msg, int command); +static int gprs_llc_tx_dm(struct gprs_llc_lle *lle); static int gprs_llc_tx_u(struct msgb *msg, uint8_t sapi, int command, enum gprs_llc_u_cmd u_cmd, int pf_bit); @@ -676,6 +677,18 @@ return gprs_llc_tx_u(msg, lle->sapi, command, GPRS_LLC_U_XID, 1); } +static int gprs_llc_tx_dm(struct gprs_llc_lle *lle) +{ + struct msgb *msg = msgb_alloc_headroom(4096, 1024, "LLC_DM"); + + /* copy identifiers from LLE to ensure lower layers can route */ + msgb_tlli(msg) = lle->llme->tlli; + msgb_bvci(msg) = lle->llme->bvci; + msgb_nsei(msg) = lle->llme->nsei; + + return gprs_llc_tx_u(msg, lle->sapi, 0, GPRS_LLC_U_DM_RESP, 1); +} + /* encrypt information field + FCS, if needed! */ static int apply_gea(struct gprs_llc_lle *lle, uint16_t crypt_len, uint16_t nu, uint32_t oc, uint8_t sapi, uint8_t *fcs, uint8_t *data) @@ -802,6 +815,8 @@ struct gprs_llc_lle *lle) { switch (gph->cmd) { +#if 0 + /* we don't fully imoplement ABM, so refuse it properly (OS#3953) */ case GPRS_LLC_SABM: /* Section 6.4.1.1 */ lle->v_sent = lle->v_ack = lle->v_recv = 0; if (lle->state == GPRS_LLES_ASSIGNED_ADM) { @@ -827,6 +842,13 @@ break; case GPRS_LLC_FRMR: /* Section 6.4.1.5 */ break; +#else + case GPRS_LLC_SABM: + case GPRS_LLC_DISC: + /* send DM to properly signal we don't do ABM */ + gprs_llc_tx_dm(lle); + break; +#endif case GPRS_LLC_XID: /* Section 6.4.1.6 */ rx_llc_xid(lle, gph); break; -- To view, visit https://gerrit.osmocom.org/13767 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie8b8e16d5a68f19f21dc4fdb5703c8a794e0173c Gerrit-Change-Number: 13767 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:59:55 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 19:59:55 +0000 Subject: Change in osmo-sgsn[master]: LLC: Store the XID inside the LLC Entity, not LLC Mgmg Entity In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13623 ) Change subject: LLC: Store the XID inside the LLC Entity, not LLC Mgmg Entity ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13623 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaeb54ca5ac58391be45e56c2e721f531969f3a9e Gerrit-Change-Number: 13623 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 25 Apr 2019 19:59:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 19:59:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 19:59:57 +0000 Subject: Change in osmo-sgsn[master]: LLC: Store the XID inside the LLC Entity, not LLC Mgmg Entity In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13623 ) Change subject: LLC: Store the XID inside the LLC Entity, not LLC Mgmg Entity ...................................................................... LLC: Store the XID inside the LLC Entity, not LLC Mgmg Entity For every logical session between a MS and the SGSN, there is one LLME (LLC Management Entity) and a set of LLEs (Logical Link Entities): One for each SAPI. The XID procedure used to establish LLC configuration values such as N201 (MTU) parameters happens on each LLE separately. The negotiated parameters only affect that one LLE (SAPI) and are not global. Still, the OsmoSGSN LLC code has the "struct llist_head *xid" member as part of the gprs_llc_llme, and not as part of the gprs_llc_lle. This list is a cache of the XID fields we have sent with the last XID request, which is used in processing the response from the MS. If two XID handshakes were to occur concurrently on two LLEs, the state between them would get messed up. It must be maintained separately for each LLE. Closes: OS#3955 Change-Id: Iaeb54ca5ac58391be45e56c2e721f531969f3a9e --- M include/osmocom/sgsn/gprs_llc.h M src/gprs/gprs_llc.c M src/gprs/gprs_sndcp.c 3 files changed, 25 insertions(+), 26 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved diff --git a/include/osmocom/sgsn/gprs_llc.h b/include/osmocom/sgsn/gprs_llc.h index 376ae9a..711bcd6 100644 --- a/include/osmocom/sgsn/gprs_llc.h +++ b/include/osmocom/sgsn/gprs_llc.h @@ -145,6 +145,13 @@ unsigned int retrans_ctr; struct gprs_llc_params params; + + /* Copy of the XID fields we have sent with the last + * network originated XID-Request. Since the phone + * may strip the optional fields in the confirmation + * we need to remeber those fields in order to be + * able to create the compression entity. */ + struct llist_head *xid; }; #define NUM_SAPIS 16 @@ -169,13 +176,6 @@ uint16_t nsei; struct gprs_llc_lle lle[NUM_SAPIS]; - /* Copy of the XID fields we have sent with the last - * network originated XID-Request. Since the phone - * may strip the optional fields in the confirmation - * we need to remeber those fields in order to be - * able to create the compression entity. */ - struct llist_head *xid; - /* Compression entities */ struct { /* In these two list_heads we will store the diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 2ec7100..acf4b54 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -53,7 +53,7 @@ /* Generate XID message */ static int gprs_llc_generate_xid(uint8_t *bytes, int bytes_len, struct gprs_llc_xid_field *l3_xid_field, - struct gprs_llc_llme *llme) + struct gprs_llc_lle *lle) { /* Note: Called by gprs_ll_xid_req() */ @@ -90,8 +90,8 @@ } /* Store generated XID for later reference */ - talloc_free(llme->xid); - llme->xid = gprs_llc_copy_xid(llme, &xid_fields); + talloc_free(lle->xid); + lle->xid = gprs_llc_copy_xid(lle->llme, &xid_fields); return gprs_llc_compile_xid(bytes, bytes_len, &xid_fields); } @@ -99,7 +99,7 @@ /* Generate XID message that will cause the GMM to reset */ static int gprs_llc_generate_xid_for_gmm_reset(uint8_t *bytes, int bytes_len, uint32_t iov_ui, - struct gprs_llc_llme *llme) + struct gprs_llc_lle *lle) { /* Called by gprs_llgmm_reset() and * gprs_llgmm_reset_oldmsg() */ @@ -124,8 +124,8 @@ llist_add(&xid_reset.list, &xid_fields); /* Store generated XID for later reference */ - talloc_free(llme->xid); - llme->xid = gprs_llc_copy_xid(llme, &xid_fields); + talloc_free(lle->xid); + lle->xid = gprs_llc_copy_xid(lle->llme, &xid_fields); return gprs_llc_compile_xid(bytes, bytes_len, &xid_fields); } @@ -144,8 +144,8 @@ struct gprs_llc_xid_field *xid_field_request_l3 = NULL; /* Pick layer3 XID from the XID request we have sent last */ - if (lle->llme->xid) { - llist_for_each_entry(xid_field_request, lle->llme->xid, list) { + if (lle->xid) { + llist_for_each_entry(xid_field_request, lle->xid, list) { if (xid_field_request->type == GPRS_LLC_XID_T_L3_PAR) xid_field_request_l3 = xid_field_request; } @@ -189,8 +189,8 @@ } /* Flush pending XID fields */ - talloc_free(lle->llme->xid); - lle->llme->xid = NULL; + talloc_free(lle->xid); + lle->xid = NULL; return 0; } @@ -325,8 +325,7 @@ /* Generate XID */ xid_bytes_len = - gprs_llc_generate_xid(xid_bytes, sizeof(xid_bytes), - l3_xid_field, lle->llme); + gprs_llc_generate_xid(xid_bytes, sizeof(xid_bytes), l3_xid_field, lle); /* Only perform XID sending if the XID message contains something */ if (xid_bytes_len > 0) { @@ -577,7 +576,6 @@ { gprs_sndcp_comp_free(llme->comp.proto); gprs_sndcp_comp_free(llme->comp.data); - talloc_free(llme->xid); llist_del(&llme->list); talloc_free(llme); } @@ -1114,8 +1112,8 @@ } /* Generate XID message */ - xid_bytes_len = gprs_llc_generate_xid_for_gmm_reset(xid_bytes, - sizeof(xid_bytes),llme->iov_ui,llme); + xid_bytes_len = gprs_llc_generate_xid_for_gmm_reset(xid_bytes, sizeof(xid_bytes), + llme->iov_ui, lle); if (xid_bytes_len < 0) return -EINVAL; xid = msgb_put(msg, xid_bytes_len); @@ -1135,6 +1133,7 @@ struct gprs_llc_llme *llme) { struct msgb *msg = msgb_alloc_headroom(4096, 1024, "LLC_XID"); + struct gprs_llc_lle *lle = &llme->lle[sapi]; uint8_t xid_bytes[1024]; int xid_bytes_len, rc; uint8_t *xid; @@ -1148,8 +1147,8 @@ } /* Generate XID message */ - xid_bytes_len = gprs_llc_generate_xid_for_gmm_reset(xid_bytes, - sizeof(xid_bytes),llme->iov_ui,llme); + xid_bytes_len = gprs_llc_generate_xid_for_gmm_reset(xid_bytes, sizeof(xid_bytes), + llme->iov_ui, lle); if (xid_bytes_len < 0) return -EINVAL; xid = msgb_put(msg, xid_bytes_len); diff --git a/src/gprs/gprs_sndcp.c b/src/gprs/gprs_sndcp.c index f0239cb..23d1e9a 100644 --- a/src/gprs/gprs_sndcp.c +++ b/src/gprs/gprs_sndcp.c @@ -989,8 +989,8 @@ gprs_sndcp_comp_free(lle->llme->comp.data); lle->llme->comp.proto = gprs_sndcp_comp_alloc(lle->llme); lle->llme->comp.data = gprs_sndcp_comp_alloc(lle->llme); - talloc_free(lle->llme->xid); - lle->llme->xid = NULL; + talloc_free(lle->xid); + lle->xid = NULL; /* Generate compression parameter bytestream */ xid_len = gprs_llc_gen_sndcp_xid(l3params, sizeof(l3params), nsapi); -- To view, visit https://gerrit.osmocom.org/13623 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iaeb54ca5ac58391be45e56c2e721f531969f3a9e Gerrit-Change-Number: 13623 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:00:06 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:00:06 +0000 Subject: Change in osmo-sgsn[master]: gb_proxy.h: Add missing comments; improve comments In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13761 ) Change subject: gb_proxy.h: Add missing comments; improve comments ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13761 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I61bdd3b1cec037bce825c234a8a274b70629adc8 Gerrit-Change-Number: 13761 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 25 Apr 2019 20:00:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:00:07 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:00:07 +0000 Subject: Change in osmo-sgsn[master]: gb_proxy.h: Add missing comments; improve comments In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13761 ) Change subject: gb_proxy.h: Add missing comments; improve comments ...................................................................... gb_proxy.h: Add missing comments; improve comments When the patching and routing features were introduced, a lot of the new structures were not documented at the same level as the pre-existing code. Let's fix that. Change-Id: I61bdd3b1cec037bce825c234a8a274b70629adc8 --- M include/osmocom/sgsn/gb_proxy.h 1 file changed, 46 insertions(+), 13 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h index 7e2ae42..a3e1a02 100644 --- a/include/osmocom/sgsn/gb_proxy.h +++ b/include/osmocom/sgsn/gb_proxy.h @@ -70,29 +70,30 @@ }; enum gbproxy_keep_mode { - GBPROX_KEEP_NEVER, - GBPROX_KEEP_REATTACH, - GBPROX_KEEP_IDENTIFIED, - GBPROX_KEEP_ALWAYS, + GBPROX_KEEP_NEVER, /* don't ever keep TLLI/IMSI state of de-registered subscribers */ + GBPROX_KEEP_REATTACH, /* keep if re-attach has been requested by SGSN */ + GBPROX_KEEP_IDENTIFIED, /* keep if we had resolved an IMSI */ + GBPROX_KEEP_ALWAYS, /* always keep */ }; enum gbproxy_match_id { - GBPROX_MATCH_PATCHING, - GBPROX_MATCH_ROUTING, + GBPROX_MATCH_PATCHING, /* match rule on whether or not we should patch */ + GBPROX_MATCH_ROUTING, /* match rule on whether or not we should route (2-SGSN) */ GBPROX_MATCH_LAST }; struct gbproxy_match { - int enable; - char *re_str; - regex_t re_comp; + int enable; /* is this match enabled? */ + char *re_str; /* regular expression (for IMSI) in string format */ + regex_t re_comp; /* compiled regular expression (for IMSI) */ }; +/* global gb-proxy configuration */ struct gbproxy_config { /* parsed from config file */ uint16_t nsip_sgsn_nsei; - /* misc */ + /* NS instance of libosmogb */ struct gprs_ns_inst *nsi; /* Linked list of all Gb peers (except SGSN) */ @@ -101,10 +102,13 @@ /* Counter */ struct rate_ctr_group *ctrg; - /* force mcc/mnc */ + /* MCC/MNC to be patched into RA-ID on the way from BSS to SGSN? */ struct osmo_plmn_id core_plmn; + + /* APN to be patched into PDP CTX ACT REQ on the way from BSS to SGSN */ uint8_t* core_apn; size_t core_apn_size; + /* Frequency (sec) at which timer to clean stale links is fired (0 disabled) */ unsigned int clean_stale_timer_freq; /* If !0, Max age to consider a struct gbproxy_link_info as stale */ @@ -114,14 +118,18 @@ /* If !0, Max len of gbproxy_link_info->stored_msgs (list of msgb) */ uint32_t stored_msgs_max_len; - /* Experimental config */ + /* Should the P-TMSI be patched on the fly (required for 2-SGSN config) */ int patch_ptmsi; + /* Should the IMSI be acquired by the proxy (required for 2-SGSN config) */ int acquire_imsi; + /* Should we route subscribers to two different SGSNs? */ int route_to_sgsn2; + /* NSEI of the second SGSN */ uint16_t nsip_sgsn2_nsei; + /* should we keep a cache of per-subscriber state even after de-registration? */ enum gbproxy_keep_mode keep_link_infos; - /* IMSI checking/matching */ + /* IMSI checking/matching for 2-SGSN routing and patching */ struct gbproxy_match matches[GBPROX_MATCH_LAST]; }; @@ -133,7 +141,9 @@ int logical_link_count; }; +/* one peer at NS level that we interact with (BSS/PCU) */ struct gbproxy_peer { + /* linked to gbproxy_config.bts_peers */ struct llist_head list; /* point back to the config */ @@ -152,6 +162,7 @@ /* Counter */ struct rate_ctr_group *ctrg; + /* State related to on-the-fly patching of certain messages */ struct gbproxy_patch_state patch_state; /* Fired periodically to clean up stale links from list */ @@ -159,32 +170,54 @@ }; struct gbproxy_tlli_state { + /* currently active TLLI */ uint32_t current; + /* newly-assigned TLLI (e.g. during P-TMSI allocation procedure) */ uint32_t assigned; + /* has the BSS side validated (confirmed) the new TLLI? */ int bss_validated; + /* has the SGSN side validated (confirmed) the new TLLI? */ int net_validated; + /* NOTE: once both are validated, we set current = assigned and assigned = 0 */ + /* The P-TMSI for this subscriber */ uint32_t ptmsi; }; +/* One TLLI (= UE, = Subscriber) served via this proxy */ struct gbproxy_link_info { + /* link to gbproxy_peer.patch_state.logical_links */ struct llist_head list; + /* TLLI on the BSS/PCU side */ struct gbproxy_tlli_state tlli; + /* TLLI on the SGSN side (can be different in case of P-TMSI patching) */ struct gbproxy_tlli_state sgsn_tlli; + /* NSEI of the SGSN serving this link */ uint32_t sgsn_nsei; + /* timestamp when we last had any contact with this UE */ time_t timestamp; + + /* IMSI of the subscriber (if/once known) */ uint8_t *imsi; size_t imsi_len; + /* is the IMSI acquisition still pending? */ int imsi_acq_pending; + + /* queue of stored UL messages (until IMSI acquisition completes and we can + * determine which of the SGSNs we should route this to */ struct llist_head stored_msgs; uint32_t stored_msgs_len; + + /* generated N(U) we use (required due to IMSI acquisition */ unsigned vu_gen_tx_bss; + /* is this subscriber deregistered (TLLI invalidated)? */ int is_deregistered; + /* does this link match either the (2-SGSN) routing or the patching rule? */ int is_matching[GBPROX_MATCH_LAST]; }; -- To view, visit https://gerrit.osmocom.org/13761 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I61bdd3b1cec037bce825c234a8a274b70629adc8 Gerrit-Change-Number: 13761 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:00:23 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:00:23 +0000 Subject: Change in osmo-sgsn[master]: gb_proxy: cosmetic: Use 'bool' in data structures where applicable In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13762 ) Change subject: gb_proxy: cosmetic: Use 'bool' in data structures where applicable ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13762 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I63876f52d5de87e4c99d92669270fd1f487e217c Gerrit-Change-Number: 13762 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 25 Apr 2019 20:00:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:00:24 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:00:24 +0000 Subject: Change in osmo-sgsn[master]: gb_proxy: cosmetic: Use 'bool' in data structures where applicable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13762 ) Change subject: gb_proxy: cosmetic: Use 'bool' in data structures where applicable ...................................................................... gb_proxy: cosmetic: Use 'bool' in data structures where applicable If we ever only use 0/1 in an 'int', we should have used 'bool'. Change-Id: I63876f52d5de87e4c99d92669270fd1f487e217c --- M include/osmocom/sgsn/gb_proxy.h M src/gprs/gb_proxy.c M src/gprs/gb_proxy_patch.c M src/gprs/gb_proxy_tlli.c M src/gprs/gb_proxy_vty.c 5 files changed, 36 insertions(+), 35 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h index a3e1a02..1e8fb25 100644 --- a/include/osmocom/sgsn/gb_proxy.h +++ b/include/osmocom/sgsn/gb_proxy.h @@ -10,6 +10,7 @@ #include #include +#include #define GBPROXY_INIT_VU_GEN_TX 256 @@ -83,7 +84,7 @@ }; struct gbproxy_match { - int enable; /* is this match enabled? */ + bool enable; /* is this match enabled? */ char *re_str; /* regular expression (for IMSI) in string format */ regex_t re_comp; /* compiled regular expression (for IMSI) */ }; @@ -119,11 +120,11 @@ uint32_t stored_msgs_max_len; /* Should the P-TMSI be patched on the fly (required for 2-SGSN config) */ - int patch_ptmsi; + bool patch_ptmsi; /* Should the IMSI be acquired by the proxy (required for 2-SGSN config) */ - int acquire_imsi; + bool acquire_imsi; /* Should we route subscribers to two different SGSNs? */ - int route_to_sgsn2; + bool route_to_sgsn2; /* NSEI of the second SGSN */ uint16_t nsip_sgsn2_nsei; /* should we keep a cache of per-subscriber state even after de-registration? */ @@ -154,7 +155,7 @@ /* BVCI used for Point-to-Point to this peer */ uint16_t bvci; - int blocked; + bool blocked; /* Routeing Area that this peer is part of (raw 04.08 encoding) */ uint8_t ra[6]; @@ -175,9 +176,9 @@ /* newly-assigned TLLI (e.g. during P-TMSI allocation procedure) */ uint32_t assigned; /* has the BSS side validated (confirmed) the new TLLI? */ - int bss_validated; + bool bss_validated; /* has the SGSN side validated (confirmed) the new TLLI? */ - int net_validated; + bool net_validated; /* NOTE: once both are validated, we set current = assigned and assigned = 0 */ /* The P-TMSI for this subscriber */ @@ -204,7 +205,7 @@ size_t imsi_len; /* is the IMSI acquisition still pending? */ - int imsi_acq_pending; + bool imsi_acq_pending; /* queue of stored UL messages (until IMSI acquisition completes and we can * determine which of the SGSNs we should route this to */ @@ -215,10 +216,10 @@ unsigned vu_gen_tx_bss; /* is this subscriber deregistered (TLLI invalidated)? */ - int is_deregistered; + bool is_deregistered; /* does this link match either the (2-SGSN) routing or the patching rule? */ - int is_matching[GBPROX_MATCH_LAST]; + bool is_matching[GBPROX_MATCH_LAST]; }; diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index 0b5758a..3da7bfd 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -310,7 +310,7 @@ in_progress = 1; gbproxy_link_info_discard_messages(link_info); - link_info->imsi_acq_pending = 0; + link_info->imsi_acq_pending = false; return in_progress; } @@ -531,7 +531,7 @@ * implementation relies on the MS doing proper retransmissions * of the triggering message instead */ - link_info->imsi_acq_pending = 1; + link_info->imsi_acq_pending = true; } return 0; @@ -836,11 +836,11 @@ switch (pdu_type) { case BSSGP_PDUT_BVC_BLOCK_ACK: - peer->blocked = 1; + peer->blocked = true; rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_BLOCKED]); break; case BSSGP_PDUT_BVC_UNBLOCK_ACK: - peer->blocked = 0; + peer->blocked = false; rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_UNBLOCKED]); break; default: diff --git a/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c index 251bb67..6235b04 100644 --- a/src/gprs/gb_proxy_patch.c +++ b/src/gprs/gb_proxy_patch.c @@ -398,7 +398,7 @@ { if (match->enable) { regfree(&match->re_comp); - match->enable = 0; + match->enable = false; } talloc_free(match->re_str); match->re_str = NULL; @@ -419,7 +419,7 @@ REG_EXTENDED | REG_NOSUB | REG_ICASE); if (rc == 0) { - match->enable = 1; + match->enable = true; match->re_str = talloc_strdup(tall_sgsn_ctx, filter); return 0; } diff --git a/src/gprs/gb_proxy_tlli.c b/src/gprs/gb_proxy_tlli.c index 0c027d5..4e21ede 100644 --- a/src/gprs/gb_proxy_tlli.c +++ b/src/gprs/gb_proxy_tlli.c @@ -284,8 +284,8 @@ /* Remember assigned TLLI */ tlli_state->assigned = new_tlli; - tlli_state->bss_validated = 0; - tlli_state->net_validated = 0; + tlli_state->bss_validated = false; + tlli_state->net_validated = false; } uint32_t gbproxy_map_tlli(uint32_t other_tlli, @@ -325,9 +325,9 @@ /* See GSM 04.08, 4.7.1.5 */ if (to_bss) - tlli_state->net_validated = 1; + tlli_state->net_validated = true; else - tlli_state->bss_validated = 1; + tlli_state->bss_validated = true; if (!tlli_state->bss_validated || !tlli_state->net_validated) return; @@ -367,7 +367,7 @@ link_info->sgsn_tlli.current = 0; link_info->sgsn_tlli.assigned = 0; - link_info->is_deregistered = 1; + link_info->is_deregistered = true; gbproxy_reset_link(link_info); @@ -424,7 +424,7 @@ &peer->cfg->matches[match_id], parse_ctx->imsi, parse_ctx->imsi_len); if (imsi_matches >= 0) - link_info->is_matching[match_id] = imsi_matches; + link_info->is_matching[match_id] = imsi_matches ? true : false; } } @@ -498,7 +498,7 @@ if (!link_info) return NULL; - link_info->is_deregistered = 0; + link_info->is_deregistered = false; return link_info; } @@ -577,7 +577,7 @@ peer, parse_ctx->imsi, parse_ctx->imsi_len); if (link_info) - link_info->is_deregistered = 0; + link_info->is_deregistered = false; return link_info; } diff --git a/src/gprs/gb_proxy_vty.c b/src/gprs/gb_proxy_vty.c index 52c39fd..5c4f454 100644 --- a/src/gprs/gb_proxy_vty.c +++ b/src/gprs/gb_proxy_vty.c @@ -241,7 +241,7 @@ return CMD_WARNING; } - g_cfg->acquire_imsi = 1; + g_cfg->acquire_imsi = true; return CMD_SUCCESS; } @@ -256,7 +256,7 @@ for (match_id = 0; match_id < ARRAY_SIZE(g_cfg->matches); ++match_id) gbproxy_clear_patch_filter(&g_cfg->matches[match_id]); - g_cfg->acquire_imsi = 0; + g_cfg->acquire_imsi = false; return CMD_SUCCESS; } @@ -329,7 +329,7 @@ "patch-ptmsi", GBPROXY_PATCH_PTMSI_STR) { - g_cfg->patch_ptmsi = 1; + g_cfg->patch_ptmsi = true; return CMD_SUCCESS; } @@ -339,7 +339,7 @@ "no patch-ptmsi", NO_STR GBPROXY_PATCH_PTMSI_STR) { - g_cfg->patch_ptmsi = 0; + g_cfg->patch_ptmsi = false; return CMD_SUCCESS; } @@ -355,7 +355,7 @@ "acquire-imsi", GBPROXY_ACQUIRE_IMSI_STR) { - g_cfg->acquire_imsi = 1; + g_cfg->acquire_imsi = true; return CMD_SUCCESS; } @@ -365,7 +365,7 @@ "no acquire-imsi", NO_STR GBPROXY_ACQUIRE_IMSI_STR) { - g_cfg->acquire_imsi = 0; + g_cfg->acquire_imsi = false; return CMD_SUCCESS; } @@ -387,10 +387,10 @@ return CMD_WARNING; } - g_cfg->route_to_sgsn2 = 1; + g_cfg->route_to_sgsn2 = true; g_cfg->nsip_sgsn2_nsei = nsei; - g_cfg->patch_ptmsi = 1; + g_cfg->patch_ptmsi = true; return CMD_SUCCESS; } @@ -400,10 +400,10 @@ "no secondary-sgsn", NO_STR GBPROXY_SECOND_SGSN_STR) { - g_cfg->route_to_sgsn2 = 0; + g_cfg->route_to_sgsn2 = false; g_cfg->nsip_sgsn2_nsei = 0xFFFF; - g_cfg->patch_ptmsi = 0; + g_cfg->patch_ptmsi = false; return CMD_SUCCESS; } @@ -849,7 +849,7 @@ return CMD_WARNING; } - g_cfg->acquire_imsi = 1; + g_cfg->acquire_imsi = true; return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/13762 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I63876f52d5de87e4c99d92669270fd1f487e217c Gerrit-Change-Number: 13762 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:00:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:00:45 +0000 Subject: Change in osmo-bts[master]: common/rsl.c: fix unaligned pointers in rsl_add_rtp_stats() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13768 ) Change subject: common/rsl.c: fix unaligned pointers in rsl_add_rtp_stats() ...................................................................... common/rsl.c: fix unaligned pointers in rsl_add_rtp_stats() Found using clang-8: rsl.c:1646:7: warning: taking address of packed member 'packets_sent' of class or structure 'ipa_stats' may result in an unaligned pointer value rsl.c:1646:28: warning: taking address of packed member 'octets_sent' of class or structure 'ipa_stats' may result in an unaligned pointer value rsl.c:1647:7: warning: taking address of packed member 'packets_recv' of class or structure 'ipa_stats' may result in an unaligned pointer value rsl.c:1647:28: warning: taking address of packed member 'octets_recv' of class or structure 'ipa_stats' may result in an unaligned pointer value rsl.c:1648:7: warning: taking address of packed member 'packets_lost' of class or structure 'ipa_stats' may result in an unaligned pointer value rsl.c:1648:28: warning: taking address of packed member 'arrival_jitter' of class or structure 'ipa_stats' may result in an unaligned pointer value Change-Id: Ifba33cfd8edeccc99a21c7d076db7119c29d4f40 --- M src/common/rsl.c 1 file changed, 23 insertions(+), 23 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/common/rsl.c b/src/common/rsl.c index 8f5d689..c2a7db6 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1627,33 +1627,33 @@ */ static void rsl_add_rtp_stats(struct gsm_lchan *lchan, struct msgb *msg) { - struct ipa_stats { - uint32_t packets_sent; - uint32_t octets_sent; - uint32_t packets_recv; - uint32_t octets_recv; - uint32_t packets_lost; - uint32_t arrival_jitter; - uint32_t avg_tx_delay; - } __attribute__((packed)); + uint32_t packets_sent, octets_sent; + uint32_t packets_recv, octets_recv; + uint32_t packets_lost; + uint32_t arrival_jitter; - struct ipa_stats stats; + msgb_tv_put(msg, RSL_IE_IPAC_CONN_STAT, sizeof(uint32_t) * 7); - memset(&stats, 0, sizeof(stats)); - - if (lchan->abis_ip.rtp_socket) + if (lchan->abis_ip.rtp_socket) { osmo_rtp_socket_stats(lchan->abis_ip.rtp_socket, - &stats.packets_sent, &stats.octets_sent, - &stats.packets_recv, &stats.octets_recv, - &stats.packets_lost, &stats.arrival_jitter); - /* convert to network byte order */ - stats.packets_sent = htonl(stats.packets_sent); - stats.octets_sent = htonl(stats.octets_sent); - stats.packets_recv = htonl(stats.packets_recv); - stats.octets_recv = htonl(stats.octets_recv); - stats.packets_lost = htonl(stats.packets_lost); + &packets_sent, &octets_sent, + &packets_recv, &octets_recv, + &packets_lost, &arrival_jitter); - msgb_tlv_put(msg, RSL_IE_IPAC_CONN_STAT, sizeof(stats), (uint8_t *) &stats); + /* msgb_put_u32() uses osmo_store32be(), + * so we don't need to call htonl(). */ + msgb_put_u32(msg, packets_sent); + msgb_put_u32(msg, octets_sent); + msgb_put_u32(msg, packets_recv); + msgb_put_u32(msg, octets_recv); + msgb_put_u32(msg, packets_lost); + msgb_put_u32(msg, arrival_jitter); + /* FIXME: AVG Tx delay is always 0 */ + msgb_put_u32(msg, 0); + } else { + msgb_put(msg, sizeof(uint32_t) * 7); + memset(msg->tail, 0x00, sizeof(uint32_t) * 7); + } } int rsl_tx_ipac_dlcx_ind(struct gsm_lchan *lchan, uint8_t cause) -- To view, visit https://gerrit.osmocom.org/13768 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ifba33cfd8edeccc99a21c7d076db7119c29d4f40 Gerrit-Change-Number: 13768 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:00:56 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:00:56 +0000 Subject: Change in osmo-ttcn3-hacks[master]: LLC_Templates: Add SABM, UA, FRMR, DM templates In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13757 ) Change subject: LLC_Templates: Add SABM, UA, FRMR, DM templates ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13757 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idb40dcd53310b76ea9df6c0090e31175a4382460 Gerrit-Change-Number: 13757 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 25 Apr 2019 20:00:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:00:46 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:00:46 +0000 Subject: Change in osmo-bts[master]: common/paging.c: fix unaligned pointer access In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13769 ) Change subject: common/paging.c: fix unaligned pointer access ...................................................................... common/paging.c: fix unaligned pointer access Passing a pointer to a packed structure to tmsi_mi_to_uint() may result in unaligned pointer value. Found with clang-8. Change-Id: Ief69854973a098e6da7c05f4417dc11988edd777 --- M src/common/paging.c 1 file changed, 22 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/common/paging.c b/src/common/paging.c index aa604e7..111f947 100644 --- a/src/common/paging.c +++ b/src/common/paging.c @@ -302,7 +302,9 @@ uint8_t cneed2, const uint8_t *identity3_lv) { struct gsm48_paging2 *pt2 = (struct gsm48_paging2 *) out_buf; + uint32_t tmsi; uint8_t *cur; + int rc; memset(out_buf, 0, sizeof(*pt2)); @@ -311,8 +313,12 @@ pt2->pag_mode = GSM48_PM_NORMAL; pt2->cneed1 = cneed1; pt2->cneed2 = cneed2; - tmsi_mi_to_uint(&pt2->tmsi1, tmsi1_lv); - tmsi_mi_to_uint(&pt2->tmsi2, tmsi2_lv); + rc = tmsi_mi_to_uint(&tmsi, tmsi1_lv); + if (rc == 0) + pt2->tmsi1 = tmsi; + rc = tmsi_mi_to_uint(&tmsi, tmsi2_lv); + if (rc == 0) + pt2->tmsi2 = tmsi; cur = out_buf + sizeof(*pt2); if (identity3_lv) @@ -329,6 +335,8 @@ const uint8_t *tmsi4_lv, uint8_t cneed4) { struct gsm48_paging3 *pt3 = (struct gsm48_paging3 *) out_buf; + uint32_t tmsi; + int rc; memset(out_buf, 0, sizeof(*pt3)); @@ -337,10 +345,18 @@ pt3->pag_mode = GSM48_PM_NORMAL; pt3->cneed1 = cneed1; pt3->cneed2 = cneed2; - tmsi_mi_to_uint(&pt3->tmsi1, tmsi1_lv); - tmsi_mi_to_uint(&pt3->tmsi2, tmsi2_lv); - tmsi_mi_to_uint(&pt3->tmsi3, tmsi3_lv); - tmsi_mi_to_uint(&pt3->tmsi4, tmsi4_lv); + rc = tmsi_mi_to_uint(&tmsi, tmsi1_lv); + if (rc == 0) + pt3->tmsi1 = tmsi; + rc = tmsi_mi_to_uint(&tmsi, tmsi2_lv); + if (rc == 0) + pt3->tmsi2 = tmsi; + rc = tmsi_mi_to_uint(&tmsi, tmsi3_lv); + if (rc == 0) + pt3->tmsi3 = tmsi; + rc = tmsi_mi_to_uint(&tmsi, tmsi4_lv); + if (rc == 0) + pt3->tmsi4 = tmsi; /* The structure definition in libosmocore is wrong. It includes as last * byte some invalid definition of chneed3/chneed4, so we must do this by hand -- To view, visit https://gerrit.osmocom.org/13769 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ief69854973a098e6da7c05f4417dc11988edd777 Gerrit-Change-Number: 13769 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:01:19 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 25 Apr 2019 20:01:19 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_04_11.c: clarify implicit CP-ACK handling In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13633 ) Change subject: libmsc/gsm_04_11.c: clarify implicit CP-ACK handling ...................................................................... libmsc/gsm_04_11.c: clarify implicit CP-ACK handling Change-Id: I3c5327a5019590c65d0ccb33a52f07b3988ea952 --- M src/libmsc/gsm_04_11.c 1 file changed, 6 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 434f878..da0744a 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -1238,11 +1238,13 @@ LOG_TRANS(trans, LOGL_DEBUG, "receiving SMS message %s\n", gsm48_pdisc_msgtype_name(gsm48_hdr_pdisc(gh), gsm48_hdr_msg_type(gh))); - /* 5.4: For MO, if a CP-DATA is received for a new - * transaction, equals reception of an implicit - * last CP-ACK for previous transaction */ + /* According to section 5.3.4, due to structure of message flow on + * SAPI 0 and 3 it is possible that the CP-ACK of a short message + * transfer might not be received. In this case the reception of + * CP-DATA may be interpreted as the reception of the awaited + * CP-ACK (implicit) and CP-DATA message. */ if (trans->sms.smc_inst.cp_state == GSM411_CPS_IDLE - && msg_type == GSM411_MT_CP_DATA) { + && msg_type == GSM411_MT_CP_DATA) { int i; struct gsm_trans *ptrans; -- To view, visit https://gerrit.osmocom.org/13633 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3c5327a5019590c65d0ccb33a52f07b3988ea952 Gerrit-Change-Number: 13633 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:05:34 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:05:34 +0000 Subject: Change in osmo-ttcn3-hacks[master]: deps/Makefile: Use osmocom fork of LLC protocol module In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13758 ) Change subject: deps/Makefile: Use osmocom fork of LLC protocol module ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8b9f107f0a99dcbd8148a3d431a101d194dfe788 Gerrit-Change-Number: 13758 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 25 Apr 2019 20:05:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:05:39 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:05:39 +0000 Subject: Change in osmo-ttcn3-hacks[master]: LLC_Templates: Add templates for NULL and DISC In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13759 ) Change subject: LLC_Templates: Add templates for NULL and DISC ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13759 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia5b350990379bba1677a0c1c99cf37e6651ba84d Gerrit-Change-Number: 13759 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 25 Apr 2019 20:05:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:06:11 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:06:11 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13760 ) Change subject: sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13760 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I38326f2ebaaff009d4357edad9511ce2ce7736fd Gerrit-Change-Number: 13760 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Comment-Date: Thu, 25 Apr 2019 20:06:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:06:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:06:13 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add test cases to verify SABM handling on LLGMM + LL5 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13766 ) Change subject: sgsn: Add test cases to verify SABM handling on LLGMM + LL5 ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13766 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib0d371a3356d6cb481b794945476ab40f5e0f02a Gerrit-Change-Number: 13766 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Thu, 25 Apr 2019 20:06:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:06:16 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:06:16 +0000 Subject: Change in osmo-ttcn3-hacks[master]: LLC_Templates: Add SABM, UA, FRMR, DM templates In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13757 ) Change subject: LLC_Templates: Add SABM, UA, FRMR, DM templates ...................................................................... LLC_Templates: Add SABM, UA, FRMR, DM templates Related: OS#3953 Change-Id: Idb40dcd53310b76ea9df6c0090e31175a4382460 --- M library/LLC_Templates.ttcn 1 file changed, 59 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/LLC_Templates.ttcn b/library/LLC_Templates.ttcn index 086207c..024ae0b 100644 --- a/library/LLC_Templates.ttcn +++ b/library/LLC_Templates.ttcn @@ -10,6 +10,14 @@ cR := cr, pD := '0'B } +template (value) Address_field ts_LLC_Addr(template (value) BIT4 sapi, + template (value) BIT1 cr, + template (value) BIT1 pd := '0'B) := { + sAPI := sapi, + spare := '00'B, + cR := cr, + pD := '0'B +} template (value) Control_field_UI ts_LLC_CtrlUI(uint9_t n_u, boolean encrypted := false, boolean protected := false) := { @@ -20,7 +28,7 @@ pM := bool2bit(protected) } -template (value) Control_field_U ts_LLC_CtrlU(BIT4 m_bits, BIT1 p_f) := { +template (value) Control_field_U ts_LLC_CtrlU(template (value) BIT4 m_bits, template (value) BIT1 p_f) := { mBits := m_bits, pF := p_f, format := '111'B @@ -47,7 +55,7 @@ template PDU_LLC ts_LLC_UI(octetstring payload, BIT4 sapi, BIT1 cr, uint9_t n_u, boolean encrypted := false, boolean protected := false) := { pDU_LLC_UI := { - address_field := t_LLC_Addr(sapi, cr), + address_field := ts_LLC_Addr(sapi, cr), control_field := ts_LLC_CtrlUI(n_u, encrypted, protected), information_field_UI := payload, fCS := omit /* causes encoder to generate FCS */ @@ -77,6 +85,55 @@ } } +template PDU_LLC tr_LLC_U(template BIT4 m_bits, template BIT1 p_f, template Information_field_U u, + template BIT4 sapi, template BIT1 cr) := { + pDU_LLC_U := { + address_field := t_LLC_Addr(sapi, cr), + control_field := tr_LLC_CtrlU(m_bits, p_f), + information_field_U := u, + fCS := '000000'O /* provided by decoder if FCS OK */ + } +} +template (value) PDU_LLC ts_LLC_U(template (value) BIT4 m_bits, template (value) BIT1 p_f, + template (value) Information_field_U u, + template (value) BIT4 sapi, template (value) BIT1 cr) := { + pDU_LLC_U := { + address_field := ts_LLC_Addr(sapi, cr), + control_field := ts_LLC_CtrlU(m_bits, p_f), + information_field_U := u, + fCS := omit /* causes encoder to generate FCS */ + } +} + +template PDU_LLC tr_LLC_SABM(template SABM_Information sabm_xid, template BIT1 p_f, + template BIT4 sapi, template BIT1 cr) := + tr_LLC_U('0111'B, p_f, Information_field_U:{sABM := sabm_xid}, sapi, cr); +template (value) PDU_LLC ts_LLC_SABM(template (value) SABM_Information sabm_xid, + template (value) BIT1 p_f, + template (value) BIT4 sapi, template (value) BIT1 cr) := + ts_LLC_U('0111'B, p_f, Information_field_U:{sABM := sabm_xid}, sapi, cr); + +template PDU_LLC tr_LLC_UA(template UA_Information ua_xid, template BIT1 p_f, + template BIT4 sapi, template BIT1 cr) := + tr_LLC_U('0110'B, p_f, Information_field_U:{uA := ua_xid}, sapi, cr); +template (value) PDU_LLC ts_LLC_UA(template (value) UA_Information ua_xid, + template (value) BIT1 p_f, + template (value) BIT4 sapi, template (value) BIT1 cr) := + ts_LLC_U('0110'B, p_f, Information_field_U:{uA := ua_xid}, sapi, cr); + +template PDU_LLC tr_LLC_FRMR(template FRMR_Information frmr, template BIT1 p_f, + template BIT4 sapi, template BIT1 cr) := + tr_LLC_U('1000'B, p_f, Information_field_U:{fRMR := frmr}, sapi, cr); +template (value) PDU_LLC ts_LLC_FRMR(template (value) FRMR_Information frmr, + template (value) BIT1 p_f, + template (value) BIT4 sapi, template (value) BIT1 cr) := + ts_LLC_U('1000'B, p_f, Information_field_U:{fRMR := frmr}, sapi, cr); + +template PDU_LLC tr_LLC_DM(template BIT1 p_f, template BIT4 sapi, template BIT1 cr) := + tr_LLC_U('0001'B, p_f, Information_field_U:{dM := ''O}, sapi, cr); +template (value) PDU_LLC ts_LLC_DM(template (value) BIT1 p_f, template (value) BIT4 sapi, + template (value) BIT1 cr) := + ts_LLC_U('0001'B, p_f, Information_field_U:{dM := ''O}, sapi, cr); const BIT4 c_LLC_SAPI_LLGMM := '0001'B; const BIT4 c_LLC_SAPI_TOM2 := '0010'B; -- To view, visit https://gerrit.osmocom.org/13757 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Idb40dcd53310b76ea9df6c0090e31175a4382460 Gerrit-Change-Number: 13757 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:06:16 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:06:16 +0000 Subject: Change in osmo-ttcn3-hacks[master]: deps/Makefile: Use osmocom fork of LLC protocol module In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13758 ) Change subject: deps/Makefile: Use osmocom fork of LLC protocol module ...................................................................... deps/Makefile: Use osmocom fork of LLC protocol module Change-Id: I8b9f107f0a99dcbd8148a3d431a101d194dfe788 --- M deps/Makefile 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/deps/Makefile b/deps/Makefile index 7cf9300..6b19cf3 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -37,13 +37,13 @@ titan.ProtocolModules.GTP_v13.5.0 \ titan.ProtocolModules.GTPv2_v13.7.0 \ titan.ProtocolModules.ISUP_Q.762 \ - titan.ProtocolModules.LLC_v7.1.0 \ titan.ProtocolModules.MobileL3_v13.4.0 \ titan.ProtocolModules.NS_v7.3.0 \ titan.ProtocolModules.SNDCP_v7.0.0 \ titan.ProtocolEmulations.SCCP OSMOGITHUB_REPOS= titan.TestPorts.SCTPasp \ + titan.ProtocolModules.LLC_v7.1.0 \ titan.ProtocolModules.SGsAP_13.2.0 \ titan.TestPorts.MTP3asp \ titan.ProtocolEmulations.M3UA @@ -69,7 +69,7 @@ titan.ProtocolModules.IP_commit= R.10.B-1-g99d0ec9 titan.ProtocolModules.ISUP_Q.762_commit= R.8.A titan.ProtocolModules.L2TP_commit= R.2.A -titan.ProtocolModules.LLC_v7.1.0_commit= R.2.A +titan.ProtocolModules.LLC_v7.1.0_commit= 2a3c09fbf7bae22f802aa88689800f38a1f3732d titan.ProtocolModules.MAP_commit= R.2.A-1-g79c6a3d titan.ProtocolModules.M2PA_commit= R.2.A titan.ProtocolModules.M3UA_commit= R.2.A -- To view, visit https://gerrit.osmocom.org/13758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8b9f107f0a99dcbd8148a3d431a101d194dfe788 Gerrit-Change-Number: 13758 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:06:17 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:06:17 +0000 Subject: Change in osmo-ttcn3-hacks[master]: LLC_Templates: Add templates for NULL and DISC In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13759 ) Change subject: LLC_Templates: Add templates for NULL and DISC ...................................................................... LLC_Templates: Add templates for NULL and DISC Change-Id: Ia5b350990379bba1677a0c1c99cf37e6651ba84d --- M library/LLC_Templates.ttcn 1 file changed, 13 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/LLC_Templates.ttcn b/library/LLC_Templates.ttcn index 024ae0b..b1cdb75 100644 --- a/library/LLC_Templates.ttcn +++ b/library/LLC_Templates.ttcn @@ -135,6 +135,19 @@ template (value) BIT1 cr) := ts_LLC_U('0001'B, p_f, Information_field_U:{dM := ''O}, sapi, cr); +template PDU_LLC tr_LLC_NULL(template BIT1 p_f, template BIT4 sapi, template BIT1 cr) := + tr_LLC_U('0000'B, p_f, Information_field_U:{nULL := ''O}, sapi, cr); +template (value) PDU_LLC ts_LLC_NULL(template (value) BIT1 p_f, template (value) BIT4 sapi, + template (value) BIT1 cr) := + ts_LLC_U('0000'B, p_f, Information_field_U:{nULL := ''O}, sapi, cr); + +template PDU_LLC tr_LLC_DISC(template BIT1 p_f, template BIT4 sapi, template BIT1 cr) := + tr_LLC_U('0100'B, p_f, Information_field_U:{dISC := ''O}, sapi, cr); +template (value) PDU_LLC ts_LLC_DISC(template (value) BIT1 p_f, template (value) BIT4 sapi, + template (value) BIT1 cr) := + ts_LLC_U('0100'B, p_f, Information_field_U:{dISC := ''O}, sapi, cr); + + const BIT4 c_LLC_SAPI_LLGMM := '0001'B; const BIT4 c_LLC_SAPI_TOM2 := '0010'B; const BIT4 c_LLC_SAPI_LL3 := '0011'B; -- To view, visit https://gerrit.osmocom.org/13759 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia5b350990379bba1677a0c1c99cf37e6651ba84d Gerrit-Change-Number: 13759 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:06:17 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:06:17 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13760 ) Change subject: sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet ...................................................................... sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet This test case reproduces a bug in OsmoSGSN where it would crash as a result to sending LLC NULL frames. Change-Id: I38326f2ebaaff009d4357edad9511ce2ce7736fd Related: OS#3952 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 25 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 74cdece..78bee58 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -375,12 +375,16 @@ f_sleep(20.0); } +function f_send_llc(template (value) PDU_LLC llc_pdu, integer gb_index := 0) runs on BSSGP_ConnHdlr { + var octetstring llc_enc := enc_PDU_LLC(valueof(llc_pdu)); + BSSGP[gb_index].send(ts_BSSGP_UL_UD(g_pars.tlli, g_pars.bssgp_cell_id[gb_index], llc_enc)); +} + function f_send_l3_gmm_llc(template PDU_L3_MS_SGSN l3_mo, integer gb_index := 0) runs on BSSGP_ConnHdlr { var octetstring l3_enc := enc_PDU_L3_MS_SGSN(valueof(l3_mo)); var BIT4 sapi := f_llc_sapi_by_l3_mo(valueof(l3_mo)); var integer n_u := f_llc_get_n_u_tx(llc[bit2int(sapi)]); - var octetstring llc_enc := enc_PDU_LLC(valueof(ts_LLC_UI(l3_enc, sapi, '0'B, n_u))); - BSSGP[gb_index].send(ts_BSSGP_UL_UD(g_pars.tlli, g_pars.bssgp_cell_id[gb_index], llc_enc)); + f_send_llc(ts_LLC_UI(l3_enc, sapi, '0'B, n_u)); } altstep as_mm_identity() runs on BSSGP_ConnHdlr { @@ -2153,6 +2157,23 @@ vc_conn.done; } + +/* Send LLC NULL to see if the SGSN survives it (OS#3952) */ +private function f_TC_llc_null(charstring id) runs on BSSGP_ConnHdlr { + f_gmm_attach(false, false); + f_sleep(1.0); + f_send_llc(ts_LLC_NULL('0'B, c_LLC_SAPI_LLGMM, LLC_CR_UL_CMD)); + /* try to detach to check if SGSN is still alive */ + f_detach_mo(c_GMM_DTT_MO_GPRS, true, true); +} +testcase TC_llc_null() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_llc_null), testcasename(), g_gb, 41); + vc_conn.done; +} + control { execute( TC_attach() ); execute( TC_attach_mnc3() ); @@ -2197,6 +2218,8 @@ execute( TC_attach_pdp_act_deact_mt_t3395_expire() ); execute( TC_attach_pdp_act_user_error_ind_ggsn() ); execute( TC_attach_gmm_attach_req_while_gmm_attach() ); + + execute( TC_llc_null() ); } -- To view, visit https://gerrit.osmocom.org/13760 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I38326f2ebaaff009d4357edad9511ce2ce7736fd Gerrit-Change-Number: 13760 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:06:17 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:06:17 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add test cases to verify SABM handling on LLGMM + LL5 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13766 ) Change subject: sgsn: Add test cases to verify SABM handling on LLGMM + LL5 ...................................................................... sgsn: Add test cases to verify SABM handling on LLGMM + LL5 As OsmoSGSN doesn't implement ABM, the correct resposne to any SABM is DM. RelateD: OS#3953 Change-Id: Ib0d371a3356d6cb481b794945476ab40f5e0f02a --- M sgsn/SGSN_Tests.ttcn 1 file changed, 36 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 78bee58..889a16f 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -2174,6 +2174,40 @@ vc_conn.done; } +/* Send LLC SABM to see if the SGSN rejects it properly with DM */ +private function f_TC_llc_sabm_dm_llgmm(charstring id) runs on BSSGP_ConnHdlr { + f_gmm_attach(false, false); + f_sleep(1.0); + f_send_llc(ts_LLC_SABM({}, '1'B, c_LLC_SAPI_LLGMM, LLC_CR_UL_CMD)); + BSSGP[0].receive(tr_BD_LLC(tr_LLC_DM(?, c_LLC_SAPI_LLGMM, LLC_CR_DL_RSP))); + setverdict(pass); +} +testcase TC_llc_sabm_dm_llgmm() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_llc_sabm_dm_llgmm), testcasename(), g_gb, 42); + vc_conn.done; +} + +/* Send LLC SABM to see if the SGSN rejects it properly with DM */ +private function f_TC_llc_sabm_dm_ll5(charstring id) runs on BSSGP_ConnHdlr { + f_gmm_attach(false, false); + f_sleep(1.0); + f_send_llc(ts_LLC_SABM({}, '1'B, c_LLC_SAPI_LL5, LLC_CR_UL_CMD)); + BSSGP[0].receive(tr_BD_LLC(tr_LLC_DM(?, c_LLC_SAPI_LL5, LLC_CR_DL_RSP))); + setverdict(pass); +} +testcase TC_llc_sabm_dm_ll5() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_llc_sabm_dm_ll5), testcasename(), g_gb, 43); + vc_conn.done; +} + + + control { execute( TC_attach() ); execute( TC_attach_mnc3() ); @@ -2220,6 +2254,8 @@ execute( TC_attach_gmm_attach_req_while_gmm_attach() ); execute( TC_llc_null() ); + execute( TC_llc_sabm_dm_llgmm() ); + execute( TC_llc_sabm_dm_ll5() ); } -- To view, visit https://gerrit.osmocom.org/13766 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib0d371a3356d6cb481b794945476ab40f5e0f02a Gerrit-Change-Number: 13766 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:06:50 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:06:50 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: f_mm_auth(): Add support for UMTS AKA In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13736 ) Change subject: msc: f_mm_auth(): Add support for UMTS AKA ...................................................................... msc: f_mm_auth(): Add support for UMTS AKA Change-Id: Id57adcebd63a06cfa555824e493561fe08f13d6d --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 30 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 4534a9b..e408f82 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -75,7 +75,8 @@ boolean mm_info, boolean sgsap_enable, boolean gsup_enable, - integer ran_idx + integer ran_idx, + boolean use_umts_aka }; /* get a one-octet bitmaks of supported algorithms based on Classmark information */ @@ -293,15 +294,34 @@ function f_mm_auth() runs on BSC_ConnHdlr { if (g_pars.net.expect_auth) { - g_pars.vec := f_gen_auth_vec_2g(); - var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(g_pars.vec.rand, - g_pars.vec.sres, - g_pars.vec.kc)); + var GSUP_IE auth_tuple; GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); - GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(g_pars.vec.rand))); - BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(g_pars.vec.sres))); + if (g_pars.use_umts_aka) { + g_pars.vec := f_gen_auth_vec_3g(); + auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G3G(g_pars.vec.rand, + g_pars.vec.sres, + g_pars.vec.kc, + g_pars.vec.ik, + g_pars.vec.ck, + g_pars.vec.autn, + g_pars.vec.res)); + GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); + + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ_3G(g_pars.vec.rand, g_pars.vec.autn))); + var OCT4 res := substr(g_pars.vec.res, 0, 4); + var OCT4 xres := substr(g_pars.vec.res, 4, 4); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_3G(res, xres))); + } else { + g_pars.vec := f_gen_auth_vec_2g(); + auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(g_pars.vec.rand, + g_pars.vec.sres, + g_pars.vec.kc)); + GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); + + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(g_pars.vec.rand))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(g_pars.vec.sres))); + } } } diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 8c221dc..7d9c098 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -513,7 +513,8 @@ mm_info := mp_mm_info, sgsap_enable := sgsap, gsup_enable := gsup, - ran_idx := ran_idx + ran_idx := ran_idx, + use_umts_aka := false }; return pars; } -- To view, visit https://gerrit.osmocom.org/13736 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id57adcebd63a06cfa555824e493561fe08f13d6d Gerrit-Change-Number: 13736 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:06:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:06:51 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Add testcase for UMTS AKA over GERAN TC_lu_imsi_auth3g_tmsi() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13737 ) Change subject: msc: Add testcase for UMTS AKA over GERAN TC_lu_imsi_auth3g_tmsi() ...................................................................... msc: Add testcase for UMTS AKA over GERAN TC_lu_imsi_auth3g_tmsi() Change-Id: I10cc7ed214e83b4624587c60f332034d3f19b22d --- M msc/MSC_Tests.ttcn 1 file changed, 15 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 7d9c098..9a37fb0 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -652,6 +652,20 @@ vc_conn.done; } +private function f_tc_lu_imsi_auth3g_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; + pars.use_umts_aka := true; + f_init_handler(pars); + f_perform_lu(); +} +testcase TC_lu_imsi_auth3g_tmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth3g_tmsi), 1005); + vc_conn.done; +} /* Send CM SERVICE REQ for IMSI that has never performed LU before */ private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) @@ -4667,6 +4681,7 @@ execute( TC_lu_imsi_reject() ); execute( TC_lu_imsi_timeout_gsup() ); execute( TC_lu_imsi_auth_tmsi() ); + execute( TC_lu_imsi_auth3g_tmsi() ); execute( TC_cmserv_imsi_unknown() ); execute( TC_lu_and_mo_call() ); execute( TC_lu_auth_sai_timeout() ); -- To view, visit https://gerrit.osmocom.org/13737 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I10cc7ed214e83b4624587c60f332034d3f19b22d Gerrit-Change-Number: 13737 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:07:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:07:12 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Modularize protocol support In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13651 ) Change subject: RAN_Emulation: Modularize protocol support ...................................................................... RAN_Emulation: Modularize protocol support The RAN_Emulation currently unconditionally provides BSSAP and MGCP support. Let's re-structure the code so that support for those protocols is now possible to enable/disable at compile time. This patch is in preparation of introducing RANAP support in RAN_Emulation. Change-Id: Id53ba3ff05f9946230e0e4a759245de14a0f9fbd Related: OS#2856 --- M bsc-nat/BSC_MS_ConnectionHandler.ttcn M bsc-nat/MSC_ConnectionHandler.ttcn M bsc-nat/gen_links.sh M bsc-nat/regen_makefile.sh M bsc/MSC_ConnectionHandler.ttcn M bsc/gen_links.sh M bsc/regen_makefile.sh R library/RAN_Adapter.ttcnpp R library/RAN_Emulation.ttcnpp M msc/BSC_ConnectionHandler.ttcn M msc/gen_links.sh M msc/regen_makefile.sh 12 files changed, 216 insertions(+), 141 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc-nat/BSC_MS_ConnectionHandler.ttcn b/bsc-nat/BSC_MS_ConnectionHandler.ttcn index 63d0451..e52b678 100644 --- a/bsc-nat/BSC_MS_ConnectionHandler.ttcn +++ b/bsc-nat/BSC_MS_ConnectionHandler.ttcn @@ -53,6 +53,7 @@ unitdata_cb := refers(UnitdataCallback), decode_dtap := false, role_ms := true, + protocol := RAN_PROTOCOL_BSSAP, sccp_addr_local := omit, sccp_addr_peer := omit } diff --git a/bsc-nat/MSC_ConnectionHandler.ttcn b/bsc-nat/MSC_ConnectionHandler.ttcn index 383b67b..8635a29 100644 --- a/bsc-nat/MSC_ConnectionHandler.ttcn +++ b/bsc-nat/MSC_ConnectionHandler.ttcn @@ -59,6 +59,7 @@ unitdata_cb := refers(UnitdataCallback), decode_dtap := false, role_ms := false, + protocol := RAN_PROTOCOL_BSSAP, sccp_addr_local := omit, sccp_addr_peer := omit } diff --git a/bsc-nat/gen_links.sh b/bsc-nat/gen_links.sh index e54eec4..16e32b7 100755 --- a/bsc-nat/gen_links.sh +++ b/bsc-nat/gen_links.sh @@ -47,7 +47,7 @@ gen_links $DIR $FILES DIR=../library -FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn BSSAP_CodecPort.ttcn" +FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcnpp MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn BSSAP_CodecPort.ttcn" gen_links $DIR $FILES ignore_pp_results diff --git a/bsc-nat/regen_makefile.sh b/bsc-nat/regen_makefile.sh index c5fe64c..f49df7e 100755 --- a/bsc-nat/regen_makefile.sh +++ b/bsc-nat/regen_makefile.sh @@ -4,6 +4,6 @@ FILES="*.ttcn *.ttcnpp SCCP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc RTP_EncDec.cc SDP_EncDec.cc *.c MGCP_CodecPort_CtrlFunctDef.cc" -export CPPFLAGS_TTCN3="-DIPA_EMULATION_SCCP -DIPA_EMULATION_MGCP -DUSE_MTP3_DISTRIBUTOR" +export CPPFLAGS_TTCN3="-DIPA_EMULATION_SCCP -DIPA_EMULATION_MGCP -DRAN_EMULATION_BSSAP -DRAN_EMULATION_MGCP -DUSE_MTP3_DISTRIBUTOR" ../regen-makefile.sh $MAIN $FILES diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 36e554d..520cc3e 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -376,6 +376,7 @@ unitdata_cb := refers(UnitdataCallback), decode_dtap := false, role_ms := false, + protocol := RAN_PROTOCOL_BSSAP, sccp_addr_local := omit, sccp_addr_peer := omit } diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh index d8393c3..a4f09f4 100755 --- a/bsc/gen_links.sh +++ b/bsc/gen_links.sh @@ -67,7 +67,7 @@ gen_links $DIR $FILES DIR=../library -FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn RAN_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn" +FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcnpp RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn RAN_Adapter.ttcnpp Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn" gen_links $DIR $FILES ignore_pp_results diff --git a/bsc/regen_makefile.sh b/bsc/regen_makefile.sh index 08629d2..06fa812 100755 --- a/bsc/regen_makefile.sh +++ b/bsc/regen_makefile.sh @@ -4,6 +4,6 @@ FILES="*.ttcn *.ttcnpp IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc SCTPasp_PT.cc RTP_EncDec.cc SDP_EncDec.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc IuUP_EncDec.cc Native_FunctionDefs.cc TELNETasp_PT.cc *.c" -export CPPFLAGS_TTCN3="-DIPA_EMULATION_RSL -DIPA_EMULATION_MGCP -DIPA_EMULATION_SCCP -DUSE_MTP3_DISTRIBUTOR" +export CPPFLAGS_TTCN3="-DIPA_EMULATION_RSL -DIPA_EMULATION_MGCP -DIPA_EMULATION_SCCP -DRAN_EMULATION_BSSAP -DRAN_EMULATION_MGCP -DUSE_MTP3_DISTRIBUTOR" ../regen-makefile.sh $MAIN $FILES diff --git a/library/RAN_Adapter.ttcn b/library/RAN_Adapter.ttcnpp similarity index 98% rename from library/RAN_Adapter.ttcn rename to library/RAN_Adapter.ttcnpp index 294f747..43b4988 100644 --- a/library/RAN_Adapter.ttcn +++ b/library/RAN_Adapter.ttcnpp @@ -88,6 +88,7 @@ ba.vc_RAN := RAN_Emulation_CT.create(id & "-RAN"); } select (cfg.transport) { +#ifdef RAN_EMULATION_BSSAP case (BSSAP_TRANSPORT_AoIP) { ba.vc_M3UA := M3UA_CT.create(id & "-M3UA"); map(ba.vc_M3UA:SCTP_PORT, system:sctp); @@ -128,6 +129,7 @@ ba.vc_WAIT.done; disconnect(ba.vc_IPA:IPA_SP_PORT, ba.vc_WAIT:IPA_SP_PORT); } +#endif case else { setverdict(fail, "Unsuppored RAN_Transport"); mtc.stop; @@ -139,8 +141,10 @@ T.start; //T.timeout; log("Connecting BSSMAP Emulation to SCCP_SP_PORT and starting emulation"); +#if RAN_EMULATION_BSSAP /* connect BSSNAP component to upper side of SCCP */ connect(ba.vc_RAN:BSSAP, ba.vc_SCCP:SCCP_SP_PORT); +#endif if (cfg.transport == BSSAP_TRANSPORT_SCCPlite_SERVER or cfg.transport == BSSAP_TRANSPORT_SCCPlite_CLIENT) { /* connect IPA MGCP port with BSSMAP MGCP port */ diff --git a/library/RAN_Emulation.ttcn b/library/RAN_Emulation.ttcnpp similarity index 92% rename from library/RAN_Emulation.ttcn rename to library/RAN_Emulation.ttcnpp index 72e2733..e091133 100644 --- a/library/RAN_Emulation.ttcn +++ b/library/RAN_Emulation.ttcnpp @@ -22,7 +22,7 @@ * Inbound Unit Data messages (such as are dispatched to the RanOps.unitdata_cb() callback, * which is registered with an argument to the main() function below. * - * (C) 2017-2018 by Harald Welte + * (C) 2017-2019 by Harald Welte * All rights reserved. * * Released under the terms of GNU General Public License, Version 2 or @@ -34,13 +34,19 @@ import from Osmocom_Types all; import from SCCP_Emulation all; import from SCCPasp_Types all; +import from IPA_Emulation all; +import from MobileL3_Types all; + +#ifdef RAN_EMULATION_BSSAP import from BSSAP_Types all; import from BSSAP_CodecPort all; import from BSSMAP_Templates all; +#endif + +#ifdef RAN_EMULATION_MGCP import from MGCP_Types all; import from MGCP_Templates all; -import from IPA_Emulation all; -import from MobileL3_Types all; +#endif /* General "base class" component definition, of which specific implementations * derive themselves by means of the "extends" feature */ @@ -61,12 +67,6 @@ MSC_CONN_PRIM_CONF_IND } -type record BSSAP_Conn_Req { - SCCP_PAR_Address addr_peer, - SCCP_PAR_Address addr_own, - PDU_BSSAP bssap -} - /* similar to PDU_BSSAP with DTAP, but DTAP is already decoded! */ type record PDU_DTAP_MO { OCT1 dlci optional, @@ -102,23 +102,22 @@ dtap := dtap } -template BSSAP_Conn_Req ts_BSSAP_Conn_Req(SCCP_PAR_Address peer, SCCP_PAR_Address own, PDU_BSSAP bssap) := { - addr_peer := peer, - addr_own := own, - bssap := bssap -}; - - /* port between individual per-connection components and this dispatcher */ type port RAN_Conn_PT message { - /* BSSAP or direct DTAP messages from/to clients */ - inout PDU_BSSAP, PDU_DTAP_MO, PDU_DTAP_MT, - /* misc indications / requests between SCCP and client */ - RAN_Conn_Prim, + inout +#ifdef RAN_EMULATION_BSSAP + PDU_BSSAP, /* Client requests us to create SCCP Connection */ BSSAP_Conn_Req, +#endif +#ifdef RAN_EMULATION_MGCP /* MGCP, only used for IPA SCCPlite (MGCP in IPA mux) */ - MgcpCommand, MgcpResponse; + MgcpCommand, MgcpResponse, +#endif + /* direct DTAP messages from/to clients */ + PDU_DTAP_MO, PDU_DTAP_MT, + /* misc indications / requests between SCCP and client */ + RAN_Conn_Prim; } with { extension "internal" }; @@ -127,8 +126,10 @@ /* reference to the instance of the per-connection component */ RAN_ConnHdlr comp_ref, integer sccp_conn_id, +#ifdef RAN_EMULATION_MGCP /* most recent MGCP transaction ID (Used on MSC side) */ MgcpTransId mgcp_trans_id optional, +#endif /* CIC that has been used for voice of this channel (BSC side) */ integer cic optional, /* array of N(SD) values for MO DTAP messages, indexed by discriminator */ @@ -142,12 +143,16 @@ } type component RAN_Emulation_CT { - /* SCCP port on the bottom side, using ASP primitives */ + /* SCCP ports on the bottom side, using ASP primitives */ +#ifdef RAN_EMULATION_BSSAP port BSSAP_CODEC_PT BSSAP; +#endif /* BSSAP port to the per-connection clients */ port RAN_Conn_PT CLIENT; +#ifdef RAN_EMULATION_MGCP /* MGCP port */ port IPA_MGCP_PT MGCP; +#endif /* use 16 as this is also the number of SCCP connections that SCCP_Emulation can handle */ var ConnectionData ConnectionTable[16]; @@ -212,6 +217,8 @@ mtc.stop; } + +#ifdef RAN_EMULATION_MGCP /* resolve component reference by CIC */ private function f_comp_by_mgcp_tid(MgcpTransId tid) runs on RAN_Emulation_CT return RAN_ConnHdlr { @@ -237,6 +244,7 @@ setverdict(fail, "RAN Connection table not found by component ", client); mtc.stop; } +#endif private function f_comp_by_cic(integer cic) runs on RAN_Emulation_CT return RAN_ConnHdlr { @@ -303,7 +311,9 @@ for (var integer i := 0; i < sizeof(ConnectionTable); i := i+1) { ConnectionTable[i].comp_ref := null; ConnectionTable[i].sccp_conn_id := -1; +#ifdef RAN_EMULATION_MGCP ConnectionTable[i].mgcp_trans_id := omit; +#endif ConnectionTable[i].cic := omit; ConnectionTable[i].n_sd := { 0, 0, 0, 0 }; } @@ -354,6 +364,18 @@ return null; } +#ifdef RAN_EMULATION_BSSAP +type record BSSAP_Conn_Req { + SCCP_PAR_Address addr_peer, + SCCP_PAR_Address addr_own, + PDU_BSSAP bssap +} +template BSSAP_Conn_Req ts_BSSAP_Conn_Req(SCCP_PAR_Address peer, SCCP_PAR_Address own, PDU_BSSAP bssap) := { + addr_peer := peer, + addr_own := own, + bssap := bssap +}; + /* handle (optional) userData portion of various primitives and dispatch it to the client */ private function f_handle_userData(RAN_ConnHdlr client, PDU_BSSAP bssap) runs on RAN_Emulation_CT { @@ -420,69 +442,6 @@ return g_ran_ops.unitdata_cb.apply(bssap); } -type record RanOps { - BssmapCreateCallback create_cb, - BssmapUnitdataCallback unitdata_cb, - boolean decode_dtap, - boolean role_ms, - /* needed for performing BSSMAP RESET */ - SCCP_PAR_Address sccp_addr_local optional, - SCCP_PAR_Address sccp_addr_peer optional -} - -template BIT4 t_ML3_DISC_CC_MM_SS := ('0011'B, '0101'B, '1011'B); - -/* patch N(SD) into enc_l3, according to 24.007 11.2.3.2 */ -function f_ML3_patch_seq(inout ConnectionData cd, in PDU_ML3_MS_NW dtap, inout octetstring enc_l3) { - var uint2_t seq_nr; - if (ischosen(dtap.msgs.cc) or ischosen(dtap.msgs.mm) or ischosen(dtap.msgs.ss)) { - seq_nr := cd.n_sd[0]; - cd.n_sd[0] := (cd.n_sd[0] + 1) mod 4; - } else if (ischosen(dtap.msgs.gcc)) { - seq_nr := cd.n_sd[1]; - cd.n_sd[1] := (cd.n_sd[1] + 1) mod 2; - } else if (ischosen(dtap.msgs.bcc)) { - seq_nr := cd.n_sd[2]; - cd.n_sd[2] := (cd.n_sd[2] + 1) mod 2; - } else if (ischosen(dtap.msgs.loc)) { - seq_nr := cd.n_sd[3]; - cd.n_sd[3] := (cd.n_sd[3] + 1) mod 2; - } else { - /* no sequence number to patch */ - return; - } - log("patching N(SD)=", seq_nr, " into dtap ", enc_l3); - enc_l3[1] := (enc_l3[1] and4b '3f'O) or4b bit2oct(int2bit(seq_nr, 8) << 6); - log("patched enc_l3: ", enc_l3); -} - -private function f_bssap_l3_is_rr(PDU_BSSAP bssap) return boolean { - var template octetstring l3 := f_bssap_extract_l3(bssap); - if (not isvalue(l3)) { - return false; - } - var octetstring l3v := valueof(l3); - if (lengthof(l3v) < 1) { - return false; - } - /* lower 4 bits of first octet are protocol discriminator */ - if ((oct2bit(l3v[0]) and4b '00001111'B) == '00000110'B) { - return true; - } - return false; -} - -private altstep as_reset_ack() runs on RAN_Emulation_CT { - var BSSAP_N_UNITDATA_ind ud_ind; - [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) -> value ud_ind { - log("Respoding to inbound RESET with RESET-ACK"); - BSSAP.send(ts_BSSAP_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress, - ts_BSSMAP_ResetAck)); - repeat; - } -} - - private function f_bssap_wait_for_reset() runs on RAN_Emulation_CT { var BSSAP_N_UNITDATA_ind ud_ind; timer T := 20.0; @@ -522,37 +481,98 @@ } } -function main(RanOps ops, charstring id) runs on RAN_Emulation_CT { +private function f_bssap_l3_is_rr(PDU_BSSAP bssap) return boolean { + var template octetstring l3 := f_bssap_extract_l3(bssap); + return f_L3_is_rr(l3); +} +#endif - g_ran_id := id; - g_ran_ops := ops; - f_conn_table_init(); - f_expect_table_init(); - if (isvalue(ops.sccp_addr_peer) and isvalue(ops.sccp_addr_local)) { - f_sleep(1.0); /* HACK to wait for M3UA/ASP to be ACTIVE */ - f_bssap_reset(ops.sccp_addr_peer, ops.sccp_addr_local); + +type enumerated RanProtocol { + RAN_PROTOCOL_BSSAP +} + +type record RanOps { +#ifdef RAN_EMULATION_BSSAP + BssmapCreateCallback create_cb optional, + BssmapUnitdataCallback unitdata_cb optional, +#endif + boolean decode_dtap, + boolean role_ms, + RanProtocol protocol, + /* needed for performing BSSMAP RESET */ + SCCP_PAR_Address sccp_addr_local optional, + SCCP_PAR_Address sccp_addr_peer optional +} + +template BIT4 t_ML3_DISC_CC_MM_SS := ('0011'B, '0101'B, '1011'B); + +private function f_L3_is_rr(template octetstring l3) return boolean { + if (not isvalue(l3)) { + return false; } + var octetstring l3v := valueof(l3); + if (lengthof(l3v) < 1) { + return false; + } + /* lower 4 bits of first octet are protocol discriminator */ + if ((oct2bit(l3v[0]) and4b '00001111'B) == '00000110'B) { + return true; + } + return false; +} - while (true) { +/* patch N(SD) into enc_l3, according to 24.007 11.2.3.2 */ +function f_ML3_patch_seq(inout ConnectionData cd, in PDU_ML3_MS_NW dtap, inout octetstring enc_l3) { + var uint2_t seq_nr; + if (ischosen(dtap.msgs.cc) or ischosen(dtap.msgs.mm) or ischosen(dtap.msgs.ss)) { + seq_nr := cd.n_sd[0]; + cd.n_sd[0] := (cd.n_sd[0] + 1) mod 4; + } else if (ischosen(dtap.msgs.gcc)) { + seq_nr := cd.n_sd[1]; + cd.n_sd[1] := (cd.n_sd[1] + 1) mod 2; + } else if (ischosen(dtap.msgs.bcc)) { + seq_nr := cd.n_sd[2]; + cd.n_sd[2] := (cd.n_sd[2] + 1) mod 2; + } else if (ischosen(dtap.msgs.loc)) { + seq_nr := cd.n_sd[3]; + cd.n_sd[3] := (cd.n_sd[3] + 1) mod 2; + } else { + /* no sequence number to patch */ + return; + } + log("patching N(SD)=", seq_nr, " into dtap ", enc_l3); + enc_l3[1] := (enc_l3[1] and4b '3f'O) or4b bit2oct(int2bit(seq_nr, 8) << 6); + log("patched enc_l3: ", enc_l3); +} + +private altstep as_reset_ack() runs on RAN_Emulation_CT { +#ifdef RAN_EMULATION_BSSAP + var BSSAP_N_UNITDATA_ind ud_ind; +#endif +#ifdef RAN_EMULATION_BSSAP + [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) -> value ud_ind { + log("Respoding to inbound RESET with RESET-ACK"); + BSSAP.send(ts_BSSAP_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress, + ts_BSSMAP_ResetAck)); + repeat; + } +#endif +} + + +private altstep as_main_bssap() runs on RAN_Emulation_CT { +#ifdef RAN_EMULATION_BSSAP var BSSAP_N_UNITDATA_ind ud_ind; var BSSAP_N_CONNECT_ind conn_ind; var BSSAP_N_CONNECT_cfm conn_cfm; var BSSAP_N_DATA_ind data_ind; var BSSAP_N_DISCONNECT_ind disc_ind; var BSSAP_Conn_Req creq; - var RAN_ConnHdlr vc_conn; var PDU_BSSAP bssap; - var PDU_DTAP_MO dtap_mo; - var PDU_DTAP_MT dtap_mt; - var MgcpCommand mgcp_req; - var MgcpResponse mgcp_resp; - var RAN_ConnHdlr vc_hdlr; - var octetstring l3_info; - var hexstring imsi; - var OCT4 tmsi; + var RAN_ConnHdlr vc_conn; - alt { /* SCCP -> Client: UNIT-DATA (connectionless SCCP) from a BSC */ [] BSSAP.receive(BSSAP_N_UNITDATA_ind:?) -> value ud_ind { /* Connectionless Procedures like RESET */ @@ -563,10 +583,9 @@ ud_ind.calledAddress, resp)); } } - /* SCCP -> Client: new connection from BSC */ [] BSSAP.receive(BSSAP_N_CONNECT_ind:?) -> value conn_ind { - vc_conn := ops.create_cb.apply(conn_ind, id); + vc_conn := g_ran_ops.create_cb.apply(conn_ind, g_ran_id); /* store mapping between client components and SCCP connectionId */ f_conn_table_add(vc_conn, conn_ind.connectionId); /* handle user payload */ @@ -574,7 +593,6 @@ /* confirm connection establishment */ BSSAP.send(ts_BSSAP_CONNECT_res(conn_ind.connectionId, omit)); } - /* SCCP -> Client: connection-oriented data in existing connection */ [] BSSAP.receive(BSSAP_N_DATA_ind:?) -> value data_ind { vc_conn := f_comp_by_conn_id(data_ind.connectionId); @@ -582,7 +600,6 @@ f_handle_userData(vc_conn, data_ind.userData); } } - /* SCCP -> Client: disconnect of an existing connection */ [] BSSAP.receive(BSSAP_N_DISCONNECT_ind:?) -> value disc_ind { vc_conn := f_comp_by_conn_id(disc_ind.connectionId); @@ -595,7 +612,6 @@ f_conn_table_del(disc_ind.connectionId); /* TOOD: return confirm to other side? */ } - /* SCCP -> Client: connection confirm for outbound connection */ [] BSSAP.receive(BSSAP_N_CONNECT_cfm:?) -> value conn_cfm { vc_conn := f_comp_by_conn_id(conn_cfm.connectionId); @@ -606,6 +622,11 @@ f_handle_userData(vc_conn, conn_cfm.userData); } } + [] CLIENT.receive(PDU_BSSAP:?) -> value bssap sender vc_conn { + var integer conn_id := f_conn_id_by_comp(vc_conn); + /* send it to dispatcher */ + BSSAP.send(ts_BSSAP_DATA_req(conn_id, bssap)); + } /* Disconnect request client -> SCCP */ [] CLIENT.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ) -> sender vc_conn { @@ -644,33 +665,16 @@ } } +#else + [false] CLIENT.receive(false) {} +#endif +} - [] CLIENT.receive(PDU_BSSAP:?) -> value bssap sender vc_conn { - var integer conn_id := f_conn_id_by_comp(vc_conn); - /* send it to dispatcher */ - BSSAP.send(ts_BSSAP_DATA_req(conn_id, bssap)); - } - - [g_ran_ops.role_ms] CLIENT.receive(PDU_DTAP_MO:?) -> value dtap_mo sender vc_conn { - var integer idx := f_idx_by_comp(vc_conn); - /* convert from decoded DTAP to encoded DTAP */ - var octetstring l3_enc := enc_PDU_ML3_MS_NW(dtap_mo.dtap); - /* patch correct L3 send sequence number N(SD) into l3_enc */ - if (dtap_mo.skip_seq_patching == false) { - f_ML3_patch_seq(ConnectionTable[idx], dtap_mo.dtap, l3_enc); - } - bssap := valueof(ts_BSSAP_DTAP(l3_enc, dtap_mo.dlci)); - BSSAP.send(ts_BSSAP_DATA_req(ConnectionTable[idx].sccp_conn_id, bssap)); - } - - [not g_ran_ops.role_ms] CLIENT.receive(PDU_DTAP_MT:?) -> value dtap_mt sender vc_conn { - var integer conn_id := f_conn_id_by_comp(vc_conn); - /* convert from decoded DTAP to encoded DTAP */ - var octetstring l3_enc := enc_PDU_ML3_NW_MS(dtap_mt.dtap); - bssap := valueof(ts_BSSAP_DTAP(l3_enc, dtap_mo.dlci)); - BSSAP.send(ts_BSSAP_DATA_req(conn_id, bssap)); - } - +private altstep as_main_mgcp() runs on RAN_Emulation_CT { +#ifdef RAN_EMULATION_MGCP + var MgcpCommand mgcp_req; + var MgcpResponse mgcp_resp; + var RAN_ConnHdlr vc_conn; /* Handling of MGCP in IPA SCCPLite case. This predates 3GPP AoIP * and uses a MGCP session in parallel to BSSAP. BSSAP uses CIC @@ -710,7 +714,68 @@ vc_conn := f_comp_by_mgcp_tid(mgcp_resp.line.trans_id); CLIENT.send(mgcp_resp) to vc_conn; } +#else + [false] CLIENT.receive {} +#endif +} +/* send a raw (encoded) L3 message over given SCCP connection */ +private function f_xmit_raw_l3(integer sccp_conn_id, OCT1 dlci, octetstring l3_enc) runs on RAN_Emulation_CT +{ + select (g_ran_ops.protocol) { +#ifdef RAN_EMULATION_BSSAP + case (RAN_PROTOCOL_BSSAP) { + var PDU_BSSAP bssap; + bssap := valueof(ts_BSSAP_DTAP(l3_enc, dlci)); + BSSAP.send(ts_BSSAP_DATA_req(sccp_conn_id, bssap)); + } +#endif + } +} + +function main(RanOps ops, charstring id) runs on RAN_Emulation_CT { + + g_ran_id := id; + g_ran_ops := ops; + f_conn_table_init(); + f_expect_table_init(); + + if (isvalue(ops.sccp_addr_peer) and isvalue(ops.sccp_addr_local)) { + f_sleep(1.0); /* HACK to wait for M3UA/ASP to be ACTIVE */ + f_bssap_reset(ops.sccp_addr_peer, ops.sccp_addr_local); + } + + while (true) { + var RAN_ConnHdlr vc_conn; + var PDU_DTAP_MO dtap_mo; + var PDU_DTAP_MT dtap_mt; + var RAN_ConnHdlr vc_hdlr; + var octetstring l3_info; + var hexstring imsi; + var OCT4 tmsi; + + alt { + [g_ran_ops.protocol == RAN_PROTOCOL_BSSAP] as_main_bssap(); + + [g_ran_ops.role_ms] CLIENT.receive(PDU_DTAP_MO:?) -> value dtap_mo sender vc_conn { + var integer idx := f_idx_by_comp(vc_conn); + /* convert from decoded DTAP to encoded DTAP */ + var octetstring l3_enc := enc_PDU_ML3_MS_NW(dtap_mo.dtap); + /* patch correct L3 send sequence number N(SD) into l3_enc */ + if (dtap_mo.skip_seq_patching == false) { + f_ML3_patch_seq(ConnectionTable[idx], dtap_mo.dtap, l3_enc); + } + f_xmit_raw_l3(ConnectionTable[idx].sccp_conn_id, dtap_mo.dlci, l3_enc); + } + + [not g_ran_ops.role_ms] CLIENT.receive(PDU_DTAP_MT:?) -> value dtap_mt sender vc_conn { + var integer idx := f_idx_by_comp(vc_conn); + /* convert from decoded DTAP to encoded DTAP */ + var octetstring l3_enc := enc_PDU_ML3_NW_MS(dtap_mt.dtap); + f_xmit_raw_l3(ConnectionTable[idx].sccp_conn_id, dtap_mt.dlci, l3_enc); + } + + [] as_main_mgcp(); [] PROC.getcall(RAN_register:{?,?}) -> param(l3_info, vc_hdlr) { f_create_expect(l3_info, vc_hdlr); @@ -727,11 +792,13 @@ } } +#ifdef RAN_EMULATION_MGCP private function f_mgcp_ep_extract_cic(charstring inp) return integer { var charstring local_part := regexp(inp, "(*)@*", 0); return hex2int(str2hex(local_part)); } +#endif /*********************************************************************** * "Expect" Handling (mapping for expected incoming SCCP connections) diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index e408f82..11baf2a 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -180,6 +180,7 @@ unitdata_cb := refers(BscUnitdataCallback), decode_dtap := true, role_ms := true, + protocol := RAN_PROTOCOL_BSSAP, sccp_addr_local := omit, sccp_addr_peer := omit } diff --git a/msc/gen_links.sh b/msc/gen_links.sh index a29118a..e4e142b 100755 --- a/msc/gen_links.sh +++ b/msc/gen_links.sh @@ -89,7 +89,7 @@ FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc " FILES+="IPA_Types.ttcn IPA_Emulation.ttcnpp IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc GSUP_Types.ttcn GSUP_Emulation.ttcn " FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Common.ttcn " -FILES+="RAN_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn RAN_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn " +FILES+="RAN_Emulation.ttcnpp BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn RAN_Adapter.ttcnpp MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn " FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc " FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc " FILES+="SMPP_CodecPort.ttcn SMPP_CodecPort_CtrlFunct.ttcn SMPP_CodecPort_CtrlFunctDef.cc SMPP_Emulation.ttcn SMPP_Templates.ttcn " diff --git a/msc/regen_makefile.sh b/msc/regen_makefile.sh index 5645fdd..091faf8 100755 --- a/msc/regen_makefile.sh +++ b/msc/regen_makefile.sh @@ -2,6 +2,6 @@ FILES="*.ttcn *.ttcnpp SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc Native_FunctionDefs.cc SMPP_EncDec.cc SMPP_CodecPort_CtrlFunctDef.cc MAP_EncDec.cc SS_EncDec.cc TCCEncoding.cc SGsAP_CodecPort_CtrlFunctDef.cc *.c *.asn" -export CPPFLAGS_TTCN3="-DIPA_EMULATION_MGCP -DIPA_EMULATION_GSUP -DIPA_EMULATION_SCCP -DUSE_MTP3_DISTRIBUTOR" +export CPPFLAGS_TTCN3="-DIPA_EMULATION_MGCP -DIPA_EMULATION_GSUP -DIPA_EMULATION_SCCP -DRAN_EMULATION_BSSAP -DRAN_EMULATION_MGCP -DUSE_MTP3_DISTRIBUTOR" ../regen-makefile.sh MSC_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/13651 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id53ba3ff05f9946230e0e4a759245de14a0f9fbd Gerrit-Change-Number: 13651 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:07:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:07:12 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Adapter: Rename functions from f_bssap_* to f_ran_adapter_* In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13749 ) Change subject: RAN_Adapter: Rename functions from f_bssap_* to f_ran_adapter_* ...................................................................... RAN_Adapter: Rename functions from f_bssap_* to f_ran_adapter_* Change-Id: I73818247f1dfc71c8ece11660e6c18f5f153d186 --- M bsc/BSC_Tests.ttcn M library/RAN_Adapter.ttcnpp M msc/MSC_Tests.ttcn 3 files changed, 10 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 720669b..fb43d5e 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -316,12 +316,12 @@ /* Call a function of our 'parent component' RAN_Adapter_CT to start the * MSC-side BSSAP emulation */ if (handler_mode) { - f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", MSC_RanOps); - f_bssap_start(g_bssap); + f_ran_adapter_init(g_bssap, mp_bssap_cfg, "VirtMSC", MSC_RanOps); + f_ran_adapter_start(g_bssap); } else { - f_bssap_init(g_bssap, mp_bssap_cfg, "VirtMSC", omit); + f_ran_adapter_init(g_bssap, mp_bssap_cfg, "VirtMSC", omit); connect(self:BSSAP, g_bssap.vc_SCCP:SCCP_SP_PORT); - f_bssap_start(g_bssap); + f_ran_adapter_start(g_bssap); f_legacy_bssap_reset(); } diff --git a/library/RAN_Adapter.ttcnpp b/library/RAN_Adapter.ttcnpp index 43b4988..a96c6ef 100644 --- a/library/RAN_Adapter.ttcnpp +++ b/library/RAN_Adapter.ttcnpp @@ -76,7 +76,7 @@ } -function f_bssap_init(inout RAN_Adapter ba, in RAN_Configuration cfg, charstring id, +function f_ran_adapter_init(inout RAN_Adapter ba, in RAN_Configuration cfg, charstring id, template RanOps ops) { init_pars(ba, cfg); ops.sccp_addr_local := ba.sccp_addr_own; @@ -157,7 +157,7 @@ } -function f_bssap_start(inout RAN_Adapter ba) { +function f_ran_adapter_start(inout RAN_Adapter ba) { ba.vc_SCCP.start(SCCPStart(ba.sccp_pars)); } diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 9a37fb0..b2503b7 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -277,8 +277,8 @@ for (var integer i := 0; i < num_bsc; i := i + 1) { if (isbound(mp_bssap_cfg[i])) { - f_bssap_init(g_bssap[i], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), BSC_RanOps); - f_bssap_start(g_bssap[i]); + f_ran_adapter_init(g_bssap[i], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), BSC_RanOps); + f_ran_adapter_start(g_bssap[i]); } else { testcase.stop("missing BSSAP configuration"); } @@ -311,7 +311,7 @@ * to f_init() when the high level functions of the BSC_ConnectionHandler are * not needed. */ function f_init_bssap_direct() runs on MTC_CT { - f_bssap_init(g_bssap[0], mp_bssap_cfg[0], "MSC_Test", omit); + f_ran_adapter_init(g_bssap[0], mp_bssap_cfg[0], "MSC_Test", omit); connect(g_bssap[0].vc_SCCP:SCCP_SP_PORT, self:BSSAP_DIRECT); /* Start guard timer and activate it as default */ @@ -1860,7 +1860,7 @@ var boolean reset_ack_seen := false; f_init_bssap_direct(); - f_bssap_start(g_bssap[0]); + f_ran_adapter_start(g_bssap[0]); f_sleep(3.0); -- To view, visit https://gerrit.osmocom.org/13749 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I73818247f1dfc71c8ece11660e6c18f5f153d186 Gerrit-Change-Number: 13749 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:07:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:07:12 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Adapter: Support build without IPA / BSSAP support In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13750 ) Change subject: RAN_Adapter: Support build without IPA / BSSAP support ...................................................................... RAN_Adapter: Support build without IPA / BSSAP support Change-Id: I5370f0ea6f2f6cfdc3370a6f3d3bf2e6c32af4d2 --- M library/RAN_Adapter.ttcnpp 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/RAN_Adapter.ttcnpp b/library/RAN_Adapter.ttcnpp index a96c6ef..ae7934e 100644 --- a/library/RAN_Adapter.ttcnpp +++ b/library/RAN_Adapter.ttcnpp @@ -22,7 +22,9 @@ import from SCTPasp_Types all; import from SCTPasp_PortType all; +#ifdef RAN_EMULATION_BSSAP import from BSSMAP_Templates all; +#endif import from RAN_Emulation all; type record RAN_Adapter { @@ -96,6 +98,7 @@ connect(ba.vc_M3UA:MTP3_SP_PORT, ba.vc_SCCP:MTP3_SCCP_PORT); ba.vc_M3UA.start(f_M3UA_Emulation(cfg.sctp_addr, cfg.rctx)); } +#ifdef IPA_EMULATION_SCCP case (BSSAP_TRANSPORT_SCCPlite_SERVER) { ba.vc_IPA := IPA_Emulation_CT.create(id & "-IPA"); map(ba.vc_IPA:IPA_PORT, system:IPA_CODEC_PT); @@ -129,7 +132,8 @@ ba.vc_WAIT.done; disconnect(ba.vc_IPA:IPA_SP_PORT, ba.vc_WAIT:IPA_SP_PORT); } -#endif +#endif /* SCCP */ +#endif /* BSSAP */ case else { setverdict(fail, "Unsuppored RAN_Transport"); mtc.stop; @@ -147,8 +151,10 @@ #endif if (cfg.transport == BSSAP_TRANSPORT_SCCPlite_SERVER or cfg.transport == BSSAP_TRANSPORT_SCCPlite_CLIENT) { +#ifdef IPA_EMULATION_MGCP /* connect IPA MGCP port with BSSMAP MGCP port */ connect(ba.vc_IPA:IPA_MGCP_PORT, ba.vc_RAN:MGCP); +#endif } /* start the BSSMAP emulation */ ba.vc_RAN.start(RAN_Emulation.main(valueof(ops), "")); -- To view, visit https://gerrit.osmocom.org/13750 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5370f0ea6f2f6cfdc3370a6f3d3bf2e6c32af4d2 Gerrit-Change-Number: 13750 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:07:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:07:12 +0000 Subject: Change in osmo-ttcn3-hacks[master]: HNBAP, RUA and RANAP protocol codecs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13652 ) Change subject: HNBAP, RUA and RANAP protocol codecs ...................................................................... HNBAP, RUA and RANAP protocol codecs This patch introduces protocol codecs for the HNBAP, RUA and RANAP protocols, which is mandatory for testing IuCS, IuPS or Iuh in the future. As Eclipse TITAN ASN.1 only supports the BER codec and the above protocols all use APER, we need to use an external transcoder from APER to BER and vice-versa. This was implemented using a proprietary ASN.1 compiler / trnaslator which sysmocom is packaging as libfftranscode, which is made available as binary package for Debian 9 at https://ftp.osmocom.org/binaries/libfftranscode/ Related: OS#2856, OS#2857, OS#2858 Change-Id: If4a72de9bc54d6e6a7daaca78a4d4aa5684203a5 --- A asn-test/ttcn3_asn1_rename.sh A library/hnbap/HNBAP_CommonDataTypes.asn A library/hnbap/HNBAP_Constants.asn A library/hnbap/HNBAP_Containers.asn A library/hnbap/HNBAP_EncDec.cc A library/hnbap/HNBAP_IEs.asn A library/hnbap/HNBAP_PDU_Contents.asn A library/hnbap/HNBAP_PDU_Descriptions.asn A library/hnbap/HNBAP_Types.ttcn A library/hnbap/regen_makefile.sh A library/ranap/RANAP_CodecPort.ttcn A library/ranap/RANAP_CommonDataTypes.asn A library/ranap/RANAP_Constants.asn A library/ranap/RANAP_Containers.asn A library/ranap/RANAP_EncDec.cc A library/ranap/RANAP_IEs.asn A library/ranap/RANAP_PDU_Contents.asn A library/ranap/RANAP_PDU_Descriptions.asn A library/ranap/RANAP_Selftests.ttcn A library/ranap/RANAP_Templates.ttcn A library/ranap/RANAP_Types.ttcn A library/ranap/regen_makefile.sh A library/rua/RUA_CommonDataTypes.asn A library/rua/RUA_Constants.asn A library/rua/RUA_Containers.asn A library/rua/RUA_EncDec.cc A library/rua/RUA_IEs.asn A library/rua/RUA_PDU_Contents.asn A library/rua/RUA_PDU_Descriptions.asn A library/rua/RUA_Types.ttcn A library/rua/regen_makefile.sh 31 files changed, 12,411 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/13652 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If4a72de9bc54d6e6a7daaca78a4d4aa5684203a5 Gerrit-Change-Number: 13652 Gerrit-PatchSet: 9 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:07:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:07:13 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RAN_Emulation: Add RANAP support In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13653 ) Change subject: RAN_Emulation: Add RANAP support ...................................................................... RAN_Emulation: Add RANAP support So far, RAN_Emulation only handled BSSAP and hence could be used to emulate BSCs towards the MSC. Let's extend it with RANAP support so we can also emulate RNCs towards the MSC. We try to share as much code and logic as possible betweeb the two. Related: OS#2856, OS#2857 Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33 --- M library/RAN_Adapter.ttcnpp M library/RAN_Emulation.ttcnpp 2 files changed, 345 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/RAN_Adapter.ttcnpp b/library/RAN_Adapter.ttcnpp index ae7934e..53c8bac 100644 --- a/library/RAN_Adapter.ttcnpp +++ b/library/RAN_Adapter.ttcnpp @@ -45,7 +45,8 @@ type enumerated RAN_Transport { BSSAP_TRANSPORT_AoIP, /* 3GPP AoIP: SCCP over M3UA over SCTP */ BSSAP_TRANSPORT_SCCPlite_SERVER, /* SCCPlite: SCCP over IPA over TCP */ - BSSAP_TRANSPORT_SCCPlite_CLIENT /* SCCPlite: SCCP over IPA over TCP */ + BSSAP_TRANSPORT_SCCPlite_CLIENT, /* SCCPlite: SCCP over IPA over TCP */ + RANAP_TRANSPORT_IuCS /* 3GPP IuCS: SCCP over M3UA over SCTP */ }; type record RAN_Configuration { @@ -90,8 +91,7 @@ ba.vc_RAN := RAN_Emulation_CT.create(id & "-RAN"); } select (cfg.transport) { -#ifdef RAN_EMULATION_BSSAP - case (BSSAP_TRANSPORT_AoIP) { + case (BSSAP_TRANSPORT_AoIP, RANAP_TRANSPORT_IuCS) { ba.vc_M3UA := M3UA_CT.create(id & "-M3UA"); map(ba.vc_M3UA:SCTP_PORT, system:sctp); /* connect MTP3 service provider (M3UA) to lower side of SCCP */ @@ -133,7 +133,6 @@ disconnect(ba.vc_IPA:IPA_SP_PORT, ba.vc_WAIT:IPA_SP_PORT); } #endif /* SCCP */ -#endif /* BSSAP */ case else { setverdict(fail, "Unsuppored RAN_Transport"); mtc.stop; @@ -145,10 +144,17 @@ T.start; //T.timeout; log("Connecting BSSMAP Emulation to SCCP_SP_PORT and starting emulation"); -#if RAN_EMULATION_BSSAP /* connect BSSNAP component to upper side of SCCP */ - connect(ba.vc_RAN:BSSAP, ba.vc_SCCP:SCCP_SP_PORT); + if (cfg.transport == RANAP_TRANSPORT_IuCS) { +#ifdef RAN_EMULATION_RANAP + ops.protocol := RAN_PROTOCOL_RANAP + connect(ba.vc_RAN:RANAP, ba.vc_SCCP:SCCP_SP_PORT); #endif + } else { +#ifdef RAN_EMULATION_BSSAP + connect(ba.vc_RAN:BSSAP, ba.vc_SCCP:SCCP_SP_PORT); +#endif + } if (cfg.transport == BSSAP_TRANSPORT_SCCPlite_SERVER or cfg.transport == BSSAP_TRANSPORT_SCCPlite_CLIENT) { #ifdef IPA_EMULATION_MGCP @@ -156,7 +162,6 @@ connect(ba.vc_IPA:IPA_MGCP_PORT, ba.vc_RAN:MGCP); #endif } - /* start the BSSMAP emulation */ ba.vc_RAN.start(RAN_Emulation.main(valueof(ops), "")); } diff --git a/library/RAN_Emulation.ttcnpp b/library/RAN_Emulation.ttcnpp index e091133..a74b6de 100644 --- a/library/RAN_Emulation.ttcnpp +++ b/library/RAN_Emulation.ttcnpp @@ -48,6 +48,14 @@ import from MGCP_Templates all; #endif +#ifdef RAN_EMULATION_RANAP +import from RANAP_CodecPort all; +import from RANAP_PDU_Descriptions all; +import from RANAP_Constants all; +import from RANAP_IEs all; +import from RANAP_Templates all; +#endif + /* General "base class" component definition, of which specific implementations * derive themselves by means of the "extends" feature */ type component RAN_ConnHdlr { @@ -110,6 +118,11 @@ /* Client requests us to create SCCP Connection */ BSSAP_Conn_Req, #endif +#ifdef RAN_EMULATION_RANAP + RANAP_PDU, + /* Client requests us to create SCCP Connection */ + RANAP_Conn_Req, +#endif #ifdef RAN_EMULATION_MGCP /* MGCP, only used for IPA SCCPlite (MGCP in IPA mux) */ MgcpCommand, MgcpResponse, @@ -147,6 +160,9 @@ #ifdef RAN_EMULATION_BSSAP port BSSAP_CODEC_PT BSSAP; #endif +#ifdef RAN_EMULATION_RANAP + port RANAP_CODEC_PT RANAP; +#endif /* BSSAP port to the per-connection clients */ port RAN_Conn_PT CLIENT; #ifdef RAN_EMULATION_MGCP @@ -487,10 +503,137 @@ } #endif +#ifdef RAN_EMULATION_RANAP +type record RANAP_Conn_Req { + SCCP_PAR_Address addr_peer, + SCCP_PAR_Address addr_own, + RANAP_PDU ranap +} +template (value) RANAP_Conn_Req ts_RANAP_Conn_Req(SCCP_PAR_Address peer, SCCP_PAR_Address own, RANAP_PDU ranap) := { + addr_peer := peer, + addr_own := own, + ranap := ranap +}; + +private function fake_dlci_from_sapi(template (omit) SAPI sapi) return template (omit) OCT1 +{ + if (istemplatekind(sapi, "omit")) { + return omit; + } else if (valueof(sapi) == sapi_3) { + return '03'O; + } + return '00'O; +} + +private function f_handle_userData_RANAP(RAN_ConnHdlr client, RANAP_PDU ranap) +runs on RAN_Emulation_CT { + /* decode + send decoded RANAP to client */ + var template (omit) octetstring l3 := f_ranap_extract_l3(ranap); + if (istemplatekind(l3, "omit")) { + CLIENT.send(ranap) to client; + } else { + var template (omit) SAPI sapi := f_ranap_extract_sapi(ranap); + var template (omit) OCT1 dlci := fake_dlci_from_sapi(sapi); + if (g_ran_ops.role_ms) { + /* we are the MS, so any message to us must be MT */ + var PDU_DTAP_MT mt := { + dlci := omit, + dtap := dec_PDU_ML3_NW_MS(valueof(l3)) + }; + if (isvalue(dlci)) { + mt.dlci := valueof(dlci) + } + CLIENT.send(mt) to client; + } else { + /* we are the Network, so any message to us must be MO */ + var PDU_DTAP_MO mo := { + dlci := omit, + dtap := dec_PDU_ML3_MS_NW(valueof(l3)) + }; + if (isvalue(dlci)) { + mo.dlci := valueof(dlci) + } + CLIENT.send(mo) to client; + } + } +} + +/* call-back type, to be provided by specific implementation; called when new SCCP connection + * arrives */ +type function RanapCreateCallback(RANAP_N_CONNECT_ind conn_ind, charstring id) +runs on RAN_Emulation_CT return RAN_ConnHdlr; + +type function RanapUnitdataCallback(RANAP_PDU ranap) +runs on RAN_Emulation_CT return template RANAP_PDU; + +private function CommonRanapUnitdataCallback(RANAP_PDU ranap) +runs on RAN_Emulation_CT return template RANAP_PDU { + if (match(ranap, tr_RANAP_Paging(?, ?))) { + var RAN_ConnHdlr client := null; + /* extract IMSI and (if present) TMSI */ + var IMSI imsi := ranap.initiatingMessage.value_.paging.protocolIEs[1].value_.permanentNAS_UE_ID.iMSI; + var template OCT4 tmsi := omit; + if (lengthof(ranap.initiatingMessage.value_.paging.protocolIEs) > 2 and + ranap.initiatingMessage.value_.paging.protocolIEs[2].id == id_TemporaryUE_ID) { + var TemporaryUE_ID ue_id; + ue_id := ranap.initiatingMessage.value_.paging.protocolIEs[2].value_.temporaryUE_ID; + if (ischosen(ue_id.tMSI)) { + tmsi := ue_id.tMSI; + } else { + tmsi := ue_id.p_TMSI; + } + } + client := f_imsi_table_find(oct2hex(imsi), tmsi); + if (isvalue(client)) { + log("CommonRanapUnitdataCallback: IMSI/TMSI found in table, dispatching to ", + client); + CLIENT.send(ranap) to client; + return omit; + } + log("CommonRanapUnitdataCallback: IMSI/TMSI not found in table"); + } else { + log("CommonRanapUnitdataCallback: Not a paging message"); + } + + /* ELSE: handle in user callback */ + return g_ran_ops.ranap_unitdata_cb.apply(ranap); +} + +private function f_ranap_l3_is_rr(RANAP_PDU ranap) return boolean { + var template (omit) SAPI sapi; + var template octetstring l3 := f_ranap_extract_l3(ranap); + return f_L3_is_rr(l3); +} + +function f_ranap_reset(SCCP_PAR_Address peer, SCCP_PAR_Address own) runs on RAN_Emulation_CT { + timer T := 5.0; + var CN_DomainIndicator dom; + if (g_ran_ops.ps_domain) { + dom := ps_domain; + } else { + dom := cs_domain; + } + + RANAP.send(ts_RANAP_UNITDATA_req(peer, own, ts_RANAP_Reset(ts_RanapCause_om_intervention, dom))); + T.start; + alt { + [] RANAP.receive(tr_RANAP_UNITDATA_ind(own, peer, tr_RANAP_ResetAck)) { + log("Received RESET-ACK in response to RESET, we're ready to go!"); + } + [] as_reset_ack(); + [] RANAP.receive { repeat }; + [] T.timeout { + setverdict(fail, "Timeout waiting for RESET-ACK after sending RESET"); + mtc.stop; + } + } +} +#endif type enumerated RanProtocol { - RAN_PROTOCOL_BSSAP + RAN_PROTOCOL_BSSAP, + RAN_PROTOCOL_RANAP } type record RanOps { @@ -498,6 +641,11 @@ BssmapCreateCallback create_cb optional, BssmapUnitdataCallback unitdata_cb optional, #endif +#ifdef RAN_EMULATION_RANAP + RanapCreateCallback ranap_create_cb optional, + RanapUnitdataCallback ranap_unitdata_cb optional, + boolean ps_domain, +#endif boolean decode_dtap, boolean role_ms, RanProtocol protocol, @@ -551,6 +699,9 @@ #ifdef RAN_EMULATION_BSSAP var BSSAP_N_UNITDATA_ind ud_ind; #endif +#ifdef RAN_EMULATION_RANAP + var RANAP_N_UNITDATA_ind rud_ind; +#endif #ifdef RAN_EMULATION_BSSAP [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) -> value ud_ind { log("Respoding to inbound RESET with RESET-ACK"); @@ -559,6 +710,15 @@ repeat; } #endif +#ifdef RAN_EMULATION_RANAP + [] RANAP.receive(tr_RANAP_UNITDATA_ind(?, ?, tr_RANAP_Reset)) -> value rud_ind { + log("Respoding to inbound IuRESET with IuRESET-ACK"); + var CN_DomainIndicator dom; + dom := rud_ind.userData.initiatingMessage.value_.Reset.protocolIEs[1].value_.cN_DomainIndicator; + RANAP.send(ts_RANAP_UNITDATA_req(rud_ind.callingAddress, rud_ind.calledAddress, + ts_RANAP_ResetAck(dom))); + } +#endif } @@ -666,7 +826,116 @@ } #else - [false] CLIENT.receive(false) {} + [false] CLIENT.receive {} +#endif +} + +private altstep as_main_ranap() runs on RAN_Emulation_CT { +#ifdef RAN_EMULATION_RANAP + var RANAP_N_UNITDATA_ind rud_ind; + var RANAP_N_CONNECT_ind rconn_ind; + var RANAP_N_CONNECT_cfm rconn_cfm; + var RANAP_N_DATA_ind rdata_ind; + var RANAP_N_DISCONNECT_ind rdisc_ind; + var RANAP_Conn_Req creq; + var RANAP_PDU ranap; + var RAN_ConnHdlr vc_conn; + + /* SCCP -> Client: UNIT-DATA (connectionless SCCP) from a BSC */ + [] RANAP.receive(RANAP_N_UNITDATA_ind:?) -> value rud_ind { + /* Connectionless Procedures like RESET */ + var template RANAP_PDU resp; + resp := CommonRanapUnitdataCallback(rud_ind.userData); + if (isvalue(resp)) { + RANAP.send(ts_RANAP_UNITDATA_req(rud_ind.callingAddress, + rud_ind.calledAddress, resp)); + } + } + /* SCCP -> Client: new connection from BSC */ + [] RANAP.receive(RANAP_N_CONNECT_ind:?) -> value rconn_ind { + vc_conn := g_ran_ops.ranap_create_cb.apply(rconn_ind, g_ran_id); + /* store mapping between client components and SCCP connectionId */ + f_conn_table_add(vc_conn, rconn_ind.connectionId); + /* handle user payload */ + f_handle_userData_RANAP(vc_conn, rconn_ind.userData); + /* confirm connection establishment */ + RANAP.send(ts_RANAP_CONNECT_res(rconn_ind.connectionId, omit)); + } + /* SCCP -> Client: connection-oriented data in existing connection */ + [] RANAP.receive(RANAP_N_DATA_ind:?) -> value rdata_ind { + vc_conn := f_comp_by_conn_id(rdata_ind.connectionId); + if (ispresent(rdata_ind.userData)) { + f_handle_userData_RANAP(vc_conn, rdata_ind.userData); + } + } + /* SCCP -> Client: disconnect of an existing connection */ + [] RANAP.receive(RANAP_N_DISCONNECT_ind:?) -> value rdisc_ind { + vc_conn := f_comp_by_conn_id(rdisc_ind.connectionId); + if (ispresent(rdisc_ind.userData)) { + f_handle_userData_RANAP(vc_conn, rdisc_ind.userData); + } + /* notify client about termination */ + var RAN_Conn_Prim prim := MSC_CONN_PRIM_DISC_IND; + CLIENT.send(prim) to vc_conn; + f_conn_table_del(rdisc_ind.connectionId); + /* TOOD: return confirm to other side? */ + } + /* SCCP -> Client: connection confirm for outbound connection */ + [] RANAP.receive(RANAP_N_CONNECT_cfm:?) -> value rconn_cfm { + vc_conn := f_comp_by_conn_id(rconn_cfm.connectionId); + var RAN_Conn_Prim prim := MSC_CONN_PRIM_CONF_IND; + CLIENT.send(prim) to vc_conn; + /* handle user payload */ + if (ispresent(rconn_cfm.userData)) { + f_handle_userData_RANAP(vc_conn, rconn_cfm.userData); + } + } + + [] CLIENT.receive(RANAP_PDU:?) -> value ranap sender vc_conn { + var integer conn_id := f_conn_id_by_comp(vc_conn); + /* send it to dispatcher */ + RANAP.send(ts_RANAP_DATA_req(conn_id, ranap)); + } + + /* Disconnect request client -> SCCP */ + [] CLIENT.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_REQ) -> sender vc_conn { + var integer conn_id := f_conn_id_by_comp(vc_conn); + RANAP.send(ts_RANAP_DISC_req(conn_id, 0)); + f_conn_table_del(conn_id); + } + + /* BSSAP from client -> SCCP */ + [] CLIENT.receive(RANAP_Conn_Req:?) -> value creq sender vc_conn { + var integer conn_id; + /* send to dispatcher */ + + if (f_comp_known(vc_conn) == false) { + /* unknown client, create new connection */ + conn_id := f_gen_conn_id(); + + /* store mapping between client components and SCCP connectionId */ + f_conn_table_add(vc_conn, conn_id); + + RANAP.send(ts_RANAP_CONNECT_req(creq.addr_peer, creq.addr_own, conn_id, + creq.ranap)); + } else { + /* known client, send via existing connection */ + conn_id := f_conn_id_by_comp(vc_conn); + RANAP.send(ts_RANAP_DATA_req(conn_id, creq.ranap)); + } + + /* InitialL3 contains RR (PAG RESP) or MM (CM SRV REQ), we must increment + * counter only on MM/CC/SS, but not on RR */ + if (g_ran_ops.role_ms and not f_ranap_l3_is_rr(creq.ranap)) { + /* we have just sent the first MM message, increment the counter */ + var integer idx := f_idx_by_comp(vc_conn); + ConnectionTable[idx].n_sd[0] := 1; + log("patch: N(SD) for ConnIdx ", idx, " set to 1"); + } + } + +#else + [false] CLIENT.receive {} #endif } @@ -730,6 +999,18 @@ BSSAP.send(ts_BSSAP_DATA_req(sccp_conn_id, bssap)); } #endif +#ifdef RAN_EMULATION_RANAP + case (RAN_PROTOCOL_RANAP) { + var RANAP_PDU ranap; + if (false /* SAPI */) { + var RANAP_IEs.SAPI sapi := sapi_0; + ranap := valueof(ts_RANAP_DirectTransferSAPI(l3_enc, sapi)); + } else { + ranap := valueof(ts_RANAP_DirectTransfer(l3_enc)); + } + RANAP.send(ts_RANAP_DATA_req(sccp_conn_id, ranap)); + } +#endif } } @@ -742,7 +1023,18 @@ if (isvalue(ops.sccp_addr_peer) and isvalue(ops.sccp_addr_local)) { f_sleep(1.0); /* HACK to wait for M3UA/ASP to be ACTIVE */ - f_bssap_reset(ops.sccp_addr_peer, ops.sccp_addr_local); + select (g_ran_ops.protocol) { +#ifdef RAN_EMULATION_BSSAP + case (RAN_PROTOCOL_BSSAP) { + f_bssap_reset(ops.sccp_addr_peer, ops.sccp_addr_local); + } +#endif +#ifdef RAN_EMULATION_RANAP + case (RAN_PROTOCOL_RANAP) { + f_ranap_reset(ops.sccp_addr_peer, ops.sccp_addr_local); + } +#endif + } } while (true) { @@ -756,6 +1048,7 @@ alt { [g_ran_ops.protocol == RAN_PROTOCOL_BSSAP] as_main_bssap(); + [g_ran_ops.protocol == RAN_PROTOCOL_RANAP] as_main_ranap(); [g_ran_ops.role_ms] CLIENT.receive(PDU_DTAP_MO:?) -> value dtap_mo sender vc_conn { var integer idx := f_idx_by_comp(vc_conn); @@ -822,6 +1115,7 @@ inout RAN_register, RAN_register_imsi; } with { extension "internal" }; +#ifdef RAN_EMULATION_BSSAP /* CreateCallback that can be used as create_cb and will use the expectation table */ function ExpectedCreateCallback(BSSAP_N_CONNECT_ind conn_ind, charstring id) runs on RAN_Emulation_CT return RAN_ConnHdlr { @@ -854,6 +1148,42 @@ mtc.stop; return ret; } +#endif + +#ifdef RAN_EMULATION_RANAP +/* CreateCallback that can be used as create_cb and will use the expectation table */ +function RanapExpectedCreateCallback(RANAP_N_CONNECT_ind conn_ind, charstring id) +runs on RAN_Emulation_CT return RAN_ConnHdlr { + var RAN_ConnHdlr ret := null; + var template (omit) octetstring l3_info; + var integer i; + + l3_info := f_ranap_extract_l3(conn_ind.userData); + if (istemplatekind(l3_info, "omit")) { + setverdict(fail, "N-CONNECT.ind without NAS payload"); + mtc.stop; + return ret; + } + + for (i := 0; i < sizeof(ExpectTable); i:= i+1) { + if (not ispresent(ExpectTable[i].l3_payload)) { + continue; + } + if (valueof(l3_info) == ExpectTable[i].l3_payload) { + ret := ExpectTable[i].vc_conn; + /* release this entry to be used again */ + ExpectTable[i].l3_payload := omit; + ExpectTable[i].vc_conn := null; + log("Found Expect[", i, "] for ", l3_info, " handled at ", ret); + /* return the component reference */ + return ret; + } + } + setverdict(fail, "Couldn't find Expect for incoming connection ", conn_ind); + mtc.stop; + return ret; +} +#endif private function f_create_expect(octetstring l3, RAN_ConnHdlr hdlr) runs on RAN_Emulation_CT { -- To view, visit https://gerrit.osmocom.org/13653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33 Gerrit-Change-Number: 13653 Gerrit-PatchSet: 8 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:14:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:14:13 +0000 Subject: Change in osmo-msc[master]: smpp: Make libsmpp34 use talloc for its allocations In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Pau Espin Pedrol, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13562 to look at the new patch set (#4). Change subject: smpp: Make libsmpp34 use talloc for its allocations ...................................................................... smpp: Make libsmpp34 use talloc for its allocations We are just introducing smpp34_set_memory_functions() in libsmpp34 to allow applications like OsmoMSC to provide their own heap allocator callback functions. Let's used this to integrate with talloc and hence allow talloc tracking/debugging for libsmpp34 internal allocations. Depends: libsmpp34 Change-Id I3656117115e89638c093bfbcbc4369ce302f7a94 Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Related: OS#3913 --- M src/libmsc/smpp_openbsc.c 1 file changed, 27 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/62/13562/4 -- To view, visit https://gerrit.osmocom.org/13562 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Gerrit-Change-Number: 13562 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:15:25 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:15:25 +0000 Subject: Change in osmo-msc[master]: smpp: Make libsmpp34 use talloc for its allocations In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13562 ) Change subject: smpp: Make libsmpp34 use talloc for its allocations ...................................................................... Patch Set 4: Code-Review+2 re-add ++2/+1 -- To view, visit https://gerrit.osmocom.org/13562 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie2725ffab6a225813e65768735f01678e2022128 Gerrit-Change-Number: 13562 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 25 Apr 2019 20:15:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:16:39 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:16:39 +0000 Subject: Change in osmo-ggsn[master]: ggsn: const-ify input / read-only arguments of PCO related functions In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13568 ) Change subject: ggsn: const-ify input / read-only arguments of PCO related functions ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13568 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia0877988180ded4e3c033d7f1fb6e1c2acd60163 Gerrit-Change-Number: 13568 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 25 Apr 2019 20:16:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:16:48 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:16:48 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Remove magic numbers from ipcp_contains_option() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13569 ) Change subject: ggsn: Remove magic numbers from ipcp_contains_option() ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13569 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5b1abc6f403f85986407e9e8359924dfcb58031a Gerrit-Change-Number: 13569 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 25 Apr 2019 20:16:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:17:09 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:17:09 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Fix build_ipcp_pco() in presence of invalid IPCP content In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13570 ) Change subject: ggsn: Fix build_ipcp_pco() in presence of invalid IPCP content ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13570 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8e9cffde092c8c5824abfaeecb742afcf949802c Gerrit-Change-Number: 13570 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 25 Apr 2019 20:17:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:17:24 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:17:24 +0000 Subject: Change in osmo-ggsn[master]: ggsn.c: Refactor PCO processing during PDP activation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13606 ) Change subject: ggsn.c: Refactor PCO processing during PDP activation ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13606 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4a7d09279b6b259e2b95f1f51159b16838b2d94c Gerrit-Change-Number: 13606 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 25 Apr 2019 20:17:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:17:29 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:17:29 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Remove magic numbers from pco_contains_proto() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13567 ) Change subject: ggsn: Remove magic numbers from pco_contains_proto() ...................................................................... ggsn: Remove magic numbers from pco_contains_proto() Let's remove some magic numbers and use a data structure to describe the PCO element header. Change-Id: I9871ffced677320aa82438332bfdb951ab129f04 --- M ggsn/ggsn.c 1 file changed, 11 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 423f0c0..65e15c3 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -462,18 +462,23 @@ PCO_P_REL_DATA_SVC = 0x0018, }; +struct pco_element { + uint16_t protocol_id; /* network byte order */ + uint8_t length; /* length of data below */ + uint8_t data[0]; +} __attribute__((packed)); + /* determine if PCO contains given protocol */ static uint8_t *pco_contains_proto(struct ul255_t *pco, size_t offset, uint16_t prot, size_t prot_minlen) { - uint8_t *cur = pco->v + 1 + offset; + uint8_t *cur = pco->v + 1 /*length*/ + offset; /* iterate over PCO and check if protocol contained */ - while (cur + 3 <= pco->v + pco->l) { - uint16_t cur_prot = osmo_load16be(cur); - uint8_t cur_len = cur[2]; - if (cur_prot == prot && cur_len >= prot_minlen) + while (cur + sizeof(struct pco_element) <= pco->v + pco->l) { + const struct pco_element *elem = (const struct pco_element *)cur; + if (ntohs(elem->protocol_id) == prot && elem->length >= prot_minlen) return cur; - cur += cur_len + 3; + cur += elem->length + sizeof(struct pco_element); } return NULL; } -- To view, visit https://gerrit.osmocom.org/13567 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9871ffced677320aa82438332bfdb951ab129f04 Gerrit-Change-Number: 13567 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:17:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:17:30 +0000 Subject: Change in osmo-ggsn[master]: ggsn: const-ify input / read-only arguments of PCO related functions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13568 ) Change subject: ggsn: const-ify input / read-only arguments of PCO related functions ...................................................................... ggsn: const-ify input / read-only arguments of PCO related functions Change-Id: Ia0877988180ded4e3c033d7f1fb6e1c2acd60163 --- M ggsn/ggsn.c 1 file changed, 8 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 65e15c3..a439d01 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -413,9 +413,10 @@ } __attribute__ ((packed)); /* determine if IPCP contains given option */ -static uint8_t *ipcp_contains_option(uint8_t *ipcp, size_t ipcp_len, enum ipcp_options opt, size_t opt_minlen) +static const uint8_t *ipcp_contains_option(const uint8_t *ipcp, size_t ipcp_len, + enum ipcp_options opt, size_t opt_minlen) { - uint8_t *cur_opt = ipcp + sizeof(struct ipcp_hdr); + const uint8_t *cur_opt = ipcp + sizeof(struct ipcp_hdr); /* iterate over Options and check if protocol contained */ while (cur_opt + 2 <= ipcp + ipcp_len) { @@ -469,9 +470,10 @@ } __attribute__((packed)); /* determine if PCO contains given protocol */ -static uint8_t *pco_contains_proto(struct ul255_t *pco, size_t offset, uint16_t prot, size_t prot_minlen) +static const uint8_t *pco_contains_proto(const struct ul255_t *pco, size_t offset, + uint16_t prot, size_t prot_minlen) { - uint8_t *cur = pco->v + 1 /*length*/ + offset; + const uint8_t *cur = pco->v + 1 /*length*/ + offset; /* iterate over PCO and check if protocol contained */ while (cur + sizeof(struct pco_element) <= pco->v + pco->l) { @@ -512,9 +514,9 @@ { const struct in46_addr *dns1 = &apn->v4.cfg.dns[0]; const struct in46_addr *dns2 = &apn->v4.cfg.dns[1]; - uint8_t *ipcp; + const uint8_t *ipcp, *pco_ipcp; uint16_t ipcp_len; - uint8_t *len1, *len2, *pco_ipcp; + uint8_t *len1, *len2; unsigned int len_appended; ptrdiff_t consumed; size_t remain, offset = 0; -- To view, visit https://gerrit.osmocom.org/13568 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia0877988180ded4e3c033d7f1fb6e1c2acd60163 Gerrit-Change-Number: 13568 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:17:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:17:30 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Remove magic numbers from ipcp_contains_option() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13569 ) Change subject: ggsn: Remove magic numbers from ipcp_contains_option() ...................................................................... ggsn: Remove magic numbers from ipcp_contains_option() Let's remove some magic numbers and use a data structure instead. Change-Id: I5b1abc6f403f85986407e9e8359924dfcb58031a --- M ggsn/ggsn.c 1 file changed, 7 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index a439d01..59523ac 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -419,14 +419,15 @@ const uint8_t *cur_opt = ipcp + sizeof(struct ipcp_hdr); /* iterate over Options and check if protocol contained */ - while (cur_opt + 2 <= ipcp + ipcp_len) { - uint8_t type = cur_opt[0]; - uint8_t len = cur_opt[1]; /* length value includes 2 bytes type/length */ - if (len < 2) + while (cur_opt + sizeof(struct ipcp_option_hdr) <= ipcp + ipcp_len) { + const struct ipcp_option_hdr *cur_opt_hdr = (const struct ipcp_option_hdr *)cur_opt; + /* length value includes 2 bytes type/length */ + if (cur_opt_hdr->len < sizeof(struct ipcp_option_hdr)) return NULL; - if (type == opt && len >= 2 + opt_minlen) + if (cur_opt_hdr->type == opt && + cur_opt_hdr->len >= sizeof(struct ipcp_option_hdr) + opt_minlen) return cur_opt; - cur_opt += len; + cur_opt += cur_opt_hdr->len; } return NULL; } -- To view, visit https://gerrit.osmocom.org/13569 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5b1abc6f403f85986407e9e8359924dfcb58031a Gerrit-Change-Number: 13569 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:17:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:17:30 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Fix build_ipcp_pco() in presence of invalid IPCP content In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13570 ) Change subject: ggsn: Fix build_ipcp_pco() in presence of invalid IPCP content ...................................................................... ggsn: Fix build_ipcp_pco() in presence of invalid IPCP content When build_ipcp_pco() iterated over the PCO list, it didn't use the "outer" pco length as an increment, but used the "inner" IPCP length. If an IPCP message with an invalid "inner" length was being processed (see pcap file attached to OS#3914), the PCO iteration beyond that broken IPCP would fail, possibly rendering false hits. Let's make pco_contains_proto() return a pointer to the the pco_element, so that the caller can use the outer length as an increment. Change-Id: I8e9cffde092c8c5824abfaeecb742afcf949802c Related: OS#3914 --- M ggsn/ggsn.c 1 file changed, 7 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 59523ac..8cd4b05 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -471,8 +471,8 @@ } __attribute__((packed)); /* determine if PCO contains given protocol */ -static const uint8_t *pco_contains_proto(const struct ul255_t *pco, size_t offset, - uint16_t prot, size_t prot_minlen) +static const struct pco_element *pco_contains_proto(const struct ul255_t *pco, size_t offset, + uint16_t prot, size_t prot_minlen) { const uint8_t *cur = pco->v + 1 /*length*/ + offset; @@ -480,7 +480,7 @@ while (cur + sizeof(struct pco_element) <= pco->v + pco->l) { const struct pco_element *elem = (const struct pco_element *)cur; if (ntohs(elem->protocol_id) == prot && elem->length >= prot_minlen) - return cur; + return elem; cur += elem->length + sizeof(struct pco_element); } return NULL; @@ -515,7 +515,8 @@ { const struct in46_addr *dns1 = &apn->v4.cfg.dns[0]; const struct in46_addr *dns2 = &apn->v4.cfg.dns[1]; - const uint8_t *ipcp, *pco_ipcp; + const struct pco_element *pco_ipcp; + const uint8_t *ipcp; uint16_t ipcp_len; uint8_t *len1, *len2; unsigned int len_appended; @@ -527,7 +528,7 @@ while (pco_ipcp) { uint8_t *start = msg->tail; - ipcp = (pco_ipcp + 3); /* 2=type + 1=len */ + ipcp = pco_ipcp->data; consumed = (ipcp - &pdp->pco_req.v[0]); remain = sizeof(pdp->pco_req.v) - consumed; ipcp_len = osmo_load16be(ipcp + 2); /* 1=code + 1=id */ @@ -560,7 +561,7 @@ *len1 = len_appended - 3; *len2 = len_appended - 3; - offset += 3 + ipcp_len; + offset += sizeof(pco_ipcp) + pco_ipcp->length; pco_ipcp = pco_contains_proto(&pdp->pco_req, offset, PCO_P_IPCP, sizeof(struct ipcp_hdr)); } -- To view, visit https://gerrit.osmocom.org/13570 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8e9cffde092c8c5824abfaeecb742afcf949802c Gerrit-Change-Number: 13570 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 20:17:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Apr 2019 20:17:30 +0000 Subject: Change in osmo-ggsn[master]: ggsn.c: Refactor PCO processing during PDP activation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13606 ) Change subject: ggsn.c: Refactor PCO processing during PDP activation ...................................................................... ggsn.c: Refactor PCO processing during PDP activation The existing PCO processing is implemented in a rather convoluted way. We scan the list of PCO elements several times for different PCO protocols. Let's change to a straight-forward model where we simply do one iteration over the list of PCO elements and generate responses step by step. Change-Id: I4a7d09279b6b259e2b95f1f51159b16838b2d94c --- M ggsn/ggsn.c 1 file changed, 95 insertions(+), 85 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 8cd4b05..2d37cf0 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -470,22 +470,6 @@ uint8_t data[0]; } __attribute__((packed)); -/* determine if PCO contains given protocol */ -static const struct pco_element *pco_contains_proto(const struct ul255_t *pco, size_t offset, - uint16_t prot, size_t prot_minlen) -{ - const uint8_t *cur = pco->v + 1 /*length*/ + offset; - - /* iterate over PCO and check if protocol contained */ - while (cur + sizeof(struct pco_element) <= pco->v + pco->l) { - const struct pco_element *elem = (const struct pco_element *)cur; - if (ntohs(elem->protocol_id) == prot && elem->length >= prot_minlen) - return elem; - cur += elem->length + sizeof(struct pco_element); - } - return NULL; -} - /*! Get the peer of pdp based on IP version used. * \param[in] pdp PDP context to select the peer from. * \param[in] v4v6 IP version to select. Valid values are 4 and 6. @@ -510,101 +494,127 @@ return NULL; } -/* construct an IPCP PCO response from request*/ -static void build_ipcp_pco(const struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) +static void process_pco_element_ipcp(const struct pco_element *pco_elem, struct msgb *resp, + const struct apn_ctx *apn, struct pdp_t *pdp) { + struct ippoolm_t *peer_v4 = pdp_get_peer_ipv(pdp, false); const struct in46_addr *dns1 = &apn->v4.cfg.dns[0]; const struct in46_addr *dns2 = &apn->v4.cfg.dns[1]; - const struct pco_element *pco_ipcp; + uint8_t *start = resp->tail; const uint8_t *ipcp; uint16_t ipcp_len; uint8_t *len1, *len2; unsigned int len_appended; ptrdiff_t consumed; - size_t remain, offset = 0; + size_t remain; - /* pco_contains_proto() returns a potentially unaligned pointer into pco_req->v (see OS#3194) */ - pco_ipcp = pco_contains_proto(&pdp->pco_req, offset, PCO_P_IPCP, sizeof(struct ipcp_hdr)); - while (pco_ipcp) { - uint8_t *start = msg->tail; + if (!peer_v4) + return; - ipcp = pco_ipcp->data; - consumed = (ipcp - &pdp->pco_req.v[0]); - remain = sizeof(pdp->pco_req.v) - consumed; - ipcp_len = osmo_load16be(ipcp + 2); /* 1=code + 1=id */ - if (remain < 0 || remain < ipcp_len) - return; + ipcp = pco_elem->data; + consumed = (ipcp - &pdp->pco_req.v[0]); + remain = sizeof(pdp->pco_req.v) - consumed; + ipcp_len = osmo_load16be(ipcp + 2); /* 1=code + 1=id */ + if (remain < 0 || remain < ipcp_len) + return; - /* Three byte T16L header */ - msgb_put_u16(msg, 0x8021); /* IPCP */ - len1 = msgb_put(msg, 1); /* Length of contents: delay */ + /* Three byte T16L header */ + msgb_put_u16(resp, 0x8021); /* IPCP */ + len1 = msgb_put(resp, 1); /* Length of contents: delay */ - msgb_put_u8(msg, 0x02); /* ACK */ - msgb_put_u8(msg, ipcp[1]); /* ID: Needs to match request */ - msgb_put_u8(msg, 0x00); /* Length MSB */ - len2 = msgb_put(msg, 1); /* Length LSB: delay */ + msgb_put_u8(resp, 0x02); /* ACK */ + msgb_put_u8(resp, ipcp[1]); /* ID: Needs to match request */ + msgb_put_u8(resp, 0x00); /* Length MSB */ + len2 = msgb_put(resp, 1); /* Length LSB: delay */ - if (dns1->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_PRIMARY_DNS, 4)) { - msgb_put_u8(msg, 0x81); /* DNS1 Tag */ - msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ - msgb_put_u32(msg, ntohl(dns1->v4.s_addr)); - } - - if (dns2->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_SECONDARY_DNS, 4)) { - msgb_put_u8(msg, 0x83); /* DNS2 Tag */ - msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ - msgb_put_u32(msg, ntohl(dns2->v4.s_addr)); - } - - /* patch in length values */ - len_appended = msg->tail - start; - *len1 = len_appended - 3; - *len2 = len_appended - 3; - - offset += sizeof(pco_ipcp) + pco_ipcp->length; - pco_ipcp = pco_contains_proto(&pdp->pco_req, offset, PCO_P_IPCP, sizeof(struct ipcp_hdr)); + if (dns1->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_PRIMARY_DNS, 4)) { + msgb_put_u8(resp, 0x81); /* DNS1 Tag */ + msgb_put_u8(resp, 2 + dns1->len); /* DNS1 Length, incl. TL */ + msgb_put_u32(resp, ntohl(dns1->v4.s_addr)); } + if (dns2->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_SECONDARY_DNS, 4)) { + msgb_put_u8(resp, 0x83); /* DNS2 Tag */ + msgb_put_u8(resp, 2 + dns2->len); /* DNS2 Length, incl. TL */ + msgb_put_u32(resp, ntohl(dns2->v4.s_addr)); + } + + /* patch in length values */ + len_appended = resp->tail - start; + *len1 = len_appended - 3; + *len2 = len_appended - 3; +} + +static void process_pco_element_dns_ipv6(const struct pco_element *pco_elem, struct msgb *resp, + const struct apn_ctx *apn, struct pdp_t *pdp) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { + const struct in46_addr *i46a = &apn->v6.cfg.dns[i]; + if (i46a->len != 16) + continue; + msgb_t16lv_put(resp, PCO_P_DNS_IPv6_ADDR, i46a->len, i46a->v6.s6_addr); + } +} + +static void process_pco_element_dns_ipv4(const struct pco_element *pco_elem, struct msgb *resp, + const struct apn_ctx *apn, struct pdp_t *pdp) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { + const struct in46_addr *i46a = &apn->v4.cfg.dns[i]; + if (i46a->len != 4) + continue; + msgb_t16lv_put(resp, PCO_P_DNS_IPv4_ADDR, i46a->len, (uint8_t *)&i46a->v4); + } +} + +static void process_pco_element(const struct pco_element *pco_elem, struct msgb *resp, + const struct apn_ctx *apn, struct pdp_t *pdp) +{ + switch (ntohs(pco_elem->protocol_id)) { + case PCO_P_IPCP: + process_pco_element_ipcp(pco_elem, resp, apn, pdp); + break; + case PCO_P_DNS_IPv6_ADDR: + process_pco_element_dns_ipv6(pco_elem, resp, apn, pdp); + break; + case PCO_P_DNS_IPv4_ADDR: + process_pco_element_dns_ipv4(pco_elem, resp, apn, pdp); + break; + default: + break; + } } /* process one PCO request from a MS/UE, putting together the proper responses */ static void process_pco(const struct apn_ctx *apn, struct pdp_t *pdp) { - struct msgb *msg = msgb_alloc(256, "PCO"); - struct ippoolm_t *peer_v4 = pdp_get_peer_ipv(pdp, false); - unsigned int i; + struct msgb *resp = msgb_alloc(256, "PCO.resp"); + const struct ul255_t *pco = &pdp->pco_req; + const struct pco_element *pco_elem; + const uint8_t *cur; - OSMO_ASSERT(msg); - msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ + /* build the header of the PCO response */ + OSMO_ASSERT(resp); + msgb_put_u8(resp, 0x80); /* ext-bit + configuration protocol byte */ - if (peer_v4) - build_ipcp_pco(apn, pdp, msg); - - if (pco_contains_proto(&pdp->pco_req, 0, PCO_P_DNS_IPv6_ADDR, 0)) { - for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { - const 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); - } + /* iterate over the PCO elements in the request; call process_pco_element() for each */ + for (cur = pco->v + 1, pco_elem = (const struct pco_element *) cur; + cur + sizeof(struct pco_element) <= pco->v + pco->l; + cur += pco_elem->length + sizeof(*pco_elem), pco_elem = (const struct pco_element *) cur) { + process_pco_element(pco_elem, resp, apn, pdp); } - if (pco_contains_proto(&pdp->pco_req, 0, PCO_P_DNS_IPv4_ADDR, 0)) { - for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { - const 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) { - memcpy(pdp->pco_neg.v, msgb_data(msg), msgb_length(msg)); - pdp->pco_neg.l = msgb_length(msg); + /* copy the PCO response msgb and copy its contents over to the PDP context */ + if (msgb_length(resp) > 1) { + memcpy(pdp->pco_neg.v, msgb_data(resp), msgb_length(resp)); + pdp->pco_neg.l = msgb_length(resp); } else pdp->pco_neg.l = 0; - - msgb_free(msg); + msgb_free(resp); } static bool apn_supports_ipv4(const struct apn_ctx *apn) -- To view, visit https://gerrit.osmocom.org/13606 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4a7d09279b6b259e2b95f1f51159b16838b2d94c Gerrit-Change-Number: 13606 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 21:27:44 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Apr 2019 21:27:44 +0000 Subject: Change in osmo-trx[master]: lms: flush_recv: alloc buf on stack instead of heap Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13782 Change subject: lms: flush_recv: alloc buf on stack instead of heap ...................................................................... lms: flush_recv: alloc buf on stack instead of heap No need to use the heap here since buffer is only used as a temporary trash. Using the stack is quicker. Change-Id: Iede8dc0903ee3865a52c8e2fd811bcde444fee33 --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/82/13782/1 diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 05904e8..064d742 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -450,7 +450,7 @@ { #define CHUNK 625 int len = CHUNK * tx_sps; - short *buffer = new short[len * 2]; + short *buffer = (short*) alloca(sizeof(short) * len * 2); int rc; lms_stream_meta_t rx_metadata = {}; rx_metadata.flushPartialPacket = false; @@ -463,7 +463,6 @@ LOGC(DDEV, DEBUG) << "Flush: Recv buffer of len " << rc << " at " << std::hex << rx_metadata.timestamp; if (rc != len) { LOGC(DDEV, ALERT) << "LMS: Device receive timed out"; - delete[] buffer; return false; } @@ -471,7 +470,6 @@ } LOGC(DDEV, INFO) << "Initial timestamp " << ts_initial << std::endl; - delete[] buffer; return true; } -- To view, visit https://gerrit.osmocom.org/13782 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iede8dc0903ee3865a52c8e2fd811bcde444fee33 Gerrit-Change-Number: 13782 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 21:27:44 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Apr 2019 21:27:44 +0000 Subject: Change in osmo-trx[master]: lms: Improve log during flush recv error Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13783 Change subject: lms: Improve log during flush recv error ...................................................................... lms: Improve log during flush recv error Change-Id: Id45d42599738efd6a5d89787c75779838a979330 --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/83/13783/1 diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 064d742..b924fa7 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -462,7 +462,7 @@ rc = LMS_RecvStream(&m_lms_stream_rx[0], &buffer[0], len, &rx_metadata, 100); LOGC(DDEV, DEBUG) << "Flush: Recv buffer of len " << rc << " at " << std::hex << rx_metadata.timestamp; if (rc != len) { - LOGC(DDEV, ALERT) << "LMS: Device receive timed out"; + LOGC(DDEV, ALERT) << "Flush: Device receive timed out"; return false; } -- To view, visit https://gerrit.osmocom.org/13783 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id45d42599738efd6a5d89787c75779838a979330 Gerrit-Change-Number: 13783 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 21:27:44 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Apr 2019 21:27:44 +0000 Subject: Change in osmo-trx[master]: cosmetic: Threads.h: Remove trailing whitespace Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13784 Change subject: cosmetic: Threads.h: Remove trailing whitespace ...................................................................... cosmetic: Threads.h: Remove trailing whitespace Change-Id: I0ae6e435a7f0480c3eaa08dccfe824456f33b015 --- M CommonLibs/Threads.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/84/13784/1 diff --git a/CommonLibs/Threads.h b/CommonLibs/Threads.h index 857c5d9..3b76985 100644 --- a/CommonLibs/Threads.h +++ b/CommonLibs/Threads.h @@ -55,7 +55,7 @@ #define OBJDCOUT(text) {} #else #define DCOUT(text) { COUT(__FILE__ << ":" << __LINE__ << " " << text); } -#define OBJDCOUT(text) { DCOUT(this << " " << text); } +#define OBJDCOUT(text) { DCOUT(this << " " << text); } #endif //@} //@} @@ -152,7 +152,7 @@ pthread_attr_t mAttrib; // FIXME -- Can this be reduced now? size_t mStackSize; - + public: -- To view, visit https://gerrit.osmocom.org/13784 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0ae6e435a7f0480c3eaa08dccfe824456f33b015 Gerrit-Change-Number: 13784 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 21:27:45 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Apr 2019 21:27:45 +0000 Subject: Change in osmo-trx[master]: Move duplicated thread_enable_cancel to CommonLibs Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13785 Change subject: Move duplicated thread_enable_cancel to CommonLibs ...................................................................... Move duplicated thread_enable_cancel to CommonLibs Change-Id: I1a479b59bdda01233273dfa919bd678edbe34708 --- M CommonLibs/Threads.cpp M CommonLibs/Threads.h M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/uhd/UHDDevice.cpp 4 files changed, 7 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/85/13785/1 diff --git a/CommonLibs/Threads.cpp b/CommonLibs/Threads.cpp index 2988e12..c056d69 100644 --- a/CommonLibs/Threads.cpp +++ b/CommonLibs/Threads.cpp @@ -122,6 +122,12 @@ } } +void thread_enable_cancel(bool cancel) +{ + cancel ? pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) : + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); +} + void Thread::start(void *(*task)(void*), void *arg) { assert(mThread==((pthread_t)0)); diff --git a/CommonLibs/Threads.h b/CommonLibs/Threads.h index 3b76985..4c5b9ee 100644 --- a/CommonLibs/Threads.h +++ b/CommonLibs/Threads.h @@ -142,6 +142,7 @@ thread.start((void *(*)(void*))function, (void*)argument); void set_selfthread_name(const char *name); +void thread_enable_cancel(bool cancel); /** A C++ wrapper for pthread threads. */ class Thread { diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index b924fa7..0cd41d3 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -90,12 +90,6 @@ LOGLV(DLMS, lvl_map[lvl]) << msg; } -static void thread_enable_cancel(bool cancel) -{ - cancel ? pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) : - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); -} - static void print_range(const char* name, lms_range_t *range) { LOGC(DDEV, INFO) << name << ": Min=" << range->min << " Max=" << range->max diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp index 765150f..46284e5 100644 --- a/Transceiver52M/device/uhd/UHDDevice.cpp +++ b/Transceiver52M/device/uhd/UHDDevice.cpp @@ -357,12 +357,6 @@ } #endif -static void thread_enable_cancel(bool cancel) -{ - cancel ? pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) : - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); -} - uhd_device::uhd_device(size_t tx_sps, size_t rx_sps, InterfaceType iface, size_t chans, double lo_offset, const std::vector& tx_paths, -- To view, visit https://gerrit.osmocom.org/13785 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1a479b59bdda01233273dfa919bd678edbe34708 Gerrit-Change-Number: 13785 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 21:27:45 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Apr 2019 21:27:45 +0000 Subject: Change in osmo-trx[master]: lms: Log underrun/overrun events Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13786 Change subject: lms: Log underrun/overrun events ...................................................................... lms: Log underrun/overrun events Change-Id: I8c6b1d3e8515153e5d4079cc6620901ef8ce2449 --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/86/13786/1 diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 0cd41d3..d0c8e19 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -573,12 +573,20 @@ { lms_stream_status_t status; if (LMS_GetStreamStatus(&m_lms_stream_rx[chan], &status) == 0) { - if (status.underrun > m_last_rx_underruns[chan]) + if (status.underrun > m_last_rx_underruns[chan]) { *underrun = true; + LOGC(DDEV, ERROR) << "chan " << chan << ": recv Underrun! (" + << m_last_rx_underruns[chan] << " -> " + << status.underrun << ")"; + } m_last_rx_underruns[chan] = status.underrun; - if (status.overrun > m_last_rx_overruns[chan]) + if (status.overrun > m_last_rx_overruns[chan]) { *overrun = true; + LOGC(DDEV, ERROR) << "chan " << chan << ": recv Overrun! (" + << m_last_rx_overruns[chan] << " -> " + << status.overrun << ")"; + } m_last_rx_overruns[chan] = status.overrun; } } -- To view, visit https://gerrit.osmocom.org/13786 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8c6b1d3e8515153e5d4079cc6620901ef8ce2449 Gerrit-Change-Number: 13786 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 21:27:45 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Apr 2019 21:27:45 +0000 Subject: Change in osmo-trx[master]: lms: Remove references to ALERT loglevel Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13787 Change subject: lms: Remove references to ALERT loglevel ...................................................................... lms: Remove references to ALERT loglevel ALERT log level is not Osmocom standard level, it's just a define in osmo-trx to keep compatibility with old code. Same goes for one reference to "ERR" intead of "ERROR". Change-Id: I0e171a8ac8a8bfa804ac97fba3d73efcfa6424b4 --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 21 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/87/13787/1 diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index d0c8e19..e971ad4 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -234,7 +234,7 @@ /* configure antennas */ if (!set_antennas()) { - LOGC(DDEV, ALERT) << "LMS antenna setting failed"; + LOGC(DDEV, FATAL) << "LMS antenna setting failed"; goto out_close; } @@ -245,7 +245,7 @@ return NORMAL; out_close: - LOGC(DDEV, ALERT) << "Error in LMS open, closing: " << LMS_GetLastErrorMessage(); + LOGC(DDEV, FATAL) << "Error in LMS open, closing: " << LMS_GetLastErrorMessage(); LMS_Close(m_lms_dev); m_lms_dev = NULL; return -1; @@ -456,7 +456,7 @@ rc = LMS_RecvStream(&m_lms_stream_rx[0], &buffer[0], len, &rx_metadata, 100); LOGC(DDEV, DEBUG) << "Flush: Recv buffer of len " << rc << " at " << std::hex << rx_metadata.timestamp; if (rc != len) { - LOGC(DDEV, ALERT) << "Flush: Device receive timed out"; + LOGC(DDEV, ERROR) << "Flush: Device receive timed out"; return false; } @@ -472,18 +472,18 @@ int idx; if (chan >= rx_paths.size()) { - LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan; + LOGC(DDEV, ERROR) << "Requested non-existent channel " << chan; return false; } idx = get_ant_idx(ant, LMS_CH_RX, chan); if (idx < 0) { - LOGC(DDEV, ALERT) << "Invalid Rx Antenna"; + LOGC(DDEV, ERROR) << "Invalid Rx Antenna"; return false; } if (LMS_SetAntenna(m_lms_dev, LMS_CH_RX, chan, idx) < 0) { - LOGC(DDEV, ALERT) << "Unable to set Rx Antenna"; + LOGC(DDEV, ERROR) << "Unable to set Rx Antenna"; } return true; @@ -495,18 +495,18 @@ int idx; if (chan >= rx_paths.size()) { - LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan; + LOGC(DDEV, ERROR) << "Requested non-existent channel " << chan; return ""; } idx = LMS_GetAntenna(m_lms_dev, LMS_CH_RX, chan); if (idx < 0) { - LOGC(DDEV, ALERT) << "Error getting Rx Antenna"; + LOGC(DDEV, ERROR) << "Error getting Rx Antenna"; return ""; } if (LMS_GetAntennaList(m_lms_dev, LMS_CH_RX, chan, name_list) < idx) { - LOGC(DDEV, ALERT) << "Error getting Rx Antenna List"; + LOGC(DDEV, ERROR) << "Error getting Rx Antenna List"; return ""; } @@ -518,18 +518,18 @@ int idx; if (chan >= tx_paths.size()) { - LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan; + LOGC(DDEV, ERROR) << "Requested non-existent channel " << chan; return false; } idx = get_ant_idx(ant, LMS_CH_TX, chan); if (idx < 0) { - LOGC(DDEV, ALERT) << "Invalid Rx Antenna"; + LOGC(DDEV, ERROR) << "Invalid Rx Antenna"; return false; } if (LMS_SetAntenna(m_lms_dev, LMS_CH_TX, chan, idx) < 0) { - LOGC(DDEV, ALERT) << "Unable to set Rx Antenna"; + LOGC(DDEV, ERROR) << "Unable to set Rx Antenna"; } return true; @@ -541,18 +541,18 @@ int idx; if (chan >= tx_paths.size()) { - LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan; + LOGC(DDEV, ERROR) << "Requested non-existent channel " << chan; return ""; } idx = LMS_GetAntenna(m_lms_dev, LMS_CH_TX, chan); if (idx < 0) { - LOGC(DDEV, ALERT) << "Error getting Tx Antenna"; + LOGC(DDEV, ERROR) << "Error getting Tx Antenna"; return ""; } if (LMS_GetAntennaList(m_lms_dev, LMS_CH_TX, chan, name_list) < idx) { - LOGC(DDEV, ALERT) << "Error getting Tx Antenna List"; + LOGC(DDEV, ERROR) << "Error getting Tx Antenna List"; return ""; } @@ -603,7 +603,7 @@ rx_metadata.timestamp = 0; if (bufs.size() != chans) { - LOGC(DDEV, ALERT) << "Invalid channel combination " << bufs.size(); + LOGC(DDEV, ERROR) << "Invalid channel combination " << bufs.size(); return -1; } @@ -614,12 +614,12 @@ rc = LMS_RecvStream(&m_lms_stream_rx[i], bufs[i], len, &rx_metadata, 100); update_stream_stats(i, underrun, overrun); if (rc != len) { - LOGC(DDEV, ALERT) << "LMS: Device receive timed out (" << rc << " vs exp " << len << ")."; + LOGC(DDEV, ERROR) << "LMS: Device receive timed out (" << rc << " vs exp " << len << ")."; thread_enable_cancel(true); return -1; } if (timestamp != (TIMESTAMP)rx_metadata.timestamp) - LOGC(DDEV, ALERT) << "chan "<< i << " recv buffer of len " << rc << " expect " << std::hex << timestamp << " got " << std::hex << (TIMESTAMP)rx_metadata.timestamp << " (" << std::hex << rx_metadata.timestamp <<") diff=" << rx_metadata.timestamp - timestamp; + LOGC(DDEV, ERROR) << "chan "<< i << " recv buffer of len " << rc << " expect " << std::hex << timestamp << " got " << std::hex << (TIMESTAMP)rx_metadata.timestamp << " (" << std::hex << rx_metadata.timestamp <<") diff=" << rx_metadata.timestamp - timestamp; thread_enable_cancel(true); } @@ -644,12 +644,12 @@ tx_metadata.timestamp = timestamp - ts_offset; /* Shift Tx time by offset */ if (isControl) { - LOGC(DDEV, ERR) << "Control packets not supported"; + LOGC(DDEV, ERROR) << "Control packets not supported"; return 0; } if (bufs.size() != chans) { - LOGC(DDEV, ALERT) << "Invalid channel combination " << bufs.size(); + LOGC(DDEV, ERROR) << "Invalid channel combination " << bufs.size(); return -1; } @@ -660,7 +660,7 @@ thread_enable_cancel(false); rc = LMS_SendStream(&m_lms_stream_tx[i], bufs[i], len, &tx_metadata, 100); if (rc != len) { - LOGC(DDEV, ALERT) << "LMS: Device send timed out"; + LOGC(DDEV, ERROR) << "LMS: Device send timed out"; } if (LMS_GetStreamStatus(&m_lms_stream_tx[i], &status) == 0) { -- To view, visit https://gerrit.osmocom.org/13787 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0e171a8ac8a8bfa804ac97fba3d73efcfa6424b4 Gerrit-Change-Number: 13787 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 21:27:46 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Apr 2019 21:27:46 +0000 Subject: Change in osmo-trx[master]: lms: Remove unused var m_last_tx_overruns Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13788 Change subject: lms: Remove unused var m_last_tx_overruns ...................................................................... lms: Remove unused var m_last_tx_overruns Change-Id: I2104205b2af7cd6c86075d5cc4f0f36bde5e5311 --- M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/lms/LMSDevice.h 2 files changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/88/13788/1 diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index e971ad4..e65c93d 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -55,7 +55,6 @@ m_last_rx_underruns.resize(chans, 0); m_last_rx_overruns.resize(chans, 0); m_last_tx_underruns.resize(chans, 0); - m_last_tx_overruns.resize(chans, 0); } LMSDevice::~LMSDevice() diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h index d1cb12a..4bf2b32 100644 --- a/Transceiver52M/device/lms/LMSDevice.h +++ b/Transceiver52M/device/lms/LMSDevice.h @@ -51,7 +51,6 @@ std::vector m_last_rx_underruns; std::vector m_last_rx_overruns; std::vector m_last_tx_underruns; - std::vector m_last_tx_overruns; double actualSampleRate; ///< the actual USRP sampling rate -- To view, visit https://gerrit.osmocom.org/13788 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2104205b2af7cd6c86075d5cc4f0f36bde5e5311 Gerrit-Change-Number: 13788 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 21:27:46 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Apr 2019 21:27:46 +0000 Subject: Change in osmo-trx[master]: lms: Catch and log dropped packets by HW during recv Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13789 Change subject: lms: Catch and log dropped packets by HW during recv ...................................................................... lms: Catch and log dropped packets by HW during recv Change-Id: I23554d95b0aff585024610fc12920c9da4f3ba9e --- M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/lms/LMSDevice.h 2 files changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/89/13789/1 diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index e65c93d..7071589 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -54,6 +54,7 @@ m_last_rx_underruns.resize(chans, 0); m_last_rx_overruns.resize(chans, 0); + m_last_rx_dropped.resize(chans, 0); m_last_tx_underruns.resize(chans, 0); } @@ -587,6 +588,13 @@ << status.overrun << ")"; } m_last_rx_overruns[chan] = status.overrun; + + if (status.droppedPackets > m_last_rx_dropped[chan]) { + LOGC(DDEV, ERROR) << "chan " << chan << ": recv Dropped packets by HW! (" + << m_last_rx_dropped[chan] << " -> " + << status.droppedPackets << ")"; + } + m_last_rx_dropped[chan] = m_last_rx_overruns[chan]; } } diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h index 4bf2b32..225839d 100644 --- a/Transceiver52M/device/lms/LMSDevice.h +++ b/Transceiver52M/device/lms/LMSDevice.h @@ -50,6 +50,7 @@ std::vector m_last_rx_underruns; std::vector m_last_rx_overruns; + std::vector m_last_rx_dropped; std::vector m_last_tx_underruns; double actualSampleRate; ///< the actual USRP sampling rate -- To view, visit https://gerrit.osmocom.org/13789 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I23554d95b0aff585024610fc12920c9da4f3ba9e Gerrit-Change-Number: 13789 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 21:38:18 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Apr 2019 21:38:18 +0000 Subject: Change in osmo-mgw[master]: Introduce log fmt helpers LOGPENDP and LOGPCONN In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13773 ) Change subject: Introduce log fmt helpers LOGPENDP and LOGPCONN ...................................................................... Introduce log fmt helpers LOGPENDP and LOGPCONN Let's define macro once and use it everywhere instead of passing endp information in different ways everywhere. Furthermore, use conn whenever appropiate to have more information. Change-Id: I1c49b1eb16bc5f1010376da5cf407ca6e31d81f2 --- M include/osmocom/mgcp/mgcp_endp.h M include/osmocom/mgcp/mgcp_internal.h M src/libosmo-mgcp/mgcp_codec.c M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_endp.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_sdp.c 9 files changed, 339 insertions(+), 431 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/mgcp/mgcp_endp.h b/include/osmocom/mgcp/mgcp_endp.h index a23e192..75f093d 100644 --- a/include/osmocom/mgcp/mgcp_endp.h +++ b/include/osmocom/mgcp/mgcp_endp.h @@ -99,4 +99,3 @@ #define ENDPOINT_NUMBER(endp) abs((int)(endp - endp->tcfg->endpoints)) void mgcp_endp_release(struct mgcp_endpoint *endp); - diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index ec94584..3defc4c 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -335,3 +335,13 @@ void mgcp_get_local_addr(char *addr, struct mgcp_conn_rtp *conn); void mgcp_conn_watchdog_kick(struct mgcp_conn *conn); + +#define LOGPENDP(endp, cat, level, fmt, args...) \ +LOGP(cat, level, "endpoint:0x%x " fmt, \ + ENDPOINT_NUMBER(endp), \ + ## args) + +#define LOGPCONN(conn, cat, level, fmt, args...) \ +LOGPENDP((conn)->endp, cat, level, "CI:%s " fmt, \ + (conn)->id, \ + ## args) diff --git a/src/libosmo-mgcp/mgcp_codec.c b/src/libosmo-mgcp/mgcp_codec.c index 933284d..8bf0564 100644 --- a/src/libosmo-mgcp/mgcp_codec.c +++ b/src/libosmo-mgcp/mgcp_codec.c @@ -56,8 +56,8 @@ endp = conn->conn->endp; if (rtp->codecs_assigned == 0) { - LOGP(DLMGCP, LOGL_ERROR, "endpoint:0x%x conn:%s no codecs available\n", ENDPOINT_NUMBER(endp), - mgcp_conn_dump(conn->conn)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "conn:%s no codecs available\n", + mgcp_conn_dump(conn->conn)); return; } @@ -65,8 +65,8 @@ for (i = 0; i < rtp->codecs_assigned; i++) { codec = &rtp->codecs[i]; - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:0x%x conn:%s codecs[%u]:%s", ENDPOINT_NUMBER(endp), - mgcp_conn_dump(conn->conn), i, dump_codec(codec)); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "conn:%s codecs[%u]:%s", + mgcp_conn_dump(conn->conn), i, dump_codec(codec)); if (codec == rtp->codec) LOGPC(DLMGCP, LOGL_DEBUG, " [selected]"); diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index a8341d6..bfaa111 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -75,8 +75,7 @@ } } - LOGP(DLMGCP, LOGL_ERROR, "endpoint:0x%x, unable to generate a unique connectionIdentifier\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "unable to generate a unique connectionIdentifier\n"); return -1; } @@ -129,7 +128,7 @@ void mgcp_conn_watchdog_cb(void *data) { struct mgcp_conn *conn = data; - LOGP(DLMGCP, LOGL_ERROR, "endpoint:0x%x CI:%s connection timed out!\n", ENDPOINT_NUMBER(conn->endp), conn->id); + LOGPCONN(conn, DLMGCP, LOGL_ERROR, "connection timed out!\n"); mgcp_conn_free(conn->endp, conn->id); } @@ -139,7 +138,7 @@ if (!timeout) return; - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:0x%x CI:%s watchdog kicked\n", ENDPOINT_NUMBER(conn->endp), conn->id); + LOGPCONN(conn, DLMGCP, LOGL_DEBUG, "watchdog kicked\n"); osmo_timer_schedule(&conn->watchdog, timeout, 0); } diff --git a/src/libosmo-mgcp/mgcp_endp.c b/src/libosmo-mgcp/mgcp_endp.c index fa2dd28..eec46bf 100644 --- a/src/libosmo-mgcp/mgcp_endp.c +++ b/src/libosmo-mgcp/mgcp_endp.c @@ -36,8 +36,7 @@ * \param[in] endp endpoint to release */ void mgcp_endp_release(struct mgcp_endpoint *endp) { - LOGP(DLMGCP, LOGL_DEBUG, "Releasing endpoint:0x%x\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "Releasing endpoint\n"); /* Normally this function should only be called when * all connections have been removed already. In case diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 5844d41..5dae5a2 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -82,9 +82,8 @@ int ret = 0; if (!mode) { - LOGP(DLMGCP, LOGL_ERROR, - "endpoint:0x%x missing connection mode\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn, DLMGCP, LOGL_ERROR, + "missing connection mode\n"); return -1; } if (!conn) @@ -101,9 +100,8 @@ else if (strcmp(mode, "loopback") == 0) conn->mode = MGCP_CONN_LOOPBACK; else { - LOGP(DLMGCP, LOGL_ERROR, - "endpoint:0x%x unknown connection mode: '%s'\n", - ENDPOINT_NUMBER(endp), mode); + LOGPCONN(conn, DLMGCP, LOGL_ERROR, + "unknown connection mode: '%s'\n", mode); ret = -1; } @@ -113,18 +111,15 @@ conn->mode & MGCP_CONN_SEND_ONLY ? 1 : 0; } - LOGP(DLMGCP, LOGL_DEBUG, - "endpoint:0x%x conn:%s\n", - ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn)); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "conn:%s\n", mgcp_conn_dump(conn)); - LOGP(DLMGCP, LOGL_DEBUG, - "endpoint:0x%x connection mode '%s' %d\n", - ENDPOINT_NUMBER(endp), mode, conn->mode); + LOGPCONN(conn, DLMGCP, LOGL_DEBUG, "connection mode '%s' %d\n", + mode, conn->mode); /* Special handling f?r RTP connections */ if (conn->type == MGCP_CONN_TYPE_RTP) { - LOGP(DLMGCP, LOGL_DEBUG, "endpoint:0x%x output_enabled %d\n", - ENDPOINT_NUMBER(endp), conn->u.rtp.end.output_enabled); + LOGPCONN(conn, DLMGCP, LOGL_DEBUG, "output_enabled %d\n", + conn->u.rtp.end.output_enabled); } /* The VTY might change the connection mode at any time, so we have @@ -197,9 +192,8 @@ for (i = 0; i < number_endpoints; i++) { if (endpoints[i].callid == NULL) { endp = &endpoints[i]; - LOGP(DLMGCP, LOGL_DEBUG, - "endpoint:0x%x found free endpoint\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, + "found free endpoint\n"); endp->wildcarded_req = true; return endp; } @@ -422,9 +416,9 @@ return -1; if (strcmp(endp->callid, callid) != 0) { - LOGP(DLMGCP, LOGL_ERROR, - "endpoint:0x%x CallIDs mismatch: '%s' != '%s'\n", - ENDPOINT_NUMBER(endp), endp->callid, callid); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "CallIDs mismatch: '%s' != '%s'\n", + endp->callid, callid); return -1; } @@ -443,25 +437,23 @@ /* Check for null identifiers */ if (!conn_id) { - LOGP(DLMGCP, LOGL_ERROR, - "endpoint:0x%x invalid ConnectionIdentifier (missing)\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "invalid ConnectionIdentifier (missing)\n"); return 510; } /* Check for empty connection identifiers */ if (strlen(conn_id) == 0) { - LOGP(DLMGCP, LOGL_ERROR, - "endpoint:0x%x invalid ConnectionIdentifier (empty)\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "invalid ConnectionIdentifier (empty)\n"); return 510; } /* Check for over long connection identifiers */ if (strlen(conn_id) > (MGCP_CONN_ID_MAXLEN-1)) { - LOGP(DLMGCP, LOGL_ERROR, - "endpoint:0x%x invalid ConnectionIdentifier (too long: %zu > %d) 0x%s\n", - ENDPOINT_NUMBER(endp), strlen(conn_id), MGCP_CONN_ID_MAXLEN-1, conn_id); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "invalid ConnectionIdentifier (too long: %zu > %d) 0x%s\n", + strlen(conn_id), MGCP_CONN_ID_MAXLEN-1, conn_id); return 510; } @@ -469,9 +461,8 @@ if (mgcp_conn_get(endp, conn_id)) return 0; - LOGP(DLMGCP, LOGL_ERROR, - "endpoint:0x%x no connection found under ConnectionIdentifier 0x%s\n", - ENDPOINT_NUMBER(endp), conn_id); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "no connection found under ConnectionIdentifier 0x%s\n", conn_id); /* When the conn_id was not found, return error code 515 "The transaction refers to an incorrect * connection-id (may have been already deleted)." */ diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 2c6c571..4d92051 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -76,14 +76,12 @@ if (endp->cfg->net_ports.bind_addr_probe && conn->end.addr.s_addr != 0) { rc = osmo_sock_local_ip(addr, inet_ntoa(conn->end.addr)); if (rc < 0) - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x CI:%s local interface auto detection failed, using configured addresses...\n", - ENDPOINT_NUMBER(endp), conn->conn->id); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "local interface auto detection failed, using configured addresses...\n"); else { - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x CI:%s selected local rtp bind ip %s by probing using remote ip %s\n", - ENDPOINT_NUMBER(endp), conn->conn->id, addr, - inet_ntoa(conn->end.addr)); + LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, + "selected local rtp bind ip %s by probing using remote ip %s\n", + addr, inet_ntoa(conn->end.addr)); return; } } @@ -93,17 +91,16 @@ /* Check there is a bind IP for the RTP traffic configured, * if so, use that IP-Address */ osmo_strlcpy(addr, endp->cfg->net_ports.bind_addr, INET_ADDRSTRLEN); - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x CI:%s using configured rtp bind ip as local bind ip %s\n", - ENDPOINT_NUMBER(endp), conn->conn->id, addr); + LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, + "using configured rtp bind ip as local bind ip %s\n", + addr); } else { /* No specific bind IP is configured for the RTP traffic, so * assume the IP where we listen for incoming MGCP messages * as bind IP */ osmo_strlcpy(addr, endp->cfg->source_addr, INET_ADDRSTRLEN); - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x CI:%s using mgcp bind ip as local rtp bind ip: %s\n", - ENDPOINT_NUMBER(endp), conn->conn->id, addr); + LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, + "using mgcp bind ip as local rtp bind ip: %s\n", addr); } } @@ -165,10 +162,8 @@ OSMO_ASSERT(endp); OSMO_ASSERT(conn); - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x sending dummy packet...\n", ENDPOINT_NUMBER(endp)); - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x conn:%s\n", - ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); + LOGPCONN(conn->conn, DRTP, LOGL_DEBUG,"sending dummy packet... %s\n", + mgcp_conn_dump(conn->conn)); rc = mgcp_udp_send(conn->end.rtp.fd, &conn->end.addr, conn->end.rtp_port, buf, 1); @@ -187,9 +182,9 @@ return rc; failed: - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x Failed to send dummy %s packet.\n", - ENDPOINT_NUMBER(endp), was_rtcp ? "RTCP" : "RTP"); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "Failed to send dummy %s packet.\n", + was_rtcp ? "RTCP" : "RTP"); return -1; } @@ -228,16 +223,16 @@ if (seq == sstate->last_seq) { if (timestamp != sstate->last_timestamp) { rate_ctr_inc(sstate->err_ts_ctr); - LOGP(DRTP, LOGL_ERROR, - "The %s timestamp delta is != 0 but the sequence " - "number %d is the same, " - "TS offset: %d, SeqNo offset: %d " - "on 0x%x SSRC: %u timestamp: %u " - "from %s:%d\n", - text, seq, - state->patch.timestamp_offset, state->patch.seq_offset, - ENDPOINT_NUMBER(endp), sstate->ssrc, timestamp, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "The %s timestamp delta is != 0 but the sequence " + "number %d is the same, " + "TS offset: %d, SeqNo offset: %d " + "on SSRC: %u timestamp: %u " + "from %s:%d\n", + text, seq, + state->patch.timestamp_offset, state->patch.seq_offset, + sstate->ssrc, timestamp, inet_ntoa(addr->sin_addr), + ntohs(addr->sin_port)); } return 0; } @@ -248,25 +243,25 @@ if (tsdelta == 0) { /* Don't update *tsdelta_out */ - LOGP(DRTP, LOGL_NOTICE, - "The %s timestamp delta is %d " - "on 0x%x SSRC: %u timestamp: %u " - "from %s:%d\n", - text, tsdelta, - ENDPOINT_NUMBER(endp), sstate->ssrc, timestamp, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "The %s timestamp delta is %d " + "on SSRC: %u timestamp: %u " + "from %s:%d\n", + text, tsdelta, + sstate->ssrc, timestamp, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); return 0; } if (sstate->last_tsdelta != tsdelta) { if (sstate->last_tsdelta) { - LOGP(DRTP, LOGL_INFO, - "The %s timestamp delta changes from %d to %d " - "on 0x%x SSRC: %u timestamp: %u from %s:%d\n", - text, sstate->last_tsdelta, tsdelta, - ENDPOINT_NUMBER(endp), sstate->ssrc, timestamp, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_INFO, + "The %s timestamp delta changes from %d to %d " + "on SSRC: %u timestamp: %u from %s:%d\n", + text, sstate->last_tsdelta, tsdelta, + sstate->ssrc, timestamp, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } } @@ -278,18 +273,18 @@ if (timestamp_error) { rate_ctr_inc(sstate->err_ts_ctr); - LOGP(DRTP, LOGL_NOTICE, - "The %s timestamp has an alignment error of %d " - "on 0x%x SSRC: %u " - "SeqNo delta: %d, TS delta: %d, dTS/dSeq: %d " - "from %s:%d. ptime: %d\n", - text, timestamp_error, - ENDPOINT_NUMBER(endp), sstate->ssrc, - (int16_t)(seq - sstate->last_seq), - (int32_t)(timestamp - sstate->last_timestamp), - tsdelta, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port), - state->packet_duration); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "The %s timestamp has an alignment error of %d " + "on SSRC: %u " + "SeqNo delta: %d, TS delta: %d, dTS/dSeq: %d " + "from %s:%d. ptime: %d\n", + text, timestamp_error, + sstate->ssrc, + (int16_t)(seq - sstate->last_seq), + (int32_t)(timestamp - sstate->last_timestamp), + tsdelta, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port), + state->packet_duration); } return 1; } @@ -308,21 +303,19 @@ if (tsdelta == 0) { tsdelta = state->out_stream.last_tsdelta; if (tsdelta != 0) { - LOGP(DRTP, LOGL_NOTICE, - "A fixed packet duration is not available on 0x%x, " - "using last output timestamp delta instead: %d " - "from %s:%d\n", - ENDPOINT_NUMBER(endp), tsdelta, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "A fixed packet duration is not available, " + "using last output timestamp delta instead: %d " + "from %s:%d\n", tsdelta, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } else { tsdelta = rtp_end->codec->rate * 20 / 1000; - LOGP(DRTP, LOGL_NOTICE, - "Fixed packet duration and last timestamp delta " - "are not available on 0x%x, " - "using fixed 20ms instead: %d " - "from %s:%d\n", - ENDPOINT_NUMBER(endp), tsdelta, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "Fixed packet duration and last timestamp delta " + "are not available, " + "using fixed 20ms instead: %d " + "from %s:%d\n", tsdelta, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } } @@ -332,13 +325,12 @@ if (state->patch.timestamp_offset != timestamp_offset) { state->patch.timestamp_offset = timestamp_offset; - LOGP(DRTP, LOGL_NOTICE, - "Timestamp offset change on 0x%x SSRC: %u " - "SeqNo delta: %d, TS offset: %d, " - "from %s:%d\n", - ENDPOINT_NUMBER(endp), state->in_stream.ssrc, - delta_seq, state->patch.timestamp_offset, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "Timestamp offset change on SSRC: %u " + "SeqNo delta: %d, TS offset: %d, " + "from %s:%d\n", state->in_stream.ssrc, + delta_seq, state->patch.timestamp_offset, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } return timestamp_offset; @@ -364,14 +356,13 @@ if (ts_error) { state->patch.timestamp_offset += ptime - ts_error; - LOGP(DRTP, LOGL_NOTICE, - "Corrected timestamp alignment error of %d on 0x%x SSRC: %u " - "new TS offset: %d, " - "from %s:%d\n", - ts_error, - ENDPOINT_NUMBER(endp), state->in_stream.ssrc, - state->patch.timestamp_offset, inet_ntoa(addr->sin_addr), - ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "Corrected timestamp alignment error of %d on SSRC: %u " + "new TS offset: %d, " + "from %s:%d\n", + ts_error, state->in_stream.ssrc, + state->patch.timestamp_offset, inet_ntoa(addr->sin_addr), + ntohs(addr->sin_port)); } /* Check we really managed to compensate the timestamp @@ -397,8 +388,7 @@ struct mgcp_rtp_end *dst_end, char *data, int *len, int buf_size) { - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x transcoding disabled\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "transcoding disabled\n"); return 0; } @@ -411,8 +401,7 @@ struct mgcp_conn_rtp *conn_dst, struct mgcp_conn_rtp *conn_src) { - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x transcoding disabled\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "transcoding disabled\n"); return 0; } @@ -421,9 +410,8 @@ const char **fmtp_extra, struct mgcp_conn_rtp *conn) { - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x conn:%s using format defaults\n", - ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "conn:%s using format defaults\n", + mgcp_conn_dump(conn->conn)); *codec = conn->end.codec; *fmtp_extra = conn->end.fmtp_extra; @@ -459,9 +447,9 @@ if (seq < state->stats.max_seq) state->stats.cycles += RTP_SEQ_MOD; } else if (udelta <= RTP_SEQ_MOD - RTP_MAX_MISORDER) { - LOGP(DRTP, LOGL_NOTICE, - "RTP seqno made a very large jump on 0x%x delta: %u\n", - ENDPOINT_NUMBER(endp), udelta); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "RTP seqno made a very large jump on delta: %u\n", + udelta); } } @@ -541,28 +529,27 @@ state->out_stream.last_tsdelta = 0; state->out_stream.last_timestamp = timestamp; state->out_stream.ssrc = ssrc - 1; /* force output SSRC change */ - LOGP(DRTP, LOGL_INFO, - "endpoint:0x%x initializing stream, SSRC: %u timestamp: %u " - "pkt-duration: %d, from %s:%d\n", - ENDPOINT_NUMBER(endp), state->in_stream.ssrc, - state->patch.seq_offset, state->packet_duration, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_INFO, + "initializing stream, SSRC: %u timestamp: %u " + "pkt-duration: %d, from %s:%d\n", + state->in_stream.ssrc, + state->patch.seq_offset, state->packet_duration, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); if (state->packet_duration == 0) { state->packet_duration = rtp_end->codec->rate * 20 / 1000; - LOGP(DRTP, LOGL_NOTICE, - "endpoint:0x%x fixed packet duration is not available, " - "using fixed 20ms instead: %d from %s:%d\n", - ENDPOINT_NUMBER(endp), state->packet_duration, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "fixed packet duration is not available, " + "using fixed 20ms instead: %d from %s:%d\n", + state->packet_duration, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } } else if (state->in_stream.ssrc != ssrc) { - LOGP(DRTP, LOGL_NOTICE, - "endpoint:0x%x SSRC changed: %u -> %u " - "from %s:%d\n", - ENDPOINT_NUMBER(endp), - state->in_stream.ssrc, rtp_hdr->ssrc, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "SSRC changed: %u -> %u " + "from %s:%d\n", + state->in_stream.ssrc, rtp_hdr->ssrc, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); state->in_stream.ssrc = ssrc; if (rtp_end->force_constant_ssrc) { @@ -586,13 +573,12 @@ if (rtp_end->force_constant_ssrc != -1) rtp_end->force_constant_ssrc -= 1; - LOGP(DRTP, LOGL_NOTICE, - "endpoint:0x%x SSRC patching enabled, SSRC: %u " - "SeqNo offset: %d, TS offset: %d " - "from %s:%d\n", - ENDPOINT_NUMBER(endp), state->in_stream.ssrc, - state->patch.seq_offset, state->patch.timestamp_offset, - inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); + LOGPENDP(endp, DRTP, LOGL_NOTICE, + "SSRC patching enabled, SSRC: %u " + "SeqNo offset: %d, TS offset: %d " + "from %s:%d\n", state->in_stream.ssrc, + state->patch.seq_offset, state->patch.timestamp_offset, + inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); } state->in_stream.last_tsdelta = 0; @@ -679,9 +665,8 @@ } else { /* It is possible that multiple payloads occur in one RTP * packet. This is not supported yet. */ - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x cannot figure out how to convert RTP packet\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "cannot figure out how to convert RTP packet\n"); } } @@ -726,9 +711,8 @@ rc = payload_len; } if (rc < 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x AMR RTP packet conversion failed\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "AMR RTP packet conversion failed\n"); return -EINVAL; } @@ -810,19 +794,14 @@ OSMO_ASSERT(conn_dst); if (is_rtp) { - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x delivering RTP packet...\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "delivering RTP packet...\n"); } else { - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x delivering RTCP packet...\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "delivering RTCP packet...\n"); } - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x loop:%d, mode:%d%s\n", - ENDPOINT_NUMBER(endp), tcfg->audio_loop, conn_src->conn->mode, - conn_src->conn->mode == MGCP_CONN_LOOPBACK ? " (loopback)" : ""); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "loop:%d, mode:%d%s\n", + tcfg->audio_loop, conn_src->conn->mode, + conn_src->conn->mode == MGCP_CONN_LOOPBACK ? " (loopback)" : ""); /* FIXME: It is legal that the payload type on the egress connection is * different from the payload type that has been negotiated on the @@ -835,9 +814,8 @@ if (is_rtp) { rc = mgcp_patch_pt(conn_src, conn_dst, buf, len); if (rc < 0) { - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x can not patch PT because no suitable egress codec was found.\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, + "can not patch PT because no suitable egress codec was found.\n"); } } @@ -849,13 +827,12 @@ if (!rtp_end->output_enabled) { rate_ctr_inc(&conn_dst->rate_ctr_group->ctr[RTP_DROPPED_PACKETS_CTR]); - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x output disabled, drop to %s %s " - "rtp_port:%u rtcp_port:%u\n", - ENDPOINT_NUMBER(endp), - dest_name, - inet_ntoa(rtp_end->addr), - ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) + LOGPENDP(endp, DRTP, LOGL_DEBUG, + "output disabled, drop to %s %s " + "rtp_port:%u rtcp_port:%u\n", + dest_name, + inet_ntoa(rtp_end->addr), + ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) ); } else if (is_rtp) { int cont; @@ -882,13 +859,12 @@ "GSM-HR-08") == 0) rfc5993_hr_convert(endp, buf, &buflen); - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x process/send to %s %s " - "rtp_port:%u rtcp_port:%u\n", - ENDPOINT_NUMBER(endp), dest_name, - inet_ntoa(rtp_end->addr), ntohs(rtp_end->rtp_port), - ntohs(rtp_end->rtcp_port) - ); + LOGPENDP(endp, DRTP, LOGL_DEBUG, + "process/send to %s %s " + "rtp_port:%u rtcp_port:%u\n", + dest_name, inet_ntoa(rtp_end->addr), + ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) + ); /* Forward a copy of the RTP data to a debug ip/port */ forward_data(rtp_end->rtp.fd, &conn_src->tap_out, @@ -906,10 +882,9 @@ data[0] = 0xe4; data[1] = 0x00; rtp_state->patched_first_rtp_payload = true; - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x Patching over first two bytes" - " to fake an IuUP Initialization Ack\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, + "Patching over first two bytes" + " to fake an IuUP Initialization Ack\n"); } } @@ -928,13 +903,11 @@ } while (buflen > 0); return nbytes; } else if (!tcfg->omit_rtcp) { - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x send to %s %s rtp_port:%u rtcp_port:%u\n", - ENDPOINT_NUMBER(endp), - dest_name, - inet_ntoa(rtp_end->addr), - ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) - ); + LOGPENDP(endp, DRTP, LOGL_DEBUG, + "send to %s %s rtp_port:%u rtcp_port:%u\n", + dest_name, inet_ntoa(rtp_end->addr), + ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) + ); len = mgcp_udp_send(rtp_end->rtcp.fd, &rtp_end->addr, @@ -970,20 +943,19 @@ rc = recvfrom(fd, buf, bufsize, 0, (struct sockaddr *)addr, &slen); - LOGP(DRTP, LOGL_DEBUG, + LOGPENDP(endp, DRTP, LOGL_DEBUG, "receiving %u bytes length packet from %s:%u ...\n", rc, inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); if (rc < 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x failed to receive packet, errno: %d/%s\n", - ENDPOINT_NUMBER(endp), errno, strerror(errno)); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "failed to receive packet, errno: %d/%s\n", + errno, strerror(errno)); return -1; } if (tossed) { - LOGP(DRTP, LOGL_ERROR, "endpoint:0x%x packet tossed\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_ERROR, "packet tossed\n"); } return rc; @@ -994,9 +966,6 @@ static int check_rtp_origin(struct mgcp_conn_rtp *conn, struct sockaddr_in *addr) { - struct mgcp_endpoint *endp; - endp = conn->conn->endp; - if (conn->end.addr.s_addr == 0) { switch (conn->conn->mode) { case MGCP_CONN_LOOPBACK: @@ -1007,20 +976,18 @@ * Response is received, but the nano3G expects an IuUP Initialization Ack before it even * sends the RAB Assignment Response. Hence, if the remote address is 0.0.0.0 and the * MGCP port is in loopback mode, allow looping back the packet to any source. */ - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x In loopback mode and remote address not set:" - " allowing data from address: %s\n", - ENDPOINT_NUMBER(endp), inet_ntoa(addr->sin_addr)); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "In loopback mode and remote address not set:" + " allowing data from address: %s\n", inet_ntoa(addr->sin_addr)); return 0; default: /* Receiving early media before the endpoint is configured. Instead of logging * this as an error that occurs on every call, keep it more low profile to not * confuse humans with expected errors. */ - LOGP(DRTP, LOGL_INFO, - "endpoint:0x%x I:%s Rx RTP from %s, but remote address not set:" - " dropping early media\n", - ENDPOINT_NUMBER(endp), conn->conn->id, inet_ntoa(addr->sin_addr)); + LOGPCONN(conn->conn, DRTP, LOGL_INFO, + "Rx RTP from %s, but remote address not set:" + " dropping early media\n", inet_ntoa(addr->sin_addr)); return -1; } } @@ -1028,13 +995,11 @@ /* Note: Check if the inbound RTP data comes from the same host to * which we send our outgoing RTP traffic. */ if (conn->end.addr.s_addr != addr->sin_addr.s_addr) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x data from wrong address: %s, ", - ENDPOINT_NUMBER(endp), inet_ntoa(addr->sin_addr)); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "data from wrong address: %s, ", inet_ntoa(addr->sin_addr)); LOGPC(DRTP, LOGL_ERROR, "expected: %s\n", inet_ntoa(conn->end.addr)); - LOGP(DRTP, LOGL_ERROR, "endpoint:0x%x packet tossed\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, "packet tossed\n"); return -1; } @@ -1044,14 +1009,12 @@ * plausibility. */ if (conn->end.rtp_port != addr->sin_port && conn->end.rtcp_port != addr->sin_port) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x data from wrong source port: %d, ", - ENDPOINT_NUMBER(endp), ntohs(addr->sin_port)); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "data from wrong source port: %d, ", ntohs(addr->sin_port)); LOGPC(DRTP, LOGL_ERROR, "expected: %d for RTP or %d for RTCP\n", ntohs(conn->end.rtp_port), ntohs(conn->end.rtcp_port)); - LOGP(DRTP, LOGL_ERROR, "endpoint:0x%x packet tossed\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, "packet tossed\n"); return -1; } @@ -1062,29 +1025,26 @@ * makes sense */ static int check_rtp_destin(struct mgcp_conn_rtp *conn) { - struct mgcp_endpoint *endp; - endp = conn->conn->endp; - /* Note: it is legal to create a connection but never setting a port * and IP-address for outgoing data. */ if (strcmp(inet_ntoa(conn->end.addr), "0.0.0.0") == 0 && conn->end.rtp_port == 0) { - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x destination IP-address and rtp port is (not yet) known (%s:%u)\n", - ENDPOINT_NUMBER(endp), inet_ntoa(conn->end.addr), conn->end.rtp_port); + LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, + "destination IP-address and rtp port is (not yet) known (%s:%u)\n", + inet_ntoa(conn->end.addr), conn->end.rtp_port); return -1; } if (strcmp(inet_ntoa(conn->end.addr), "0.0.0.0") == 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x destination IP-address is invalid (%s:%u)\n", - ENDPOINT_NUMBER(endp), inet_ntoa(conn->end.addr), conn->end.rtp_port); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "destination IP-address is invalid (%s:%u)\n", + inet_ntoa(conn->end.addr), conn->end.rtp_port); return -1; } if (conn->end.rtp_port == 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x destination rtp port is invalid (%s:%u)\n", - ENDPOINT_NUMBER(endp), inet_ntoa(conn->end.addr), conn->end.rtp_port); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "destination rtp port is invalid (%s:%u)\n", + inet_ntoa(conn->end.addr), conn->end.rtp_port); return -1; } @@ -1152,8 +1112,7 @@ endp = conn->conn->endp; tcfg = endp->tcfg; - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x receiving RTP/RTCP packet...\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, "receiving RTP/RTCP packet...\n"); rc = receive_from(endp, fd->fd, addr, buf, buf_size); if (rc <= 0) @@ -1167,26 +1126,23 @@ if (*proto == MGCP_PROTO_RTP) { if (check_rtp(buf, rc) < 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x invalid RTP packet received -- packet tossed\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "invalid RTP packet received -- packet tossed\n"); return -1; } } else if (*proto == MGCP_PROTO_RTCP) { if (check_rtcp(buf, rc) < 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x invalid RTCP packet received -- packet tossed\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "invalid RTCP packet received -- packet tossed\n"); return -1; } } - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x ", ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, ""); LOGPC(DRTP, LOGL_DEBUG, "receiving from %s %s %d\n", conn->conn->name, inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x conn:%s\n", ENDPOINT_NUMBER(endp), - mgcp_conn_dump(conn->conn)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "conn:%s\n", mgcp_conn_dump(conn->conn)); /* Check if the origin of the RTP packet seems plausible */ if (tcfg->rtp_accept_all == 0) { @@ -1196,11 +1152,10 @@ /* Filter out dummy message */ if (rc == 1 && buf[0] == MGCP_DUMMY_LOAD) { - LOGP(DRTP, LOGL_NOTICE, - "endpoint:0x%x dummy message received\n", - ENDPOINT_NUMBER(endp)); - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x packet tossed\n", ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DRTP, LOGL_NOTICE, + "dummy message received\n"); + LOGPCONN(conn->conn, DRTP, LOGL_ERROR, + "packet tossed\n"); return 0; } @@ -1224,8 +1179,8 @@ struct mgcp_endpoint *endp; endp = conn_src->conn->endp; - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x destin conn:%s\n", - ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn_dst->conn)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "destin conn:%s\n", + mgcp_conn_dump(conn_dst->conn)); /* Before we try to deliver the packet, we check if the destination * port and IP-Address make sense at all. If not, we will be unable @@ -1237,27 +1192,23 @@ * destination connection. */ switch (conn_dst->type) { case MGCP_RTP_DEFAULT: - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x endpoint type is MGCP_RTP_DEFAULT, " - "using mgcp_send() to forward data directly\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, + "endpoint type is MGCP_RTP_DEFAULT, " + "using mgcp_send() to forward data directly\n"); return mgcp_send(endp, proto == MGCP_PROTO_RTP, addr, buf, buf_size, conn_src, conn_dst); case MGCP_OSMUX_BSC_NAT: case MGCP_OSMUX_BSC: - LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x endpoint type is MGCP_OSMUX_BSC_NAT, " - "using osmux_xfrm_to_osmux() to forward data through OSMUX\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, + "endpoint type is MGCP_OSMUX_BSC_NAT, " + "using osmux_xfrm_to_osmux() to forward data through OSMUX\n"); return osmux_xfrm_to_osmux(buf, buf_size, conn_dst); } /* If the data has not been handled/forwarded until here, it will * be discarded, this should not happen, normally the MGCP type * should be properly set */ - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x bad MGCP type -- data discarded!\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DRTP, LOGL_ERROR, "bad MGCP type -- data discarded!\n"); return -1; } @@ -1273,8 +1224,6 @@ unsigned int buf_size, struct mgcp_conn *conn) { struct mgcp_conn *conn_dst; - struct mgcp_endpoint *endp; - endp = conn->endp; /*! NOTE: This callback function implements the endpoint specific * dispatch bahviour of an rtp bridge/proxy endpoint. It is assumed @@ -1300,17 +1249,15 @@ /* There is no destination conn, stop here */ if (!conn_dst) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x unable to find destination conn\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn, DRTP, LOGL_ERROR, + "unable to find destination conn\n"); return -1; } /* The destination conn is not an RTP connection */ if (conn_dst->type != MGCP_CONN_TYPE_RTP) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x unable to find suitable destination conn\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn, DRTP, LOGL_ERROR, + "unable to find suitable destination conn\n"); return -1; } @@ -1362,8 +1309,8 @@ endp = conn_src->conn->endp; OSMO_ASSERT(endp); - LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x source conn:%s\n", - ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn_src->conn)); + LOGPENDP(endp, DRTP, LOGL_DEBUG, "source conn:%s\n", + mgcp_conn_dump(conn_src->conn)); /* Receive packet */ len = mgcp_recv(&proto, &addr, buf, sizeof(buf), fd); @@ -1444,20 +1391,21 @@ { /* NOTE: The port that is used for RTCP is the RTP port incremented by one * (e.g. RTP-Port = 16000 ==> RTCP-Port = 16001) */ + struct mgcp_endpoint *endp = &cfg->trunk.endpoints[endpno]; if (mgcp_create_bind(source_addr, &rtp_end->rtp, rtp_end->local_port) != 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x failed to create RTP port: %s:%d\n", endpno, - source_addr, rtp_end->local_port); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "failed to create RTP port: %s:%d\n", + source_addr, rtp_end->local_port); goto cleanup0; } if (mgcp_create_bind(source_addr, &rtp_end->rtcp, rtp_end->local_port + 1) != 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x failed to create RTCP port: %s:%d\n", endpno, - source_addr, rtp_end->local_port + 1); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "failed to create RTCP port: %s:%d\n", + source_addr, rtp_end->local_port + 1); goto cleanup1; } @@ -1467,17 +1415,17 @@ rtp_end->rtp.when = BSC_FD_READ; if (osmo_fd_register(&rtp_end->rtp) != 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x failed to register RTP port %d\n", endpno, - rtp_end->local_port); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "failed to register RTP port %d\n", + rtp_end->local_port); goto cleanup2; } rtp_end->rtcp.when = BSC_FD_READ; if (osmo_fd_register(&rtp_end->rtcp) != 0) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x failed to register RTCP port %d\n", endpno, - rtp_end->local_port + 1); + LOGPENDP(endp, DRTP, LOGL_ERROR, + "failed to register RTCP port %d\n", + rtp_end->local_port + 1); goto cleanup3; } @@ -1511,10 +1459,8 @@ end = &conn->end; if (end->rtp.fd != -1 || end->rtcp.fd != -1) { - LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x %u was already bound on conn:%s\n", - ENDPOINT_NUMBER(endp), rtp_port, - mgcp_conn_dump(conn->conn)); + LOGPENDP(endp, DRTP, LOGL_ERROR, "%u was already bound on conn:%s\n", + rtp_port, mgcp_conn_dump(conn->conn)); /* Double bindings should never occour! Since we always allocate * connections dynamically and free them when they are not diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 9be4eda..be161ad 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -148,16 +148,14 @@ struct mgcp_conn *_conn; if (conn->type != MGCP_RTP_DEFAULT) { - LOGP(DLMGCP, LOGL_NOTICE, - "endpoint:%x RTP-setup: Endpoint is not configured as RTP default, stopping here!\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "RTP-setup: Endpoint is not configured as RTP default, stopping here!\n"); return 0; } if (conn->conn->mode == MGCP_CONN_LOOPBACK) { - LOGP(DLMGCP, LOGL_NOTICE, - "endpoint:%x RTP-setup: Endpoint is in loopback mode, stopping here!\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "RTP-setup: Endpoint is in loopback mode, stopping here!\n"); return 0; } @@ -225,13 +223,13 @@ len = snprintf((char *)res->data, 2048, "%d %s%s%s\r\n%s", code, trans, txt, param ? param : "", sdp ? sdp : ""); if (len < 0) { - LOGP(DLMGCP, LOGL_ERROR, "Failed to sprintf MGCP response.\n"); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "Failed to sprintf MGCP response.\n"); msgb_free(res); return NULL; } res->l2h = msgb_put(res, len); - LOGP(DLMGCP, LOGL_DEBUG, "Generated response: code=%d\n", code); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "Generated response: code=%d\n", code); mgcp_disp_msg(res->l2h, msgb_l2len(res), "Generated response"); /* @@ -430,7 +428,7 @@ /* AUEP command handler, processes the received command */ static struct msgb *handle_audit_endpoint(struct mgcp_parse_data *p) { - LOGP(DLMGCP, LOGL_NOTICE, "AUEP: auditing endpoint ...\n"); + LOGPENDP(p->endp, DLMGCP, LOGL_NOTICE, "AUEP: auditing endpoint ...\n"); return create_ok_response(p->endp, 200, "AUEP", p->trans); } @@ -469,9 +467,9 @@ } - LOGP(DLMGCP, LOGL_ERROR, - "Allocating a RTP/RTCP port failed %u times 0x%x.\n", - tries, ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "Allocating a RTP/RTCP port failed %u times.\n", + tries); return -1; } @@ -654,11 +652,11 @@ rtp->force_constant_ssrc = patch_ssrc ? 1 : 0; rtp->rfc5993_hr_convert = tcfg->rfc5993_hr_convert; - LOGP(DLMGCP, LOGL_DEBUG, - "Configuring RTP endpoint: local port %d%s%s\n", - ntohs(rtp->rtp_port), - rtp->force_aligned_timing ? ", force constant timing" : "", - rtp->force_constant_ssrc ? ", force constant ssrc" : ""); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, + "Configuring RTP endpoint: local port %d%s%s\n", + ntohs(rtp->rtp_port), + rtp->force_aligned_timing ? ", force constant timing" : "", + rtp->force_constant_ssrc ? ", force constant ssrc" : ""); } uint32_t mgcp_rtp_packet_duration(struct mgcp_endpoint *endp, @@ -684,10 +682,10 @@ { if (!endp->cfg->osmux_init) { if (osmux_init(OSMUX_ROLE_BSC, endp->cfg) < 0) { - LOGP(DLMGCP, LOGL_ERROR, "Cannot init OSMUX\n"); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "Cannot init OSMUX\n"); return -1; } - LOGP(DLMGCP, LOGL_NOTICE, "OSMUX socket has been set up\n"); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, "OSMUX socket has been set up\n"); } return mgcp_parse_osmux_cid(line); @@ -713,9 +711,8 @@ mgcp_codec_reset_all(conn); rc = mgcp_parse_sdp_data(endp, conn, p); if (rc != 0) { - LOGP(DLMGCP, LOGL_ERROR, - "%s: endpoint:%x sdp not parseable\n", cmd, - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, + "%s: sdp not parseable\n", cmd); /* See also RFC 3661: Protocol error */ return 510; @@ -747,9 +744,8 @@ return 0; error: - LOGP(DLMGCP, LOGL_ERROR, - "%s: endpoint:0x%x codec negotiation failure\n", cmd, - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, + "%s: codec negotiation failure\n", cmd); /* See also RFC 3661: Codec negotiation failure */ return 534; @@ -772,8 +768,7 @@ if (!strcmp(token, "C")) endp->x_osmo_ign |= MGCP_X_OSMO_IGN_CALLID; else - LOGP(DLMGCP, LOGL_ERROR, "endpoint 0x%x: received unknown X-Osmo-IGN item '%s'\n", - ENDPOINT_NUMBER(endp), token); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, "received unknown X-Osmo-IGN item '%s'\n", token); } return true; @@ -796,7 +791,7 @@ char conn_name[512]; int rc; - LOGP(DLMGCP, LOGL_NOTICE, "CRCX: creating new connection ...\n"); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, "CRCX: creating new connection ...\n"); /* parse CallID C: and LocalParameters L: */ for_each_line(line, p->save) { @@ -838,9 +833,8 @@ have_sdp = 1; goto mgcp_header_done; default: - LOGP(DLMGCP, LOGL_NOTICE, - "CRCX: endpoint:%x unhandled option: '%c'/%d\n", - ENDPOINT_NUMBER(endp), *line, *line); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "CRCX: unhandled option: '%c'/%d\n", *line, *line); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_UNHANDLED_PARAM]); return create_err_response(NULL, 539, "CRCX", p->trans); break; @@ -850,26 +844,24 @@ mgcp_header_done: /* Check parameters */ if (!callid) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:%x insufficient parameters, missing callid\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "CRCX: insufficient parameters, missing callid\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_MISSING_CALLID]); return create_err_response(endp, 516, "CRCX", p->trans); } if (!mode) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:%x insufficient parameters, missing mode\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "CRCX: insufficient parameters, missing mode\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_INVALID_MODE]); return create_err_response(endp, 517, "CRCX", p->trans); } /* Check if we are able to accept the creation of another connection */ if (llist_count(&endp->conns) >= endp->type->max_conns) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:%x endpoint full, max. %i connections allowed!\n", - endp->type->max_conns, ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "CRCX: endpoint full, max. %i connections allowed!\n", + endp->type->max_conns); if (tcfg->force_realloc) { /* There is no more room for a connection, make some * room by blindly tossing the oldest of the two two @@ -886,9 +878,9 @@ /* Check if this endpoint already serves a call, if so, check if the * callids match up so that we are sure that this is our call */ if (endp->callid && mgcp_verify_call_id(endp, callid)) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:0x%x allready seized by other call (%s)\n", - ENDPOINT_NUMBER(endp), endp->callid); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "CRCX: already seized by other call (%s)\n", + endp->callid); if (tcfg->force_realloc) /* This is not our call, toss everything by releasing * the entire endpoint. (rude!) */ @@ -909,9 +901,8 @@ snprintf(conn_name, sizeof(conn_name), "%s", callid); _conn = mgcp_conn_alloc(NULL, endp, MGCP_CONN_TYPE_RTP, conn_name); if (!_conn) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:0x%x unable to allocate RTP connection\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "CRCX: unable to allocate RTP connection\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_ALLOC_CONN]); goto error2; @@ -932,9 +923,8 @@ conn->osmux.cid = osmux_cid; conn->osmux.state = OSMUX_STATE_NEGOTIATING; } else if (endp->cfg->osmux == OSMUX_USAGE_ONLY) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:0x%x osmux only and no osmux offered\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(_conn, DLMGCP, LOGL_ERROR, + "CRCX: osmux only and no osmux offered\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_NO_OSMUX]); goto error2; } @@ -944,9 +934,8 @@ rc = set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, local_options); if (rc != 0) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:%x inavlid local connection options!\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(_conn, DLMGCP, LOGL_ERROR, + "CRCX: inavlid local connection options!\n"); error_code = rc; rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_INVALID_CONN_OPTIONS]); goto error2; @@ -976,9 +965,8 @@ if (conn->conn->mode != MGCP_CONN_LOOPBACK && conn->conn->mode != MGCP_CONN_RECV_ONLY && conn->end.rtp_port == 0) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:%x selected connection mode type requires an opposite end!\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(_conn, DLMGCP, LOGL_ERROR, + "CRCX: selected connection mode type requires an opposite end!\n"); error_code = 527; rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_NO_REMOTE_CONN_DESC]); goto error2; @@ -990,9 +978,8 @@ } if (setup_rtp_processing(endp, conn) != 0) { - LOGP(DLMGCP, LOGL_ERROR, - "CRCX: endpoint:0x%x could not start RTP processing!\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(_conn, DLMGCP, LOGL_ERROR, + "CRCX: could not start RTP processing!\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_START_RTP]); goto error2; } @@ -1004,9 +991,8 @@ MGCP_ENDP_CRCX, p->trans); switch (rc) { case MGCP_POLICY_REJECT: - LOGP(DLMGCP, LOGL_NOTICE, - "CRCX: endpoint:0x%x CRCX rejected by policy\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(_conn, DLMGCP, LOGL_NOTICE, + "CRCX: CRCX rejected by policy\n"); mgcp_endp_release(endp); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_FAIL_REJECTED_BY_POLICY]); return create_err_response(endp, 400, "CRCX", p->trans); @@ -1021,9 +1007,8 @@ } } - LOGP(DLMGCP, LOGL_DEBUG, - "CRCX: endpoint:0x%x Creating connection: CI: %s port: %u\n", - ENDPOINT_NUMBER(endp), conn->conn->id, conn->end.local_port); + LOGPCONN(conn->conn, DLMGCP, LOGL_DEBUG, + "CRCX: Creating connection: port: %u\n", conn->end.local_port); if (p->cfg->change_cb) p->cfg->change_cb(tcfg, ENDPOINT_NUMBER(endp), MGCP_ENDP_CRCX); @@ -1033,16 +1018,14 @@ && tcfg->keepalive_interval != MGCP_KEEPALIVE_NEVER) send_dummy(endp, conn); - LOGP(DLMGCP, LOGL_NOTICE, - "CRCX: endpoint:0x%x connection successfully created\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(_conn, DLMGCP, LOGL_NOTICE, + "CRCX: connection successfully created\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_CRCX_SUCCESS]); return create_response_with_sdp(endp, conn, "CRCX", p->trans, true); error2: mgcp_endp_release(endp); - LOGP(DLMGCP, LOGL_NOTICE, - "CRCX: endpoint:0x%x unable to create connection\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "CRCX: unable to create connection\n"); return create_err_response(endp, error_code, "CRCX", p->trans); } @@ -1066,21 +1049,19 @@ const char *conn_id = NULL; int rc; - LOGP(DLMGCP, LOGL_NOTICE, "MDCX: modifying existing connection ...\n"); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, "MDCX: modifying existing connection ...\n"); /* Prohibit wildcarded requests */ if (endp->wildcarded_req) { - LOGP(DLMGCP, LOGL_ERROR, - "MDCX: endpoint:0x%x wildcarded endpoint names not supported.\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "MDCX: wildcarded endpoint names not supported.\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_WILDCARD]); return create_err_response(endp, 507, "MDCX", p->trans); } if (llist_count(&endp->conns) <= 0) { - LOGP(DLMGCP, LOGL_ERROR, - "MDCX: endpoint:0x%x endpoint is not holding a connection.\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "MDCX: endpoint is not holding a connection.\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_NO_CONN]); return create_err_response(endp, 400, "MDCX", p->trans); } @@ -1118,9 +1099,9 @@ goto mgcp_header_done; break; default: - LOGP(DLMGCP, LOGL_NOTICE, - "MDCX: endpoint:0x%x Unhandled MGCP option: '%c'/%d\n", - ENDPOINT_NUMBER(endp), line[0], line[0]); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "MDCX: Unhandled MGCP option: '%c'/%d\n", + line[0], line[0]); rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_UNHANDLED_PARAM]); return create_err_response(NULL, 539, "MDCX", p->trans); break; @@ -1129,9 +1110,8 @@ mgcp_header_done: if (!conn_id) { - LOGP(DLMGCP, LOGL_ERROR, - "MDCX: endpoint:0x%x insufficient parameters, missing ci (connectionIdentifier)\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "MDCX: insufficient parameters, missing ci (connectionIdentifier)\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_NO_CONNID]); return create_err_response(endp, 515, "MDCX", p->trans); } @@ -1158,9 +1138,8 @@ rc = set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, local_options); if (rc != 0) { - LOGP(DLMGCP, LOGL_ERROR, - "MDCX: endpoint:%x invalid local connection options!\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, + "MDCX: invalid local connection options!\n"); error_code = rc; rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_INVALID_CONN_OPTIONS]); goto error3; @@ -1179,9 +1158,8 @@ if (conn->conn->mode != MGCP_CONN_LOOPBACK && conn->conn->mode != MGCP_CONN_RECV_ONLY && conn->end.rtp_port == 0) { - LOGP(DLMGCP, LOGL_ERROR, - "MDCX: endpoint:%x selected connection mode type requires an opposite end!\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, + "MDCX: selected connection mode type requires an opposite end!\n"); error_code = 527; rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_NO_REMOTE_CONN_DESC]); goto error3; @@ -1201,9 +1179,8 @@ MGCP_ENDP_MDCX, p->trans); switch (rc) { case MGCP_POLICY_REJECT: - LOGP(DLMGCP, LOGL_NOTICE, - "MDCX: endpoint:0x%x rejected by policy\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DLMGCP, LOGL_NOTICE, + "MDCX: rejected by policy\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_REJECTED_BY_POLICY]); if (silent) goto out_silent; @@ -1211,9 +1188,8 @@ break; case MGCP_POLICY_DEFER: /* stop processing */ - LOGP(DLMGCP, LOGL_DEBUG, - "MDCX: endpoint:0x%x deferred by policy\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DLMGCP, LOGL_DEBUG, + "MDCX: deferred by policy\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_DEFERRED_BY_POLICY]); return NULL; break; @@ -1226,9 +1202,8 @@ mgcp_rtp_end_config(endp, 1, &conn->end); /* modify */ - LOGP(DLMGCP, LOGL_DEBUG, - "MDCX: endpoint:0x%x modified conn:%s\n", - ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); + LOGPCONN(conn->conn, DLMGCP, LOGL_DEBUG, + "MDCX: modified conn:%s\n", mgcp_conn_dump(conn->conn)); if (p->cfg->change_cb) p->cfg->change_cb(endp->tcfg, ENDPOINT_NUMBER(endp), MGCP_ENDP_MDCX); @@ -1243,16 +1218,14 @@ if (silent) goto out_silent; - LOGP(DLMGCP, LOGL_NOTICE, - "MDCX: endpoint:0x%x connection successfully modified\n", - ENDPOINT_NUMBER(endp)); + LOGPCONN(conn->conn, DLMGCP, LOGL_NOTICE, + "MDCX: connection successfully modified\n"); return create_response_with_sdp(endp, conn, "MDCX", p->trans, false); error3: return create_err_response(endp, error_code, "MDCX", p->trans); out_silent: - LOGP(DLMGCP, LOGL_DEBUG, "MDCX: endpoint:0x%x silent exit\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "MDCX: silent exit\n"); return NULL; } @@ -1269,23 +1242,20 @@ const char *conn_id = NULL; struct mgcp_conn_rtp *conn = NULL; - LOGP(DLMGCP, LOGL_NOTICE, - "DLCX: endpoint:0x%x deleting connection ...\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "DLCX: deleting connection ...\n"); /* Prohibit wildcarded requests */ if (endp->wildcarded_req) { - LOGP(DLMGCP, LOGL_ERROR, - "DLCX: endpoint:0x%x wildcarded endpoint names not supported.\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "DLCX: wildcarded endpoint names not supported.\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_DLCX_FAIL_WILDCARD]); return create_err_response(endp, 507, "DLCX", p->trans); } if (llist_count(&endp->conns) <= 0) { - LOGP(DLMGCP, LOGL_ERROR, - "DLCX: endpoint:0x%x endpoint is not holding a connection.\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_ERROR, + "DLCX: endpoint is not holding a connection.\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_DLCX_FAIL_NO_CONN]); return create_err_response(endp, 515, "DLCX", p->trans); } @@ -1313,9 +1283,9 @@ silent = strcmp("noanswer", line + 3) == 0; break; default: - LOGP(DLMGCP, LOGL_NOTICE, - "DLCX: endpoint:0x%x Unhandled MGCP option: '%c'/%d\n", - ENDPOINT_NUMBER(endp), line[0], line[0]); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "DLCX: Unhandled MGCP option: '%c'/%d\n", + line[0], line[0]); rate_ctr_inc(&rate_ctrs->ctr[MGCP_DLCX_FAIL_UNHANDLED_PARAM]); return create_err_response(NULL, 539, "DLCX", p->trans); break; @@ -1329,9 +1299,7 @@ MGCP_ENDP_DLCX, p->trans); switch (rc) { case MGCP_POLICY_REJECT: - LOGP(DLMGCP, LOGL_NOTICE, - "DLCX: endpoint:0x%x rejected by policy\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, "DLCX: rejected by policy\n"); rate_ctr_inc(&rate_ctrs->ctr[MGCP_DLCX_FAIL_REJECTED_BY_POLICY]); if (silent) goto out_silent; @@ -1353,9 +1321,9 @@ * RFC3435 Section F.7) */ if (!conn_id) { int num_conns = llist_count(&endp->conns); - LOGP(DLMGCP, LOGL_NOTICE, - "DLCX: endpoint:0x%x missing ci (connectionIdentifier), will remove all connections (%d total) at once\n", - num_conns, ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "DLCX: missing ci (connectionIdentifier), will remove all connections (%d total) at once\n", + num_conns); if (num_conns > 0) rate_ctr_add(&rate_ctrs->ctr[MGCP_DLCX_SUCCESS], num_conns); @@ -1378,20 +1346,17 @@ mgcp_format_stats(stats, sizeof(stats), conn->conn); /* delete connection */ - LOGP(DLMGCP, LOGL_DEBUG, "DLCX: endpoint:0x%x deleting conn:%s\n", - ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn)); + LOGPCONN(conn->conn, DLMGCP, LOGL_DEBUG, "DLCX: deleting conn:%s\n", + mgcp_conn_dump(conn->conn)); mgcp_conn_free(endp, conn_id); - LOGP(DLMGCP, LOGL_NOTICE, - "DLCX: endpoint:0x%x connection successfully deleted\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_NOTICE, + "DLCX: connection successfully deleted\n"); /* When all connections are closed, the endpoint will be released * in order to be ready to be used by another call. */ if (llist_count(&endp->conns) <= 0) { mgcp_endp_release(endp); - LOGP(DLMGCP, LOGL_DEBUG, - "DLCX: endpoint:0x%x endpoint released\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "DLCX: endpoint released\n"); } if (p->cfg->change_cb) @@ -1407,8 +1372,7 @@ return create_err_response(endp, error_code, "DLCX", p->trans); out_silent: - LOGP(DLMGCP, LOGL_DEBUG, "DLCX: endpoint:0x%x silent exit\n", - ENDPOINT_NUMBER(endp)); + LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "DLCX: silent exit\n"); return NULL; } diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c index 02b9695..6b41f50 100644 --- a/src/libosmo-mgcp/mgcp_sdp.c +++ b/src/libosmo-mgcp/mgcp_sdp.c @@ -376,7 +376,7 @@ talloc_free(tmp_ctx); - LOGP(DLMGCP, LOGL_NOTICE, + LOGPCONN(conn->conn, DLMGCP, LOGL_NOTICE, "Got media info via SDP: port:%d, addr:%s, duration:%d, payload-types:", ntohs(rtp->rtp_port), inet_ntoa(rtp->addr), rtp->packet_duration_ms); @@ -571,6 +571,6 @@ return 0; buffer_too_small: - LOGP(DLMGCP, LOGL_ERROR, "SDP messagebuffer too small\n"); + LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, "SDP messagebuffer too small\n"); return -1; } -- To view, visit https://gerrit.osmocom.org/13773 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1c49b1eb16bc5f1010376da5cf407ca6e31d81f2 Gerrit-Change-Number: 13773 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 21:38:31 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Apr 2019 21:38:31 +0000 Subject: Change in osmo-mgw[master]: create_response_with_sdp: Fix inclusion of X-Osmux In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13775 ) Change subject: create_response_with_sdp: Fix inclusion of X-Osmux ...................................................................... create_response_with_sdp: Fix inclusion of X-Osmux In previous code, 2 blocks were handling osmux inclusion one after the other under same osmux.state. However, first block changes osmux.state so second block can never be true and X-Osmux is never added. Change-Id: Iceee8b64978651f1fe6bb883923561b081f73d9b --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 2 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index be161ad..bfb88bc 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -304,7 +304,6 @@ struct msgb *sdp; int rc; struct msgb *result; - char osmux_extension[strlen("X-Osmux: 255") + 1]; char local_ip_addr[INET_ADDRSTRLEN]; sdp = msgb_alloc_headroom(4096, 128, "sdp record"); @@ -316,13 +315,6 @@ addr = local_ip_addr; } - if (conn->osmux.state == OSMUX_STATE_NEGOTIATING) { - sprintf(osmux_extension, "X-Osmux: %u", conn->osmux.cid); - conn->osmux.state = OSMUX_STATE_ACTIVATING; - } else { - osmux_extension[0] = '\0'; - } - /* Attach optional connection parameters */ if (add_conn_params) { rc = add_params(sdp, endp, conn); @@ -332,9 +324,10 @@ /* Attach optional OSMUX parameters */ if (conn->osmux.state == OSMUX_STATE_NEGOTIATING) { - rc = msgb_printf(sdp, "%s\r\n", osmux_extension); + rc = msgb_printf(sdp, "X-Osmux: %u\r\n", conn->osmux.cid); if (rc < 0) goto error; + conn->osmux.state = OSMUX_STATE_ACTIVATING; } /* Attach line break to separate the parameters from the SDP block */ -- To view, visit https://gerrit.osmocom.org/13775 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iceee8b64978651f1fe6bb883923561b081f73d9b Gerrit-Change-Number: 13775 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Apr 25 21:38:38 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Apr 2019 21:38:38 +0000 Subject: Change in osmo-mgw[master]: osmux: Cleanup of CID alloc pool APIs In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13774 ) Change subject: osmux: Cleanup of CID alloc pool APIs ...................................................................... osmux: Cleanup of CID alloc pool APIs * Cleanup naming to make it far more clear * Drop 2 variables holding CID values (allocated_cid, cid), in favour of 1 value holdinf the value and one bool stating whether the value is used. * Change conn_osmux_allocate_cid to allow allocating either next available CID or a specific one, in preparation for forthcoming patches. This commit can be merged straight away because anyway osmux cannot be enabled in current status (blocked by vty config) and (conn_)osmux_allocate_cid was/is not called anywhere. However, it helps improving code base for future re-introduction of Osmux as it is envisioned. Change-Id: I737a248ac6c74add8e917fe2e2f36779d0f1d685 --- M include/osmocom/mgcp/mgcp_internal.h M include/osmocom/mgcp/osmux.h M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c 6 files changed, 80 insertions(+), 39 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 3defc4c..24e28b4 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -188,9 +188,9 @@ struct { /* Osmux state: disabled, activating, active */ enum osmux_state state; - /* Allocated Osmux circuit ID for this endpoint */ - int allocated_cid; - /* Used Osmux circuit ID for this endpoint */ + /* Is cid holding valid data? is it allocated from pool? */ + bool cid_allocated; + /* Allocated Osmux circuit ID for this conn */ uint8_t cid; /* handle to batch messages */ struct osmux_in_handle *in; diff --git a/include/osmocom/mgcp/osmux.h b/include/osmocom/mgcp/osmux.h index 685be9c..c080c85 100644 --- a/include/osmocom/mgcp/osmux.h +++ b/include/osmocom/mgcp/osmux.h @@ -15,13 +15,16 @@ int osmux_enable_conn(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, struct in_addr *addr, uint16_t port); void osmux_disable_conn(struct mgcp_conn_rtp *conn); -void osmux_allocate_cid(struct mgcp_conn_rtp *conn); -void osmux_release_cid(struct mgcp_conn_rtp *conn); +int conn_osmux_allocate_cid(struct mgcp_conn_rtp *conn, int osmux_cid); +void conn_osmux_release_cid(struct mgcp_conn_rtp *conn); int osmux_xfrm_to_osmux(char *buf, int buf_len, struct mgcp_conn_rtp *conn); int osmux_send_dummy(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn); -int osmux_get_cid(void); -void osmux_put_cid(uint8_t osmux_cid); -int osmux_used_cid(void); + +void osmux_cid_pool_get(uint8_t osmux_cid); +int osmux_cid_pool_get_next(void); +void osmux_cid_pool_put(uint8_t osmux_cid); +bool osmux_cid_pool_allocated(uint8_t osmux_cid); +int osmux_cid_pool_count_used(void); enum osmux_state { OSMUX_STATE_DISABLED = 0, /* Osmux not being currently used by endp */ diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index bfaa111..af5426f 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -90,7 +90,8 @@ static unsigned int rate_ctr_index = 0; conn_rtp->type = MGCP_RTP_DEFAULT; - conn_rtp->osmux.allocated_cid = -1; + conn_rtp->osmux.cid_allocated = false; + conn_rtp->osmux.cid = 0; /* backpointer to the generic part of the connection */ conn->u.rtp.conn = conn; @@ -120,7 +121,6 @@ static void mgcp_rtp_conn_cleanup(struct mgcp_conn_rtp *conn_rtp) { osmux_disable_conn(conn_rtp); - osmux_release_cid(conn_rtp); mgcp_free_rtp_port(&conn_rtp->end); rate_ctr_group_free(conn_rtp->rate_ctr_group); } diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c index a2c138d..3bd765e 100644 --- a/src/libosmo-mgcp/mgcp_osmux.c +++ b/src/libosmo-mgcp/mgcp_osmux.c @@ -614,31 +614,46 @@ osmux_xfrm_input_close_circuit(conn->osmux.in, conn->osmux.cid); conn->osmux.state = OSMUX_STATE_DISABLED; - conn->osmux.cid = -1; + conn_osmux_release_cid(conn); osmux_handle_put(conn->osmux.in); } /*! relase OSXMUX cid, that had been allocated to this connection. * \param[in] conn connection with OSMUX cid to release */ -void osmux_release_cid(struct mgcp_conn_rtp *conn) +void conn_osmux_release_cid(struct mgcp_conn_rtp *conn) { - if (!conn) - return; - - if (conn->osmux.state != OSMUX_STATE_ENABLED) - return; - - if (conn->osmux.allocated_cid >= 0) - osmux_put_cid(conn->osmux.allocated_cid); - conn->osmux.allocated_cid = -1; + if (conn->osmux.cid_allocated) + osmux_cid_pool_put(conn->osmux.cid); + conn->osmux.cid = 0; + conn->osmux.cid_allocated = false; } /*! allocate OSXMUX cid to connection. - * \param[in] conn connection for which we allocate the OSMUX cid*/ -void osmux_allocate_cid(struct mgcp_conn_rtp *conn) + * \param[in] conn connection for which we allocate the OSMUX cid + * \param[in] osmux_cid OSMUX cid to allocate. -1 Means take next available one. + * \returns Allocated OSMUX cid, -1 on error (no free cids avail, or selected one is already taken). + */ +int conn_osmux_allocate_cid(struct mgcp_conn_rtp *conn, int osmux_cid) { - osmux_release_cid(conn); - conn->osmux.allocated_cid = osmux_get_cid(); + if (osmux_cid != -1 && osmux_cid_pool_allocated((uint8_t) osmux_cid)) { + LOGP(DLMGCP, LOGL_INFO, "Conn %s: Osmux CID %d already allocated!\n", + conn->conn->id, osmux_cid); + return -1; + } + + if (osmux_cid == -1) { + osmux_cid = osmux_cid_pool_get_next(); + if (osmux_cid == -1) { + LOGP(DLMGCP, LOGL_INFO, "Conn %s: no available Osmux CID to allocate!\n", + conn->conn->id); + return -1; + } + } else + osmux_cid_pool_get(osmux_cid); + + conn->osmux.cid = (uint8_t) osmux_cid; + conn->osmux.cid_allocated = true; + return osmux_cid; } /*! send RTP dummy packet to OSMUX connection port. @@ -682,7 +697,7 @@ /*! count the number of taken OSMUX cids. * \returns number of OSMUX cids in use */ -int osmux_used_cid(void) +int osmux_cid_pool_count_used(void) { int i, j, used = 0; @@ -698,7 +713,7 @@ /*! take a free OSMUX cid. * \returns OSMUX cid */ -int osmux_get_cid(void) +int osmux_cid_pool_get_next(void) { int i, j; @@ -718,10 +733,24 @@ return -1; } +/*! take a specific OSMUX cid. + * \param[in] osmux_cid OSMUX cid */ +void osmux_cid_pool_get(uint8_t osmux_cid) +{ + LOGP(DLMGCP, LOGL_DEBUG, "Allocating Osmux CID %u from pool\n", osmux_cid); + osmux_cid_bitmap[osmux_cid / 8] |= (1 << (osmux_cid % 8)); +} + /*! put back a no longer used OSMUX cid. * \param[in] osmux_cid OSMUX cid */ -void osmux_put_cid(uint8_t osmux_cid) +void osmux_cid_pool_put(uint8_t osmux_cid) { LOGP(DLMGCP, LOGL_DEBUG, "Osmux CID %u is back to the pool\n", osmux_cid); osmux_cid_bitmap[osmux_cid / 8] &= ~(1 << (osmux_cid % 8)); } + +/*! check if OSMUX cid is already taken */ +bool osmux_cid_pool_allocated(uint8_t osmux_cid) +{ + return !!(osmux_cid_bitmap[osmux_cid / 8] & (1 << (osmux_cid % 8))); +} diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index a47376b..25d7a67 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -297,7 +297,7 @@ dump_trunk(vty, trunk, show_stats); if (g_cfg->osmux) - vty_out(vty, "Osmux used CID: %d%s", osmux_used_cid(), + vty_out(vty, "Osmux used CID: %d%s", osmux_cid_pool_count_used(), VTY_NEWLINE); return CMD_SUCCESS; diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index be45598..c4931b2 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -1554,25 +1554,34 @@ { int id, i; - OSMO_ASSERT(osmux_used_cid() == 0); - id = osmux_get_cid(); + OSMO_ASSERT(osmux_cid_pool_count_used() == 0); + + id = osmux_cid_pool_get_next(); OSMO_ASSERT(id == 0); - OSMO_ASSERT(osmux_used_cid() == 1); - osmux_put_cid(id); - OSMO_ASSERT(osmux_used_cid() == 0); + OSMO_ASSERT(osmux_cid_pool_count_used() == 1); + + osmux_cid_pool_get(30); + OSMO_ASSERT(osmux_cid_pool_count_used() == 2); + osmux_cid_pool_get(30); + OSMO_ASSERT(osmux_cid_pool_count_used() == 2); + + osmux_cid_pool_put(id); + OSMO_ASSERT(osmux_cid_pool_count_used() == 1); + osmux_cid_pool_put(30); + OSMO_ASSERT(osmux_cid_pool_count_used() == 0); for (i = 0; i < 256; ++i) { - id = osmux_get_cid(); + id = osmux_cid_pool_get_next(); OSMO_ASSERT(id == i); - OSMO_ASSERT(osmux_used_cid() == i + 1); + OSMO_ASSERT(osmux_cid_pool_count_used() == i + 1); } - id = osmux_get_cid(); + id = osmux_cid_pool_get_next(); OSMO_ASSERT(id == -1); for (i = 0; i < 256; ++i) - osmux_put_cid(i); - OSMO_ASSERT(osmux_used_cid() == 0); + osmux_cid_pool_put(i); + OSMO_ASSERT(osmux_cid_pool_count_used() == 0); } static const struct log_info_cat log_categories[] = { -- To view, visit https://gerrit.osmocom.org/13774 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I737a248ac6c74add8e917fe2e2f36779d0f1d685 Gerrit-Change-Number: 13774 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 08:52:06 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Fri, 26 Apr 2019 08:52:06 +0000 Subject: Change in docker-playground[master]: Add OSMO_*_BRANCH environment variables for build args In-Reply-To: References: Message-ID: Daniel Willmann has submitted this change and it was merged. ( https://gerrit.osmocom.org/13779 ) Change subject: Add OSMO_*_BRANCH environment variables for build args ...................................................................... Add OSMO_*_BRANCH environment variables for build args Previously we could only set OSMO_TTCN3_BRANCH as environment variable to build a test other than master. This patch adds environment variables for all osmo-*-master images which allow docker tests to be executed for an arbitrary commit. The origin/ prefix from the git checkout command is removed so the *_BRANCH variable doesn't have to contain branch names, but van also contain arbitrary commits. This shouldn't have any adverse effect as we only have one remote in the checkout. Change-Id: If3bc5fae07cf63c4fef68306be4c4328660bc869 --- M make/Makefile M osmo-bsc-master/Dockerfile M osmo-bts-master/Dockerfile M osmo-ggsn-master/Dockerfile M osmo-hlr-master/Dockerfile M osmo-hnbgw-master/Dockerfile M osmo-mgw-master/Dockerfile M osmo-msc-master/Dockerfile M osmo-nitb-master/Dockerfile M osmo-pcu-master/Dockerfile M osmo-sgsn-master/Dockerfile M osmo-sip-master/Dockerfile M osmo-stp-master/Dockerfile 13 files changed, 40 insertions(+), 13 deletions(-) Approvals: Daniel Willmann: Verified Harald Welte: Looks good to me, approved diff --git a/make/Makefile b/make/Makefile index 7dfa795..000db25 100644 --- a/make/Makefile +++ b/make/Makefile @@ -17,6 +17,18 @@ USERNAME?=$(USER) NAME?=$(shell basename $(CURDIR)) OSMO_TTCN3_BRANCH?=master +OSMO_BSC_BRANCH?=master +OSMO_BTS_BRANCH?=master +OSMO_GGSN_BRANCH?=master +OSMO_HLR_BRANCH?=master +OSMO_IUH_BRANCH?=master +OSMO_MGW_BRANCH?=master +OSMO_MSC_BRANCH?=master +OSMO_NITB_BRANCH?=master +OSMO_PCU_BRANCH?=master +OSMO_SGSN_BRANCH?=master +OSMO_SIP_BRANCH?=master +OSMO_STP_BRANCH?=master PULL?= RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support @@ -42,6 +54,18 @@ docker-build: .release docker build --build-arg USER=$(USERNAME) --build-arg OSMO_TTCN3_BRANCH=$(OSMO_TTCN3_BRANCH) \ + --build-arg OSMO_BSC_BRANCH=$(OSMO_BSC_BRANCH) \ + --build-arg OSMO_BTS_BRANCH=$(OSMO_BTS_BRANCH) \ + --build-arg OSMO_GGSN_BRANCH=$(OSMO_GGSN_BRANCH) \ + --build-arg OSMO_HLR_BRANCH=$(OSMO_HLR_BRANCH) \ + --build-arg OSMO_IUH_BRANCH=$(OSMO_IUH_BRANCH) \ + --build-arg OSMO_MGW_BRANCH=$(OSMO_MGW_BRANCH) \ + --build-arg OSMO_MSC_BRANCH=$(OSMO_MSC_BRANCH) \ + --build-arg OSMO_NITB_BRANCH=$(OSMO_NITB_BRANCH) \ + --build-arg OSMO_PCU_BRANCH=$(OSMO_PCU_BRANCH) \ + --build-arg OSMO_SGSN_BRANCH=$(OSMO_SGSN_BRANCH) \ + --build-arg OSMO_SIP_BRANCH=$(OSMO_SIP_BRANCH) \ + --build-arg OSMO_STP_BRANCH=$(OSMO_STP_BRANCH) \ $(PULL) -t $(IMAGE):latest . @DOCKER_MAJOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f1) ; \ DOCKER_MINOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f2) ; \ diff --git a/osmo-bsc-master/Dockerfile b/osmo-bsc-master/Dockerfile index 61ac8e4..bcd0573 100644 --- a/osmo-bsc-master/Dockerfile +++ b/osmo-bsc-master/Dockerfile @@ -32,7 +32,7 @@ ADD http://git.osmocom.org/osmo-bsc/patch?h=$OSMO_BSC_BRANCH /tmp/commit-osmo-bsc RUN cd osmo-bsc && \ - git fetch && git checkout -f -B $OSMO_BSC_BRANCH origin/$OSMO_BSC_BRANCH && \ + git fetch && git checkout -f -B $OSMO_BSC_BRANCH $OSMO_BSC_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-bts-master/Dockerfile b/osmo-bts-master/Dockerfile index be58081..f4ddf3a 100644 --- a/osmo-bts-master/Dockerfile +++ b/osmo-bts-master/Dockerfile @@ -33,7 +33,7 @@ ADD http://git.osmocom.org/osmo-bts/patch?h=$OSMO_BTS_BRANCH /tmp/commit-osmo-bts RUN cd osmo-bts && \ - git fetch && git checkout -f -B $OSMO_BTS_BRANCH origin/$OSMO_BTS_BRANCH && \ + git fetch && git checkout -f -B $OSMO_BTS_BRANCH $OSMO_BTS_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-trx && \ diff --git a/osmo-ggsn-master/Dockerfile b/osmo-ggsn-master/Dockerfile index ca4f111..cf84d02 100644 --- a/osmo-ggsn-master/Dockerfile +++ b/osmo-ggsn-master/Dockerfile @@ -25,7 +25,7 @@ RUN git clone git://git.osmocom.org/osmo-ggsn.git ADD http://git.osmocom.org/osmo-ggsn/patch/?h=$OSMO_GGSN_BRANCH /tmp/commit RUN cd osmo-ggsn && \ - git fetch && git checkout -f -B $OSMO_GGSN_BRANCH origin/$OSMO_GGSN_BRANCH && \ + git fetch && git checkout -f -B $OSMO_GGSN_BRANCH $OSMO_GGSN_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-hlr-master/Dockerfile b/osmo-hlr-master/Dockerfile index 75f29d9..2da7c08 100644 --- a/osmo-hlr-master/Dockerfile +++ b/osmo-hlr-master/Dockerfile @@ -30,7 +30,7 @@ ADD http://git.osmocom.org/osmo-hlr/patch?h=$OSMO_HLR_BRANCH /tmp/commit-osmo-hlr RUN cd osmo-hlr && \ - git fetch && git checkout -f -B $OSMO_HLR_BRANCH origin/$OSMO_HLR_BRANCH && \ + git fetch && git checkout -f -B $OSMO_HLR_BRANCH $OSMO_HLR_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-hnbgw-master/Dockerfile b/osmo-hnbgw-master/Dockerfile index 4334e4f..c89502b 100644 --- a/osmo-hnbgw-master/Dockerfile +++ b/osmo-hnbgw-master/Dockerfile @@ -30,7 +30,7 @@ ADD http://git.osmocom.org/osmo-iuh/patch?h=$OSMO_IUH_BRANCH /tmp/commit-osmo-mgw RUN cd osmo-iuh && \ - git fetch && git checkout -f -B $OSMO_IUH_BRANCH origin/$OSMO_IUH_BRANCH && \ + git fetch && git checkout -f -B $OSMO_IUH_BRANCH $OSMO_IUH_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-mgw-master/Dockerfile b/osmo-mgw-master/Dockerfile index c333b1d..4c6d32a 100644 --- a/osmo-mgw-master/Dockerfile +++ b/osmo-mgw-master/Dockerfile @@ -30,7 +30,7 @@ RUN cd osmo-mgw && \ - git fetch && git checkout -f -B $OSMO_MGW_BRANCH origin/$OSMO_MGW_BRANCH && \ + git fetch && git checkout -f -B $OSMO_MGW_BRANCH $OSMO_MGW_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-msc-master/Dockerfile b/osmo-msc-master/Dockerfile index 49be9c8..c8cfd62 100644 --- a/osmo-msc-master/Dockerfile +++ b/osmo-msc-master/Dockerfile @@ -37,7 +37,7 @@ ADD http://git.osmocom.org/osmo-msc/patch?h=$OSMO_MSC_BRANCH /tmp/commit-osmo-msc RUN cd osmo-msc && \ - git fetch && git checkout -f -B $OSMO_MSC_BRANCH origin/$OSMO_MSC_BRANCH && \ + git fetch && git checkout -f -B $OSMO_MSC_BRANCH $OSMO_MSC_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-smpp --enable-iu && \ diff --git a/osmo-nitb-master/Dockerfile b/osmo-nitb-master/Dockerfile index bed228e..d3774da 100644 --- a/osmo-nitb-master/Dockerfile +++ b/osmo-nitb-master/Dockerfile @@ -25,11 +25,14 @@ WORKDIR /tmp +ARG OSMO_NITB_BRANCH="master" + RUN git clone git://git.osmocom.org/openbsc.git -ADD http://git.osmocom.org/openbsc/patch /tmp/commit-openbsc +ADD http://git.osmocom.org/openbsc/patch?h=$OSMO_NITB_BRANCH /tmp/commit-openbsc RUN cd openbsc/openbsc && \ - git fetch && git checkout -f -B master origin/master && \ + git fetch && git checkout -f -B $OSMO_NITB_BRANCH $OSMO_NITB_BRANCH && \ + git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-nat --enable-osmo-bsc --enable-smpp && \ make -j8 install && \ diff --git a/osmo-pcu-master/Dockerfile b/osmo-pcu-master/Dockerfile index e33748a..7a294a4 100644 --- a/osmo-pcu-master/Dockerfile +++ b/osmo-pcu-master/Dockerfile @@ -28,7 +28,7 @@ ADD http://git.osmocom.org/osmo-pcu/patch?h=$OSMO_PCU_BRANCH /tmp/commit-osmo-pcu RUN cd osmo-pcu && \ - git fetch && git checkout -f -B $OSMO_PCU_BRANCH origin/$OSMO_PCU_BRANCH && \ + git fetch && git checkout -f -B $OSMO_PCU_BRANCH $OSMO_PCU_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-trx && \ diff --git a/osmo-sgsn-master/Dockerfile b/osmo-sgsn-master/Dockerfile index 87513cc..c373564 100644 --- a/osmo-sgsn-master/Dockerfile +++ b/osmo-sgsn-master/Dockerfile @@ -32,7 +32,7 @@ ADD http://git.osmocom.org/osmo-sgsn/patch?h=$OSMO_SGSN_BRANCH /tmp/commit RUN cd osmo-sgsn && \ - git fetch && git checkout -f -B $OSMO_SGSN_BRANCH origin/$OSMO_SGSN_BRANCH && \ + git fetch && git checkout -f -B $OSMO_SGSN_BRANCH $OSMO_SGSN_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ diff --git a/osmo-sip-master/Dockerfile b/osmo-sip-master/Dockerfile index 5854221..258b1fe 100644 --- a/osmo-sip-master/Dockerfile +++ b/osmo-sip-master/Dockerfile @@ -36,7 +36,7 @@ ADD http://git.osmocom.org/osmo-sip-connector/patch?h=$OSMO_SIP_BRANCH /tmp/commit-osmo-sip-connector RUN cd osmo-sip-connector && \ - git fetch && git checkout -f -B $OSMO_SIP_BRANCH origin/$OSMO_SIP_BRANCH && \ + git fetch && git checkout -f -B $OSMO_SIP_BRANCH $OSMO_SIP_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure --enable-smpp --enable-iu && \ diff --git a/osmo-stp-master/Dockerfile b/osmo-stp-master/Dockerfile index 7c59fb0..0a62ed7 100644 --- a/osmo-stp-master/Dockerfile +++ b/osmo-stp-master/Dockerfile @@ -26,7 +26,7 @@ RUN git clone git://git.osmocom.org/libosmo-sccp.git ADD http://git.osmocom.org/libosmo-sccp/patch?h=$OSMO_STP_BRANCH /tmp/commit RUN cd libosmo-sccp && \ - git fetch && git checkout -f -B $OSMO_STP_BRANCH origin/$OSMO_STP_BRANCH && \ + git fetch && git checkout -f -B $OSMO_STP_BRANCH $OSMO_STP_BRANCH && \ git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \ autoreconf -fi && \ ./configure && \ -- To view, visit https://gerrit.osmocom.org/13779 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If3bc5fae07cf63c4fef68306be4c4328660bc869 Gerrit-Change-Number: 13779 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 10:08:00 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Fri, 26 Apr 2019 10:08:00 +0000 Subject: Change in docker-playground[master]: Add script to bisect test failures with ttcn3 and docker Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13790 Change subject: Add script to bisect test failures with ttcn3 and docker ...................................................................... Add script to bisect test failures with ttcn3 and docker With this script you can now use docker ttcn3 test results to bisect a regression and find the offending commit. Use like this from the osmo-* git repository: $ git bisect start $ git bisect run ~/scm/osmo/docker-playground/osmo-bisect.sh e.g.: $ git bisect run ~/scm/osmo/docker-playground/osmo-bisect.sh bsc BSC_Tests.TC_ho_in_fail_no_detect Change-Id: I11f7e61a9b30d58a0fdfcaf77dde447806bf661f --- A osmo-bisect.sh 1 file changed, 53 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/90/13790/1 diff --git a/osmo-bisect.sh b/osmo-bisect.sh new file mode 100755 index 0000000..5ca69cd --- /dev/null +++ b/osmo-bisect.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +# Script to bisect an osmo-* project with the docker ttcn3 images +# You need the git checkout of the project you wand to test as well as a +# checkout of the docker-playground repository. + +# Use like this from the osmo-* project repository where the regression +# occurs: +# $ git bisect start +# $ git bisect run ~/scm/osmo/docker-playground/osmo-bisect.sh +# e.g.: +# $ git bisect run ~/scm/osmo/docker-playground/osmo-bisect.sh bsc BSC_Tests.TC_ho_in_fail_no_detect + + +DOCKER_PLAYGROUND=$(dirname "$0") +COMP_UPPER=$(echo "$1" | tr '[:lower:]' '[:upper:]') +COMP_LOWER=$(echo "$1" | tr '[:upper:]' '[:lower:]') +TESTCASE=$2 + +COMMIT=$(git log -1 --format=format:%H) + +case $COMP_LOWER in + "hnbgw") + BRANCH="OSMO_IUH_BRANCH" + SUITE="ttcn3-hnbgw-test" + ;; + "bsc"|\ + "bts"|\ + "ggsn"|\ + "hlr"|\ + "mgw"|\ + "msc"|\ + "nitb"|\ + "pcu"|\ + "sgsn"|\ + "sip"|\ + "stp") + BRANCH="OSMO_${COMP_UPPER}_BRANCH" + SUITE="ttcn3-${COMP_LOWER}-test" + ;; + *) + echo "Unknown repo, please fix the script!" + exit 125 + ;; +esac + +export "$BRANCH=$COMMIT" + +cd "$DOCKER_PLAYGROUND/$SUITE" || exit 125 + +echo "Testing for $COMMIT" +./jenkins.sh | grep -- "====== $TESTCASE pass ======" +exit $? -- To view, visit https://gerrit.osmocom.org/13790 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I11f7e61a9b30d58a0fdfcaf77dde447806bf661f Gerrit-Change-Number: 13790 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 10:09:18 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Fri, 26 Apr 2019 10:09:18 +0000 Subject: Change in docker-playground[master]: Add script to bisect test failures with ttcn3 and docker In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13790 ) Change subject: Add script to bisect test failures with ttcn3 and docker ...................................................................... Patch Set 1: Verified+1 Worked in my tests. Not used in jenkins so won't break any automatic jobs. -- To view, visit https://gerrit.osmocom.org/13790 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I11f7e61a9b30d58a0fdfcaf77dde447806bf661f Gerrit-Change-Number: 13790 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: osmith Gerrit-Comment-Date: Fri, 26 Apr 2019 10:09:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 10:16:23 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Fri, 26 Apr 2019 10:16:23 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Hello lynxis lazus, Pau Espin Pedrol, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13744 to look at the new patch set (#7). Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... gprs_gmm: send Service Reject when no PDP ctxs are available. Look at PDP Context Status IE: if there are any PDP contexts which are ACTIVE on MS side and there are no PDP contexts which are ACTIVE on the network side, then send Service Reject with the cause "NO PDP ACTIVATED". This forces MS to reactivate the PDP contexts. 3GPP TS 24.008 Section 4.7.13.4 Service request procedure not accepted by the network. Cause # 40. Fixes: OS#3937 Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 --- M src/gprs/gprs_gmm.c M tests/sgsn/sgsn_test.c M tests/sgsn/sgsn_test.ok 3 files changed, 101 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/44/13744/7 -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 7 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 10:17:27 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Fri, 26 Apr 2019 10:17:27 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Mykola Shchetinin has posted comments on this change. ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/13744/6/src/gprs/gprs_gmm.c File src/gprs/gprs_gmm.c: https://gerrit.osmocom.org/#/c/13744/6/src/gprs/gprs_gmm.c at 1935 PS6, Line 1935: if (ms_has_active_pdp_and_sgsn_has_none(ctx, pdp_status, pdp_status_len)) { > At the moment you check if the MS & SGSN is out of sync. [?] Done -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 7 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Fri, 26 Apr 2019 10:17:27 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 10:25:41 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 26 Apr 2019 10:25:41 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: use 0.0 as default for mp_ipa_up_delay Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13791 Change subject: BTS_Tests: use 0.0 as default for mp_ipa_up_delay ...................................................................... BTS_Tests: use 0.0 as default for mp_ipa_up_delay The module parameter mp_ipa_up_delay ads a delay after the ipa bring up. This is relevant for the tests with real BTS hardware, but it is not relavent for the regular TTCN3 tests. Lets set the default to 0.0, since the delay caused problems with TC_rsl_ms_pwr_ctrl and TC_si_sched_13_2bis_2ter_2quater. Change-Id: I7663cad5df1ee5a8bcdbbf522881999f1be9f4fe Related: OS#3960 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/91/13791/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 35f51a1..e1c64d6 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -65,7 +65,7 @@ integer mp_timing_offset_256syms_exp := 512; /* Time to wait for RSL conn from BTS during startup of test */ float mp_ipa_up_timeout := 15.0; - float mp_ipa_up_delay := 3.0; + float mp_ipa_up_delay := 0.0; } type record of RslChannelNr ChannelNrs; -- To view, visit https://gerrit.osmocom.org/13791 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7663cad5df1ee5a8bcdbbf522881999f1be9f4fe Gerrit-Change-Number: 13791 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 10:45:55 2019 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Apr 2019 10:45:55 +0000 Subject: Change in osmo-trx[master]: cosmetic: Threads.h: Remove trailing whitespace In-Reply-To: References: Message-ID: Max has posted comments on this change. ( https://gerrit.osmocom.org/13784 ) Change subject: cosmetic: Threads.h: Remove trailing whitespace ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13784 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0ae6e435a7f0480c3eaa08dccfe824456f33b015 Gerrit-Change-Number: 13784 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 10:45:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 10:46:39 2019 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Apr 2019 10:46:39 +0000 Subject: Change in osmo-trx[master]: lms: Remove unused var m_last_tx_overruns In-Reply-To: References: Message-ID: Max has posted comments on this change. ( https://gerrit.osmocom.org/13788 ) Change subject: lms: Remove unused var m_last_tx_overruns ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13788 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2104205b2af7cd6c86075d5cc4f0f36bde5e5311 Gerrit-Change-Number: 13788 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 10:46:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 10:47:36 2019 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Apr 2019 10:47:36 +0000 Subject: Change in osmo-trx[master]: lms: Remove references to ALERT loglevel In-Reply-To: References: Message-ID: Max has posted comments on this change. ( https://gerrit.osmocom.org/13787 ) Change subject: lms: Remove references to ALERT loglevel ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13787 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0e171a8ac8a8bfa804ac97fba3d73efcfa6424b4 Gerrit-Change-Number: 13787 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 10:47:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 10:49:50 2019 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Apr 2019 10:49:50 +0000 Subject: Change in osmo-trx[master]: lms: flush_recv: alloc buf on stack instead of heap In-Reply-To: References: Message-ID: Max has posted comments on this change. ( https://gerrit.osmocom.org/13782 ) Change subject: lms: flush_recv: alloc buf on stack instead of heap ...................................................................... Patch Set 1: > Using the stack is quicker. What makes you think that? Do you have benchmark? I wouldn't be surprised if modern compiler optimize such a trivial case. -- To view, visit https://gerrit.osmocom.org/13782 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iede8dc0903ee3865a52c8e2fd811bcde444fee33 Gerrit-Change-Number: 13782 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 10:49:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 10:52:56 2019 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Apr 2019 10:52:56 +0000 Subject: Change in osmo-bts[master]: osmo-bts-trx: distinguish 11-bit Access Bursts by synch. sequence In-Reply-To: References: Message-ID: Max has posted comments on this change. ( https://gerrit.osmocom.org/13723 ) Change subject: osmo-bts-trx: distinguish 11-bit Access Bursts by synch. sequence ...................................................................... Patch Set 4: (2 comments) https://gerrit.osmocom.org/#/c/13723/4//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13723/4//COMMIT_MSG at 24 PS4, Line 24: According to 3GPP TS 05.02, section 5.2.7, there are two alternative It's better to refer to latest version of the spec. https://gerrit.osmocom.org/#/c/13723/4//COMMIT_MSG at 29 PS4, Line 29: According to 3GPP TS 04.60, section 11.2.5a, the EGPRS capability Here as well. -- To view, visit https://gerrit.osmocom.org/13723 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibb6d27c6589965c8b59a6d2598a7c43fd860f284 Gerrit-Change-Number: 13723 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 10:52:56 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 11:00:50 2019 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Apr 2019 11:00:50 +0000 Subject: Change in libosmocore[master]: make all library-internal static buffers thread-local In-Reply-To: References: Message-ID: Max has posted comments on this change. ( https://gerrit.osmocom.org/13436 ) Change subject: make all library-internal static buffers thread-local ...................................................................... Patch Set 6: (1 comment) https://gerrit.osmocom.org/#/c/13436/6//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13436/6//COMMIT_MSG at 15 PS6, Line 15: execute the same functiosn once. They're of course still not typo: functions -- To view, visit https://gerrit.osmocom.org/13436 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I50eb2436a7c1261d79a9d2955584dce92780ca07 Gerrit-Change-Number: 13436 Gerrit-PatchSet: 6 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 11:00:50 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 11:06:01 2019 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Apr 2019 11:06:01 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_04_11.c: properly handle TP-User-Data-Length In-Reply-To: References: Message-ID: Max has posted comments on this change. ( https://gerrit.osmocom.org/13655 ) Change subject: libmsc/gsm_04_11.c: properly handle TP-User-Data-Length ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/13655/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13655/1//COMMIT_MSG at 25 PS1, Line 25: Preventing this would require adding an additional check. Is there a ticket for that? If so please reference it in here otherwise create it and than reference :) https://gerrit.osmocom.org/#/c/13655/1/src/libmsc/gsm_04_11.c File src/libmsc/gsm_04_11.c: https://gerrit.osmocom.org/#/c/13655/1/src/libmsc/gsm_04_11.c at 574 PS1, Line 574: "TP-User-Data-Length %u (septets) " What's the point of splitting the strings this way? We're well within the length limit. -- To view, visit https://gerrit.osmocom.org/13655 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4b08db7665e854a045129e7695e2bdf296df1688 Gerrit-Change-Number: 13655 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 11:06:01 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 11:10:02 2019 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Apr 2019 11:10:02 +0000 Subject: Change in osmo-msc[master]: Introduce initial unit test for db_sms_* API In-Reply-To: References: Message-ID: Max has posted comments on this change. ( https://gerrit.osmocom.org/13629 ) Change subject: Introduce initial unit test for db_sms_* API ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13629/1/src/libmsc/db.c File src/libmsc/db.c: https://gerrit.osmocom.org/#/c/13629/1/src/libmsc/db.c at 773 PS1, Line 773: if (net != NULL) /* db_sms_test passes NULL, so we need to be tolerant */ This can be split-off into separate patch. -- To view, visit https://gerrit.osmocom.org/13629 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id94ad35b6f78f839137db2e17010fbf9b40111a3 Gerrit-Change-Number: 13629 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 11:10:02 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 11:21:23 2019 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Apr 2019 11:21:23 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: fix storing SMS with empty TP-User-Data In-Reply-To: References: Message-ID: Max has posted comments on this change. ( https://gerrit.osmocom.org/13630 ) Change subject: libmsc/db.c: fix storing SMS with empty TP-User-Data ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13630/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/13630/1//COMMIT_MSG at 7 PS1, Line 7: libmsc/db.c: fix storing SMS with empty TP-User-Data Is this even legitimate case? Are there such SMS messages or we should error out instead of adding the safeguard? -- To view, visit https://gerrit.osmocom.org/13630 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If0b2bb557118c5f0e520a2e6c2816336f6028661 Gerrit-Change-Number: 13630 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 11:21:23 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 11:23:54 2019 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Apr 2019 11:23:54 +0000 Subject: Change in osmo-ggsn[master]: ggsn: Add minimalistic PAP support In-Reply-To: References: Message-ID: Max has posted comments on this change. ( https://gerrit.osmocom.org/13608 ) Change subject: ggsn: Add minimalistic PAP support ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/13608/4/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/13608/4/ggsn/ggsn.c at 511 PS4, Line 511: static const char *pap_welcome = "Welcome to OsmoGGSN"; Maybe add version to make it even more informative? -- To view, visit https://gerrit.osmocom.org/13608 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I81875f30f9f1497199253497f84718510747f731 Gerrit-Change-Number: 13608 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 11:23:54 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 11:26:23 2019 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Apr 2019 11:26:23 +0000 Subject: Change in osmo-ggsn[master]: ggsn: More logging from PCO handling (e.g. in case of malconfiguration) In-Reply-To: References: Message-ID: Max has posted comments on this change. ( https://gerrit.osmocom.org/13609 ) Change subject: ggsn: More logging from PCO handling (e.g. in case of malconfiguration) ...................................................................... Patch Set 4: Some comment/reference to what PCO is would be helpful. P. S> Seems like I'm unable to +1 this due to some permissions problem. -- To view, visit https://gerrit.osmocom.org/13609 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I38c2c4178ff4fd795f54638adec63166b1c0838e Gerrit-Change-Number: 13609 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 11:26:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 12:25:05 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 12:25:05 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: use 0.0 as default for mp_ipa_up_delay In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13791 ) Change subject: BTS_Tests: use 0.0 as default for mp_ipa_up_delay ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13791 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7663cad5df1ee5a8bcdbbf522881999f1be9f4fe Gerrit-Change-Number: 13791 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 26 Apr 2019 12:25:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 12:25:56 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 12:25:56 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: use 0.0 as default for mp_ipa_up_delay In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13791 ) Change subject: BTS_Tests: use 0.0 as default for mp_ipa_up_delay ...................................................................... Patch Set 1: You are going to have issues with real HW tests then anyway because you'll set this variable to higher values right? maybe it's better fixing that wirth virtual setup and the value != 0.0. -- To view, visit https://gerrit.osmocom.org/13791 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7663cad5df1ee5a8bcdbbf522881999f1be9f4fe Gerrit-Change-Number: 13791 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 26 Apr 2019 12:25:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 12:37:06 2019 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 26 Apr 2019 12:37:06 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: use 0.0 as default for mp_ipa_up_delay In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/13791 ) Change subject: BTS_Tests: use 0.0 as default for mp_ipa_up_delay ...................................................................... BTS_Tests: use 0.0 as default for mp_ipa_up_delay The module parameter mp_ipa_up_delay ads a delay after the ipa bring up. This is relevant for the tests with real BTS hardware, but it is not relavent for the regular TTCN3 tests. Lets set the default to 0.0, since the delay caused problems with TC_rsl_ms_pwr_ctrl and TC_si_sched_13_2bis_2ter_2quater. Change-Id: I7663cad5df1ee5a8bcdbbf522881999f1be9f4fe Related: OS#3960 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 35f51a1..e1c64d6 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -65,7 +65,7 @@ integer mp_timing_offset_256syms_exp := 512; /* Time to wait for RSL conn from BTS during startup of test */ float mp_ipa_up_timeout := 15.0; - float mp_ipa_up_delay := 3.0; + float mp_ipa_up_delay := 0.0; } type record of RslChannelNr ChannelNrs; -- To view, visit https://gerrit.osmocom.org/13791 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7663cad5df1ee5a8bcdbbf522881999f1be9f4fe Gerrit-Change-Number: 13791 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 13:30:54 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Fri, 26 Apr 2019 13:30:54 +0000 Subject: Change in osmo-ci[master]: osmocom-jenkins-slave: fix jessie-backports as it got deprecated Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/13792 Change subject: osmocom-jenkins-slave: fix jessie-backports as it got deprecated ...................................................................... osmocom-jenkins-slave: fix jessie-backports as it got deprecated Change-Id: Idae47a6529f6a870e29ab688c3479b7ef4ba200a --- M ansible/roles/osmocom-jenkins-slave/tasks/debian.yml 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/92/13792/1 diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml index 641c6f3..0f0f651 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml @@ -17,9 +17,15 @@ - fakeroot when: install_jenkins_utilities +- name: stop checking release validity for old statble + copy: + content: 'Acquire::Check-Valid-Until "false";' + dest: '/etc/apt/apt.conf.d/90-stop-check-release-validity' + when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie' + - name: enable backports for jessie apt_repository: - repo: 'deb http://ftp.debian.org/debian jessie-backports main' + repo: 'deb http://archive.debian.org/debian jessie-backports main' filename: 'backports' update_cache: yes when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie' -- To view, visit https://gerrit.osmocom.org/13792 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Idae47a6529f6a870e29ab688c3479b7ef4ba200a Gerrit-Change-Number: 13792 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 13:30:54 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Fri, 26 Apr 2019 13:30:54 +0000 Subject: Change in osmo-ci[master]: generalize the install-poky-sdk role to support multiple sdks Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/13793 Change subject: generalize the install-poky-sdk role to support multiple sdks ...................................................................... generalize the install-poky-sdk role to support multiple sdks Change-Id: I35f34a089311808cb21a064dd50e41cd1887b320 --- M ansible/roles/install-poky-sdk/README.md M ansible/roles/install-poky-sdk/defaults/main.yml M ansible/roles/install-poky-sdk/tasks/main.yml M ansible/setup-desktop.yml M ansible/setup-jenkins-slave.yml 5 files changed, 32 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/93/13793/1 diff --git a/ansible/roles/install-poky-sdk/README.md b/ansible/roles/install-poky-sdk/README.md index 541ea3c..7f2c31e 100644 --- a/ansible/roles/install-poky-sdk/README.md +++ b/ansible/roles/install-poky-sdk/README.md @@ -1,10 +1,17 @@ -# Install the poky sdk used to build sysmobts binaries +# Install the poky sdk's used to build sysmobts binaries # Poky Installation The poky installation requires you to have the installer available. Put the `poky_installer_file` to the root directory of this repo. -Also the exact filename must match the variable `poky_installer_file` and the -`poky_version`. -For the defaults of those variable have a look into `defaults/main.yml`. +Also the exact filename must match the variable `poky_installer_file` +example: +``` + - name: install-poky-sdk + jenkins_user: osmocom-build + poky_install_file: poky-glibc-x86_64-meta-toolchain-osmo-cortexa15hf-neon-toolchain-osmo-2.3.4-20190426050512.sh + poky_dest: /opt/poky-sdk/2.3.4/ + tags: + - poky +``` diff --git a/ansible/roles/install-poky-sdk/defaults/main.yml b/ansible/roles/install-poky-sdk/defaults/main.yml index 9b8eb04..5b7385c 100644 --- a/ansible/roles/install-poky-sdk/defaults/main.yml +++ b/ansible/roles/install-poky-sdk/defaults/main.yml @@ -1,7 +1,3 @@ --- # OS user jenkins_user: jenkins - -poky_installer_file: poky-glibc-x86_64-meta-toolchain-osmo-armv5te-toolchain-osmo-2.3.4.sh -poky_version: 2.3.4 - diff --git a/ansible/roles/install-poky-sdk/tasks/main.yml b/ansible/roles/install-poky-sdk/tasks/main.yml index 9d64347..85b310a 100644 --- a/ansible/roles/install-poky-sdk/tasks/main.yml +++ b/ansible/roles/install-poky-sdk/tasks/main.yml @@ -1,5 +1,4 @@ --- - - name: install bzip2 and tar apt: name: "{{ item }}" @@ -19,21 +18,28 @@ tags: [poky] - name: execute poky installer - command: "/tmp/{{ poky_installer_file }} -y" + command: "/tmp/{{ poky_installer_file }} -y -d '{{ poky_dest }}'" args: - creates: "/opt/poky/{{ poky_version }}" + creates: "{{ poky_dest }}" when: poky_copy.failed == false tags: [poky] - name: change owner/group to jenkins user file: - path: /opt/poky + path: "{{ poky_dest }}" owner: "{{ jenkins_user }}" group: "{{ jenkins_user }}" recurse: yes when: poky_copy.failed == false tags: [poky] +- name: remove poky installer + file: + path: "/tmp/{{ poky_installer_file }}" + state: absent + when: poky_copy.failed == false + tags: [poky] + - name: "Please download {{ poky_installer_file }} to your ansible directory to allow ansible to install poky" debug: msg: "Ansible can not find or copy {{ poky_installer_file }}" diff --git a/ansible/setup-desktop.yml b/ansible/setup-desktop.yml index 507a8f2..563d124 100644 --- a/ansible/setup-desktop.yml +++ b/ansible/setup-desktop.yml @@ -9,6 +9,8 @@ - name: install-poky-sdk jenkins_user: osmocom-build + poky_installer_file: poky-glibc-x86_64-meta-toolchain-osmo-armv5te-toolchain-osmo-2.3.4.sh + poky_dest: /opt/poky-sdk/2.3.4/ tags: - poky diff --git a/ansible/setup-jenkins-slave.yml b/ansible/setup-jenkins-slave.yml index 4ca7188..1135ab2 100644 --- a/ansible/setup-jenkins-slave.yml +++ b/ansible/setup-jenkins-slave.yml @@ -21,6 +21,15 @@ - name: install-poky-sdk jenkins_user: osmocom-build + poky_install_file: poky-glibc-x86_64-meta-toolchain-osmo-cortexa15hf-neon-toolchain-osmo-2.3.4-20190426050512.sh + poky_dest: /opt/poky-oc2g/2.3.4/ + tags: + - poky + + - name: install-poky-sdk + jenkins_user: osmocom-build + poky_installer_file: poky-glibc-x86_64-meta-toolchain-osmo-armv5te-toolchain-osmo-2.3.4.sh + poky_dest: /opt/poky-sdk/2.3.4/ tags: - poky -- To view, visit https://gerrit.osmocom.org/13793 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I35f34a089311808cb21a064dd50e41cd1887b320 Gerrit-Change-Number: 13793 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 13:53:52 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 13:53:52 +0000 Subject: Change in osmo-ci[master]: osmocom-jenkins-slave: fix jessie-backports as it got deprecated In-Reply-To: References: Message-ID: Pau Espin Pedrol has uploaded a new patch set (#2) to the change originally created by lynxis lazus. ( https://gerrit.osmocom.org/13792 ) Change subject: osmocom-jenkins-slave: fix jessie-backports as it got deprecated ...................................................................... osmocom-jenkins-slave: fix jessie-backports as it got deprecated Change-Id: Idae47a6529f6a870e29ab688c3479b7ef4ba200a --- M ansible/roles/osmocom-jenkins-slave/tasks/debian.yml 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/92/13792/2 -- To view, visit https://gerrit.osmocom.org/13792 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idae47a6529f6a870e29ab688c3479b7ef4ba200a Gerrit-Change-Number: 13792 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 13:59:29 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 13:59:29 +0000 Subject: Change in osmo-ci[master]: ansible: Document how to use ProxyJump to access ipv6 nodes Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13794 Change subject: ansible: Document how to use ProxyJump to access ipv6 nodes ...................................................................... ansible: Document how to use ProxyJump to access ipv6 nodes Change-Id: I31b8f8ea5ed84a676c97ad2f6802be19f0e394d9 --- M ansible/README.md 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/94/13794/1 diff --git a/ansible/README.md b/ansible/README.md index 15c6164..f3185ec 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -18,3 +18,15 @@ `ansible-playbook -i hosts setup-jenkins-slave.yml` Further information on this job and around the setup can be found on the redmine wiki. + +If you don't have access to an IPv6 network from your local host, then you can +use an ssh proxy to updates hosts in the `hosts` files being accessed only +through an IPv6 addr. Your ssh proxy must of course have an IPv6 address able to +reach the destination host. + +example `.ssh/config`: +``` +Host 2a01:4f8:13b:828::1:* +ProxyJump proxyuser at myhostproxy.com:22 +User root +``` -- To view, visit https://gerrit.osmocom.org/13794 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I31b8f8ea5ed84a676c97ad2f6802be19f0e394d9 Gerrit-Change-Number: 13794 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 14:37:14 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 14:37:14 +0000 Subject: Change in osmo-ci[master]: osmocom-jenkins-slave: fix jessie-backports as it got deprecated In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13792 ) Change subject: osmocom-jenkins-slave: fix jessie-backports as it got deprecated ...................................................................... Patch Set 2: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/13792/1/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml File ansible/roles/osmocom-jenkins-slave/tasks/debian.yml: https://gerrit.osmocom.org/#/c/13792/1/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml at 20 PS1, Line 20: - name: stop checking release validity for old stable typo: statble. -- To view, visit https://gerrit.osmocom.org/13792 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idae47a6529f6a870e29ab688c3479b7ef4ba200a Gerrit-Change-Number: 13792 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 26 Apr 2019 14:37:14 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 14:37:38 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 14:37:38 +0000 Subject: Change in osmo-ci[master]: generalize the install-poky-sdk role to support multiple sdks In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13793 ) Change subject: generalize the install-poky-sdk role to support multiple sdks ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13793 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I35f34a089311808cb21a064dd50e41cd1887b320 Gerrit-Change-Number: 13793 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 26 Apr 2019 14:37:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 14:37:44 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 14:37:44 +0000 Subject: Change in osmo-ci[master]: osmocom-jenkins-slave: fix jessie-backports as it got deprecated In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13792 ) Change subject: osmocom-jenkins-slave: fix jessie-backports as it got deprecated ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/13792 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idae47a6529f6a870e29ab688c3479b7ef4ba200a Gerrit-Change-Number: 13792 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 26 Apr 2019 14:37:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 14:37:45 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 14:37:45 +0000 Subject: Change in osmo-ci[master]: generalize the install-poky-sdk role to support multiple sdks In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13793 ) Change subject: generalize the install-poky-sdk role to support multiple sdks ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/13793 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I35f34a089311808cb21a064dd50e41cd1887b320 Gerrit-Change-Number: 13793 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 26 Apr 2019 14:37:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 14:37:47 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 14:37:47 +0000 Subject: Change in osmo-ci[master]: osmocom-jenkins-slave: fix jessie-backports as it got deprecated In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13792 ) Change subject: osmocom-jenkins-slave: fix jessie-backports as it got deprecated ...................................................................... osmocom-jenkins-slave: fix jessie-backports as it got deprecated Change-Id: Idae47a6529f6a870e29ab688c3479b7ef4ba200a --- M ansible/roles/osmocom-jenkins-slave/tasks/debian.yml 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved; Verified diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml index 641c6f3..38228ec 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml @@ -17,9 +17,15 @@ - fakeroot when: install_jenkins_utilities +- name: stop checking release validity for old stable + copy: + content: 'Acquire::Check-Valid-Until "false";' + dest: '/etc/apt/apt.conf.d/90-stop-check-release-validity' + when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie' + - name: enable backports for jessie apt_repository: - repo: 'deb http://ftp.debian.org/debian jessie-backports main' + repo: 'deb http://archive.debian.org/debian jessie-backports main' filename: 'backports' update_cache: yes when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie' -- To view, visit https://gerrit.osmocom.org/13792 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Idae47a6529f6a870e29ab688c3479b7ef4ba200a Gerrit-Change-Number: 13792 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 14:37:47 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 14:37:47 +0000 Subject: Change in osmo-ci[master]: generalize the install-poky-sdk role to support multiple sdks In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13793 ) Change subject: generalize the install-poky-sdk role to support multiple sdks ...................................................................... generalize the install-poky-sdk role to support multiple sdks Change-Id: I35f34a089311808cb21a064dd50e41cd1887b320 --- M ansible/roles/install-poky-sdk/README.md M ansible/roles/install-poky-sdk/defaults/main.yml M ansible/roles/install-poky-sdk/tasks/main.yml M ansible/setup-desktop.yml M ansible/setup-jenkins-slave.yml 5 files changed, 32 insertions(+), 12 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved; Verified diff --git a/ansible/roles/install-poky-sdk/README.md b/ansible/roles/install-poky-sdk/README.md index 541ea3c..7f2c31e 100644 --- a/ansible/roles/install-poky-sdk/README.md +++ b/ansible/roles/install-poky-sdk/README.md @@ -1,10 +1,17 @@ -# Install the poky sdk used to build sysmobts binaries +# Install the poky sdk's used to build sysmobts binaries # Poky Installation The poky installation requires you to have the installer available. Put the `poky_installer_file` to the root directory of this repo. -Also the exact filename must match the variable `poky_installer_file` and the -`poky_version`. -For the defaults of those variable have a look into `defaults/main.yml`. +Also the exact filename must match the variable `poky_installer_file` +example: +``` + - name: install-poky-sdk + jenkins_user: osmocom-build + poky_install_file: poky-glibc-x86_64-meta-toolchain-osmo-cortexa15hf-neon-toolchain-osmo-2.3.4-20190426050512.sh + poky_dest: /opt/poky-sdk/2.3.4/ + tags: + - poky +``` diff --git a/ansible/roles/install-poky-sdk/defaults/main.yml b/ansible/roles/install-poky-sdk/defaults/main.yml index 9b8eb04..5b7385c 100644 --- a/ansible/roles/install-poky-sdk/defaults/main.yml +++ b/ansible/roles/install-poky-sdk/defaults/main.yml @@ -1,7 +1,3 @@ --- # OS user jenkins_user: jenkins - -poky_installer_file: poky-glibc-x86_64-meta-toolchain-osmo-armv5te-toolchain-osmo-2.3.4.sh -poky_version: 2.3.4 - diff --git a/ansible/roles/install-poky-sdk/tasks/main.yml b/ansible/roles/install-poky-sdk/tasks/main.yml index 9d64347..85b310a 100644 --- a/ansible/roles/install-poky-sdk/tasks/main.yml +++ b/ansible/roles/install-poky-sdk/tasks/main.yml @@ -1,5 +1,4 @@ --- - - name: install bzip2 and tar apt: name: "{{ item }}" @@ -19,21 +18,28 @@ tags: [poky] - name: execute poky installer - command: "/tmp/{{ poky_installer_file }} -y" + command: "/tmp/{{ poky_installer_file }} -y -d '{{ poky_dest }}'" args: - creates: "/opt/poky/{{ poky_version }}" + creates: "{{ poky_dest }}" when: poky_copy.failed == false tags: [poky] - name: change owner/group to jenkins user file: - path: /opt/poky + path: "{{ poky_dest }}" owner: "{{ jenkins_user }}" group: "{{ jenkins_user }}" recurse: yes when: poky_copy.failed == false tags: [poky] +- name: remove poky installer + file: + path: "/tmp/{{ poky_installer_file }}" + state: absent + when: poky_copy.failed == false + tags: [poky] + - name: "Please download {{ poky_installer_file }} to your ansible directory to allow ansible to install poky" debug: msg: "Ansible can not find or copy {{ poky_installer_file }}" diff --git a/ansible/setup-desktop.yml b/ansible/setup-desktop.yml index 507a8f2..563d124 100644 --- a/ansible/setup-desktop.yml +++ b/ansible/setup-desktop.yml @@ -9,6 +9,8 @@ - name: install-poky-sdk jenkins_user: osmocom-build + poky_installer_file: poky-glibc-x86_64-meta-toolchain-osmo-armv5te-toolchain-osmo-2.3.4.sh + poky_dest: /opt/poky-sdk/2.3.4/ tags: - poky diff --git a/ansible/setup-jenkins-slave.yml b/ansible/setup-jenkins-slave.yml index 4ca7188..1135ab2 100644 --- a/ansible/setup-jenkins-slave.yml +++ b/ansible/setup-jenkins-slave.yml @@ -21,6 +21,15 @@ - name: install-poky-sdk jenkins_user: osmocom-build + poky_install_file: poky-glibc-x86_64-meta-toolchain-osmo-cortexa15hf-neon-toolchain-osmo-2.3.4-20190426050512.sh + poky_dest: /opt/poky-oc2g/2.3.4/ + tags: + - poky + + - name: install-poky-sdk + jenkins_user: osmocom-build + poky_installer_file: poky-glibc-x86_64-meta-toolchain-osmo-armv5te-toolchain-osmo-2.3.4.sh + poky_dest: /opt/poky-sdk/2.3.4/ tags: - poky -- To view, visit https://gerrit.osmocom.org/13793 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I35f34a089311808cb21a064dd50e41cd1887b320 Gerrit-Change-Number: 13793 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:03:47 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Apr 2019 16:03:47 +0000 Subject: Change in osmo-ci[master]: ansible: Document how to use ProxyJump to access ipv6 nodes In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13794 ) Change subject: ansible: Document how to use ProxyJump to access ipv6 nodes ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13794 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I31b8f8ea5ed84a676c97ad2f6802be19f0e394d9 Gerrit-Change-Number: 13794 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Fri, 26 Apr 2019 16:03:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:03:49 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Apr 2019 16:03:49 +0000 Subject: Change in osmo-ci[master]: ansible: Document how to use ProxyJump to access ipv6 nodes In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13794 ) Change subject: ansible: Document how to use ProxyJump to access ipv6 nodes ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13794 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I31b8f8ea5ed84a676c97ad2f6802be19f0e394d9 Gerrit-Change-Number: 13794 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Fri, 26 Apr 2019 16:03:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:03:51 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Apr 2019 16:03:51 +0000 Subject: Change in osmo-ci[master]: ansible: Document how to use ProxyJump to access ipv6 nodes In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13794 ) Change subject: ansible: Document how to use ProxyJump to access ipv6 nodes ...................................................................... ansible: Document how to use ProxyJump to access ipv6 nodes Change-Id: I31b8f8ea5ed84a676c97ad2f6802be19f0e394d9 --- M ansible/README.md 1 file changed, 12 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/ansible/README.md b/ansible/README.md index 15c6164..f3185ec 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -18,3 +18,15 @@ `ansible-playbook -i hosts setup-jenkins-slave.yml` Further information on this job and around the setup can be found on the redmine wiki. + +If you don't have access to an IPv6 network from your local host, then you can +use an ssh proxy to updates hosts in the `hosts` files being accessed only +through an IPv6 addr. Your ssh proxy must of course have an IPv6 address able to +reach the destination host. + +example `.ssh/config`: +``` +Host 2a01:4f8:13b:828::1:* +ProxyJump proxyuser at myhostproxy.com:22 +User root +``` -- To view, visit https://gerrit.osmocom.org/13794 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I31b8f8ea5ed84a676c97ad2f6802be19f0e394d9 Gerrit-Change-Number: 13794 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:04:17 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Apr 2019 16:04:17 +0000 Subject: Change in osmo-ci[master]: jenkins docker: Install lcov and lcov-cobertura In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13551 ) Change subject: jenkins docker: Install lcov and lcov-cobertura ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13551 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I26896a9807e756b1f935cd3ed524d25ee22efaed Gerrit-Change-Number: 13551 Gerrit-PatchSet: 1 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-CC: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 16:04:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:05:57 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Apr 2019 16:05:57 +0000 Subject: Change in osmo-msc[master]: libmsc/db.c: fix storing SMS with empty TP-User-Data In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13630 ) Change subject: libmsc/db.c: fix storing SMS with empty TP-User-Data ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13630 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If0b2bb557118c5f0e520a2e6c2816336f6028661 Gerrit-Change-Number: 13630 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 16:05:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:09:47 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Apr 2019 16:09:47 +0000 Subject: Change in osmo-trx[master]: lms: flush_recv: alloc buf on stack instead of heap In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13782 ) Change subject: lms: flush_recv: alloc buf on stack instead of heap ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13782 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iede8dc0903ee3865a52c8e2fd811bcde444fee33 Gerrit-Change-Number: 13782 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 16:09:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:10:26 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Apr 2019 16:10:26 +0000 Subject: Change in osmo-trx[master]: lms: Improve log during flush recv error In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13783 ) Change subject: lms: Improve log during flush recv error ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13783 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id45d42599738efd6a5d89787c75779838a979330 Gerrit-Change-Number: 13783 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Fri, 26 Apr 2019 16:10:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:10:33 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Apr 2019 16:10:33 +0000 Subject: Change in osmo-trx[master]: cosmetic: Threads.h: Remove trailing whitespace In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13784 ) Change subject: cosmetic: Threads.h: Remove trailing whitespace ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13784 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0ae6e435a7f0480c3eaa08dccfe824456f33b015 Gerrit-Change-Number: 13784 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 16:10:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:11:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Apr 2019 16:11:08 +0000 Subject: Change in osmo-trx[master]: Move duplicated thread_enable_cancel to CommonLibs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13785 ) Change subject: Move duplicated thread_enable_cancel to CommonLibs ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13785 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1a479b59bdda01233273dfa919bd678edbe34708 Gerrit-Change-Number: 13785 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Fri, 26 Apr 2019 16:11:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:11:30 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Apr 2019 16:11:30 +0000 Subject: Change in osmo-trx[master]: lms: Log underrun/overrun events In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13786 ) Change subject: lms: Log underrun/overrun events ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13786 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8c6b1d3e8515153e5d4079cc6620901ef8ce2449 Gerrit-Change-Number: 13786 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Fri, 26 Apr 2019 16:11:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:13:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Apr 2019 16:13:45 +0000 Subject: Change in osmo-trx[master]: lms: Remove references to ALERT loglevel In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13787 ) Change subject: lms: Remove references to ALERT loglevel ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13787 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0e171a8ac8a8bfa804ac97fba3d73efcfa6424b4 Gerrit-Change-Number: 13787 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 16:13:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:14:04 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Apr 2019 16:14:04 +0000 Subject: Change in osmo-trx[master]: lms: Remove unused var m_last_tx_overruns In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13788 ) Change subject: lms: Remove unused var m_last_tx_overruns ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13788 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2104205b2af7cd6c86075d5cc4f0f36bde5e5311 Gerrit-Change-Number: 13788 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Comment-Date: Fri, 26 Apr 2019 16:14:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:18:38 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Apr 2019 16:18:38 +0000 Subject: Change in osmo-trx[master]: lms: Catch and log dropped packets by HW during recv In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13789 ) Change subject: lms: Catch and log dropped packets by HW during recv ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13789 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I23554d95b0aff585024610fc12920c9da4f3ba9e Gerrit-Change-Number: 13789 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Fri, 26 Apr 2019 16:18:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:51:14 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 16:51:14 +0000 Subject: Change in osmo-trx[master]: lms: flush_recv: alloc buf on stack instead of heap In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13782 ) Change subject: lms: flush_recv: alloc buf on stack instead of heap ...................................................................... lms: flush_recv: alloc buf on stack instead of heap No need to use the heap here since buffer is only used as a temporary trash. Using the stack is quicker. Change-Id: Iede8dc0903ee3865a52c8e2fd811bcde444fee33 --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 1 insertion(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 05904e8..064d742 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -450,7 +450,7 @@ { #define CHUNK 625 int len = CHUNK * tx_sps; - short *buffer = new short[len * 2]; + short *buffer = (short*) alloca(sizeof(short) * len * 2); int rc; lms_stream_meta_t rx_metadata = {}; rx_metadata.flushPartialPacket = false; @@ -463,7 +463,6 @@ LOGC(DDEV, DEBUG) << "Flush: Recv buffer of len " << rc << " at " << std::hex << rx_metadata.timestamp; if (rc != len) { LOGC(DDEV, ALERT) << "LMS: Device receive timed out"; - delete[] buffer; return false; } @@ -471,7 +470,6 @@ } LOGC(DDEV, INFO) << "Initial timestamp " << ts_initial << std::endl; - delete[] buffer; return true; } -- To view, visit https://gerrit.osmocom.org/13782 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iede8dc0903ee3865a52c8e2fd811bcde444fee33 Gerrit-Change-Number: 13782 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Max -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:51:15 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 16:51:15 +0000 Subject: Change in osmo-trx[master]: lms: Improve log during flush recv error In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13783 ) Change subject: lms: Improve log during flush recv error ...................................................................... lms: Improve log during flush recv error Change-Id: Id45d42599738efd6a5d89787c75779838a979330 --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 064d742..b924fa7 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -462,7 +462,7 @@ rc = LMS_RecvStream(&m_lms_stream_rx[0], &buffer[0], len, &rx_metadata, 100); LOGC(DDEV, DEBUG) << "Flush: Recv buffer of len " << rc << " at " << std::hex << rx_metadata.timestamp; if (rc != len) { - LOGC(DDEV, ALERT) << "LMS: Device receive timed out"; + LOGC(DDEV, ALERT) << "Flush: Device receive timed out"; return false; } -- To view, visit https://gerrit.osmocom.org/13783 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id45d42599738efd6a5d89787c75779838a979330 Gerrit-Change-Number: 13783 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:51:15 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 16:51:15 +0000 Subject: Change in osmo-trx[master]: cosmetic: Threads.h: Remove trailing whitespace In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13784 ) Change subject: cosmetic: Threads.h: Remove trailing whitespace ...................................................................... cosmetic: Threads.h: Remove trailing whitespace Change-Id: I0ae6e435a7f0480c3eaa08dccfe824456f33b015 --- M CommonLibs/Threads.h 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/CommonLibs/Threads.h b/CommonLibs/Threads.h index 857c5d9..3b76985 100644 --- a/CommonLibs/Threads.h +++ b/CommonLibs/Threads.h @@ -55,7 +55,7 @@ #define OBJDCOUT(text) {} #else #define DCOUT(text) { COUT(__FILE__ << ":" << __LINE__ << " " << text); } -#define OBJDCOUT(text) { DCOUT(this << " " << text); } +#define OBJDCOUT(text) { DCOUT(this << " " << text); } #endif //@} //@} @@ -152,7 +152,7 @@ pthread_attr_t mAttrib; // FIXME -- Can this be reduced now? size_t mStackSize; - + public: -- To view, visit https://gerrit.osmocom.org/13784 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0ae6e435a7f0480c3eaa08dccfe824456f33b015 Gerrit-Change-Number: 13784 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:51:16 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 16:51:16 +0000 Subject: Change in osmo-trx[master]: Move duplicated thread_enable_cancel to CommonLibs In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13785 ) Change subject: Move duplicated thread_enable_cancel to CommonLibs ...................................................................... Move duplicated thread_enable_cancel to CommonLibs Change-Id: I1a479b59bdda01233273dfa919bd678edbe34708 --- M CommonLibs/Threads.cpp M CommonLibs/Threads.h M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/uhd/UHDDevice.cpp 4 files changed, 7 insertions(+), 12 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/CommonLibs/Threads.cpp b/CommonLibs/Threads.cpp index 2988e12..c056d69 100644 --- a/CommonLibs/Threads.cpp +++ b/CommonLibs/Threads.cpp @@ -122,6 +122,12 @@ } } +void thread_enable_cancel(bool cancel) +{ + cancel ? pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) : + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); +} + void Thread::start(void *(*task)(void*), void *arg) { assert(mThread==((pthread_t)0)); diff --git a/CommonLibs/Threads.h b/CommonLibs/Threads.h index 3b76985..4c5b9ee 100644 --- a/CommonLibs/Threads.h +++ b/CommonLibs/Threads.h @@ -142,6 +142,7 @@ thread.start((void *(*)(void*))function, (void*)argument); void set_selfthread_name(const char *name); +void thread_enable_cancel(bool cancel); /** A C++ wrapper for pthread threads. */ class Thread { diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index b924fa7..0cd41d3 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -90,12 +90,6 @@ LOGLV(DLMS, lvl_map[lvl]) << msg; } -static void thread_enable_cancel(bool cancel) -{ - cancel ? pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) : - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); -} - static void print_range(const char* name, lms_range_t *range) { LOGC(DDEV, INFO) << name << ": Min=" << range->min << " Max=" << range->max diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp index 765150f..46284e5 100644 --- a/Transceiver52M/device/uhd/UHDDevice.cpp +++ b/Transceiver52M/device/uhd/UHDDevice.cpp @@ -357,12 +357,6 @@ } #endif -static void thread_enable_cancel(bool cancel) -{ - cancel ? pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) : - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); -} - uhd_device::uhd_device(size_t tx_sps, size_t rx_sps, InterfaceType iface, size_t chans, double lo_offset, const std::vector& tx_paths, -- To view, visit https://gerrit.osmocom.org/13785 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1a479b59bdda01233273dfa919bd678edbe34708 Gerrit-Change-Number: 13785 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:51:16 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 16:51:16 +0000 Subject: Change in osmo-trx[master]: lms: Log underrun/overrun events In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13786 ) Change subject: lms: Log underrun/overrun events ...................................................................... lms: Log underrun/overrun events Change-Id: I8c6b1d3e8515153e5d4079cc6620901ef8ce2449 --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 10 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 0cd41d3..d0c8e19 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -573,12 +573,20 @@ { lms_stream_status_t status; if (LMS_GetStreamStatus(&m_lms_stream_rx[chan], &status) == 0) { - if (status.underrun > m_last_rx_underruns[chan]) + if (status.underrun > m_last_rx_underruns[chan]) { *underrun = true; + LOGC(DDEV, ERROR) << "chan " << chan << ": recv Underrun! (" + << m_last_rx_underruns[chan] << " -> " + << status.underrun << ")"; + } m_last_rx_underruns[chan] = status.underrun; - if (status.overrun > m_last_rx_overruns[chan]) + if (status.overrun > m_last_rx_overruns[chan]) { *overrun = true; + LOGC(DDEV, ERROR) << "chan " << chan << ": recv Overrun! (" + << m_last_rx_overruns[chan] << " -> " + << status.overrun << ")"; + } m_last_rx_overruns[chan] = status.overrun; } } -- To view, visit https://gerrit.osmocom.org/13786 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8c6b1d3e8515153e5d4079cc6620901ef8ce2449 Gerrit-Change-Number: 13786 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:51:17 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 16:51:17 +0000 Subject: Change in osmo-trx[master]: lms: Remove references to ALERT loglevel In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13787 ) Change subject: lms: Remove references to ALERT loglevel ...................................................................... lms: Remove references to ALERT loglevel ALERT log level is not Osmocom standard level, it's just a define in osmo-trx to keep compatibility with old code. Same goes for one reference to "ERR" intead of "ERROR". Change-Id: I0e171a8ac8a8bfa804ac97fba3d73efcfa6424b4 --- M Transceiver52M/device/lms/LMSDevice.cpp 1 file changed, 21 insertions(+), 21 deletions(-) Approvals: Jenkins Builder: Verified Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index d0c8e19..e971ad4 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -234,7 +234,7 @@ /* configure antennas */ if (!set_antennas()) { - LOGC(DDEV, ALERT) << "LMS antenna setting failed"; + LOGC(DDEV, FATAL) << "LMS antenna setting failed"; goto out_close; } @@ -245,7 +245,7 @@ return NORMAL; out_close: - LOGC(DDEV, ALERT) << "Error in LMS open, closing: " << LMS_GetLastErrorMessage(); + LOGC(DDEV, FATAL) << "Error in LMS open, closing: " << LMS_GetLastErrorMessage(); LMS_Close(m_lms_dev); m_lms_dev = NULL; return -1; @@ -456,7 +456,7 @@ rc = LMS_RecvStream(&m_lms_stream_rx[0], &buffer[0], len, &rx_metadata, 100); LOGC(DDEV, DEBUG) << "Flush: Recv buffer of len " << rc << " at " << std::hex << rx_metadata.timestamp; if (rc != len) { - LOGC(DDEV, ALERT) << "Flush: Device receive timed out"; + LOGC(DDEV, ERROR) << "Flush: Device receive timed out"; return false; } @@ -472,18 +472,18 @@ int idx; if (chan >= rx_paths.size()) { - LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan; + LOGC(DDEV, ERROR) << "Requested non-existent channel " << chan; return false; } idx = get_ant_idx(ant, LMS_CH_RX, chan); if (idx < 0) { - LOGC(DDEV, ALERT) << "Invalid Rx Antenna"; + LOGC(DDEV, ERROR) << "Invalid Rx Antenna"; return false; } if (LMS_SetAntenna(m_lms_dev, LMS_CH_RX, chan, idx) < 0) { - LOGC(DDEV, ALERT) << "Unable to set Rx Antenna"; + LOGC(DDEV, ERROR) << "Unable to set Rx Antenna"; } return true; @@ -495,18 +495,18 @@ int idx; if (chan >= rx_paths.size()) { - LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan; + LOGC(DDEV, ERROR) << "Requested non-existent channel " << chan; return ""; } idx = LMS_GetAntenna(m_lms_dev, LMS_CH_RX, chan); if (idx < 0) { - LOGC(DDEV, ALERT) << "Error getting Rx Antenna"; + LOGC(DDEV, ERROR) << "Error getting Rx Antenna"; return ""; } if (LMS_GetAntennaList(m_lms_dev, LMS_CH_RX, chan, name_list) < idx) { - LOGC(DDEV, ALERT) << "Error getting Rx Antenna List"; + LOGC(DDEV, ERROR) << "Error getting Rx Antenna List"; return ""; } @@ -518,18 +518,18 @@ int idx; if (chan >= tx_paths.size()) { - LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan; + LOGC(DDEV, ERROR) << "Requested non-existent channel " << chan; return false; } idx = get_ant_idx(ant, LMS_CH_TX, chan); if (idx < 0) { - LOGC(DDEV, ALERT) << "Invalid Rx Antenna"; + LOGC(DDEV, ERROR) << "Invalid Rx Antenna"; return false; } if (LMS_SetAntenna(m_lms_dev, LMS_CH_TX, chan, idx) < 0) { - LOGC(DDEV, ALERT) << "Unable to set Rx Antenna"; + LOGC(DDEV, ERROR) << "Unable to set Rx Antenna"; } return true; @@ -541,18 +541,18 @@ int idx; if (chan >= tx_paths.size()) { - LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan; + LOGC(DDEV, ERROR) << "Requested non-existent channel " << chan; return ""; } idx = LMS_GetAntenna(m_lms_dev, LMS_CH_TX, chan); if (idx < 0) { - LOGC(DDEV, ALERT) << "Error getting Tx Antenna"; + LOGC(DDEV, ERROR) << "Error getting Tx Antenna"; return ""; } if (LMS_GetAntennaList(m_lms_dev, LMS_CH_TX, chan, name_list) < idx) { - LOGC(DDEV, ALERT) << "Error getting Tx Antenna List"; + LOGC(DDEV, ERROR) << "Error getting Tx Antenna List"; return ""; } @@ -603,7 +603,7 @@ rx_metadata.timestamp = 0; if (bufs.size() != chans) { - LOGC(DDEV, ALERT) << "Invalid channel combination " << bufs.size(); + LOGC(DDEV, ERROR) << "Invalid channel combination " << bufs.size(); return -1; } @@ -614,12 +614,12 @@ rc = LMS_RecvStream(&m_lms_stream_rx[i], bufs[i], len, &rx_metadata, 100); update_stream_stats(i, underrun, overrun); if (rc != len) { - LOGC(DDEV, ALERT) << "LMS: Device receive timed out (" << rc << " vs exp " << len << ")."; + LOGC(DDEV, ERROR) << "LMS: Device receive timed out (" << rc << " vs exp " << len << ")."; thread_enable_cancel(true); return -1; } if (timestamp != (TIMESTAMP)rx_metadata.timestamp) - LOGC(DDEV, ALERT) << "chan "<< i << " recv buffer of len " << rc << " expect " << std::hex << timestamp << " got " << std::hex << (TIMESTAMP)rx_metadata.timestamp << " (" << std::hex << rx_metadata.timestamp <<") diff=" << rx_metadata.timestamp - timestamp; + LOGC(DDEV, ERROR) << "chan "<< i << " recv buffer of len " << rc << " expect " << std::hex << timestamp << " got " << std::hex << (TIMESTAMP)rx_metadata.timestamp << " (" << std::hex << rx_metadata.timestamp <<") diff=" << rx_metadata.timestamp - timestamp; thread_enable_cancel(true); } @@ -644,12 +644,12 @@ tx_metadata.timestamp = timestamp - ts_offset; /* Shift Tx time by offset */ if (isControl) { - LOGC(DDEV, ERR) << "Control packets not supported"; + LOGC(DDEV, ERROR) << "Control packets not supported"; return 0; } if (bufs.size() != chans) { - LOGC(DDEV, ALERT) << "Invalid channel combination " << bufs.size(); + LOGC(DDEV, ERROR) << "Invalid channel combination " << bufs.size(); return -1; } @@ -660,7 +660,7 @@ thread_enable_cancel(false); rc = LMS_SendStream(&m_lms_stream_tx[i], bufs[i], len, &tx_metadata, 100); if (rc != len) { - LOGC(DDEV, ALERT) << "LMS: Device send timed out"; + LOGC(DDEV, ERROR) << "LMS: Device send timed out"; } if (LMS_GetStreamStatus(&m_lms_stream_tx[i], &status) == 0) { -- To view, visit https://gerrit.osmocom.org/13787 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0e171a8ac8a8bfa804ac97fba3d73efcfa6424b4 Gerrit-Change-Number: 13787 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:51:17 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 16:51:17 +0000 Subject: Change in osmo-trx[master]: lms: Remove unused var m_last_tx_overruns In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13788 ) Change subject: lms: Remove unused var m_last_tx_overruns ...................................................................... lms: Remove unused var m_last_tx_overruns Change-Id: I2104205b2af7cd6c86075d5cc4f0f36bde5e5311 --- M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/lms/LMSDevice.h 2 files changed, 0 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index e971ad4..e65c93d 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -55,7 +55,6 @@ m_last_rx_underruns.resize(chans, 0); m_last_rx_overruns.resize(chans, 0); m_last_tx_underruns.resize(chans, 0); - m_last_tx_overruns.resize(chans, 0); } LMSDevice::~LMSDevice() diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h index d1cb12a..4bf2b32 100644 --- a/Transceiver52M/device/lms/LMSDevice.h +++ b/Transceiver52M/device/lms/LMSDevice.h @@ -51,7 +51,6 @@ std::vector m_last_rx_underruns; std::vector m_last_rx_overruns; std::vector m_last_tx_underruns; - std::vector m_last_tx_overruns; double actualSampleRate; ///< the actual USRP sampling rate -- To view, visit https://gerrit.osmocom.org/13788 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2104205b2af7cd6c86075d5cc4f0f36bde5e5311 Gerrit-Change-Number: 13788 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 16:51:18 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Apr 2019 16:51:18 +0000 Subject: Change in osmo-trx[master]: lms: Catch and log dropped packets by HW during recv In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13789 ) Change subject: lms: Catch and log dropped packets by HW during recv ...................................................................... lms: Catch and log dropped packets by HW during recv Change-Id: I23554d95b0aff585024610fc12920c9da4f3ba9e --- M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/lms/LMSDevice.h 2 files changed, 9 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index e65c93d..7071589 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -54,6 +54,7 @@ m_last_rx_underruns.resize(chans, 0); m_last_rx_overruns.resize(chans, 0); + m_last_rx_dropped.resize(chans, 0); m_last_tx_underruns.resize(chans, 0); } @@ -587,6 +588,13 @@ << status.overrun << ")"; } m_last_rx_overruns[chan] = status.overrun; + + if (status.droppedPackets > m_last_rx_dropped[chan]) { + LOGC(DDEV, ERROR) << "chan " << chan << ": recv Dropped packets by HW! (" + << m_last_rx_dropped[chan] << " -> " + << status.droppedPackets << ")"; + } + m_last_rx_dropped[chan] = m_last_rx_overruns[chan]; } } diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h index 4bf2b32..225839d 100644 --- a/Transceiver52M/device/lms/LMSDevice.h +++ b/Transceiver52M/device/lms/LMSDevice.h @@ -50,6 +50,7 @@ std::vector m_last_rx_underruns; std::vector m_last_rx_overruns; + std::vector m_last_rx_dropped; std::vector m_last_tx_underruns; double actualSampleRate; ///< the actual USRP sampling rate -- To view, visit https://gerrit.osmocom.org/13789 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I23554d95b0aff585024610fc12920c9da4f3ba9e Gerrit-Change-Number: 13789 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 18:55:25 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 26 Apr 2019 18:55:25 +0000 Subject: Change in osmo-msc[master]: vlr subscr get/put: also check against NULL In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13745 ) Change subject: vlr subscr get/put: also check against NULL ...................................................................... vlr subscr get/put: also check against NULL Change-Id: I36929a4ba4abb46909181068d1d0af967b1f5a94 --- M include/osmocom/msc/vlr.h 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h index 92ebda1..ce6a232 100644 --- a/include/osmocom/msc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -399,9 +399,9 @@ #define vlr_subscr_put(VSUB, USE) vlr_subscr_put_src(VSUB, USE, __FILE__, __LINE__) #define vlr_subscr_get_src(VSUB, USE, SRCFILE, SRCLINE) \ - OSMO_ASSERT(_osmo_use_count_get_put(&(VSUB)->use_count, USE, 1, SRCFILE, SRCLINE) == 0) + OSMO_ASSERT((VSUB) && _osmo_use_count_get_put(&(VSUB)->use_count, USE, 1, SRCFILE, SRCLINE) == 0) #define vlr_subscr_put_src(VSUB, USE, SRCFILE, SRCLINE) \ - OSMO_ASSERT(_osmo_use_count_get_put(&(VSUB)->use_count, USE, -1, SRCFILE, SRCLINE) == 0) + OSMO_ASSERT((VSUB) && _osmo_use_count_get_put(&(VSUB)->use_count, USE, -1, SRCFILE, SRCLINE) == 0) void vlr_subscr_free(struct vlr_subscr *vsub); int vlr_subscr_alloc_tmsi(struct vlr_subscr *vsub); -- To view, visit https://gerrit.osmocom.org/13745 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I36929a4ba4abb46909181068d1d0af967b1f5a94 Gerrit-Change-Number: 13745 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 19:03:07 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 26 Apr 2019 19:03:07 +0000 Subject: Change in osmo-hlr[master]: add missing error log: invalid IMSI In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13587 ) Change subject: add missing error log: invalid IMSI ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/13587/1/src/hlr.c File src/hlr.c: https://gerrit.osmocom.org/#/c/13587/1/src/hlr.c at 537 PS1, Line 537: > What is the benefit of using osmo_quote_str() here? [?] The point is that the strlen() is invalid. So the IMSI might be empty, or something else might be odd, maybe random memory and invalid characters? osmo_quote_str() guarantees outputting something useful in all cases. -- To view, visit https://gerrit.osmocom.org/13587 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I65e9ecac06dc6d1abb9802d621c385d3b4fab83a Gerrit-Change-Number: 13587 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 26 Apr 2019 19:03:07 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 19:03:33 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 26 Apr 2019 19:03:33 +0000 Subject: Change in osmo-hlr[master]: fix error logging for GSUP route In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13517 ) Change subject: fix error logging for GSUP route ...................................................................... fix error logging for GSUP route The addr may not be nul terminated. Change-Id: Ie4def16008af573ed2e1367d9da50c3d2b5a71ef --- M src/gsup_send.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/gsup_send.c b/src/gsup_send.c index 889cf63..247a7e7 100644 --- a/src/gsup_send.c +++ b/src/gsup_send.c @@ -42,7 +42,7 @@ conn = gsup_route_find(gs, addr, addrlen); if (!conn) { - DEBUGP(DLGSUP, "Cannot find route for addr %s\n", addr); + DEBUGP(DLGSUP, "Cannot find route for addr %s\n", osmo_quote_str((const char*)addr, addrlen)); msgb_free(msg); return -ENODEV; } -- To view, visit https://gerrit.osmocom.org/13517 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie4def16008af573ed2e1367d9da50c3d2b5a71ef Gerrit-Change-Number: 13517 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 19:03:34 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 26 Apr 2019 19:03:34 +0000 Subject: Change in osmo-hlr[master]: add missing error log: invalid IMSI In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/13587 ) Change subject: add missing error log: invalid IMSI ...................................................................... add missing error log: invalid IMSI Change-Id: I65e9ecac06dc6d1abb9802d621c385d3b4fab83a --- M src/hlr.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve diff --git a/src/hlr.c b/src/hlr.c index 422a56d..19cfebb 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -454,8 +454,10 @@ /* 3GPP TS 23.003 Section 2.2 clearly states that an IMSI with less than 5 * digits is impossible. Even 5 digits is a highly theoretical case */ - if (strlen(gsup.imsi) < 5) + if (strlen(gsup.imsi) < 5) { + LOGP(DMAIN, LOGL_ERROR, "IMSI too short: %s\n", osmo_quote_str(gsup.imsi, -1)); return gsup_send_err_reply(conn, gsup.imsi, gsup.message_type, GMM_CAUSE_INV_MAND_INFO); + } switch (gsup.message_type) { /* requests sent to us */ -- To view, visit https://gerrit.osmocom.org/13587 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I65e9ecac06dc6d1abb9802d621c385d3b4fab83a Gerrit-Change-Number: 13587 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 19:25:00 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 26 Apr 2019 19:25:00 +0000 Subject: Change in osmo-bsc[master]: fix inter-BSC-HO-incoming for AoIP (2/2) 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/13585 to look at the new patch set (#2). Change subject: fix inter-BSC-HO-incoming for AoIP (2/2) ...................................................................... fix inter-BSC-HO-incoming for AoIP (2/2) For AoIP, the AoIP Transport Layer Address IE must be included in the Handover Request Acknowledge message, so the MSC can send RTP to the right place. Add this IE for AoIP. Depends: Ia71542ea37d4fd2c9fb9b40357db7aeb111ec576 (libosmocore) Depends: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63 (libosmocore) Change-Id: Ia05e37da125eb6e7b7be9b974b73261bd72de1f4 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 31 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/85/13585/2 -- To view, visit https://gerrit.osmocom.org/13585 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia05e37da125eb6e7b7be9b974b73261bd72de1f4 Gerrit-Change-Number: 13585 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 19:25:01 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 26 Apr 2019 19:25:01 +0000 Subject: Change in osmo-bsc[master]: use libosmocore osmo_tdef Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13795 Change subject: use libosmocore osmo_tdef ...................................................................... use libosmocore osmo_tdef Move the T_defs API to libosmocore as osmo_tdefs: remove the local T_defs API and use libosmocore's osmo_tdef* API instead. The root reason is moving the mgw_endpoint_fsm to libosmo-mgcp-client to be able to use it in osmo-msc for inter-MSC handover. When adding osmo_tdef, the new concept of timer groups was added to the API. It would make sense to apply group names here as well, but do not modify the VTY configuration for timers. The future might bring separate groups (or not). Depends: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5 (libosmocore) Change-Id: I66674a5d8403d820038762888c846bae10ceac58 --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h D include/osmocom/bsc/gsm_timers.h M include/osmocom/bsc/mgw_endpoint_fsm.h M src/ipaccess/Makefile.am M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c M src/osmo-bsc/bts_siemens_bs11.c M src/osmo-bsc/gsm_data.c D src/osmo-bsc/gsm_timers.c D src/osmo-bsc/gsm_timers_vty.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c M src/osmo-bsc/lchan_rtp_fsm.c M src/osmo-bsc/mgw_endpoint_fsm.c M src/osmo-bsc/net_init.c M src/osmo-bsc/paging.c M src/utils/Makefile.am M tests/abis/Makefile.am M tests/bsc/Makefile.am M tests/gsm0408/Makefile.am M tests/handover/Makefile.am M tests/nanobts_omlattr/Makefile.am M tests/nanobts_omlattr/nanobts_omlattr_test.c 29 files changed, 94 insertions(+), 468 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/95/13795/1 diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 044fdc9..21e53d7 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -20,7 +20,6 @@ gsm_04_08_rr.h \ gsm_04_80.h \ gsm_data.h \ - gsm_timers.h \ handover.h \ handover_cfg.h \ handover_decision.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index dc133e1..7b813a6 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -31,7 +32,6 @@ #include #include #include -#include #include #define GSM_T3122_DEFAULT 10 @@ -1495,7 +1495,7 @@ struct llist_head bts_rejected; /* shall reference gsm_network_T[] */ - struct T_def *T_defs; + struct osmo_tdef *T_defs; enum gsm_chan_t ctype_by_chreq[_NUM_CHREQ_T]; diff --git a/include/osmocom/bsc/gsm_timers.h b/include/osmocom/bsc/gsm_timers.h deleted file mode 100644 index 699c461..0000000 --- a/include/osmocom/bsc/gsm_timers.h +++ /dev/null @@ -1,56 +0,0 @@ -/* API to define Tnnn timers globally, configure in VTY and use for FSM state changes. */ -#pragma once - -#include -#include - -struct osmo_fsm_inst; -struct vty; - -enum T_unit { - T_S = 0, /*< most T are in seconds, keep 0 as default. */ - T_MS, /*< milliseconds */ - T_M, /*< minutes */ - T_CUSTOM, -}; - -extern const struct value_string T_unit_names[]; -static inline const char *T_unit_name(enum T_unit val) -{ return get_value_string(T_unit_names, val); } - -/* Define a GSM timer of the form Tnnn, with unit, default value and doc string. */ -struct T_def { - const int T; /*< T1234 number */ - const int default_val; /*< timeout duration (according to unit), default value. */ - const enum T_unit unit; - const char *desc; - int val; /*< currently active value, e.g. set by user config. */ -}; - -/* Iterate an array of struct T_def, the last item should be fully zero, i.e. "{}" */ -#define for_each_T_def(d, T_defs) \ - for (d = T_defs; d && (d->T || d->default_val || d->desc); d++) - -int T_def_get(const struct T_def *T_defs, int T, enum T_unit as_unit, int val_if_not_present); -void T_defs_reset(struct T_def *T_defs); -struct T_def *T_def_get_entry(struct T_def *T_defs, int T); - -void T_defs_vty_init(struct T_def *T_defs, int cfg_parent_node); -void T_defs_vty_write(struct vty *vty, const char *indent); -struct T_def *parse_T_arg(struct vty *vty, const char *T_str); - -struct state_timeout { - int T; - bool keep_timer; -}; - -const struct state_timeout *get_state_timeout(uint32_t state, - const struct state_timeout *timeouts_array); - -#define fsm_inst_state_chg_T(fi, state, timeouts_array, T_defs, default_timeout) \ - _fsm_inst_state_chg_T(fi, state, timeouts_array, T_defs, default_timeout, \ - __FILE__, __LINE__) -int _fsm_inst_state_chg_T(struct osmo_fsm_inst *fi, uint32_t state, - const struct state_timeout *timeouts_array, - const struct T_def *T_defs, int default_timeout, - const char *file, int line); diff --git a/include/osmocom/bsc/mgw_endpoint_fsm.h b/include/osmocom/bsc/mgw_endpoint_fsm.h index e264a3c..f86a7cd 100644 --- a/include/osmocom/bsc/mgw_endpoint_fsm.h +++ b/include/osmocom/bsc/mgw_endpoint_fsm.h @@ -24,9 +24,9 @@ struct mgw_endpoint; struct mgwep_ci; -struct T_def; +struct osmo_tdef; -void mgw_endpoint_fsm_init(struct T_def *T_defs); +void mgw_endpoint_fsm_init(struct osmo_tdef *T_defs); struct mgw_endpoint *mgw_endpoint_alloc(struct osmo_fsm_inst *parent, uint32_t parent_term_event, struct mgcp_client *mgcp_client, diff --git a/src/ipaccess/Makefile.am b/src/ipaccess/Makefile.am index 3578a40..145ea39 100644 --- a/src/ipaccess/Makefile.am +++ b/src/ipaccess/Makefile.am @@ -50,7 +50,6 @@ $(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts.o \ $(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(OSMO_LIBS) \ $(NULL) @@ -62,6 +61,5 @@ $(NULL) ipaccess_proxy_LDADD = \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(OSMO_LIBS) \ $(NULL) diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index 364228d..11803da 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -57,8 +57,6 @@ gsm_04_08_rr.c \ gsm_04_80_utils.c \ gsm_data.c \ - gsm_timers.c \ - gsm_timers_vty.c \ handover_cfg.c \ handover_decision.c \ handover_decision_2.c \ diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c index 9715dfc..fda273d 100644 --- a/src/osmo-bsc/abis_om2000.c +++ b/src/osmo-bsc/abis_om2000.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include @@ -1381,7 +1380,7 @@ break; case GSM_PCHAN_CCCH_SDCCH4: msgb_tv_put(msg, OM2K_DEI_T3105, - T_def_get(ts->trx->bts->network->T_defs, 3105, T_MS, -1) / 10); + osmo_tdef_get(ts->trx->bts->network->T_defs, 3105, OSMO_TDEF_MS, -1) / 10); msgb_tv_put(msg, OM2K_DEI_NY1, 35); msgb_tv_put(msg, OM2K_DEI_BA_PA_MFRMS, 0x06); msgb_tv_put(msg, OM2K_DEI_CBCH_INDICATOR, 0); @@ -1396,7 +1395,7 @@ break; case GSM_PCHAN_SDCCH8_SACCH8C: msgb_tv_put(msg, OM2K_DEI_T3105, - T_def_get(ts->trx->bts->network->T_defs, 3105, T_MS, -1) / 10); + osmo_tdef_get(ts->trx->bts->network->T_defs, 3105, OSMO_TDEF_MS, -1) / 10); msgb_tv_put(msg, OM2K_DEI_NY1, 35); msgb_tv_put(msg, OM2K_DEI_CBCH_INDICATOR, 0); msgb_tv_put(msg, OM2K_DEI_TSC, gsm_ts_tsc(ts)); @@ -1407,7 +1406,7 @@ break; default: msgb_tv_put(msg, OM2K_DEI_T3105, - T_def_get(ts->trx->bts->network->T_defs, 3105, T_MS, -1) / 10); + osmo_tdef_get(ts->trx->bts->network->T_defs, 3105, OSMO_TDEF_MS, -1) / 10); msgb_tv_put(msg, OM2K_DEI_NY1, 35); msgb_tv_put(msg, OM2K_DEI_TSC, gsm_ts_tsc(ts)); /* Disable RF RESOURCE INDICATION on idle channels */ diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index fd6dbdb..0117435 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include @@ -1291,7 +1291,7 @@ uint8_t wait_ind; wait_ind = bts->T3122; if (!wait_ind) - wait_ind = T_def_get(bts->network->T_defs, 3122, T_S, -1); + wait_ind = osmo_tdef_get(bts->network->T_defs, 3122, OSMO_TDEF_S, -1); if (!wait_ind) wait_ind = GSM_T3122_DEFAULT; /* The BTS will gather multiple CHAN RQD and reject up to 4 MS at the same time. */ diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index 9c0c400..520498f 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -20,13 +20,13 @@ * */ +#include #include #include #include #include -#include #include #include #include @@ -48,7 +48,7 @@ return fi->priv; } -static const struct state_timeout assignment_fsm_timeouts[32] = { +static const struct osmo_tdef_state_timeout assignment_fsm_timeouts[32] = { [ASSIGNMENT_ST_WAIT_LCHAN_ACTIVE] = { .T=10 }, [ASSIGNMENT_ST_WAIT_RR_ASS_COMPLETE] = { .keep_timer=true }, [ASSIGNMENT_ST_WAIT_LCHAN_ESTABLISHED] = { .keep_timer=true }, @@ -59,10 +59,10 @@ * The actual timeout value is in turn obtained from network->T_defs. * Assumes local variable fi exists. */ #define assignment_fsm_state_chg(state) \ - fsm_inst_state_chg_T(fi, state, \ - assignment_fsm_timeouts, \ - ((struct gsm_subscriber_connection*)(fi->priv))->network->T_defs, \ - 5) + osmo_tdef_fsm_inst_state_chg(fi, state, \ + assignment_fsm_timeouts, \ + ((struct gsm_subscriber_connection*)(fi->priv))->network->T_defs, \ + 5) /* Log failure and transition to ASSIGNMENT_ST_FAILURE, which triggers the appropriate actions. */ #define assignment_fail(cause, fmt, args...) do { \ diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 1cc0c78..4466404 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -85,7 +85,7 @@ {} }; -struct state_timeout conn_fsm_timeouts[32] = { +struct osmo_tdef_state_timeout conn_fsm_timeouts[32] = { [ST_WAIT_CC] = { .T = 993210 }, [ST_CLEARING] = { .T = 999 }, }; @@ -94,10 +94,10 @@ * The actual timeout value is in turn obtained from network->T_defs. * Assumes local variable 'conn' exists. */ #define conn_fsm_state_chg(state) \ - fsm_inst_state_chg_T(conn->fi, state, \ - conn_fsm_timeouts, \ - conn->network->T_defs, \ - -1) + osmo_tdef_fsm_inst_state_chg(conn->fi, state, \ + conn_fsm_timeouts, \ + conn->network->T_defs, \ + -1) /* forward MT DTAP from BSSAP side to RSL side */ static inline void submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg) diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 767d565..3a6ddd4 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -66,11 +67,9 @@ #include #include #include -#include #include #include #include -#include #include #include @@ -1046,7 +1045,7 @@ ho_vty_write_net(vty, gsmnet); - T_defs_vty_write(vty, " "); + osmo_tdef_vty_write(vty, gsmnet->T_defs, " "); if (!gsmnet->dyn_ts_allow_tch_f) vty_out(vty, " dyn_ts_allow_tch_f 0%s", VTY_NEWLINE); @@ -1060,7 +1059,7 @@ gsmnet->tz.hr, gsmnet->tz.mn, VTY_NEWLINE); } - /* writing T3212 from the common T_defs_vty_write() instead. */ + osmo_tdef_vty_write(vty, gsmnet->T_defs, " timer "); { uint16_t meas_port; @@ -4005,10 +4004,11 @@ "Calculate T3113 dynamically based on channel config and load\n" TNUM_STR) { - struct T_def *d; + struct osmo_tdef *d; struct gsm_bts *bts = vty->index; + struct gsm_network *gsmnet = gsmnet_from_vty(vty); - d = parse_T_arg(vty, argv[0]); + d = osmo_tdef_vty_parse_T_arg(vty, gsmnet->T_defs, argv[0]); if (!d) return CMD_WARNING; @@ -4030,10 +4030,11 @@ "Set given timer to non-dynamic and use the default or user provided fixed value\n" TNUM_STR) { - struct T_def *d; + struct osmo_tdef *d; struct gsm_bts *bts = vty->index; + struct gsm_network *gsmnet = gsmnet_from_vty(vty); - d = parse_T_arg(vty, argv[0]); + d = osmo_tdef_vty_parse_T_arg(vty, gsmnet->T_defs, argv[0]); if (!d) return CMD_WARNING; @@ -5042,11 +5043,11 @@ "Periodic Location Updating Interval in Minutes\n") { struct gsm_network *net = vty->index; - struct T_def *d = T_def_get_entry(net->T_defs, 3212); + struct osmo_tdef *d = osmo_tdef_get_entry(net->T_defs, 3212); OSMO_ASSERT(d); d->val = atoi(argv[0]) / 6; - vty_out(vty, "T%d = %u %s (%s)%s", d->T, d->val, "* 6min", d->desc, VTY_NEWLINE); + vty_out(vty, "T%d = %lu %s (%s)%s", d->T, d->val, "* 6min", d->desc, VTY_NEWLINE); return CMD_SUCCESS; } @@ -5058,11 +5059,11 @@ "Periodic Location Updating Interval\n") { struct gsm_network *net = vty->index; - struct T_def *d = T_def_get_entry(net->T_defs, 3212); + struct osmo_tdef *d = osmo_tdef_get_entry(net->T_defs, 3212); OSMO_ASSERT(d); d->val = 0; - vty_out(vty, "T%d = %u %s (%s)%s", d->T, d->val, "* 6min", d->desc, VTY_NEWLINE); + vty_out(vty, "T%d = %lu %s (%s)%s", d->T, d->val, "* 6min", d->desc, VTY_NEWLINE); return CMD_SUCCESS; } @@ -5092,6 +5093,28 @@ return CMD_SUCCESS; } +DEFUN(show_timer, show_timer_cmd, + "show timer " OSMO_TDEF_VTY_ARG_T_OPTIONAL, + SHOW_STR "Show timers\n" + OSMO_TDEF_VTY_DOC_T) +{ + struct gsm_network *net = gsmnet_from_vty(vty); + const char *T_arg = argc > 0 ? argv[0] : NULL; + return osmo_tdef_vty_show_cmd(vty, net->T_defs, T_arg, NULL); +} + +DEFUN(cfg_net_timer, cfg_net_timer_cmd, + "timer " OSMO_TDEF_VTY_ARG_SET_OPTIONAL, + "Configure or show timers\n" + OSMO_TDEF_VTY_DOC_SET) +{ + struct gsm_network *net = gsmnet_from_vty(vty); + /* If any arguments are missing, redirect to 'show' */ + if (argc < 2) + return show_timer(self, vty, argc, argv); + return osmo_tdef_vty_set_cmd(vty, net->T_defs, argv); +} + extern int bsc_vty_init_extra(void); int bsc_vty_init(struct gsm_network *network) @@ -5136,6 +5159,7 @@ install_element(GSMNET_NODE, &cfg_net_dyn_ts_allow_tch_f_cmd); install_element(GSMNET_NODE, &cfg_net_meas_feed_dest_cmd); install_element(GSMNET_NODE, &cfg_net_meas_feed_scenario_cmd); + install_element(GSMNET_NODE, &cfg_net_timer_cmd); install_element_ve(&bsc_show_net_cmd); install_element_ve(&show_bts_cmd); @@ -5146,6 +5170,7 @@ install_element_ve(&show_lchan_cmd); install_element_ve(&show_lchan_summary_cmd); install_element_ve(&show_lchan_summary_all_cmd); + install_element_ve(&show_timer_cmd); install_element_ve(&show_subscr_conn_cmd); @@ -5159,8 +5184,6 @@ logging_vty_add_cmds(NULL); osmo_talloc_vty_add_cmds(); - T_defs_vty_init(network->T_defs, GSMNET_NODE); - install_element(GSMNET_NODE, &cfg_net_neci_cmd); install_element(GSMNET_NODE, &cfg_net_dtx_cmd); install_element(GSMNET_NODE, &cfg_net_pag_any_tch_cmd); diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c index be40410..8a370da 100644 --- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c +++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c @@ -23,7 +23,6 @@ #include #include #include -#include struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts) @@ -82,7 +81,7 @@ msgb_tv_fixed_put(msgb, NM_ATT_LDAVG_SLOTS, 2, buf); /* 10 milliseconds */ - msgb_tv_put(msgb, NM_ATT_BTS_AIR_TIMER, T_def_get(bts->network->T_defs, 3105, T_MS, -1)); + msgb_tv_put(msgb, NM_ATT_BTS_AIR_TIMER, osmo_tdef_get(bts->network->T_defs, 3105, OSMO_TDEF_MS, -1)); /* 10 retransmissions of physical config */ msgb_tv_put(msgb, NM_ATT_NY1, 10); diff --git a/src/osmo-bsc/bts_siemens_bs11.c b/src/osmo-bsc/bts_siemens_bs11.c index 2cb676c..b1688f3 100644 --- a/src/osmo-bsc/bts_siemens_bs11.c +++ b/src/osmo-bsc/bts_siemens_bs11.c @@ -20,6 +20,8 @@ */ +#include + #include #include @@ -27,7 +29,6 @@ #include #include #include -#include #include static int bts_model_bs11_start(struct gsm_network *net); @@ -360,7 +361,7 @@ uint8_t arfcn_high = (bts->c0->arfcn >> 8) & 0x0f; /* T3105 attribute in units of 10ms */ - bs11_attr_bts[2] = T_def_get(bts->network->T_defs, 3105, T_MS, -1) / 10; + bs11_attr_bts[2] = osmo_tdef_get(bts->network->T_defs, 3105, OSMO_TDEF_MS, -1) / 10; /* patch ARFCN into BTS Attributes */ bs11_attr_bts[69] &= 0xf0; diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index 45c433c..88690a7 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -872,7 +871,7 @@ bts->si_common.chan_desc.att = 1; /* attachment required */ bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ - bts->si_common.chan_desc.t3212 = T_def_get(net->T_defs, 3212, T_CUSTOM, -1); + bts->si_common.chan_desc.t3212 = osmo_tdef_get(net->T_defs, 3212, OSMO_TDEF_CUSTOM, -1); gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */ INIT_LLIST_HEAD(&bts->abis_queue); diff --git a/src/osmo-bsc/gsm_timers.c b/src/osmo-bsc/gsm_timers.c deleted file mode 100644 index fc3ec24..0000000 --- a/src/osmo-bsc/gsm_timers.c +++ /dev/null @@ -1,207 +0,0 @@ -/* Implementation to define Tnnn timers globally and use for FSM state changes. */ -/* (C) 2018 by sysmocom - s.f.m.c. GmbH - * - * Author: Neels Hofmeyr - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include - -#include - -/* a = return_val * b. Return 0 if factor is below 1. */ -static int T_factor(enum T_unit a, enum T_unit b) -{ - if (b == a - || b == T_CUSTOM || a == T_CUSTOM) - return 1; - - switch (b) { - case T_MS: - switch (a) { - case T_S: - return 1000; - case T_M: - return 60*1000; - default: - return 0; - } - case T_S: - switch (a) { - case T_M: - return 60; - default: - return 0; - } - default: - return 0; - } -} - -static int T_round(int val, enum T_unit from_unit, enum T_unit to_unit) -{ - int f; - if (!val) - return 0; - - f = T_factor(from_unit, to_unit); - if (f < 1) { - f = T_factor(to_unit, from_unit); - return (val / f) + (val % f? 1 : 0); - } - return val * f; -} - -/* Return the value of a T timer from a list of T_defs. - * Any value is rounded up to match as_unit: 1100 ms as T_S becomes 2 seconds, as T_M becomes one minute. - * If no such timer is defined, return the default value passed, or abort the program if default < 0. - * - * Usage examples: - * - * - Initialization: - * - * struct T_def global_T_defs[] = { - * { .T=7, .default_val=50, .desc="Water Boiling Timeout" }, // default is .unit=T_S == 0 - * { .T=8, .default_val=300, .desc="Tea brewing" }, - * { .T=9, .default_val=5, .unit=T_M, .desc="Let tea cool down before drinking" }, - * { .T=10, .default_val=20, .unit=T_M, .desc="Forgot to drink tea while it's warm" }, - * {} // <-- important! last entry shall be zero - * }; - * T_defs_reset(global_T_defs); // make all values the default - * T_defs_vty_init(global_T_defs, CONFIG_NODE); - * - * val = T_def_get(global_T_defs, 7, T_S, -1); // -> 50 - * sleep(val); - * - * val = T_def_get(global_T_defs, 7, T_M, -1); // 50 seconds becomes 1 minute -> 1 - * sleep_minutes(val); - * - * val = T_def_get(global_T_defs, 99, T_S, -1); // not defined, program aborts! - * - * val = T_def_get(global_T_defs, 99, T_S, 3); // not defined, returns 3 - */ -int T_def_get(const struct T_def *T_defs, int T, enum T_unit as_unit, int val_if_not_present) -{ - const struct T_def *d = T_def_get_entry((struct T_def*)T_defs, T); - if (!d) { - OSMO_ASSERT(val_if_not_present >= 0); - return val_if_not_present; - } - return T_round(d->val, d->unit, as_unit); -} - -/* Set all T_def values to the default_val. */ -void T_defs_reset(struct T_def *T_defs) -{ - struct T_def *d; - for_each_T_def(d, T_defs) - d->val = d->default_val; -} - -/* Return a pointer to a T_def from an array, or NULL. */ -struct T_def *T_def_get_entry(struct T_def *T_defs, int T) -{ - struct T_def *d; - for_each_T_def(d, T_defs) { - if (d->T == T) - return d; - } - return NULL; -} - -/* Return a state_timeout entry from an array, or return NULL if the entry is zero. - * - * The timeouts_array shall contain exactly 32 elements, which corresponds to the number of states - * allowed by osmo_fsm_*. Lookup is by array index. - * - * For example: - * struct state_timeout my_fsm_timeouts[32] = { - * [MY_FSM_STATE_3] = { .T = 423 }, - * [MY_FSM_STATE_7] = { .T = 235 }, - * [MY_FSM_STATE_8] = { .keep_timer = true }, - * // any state that is omitted will remain zero == no timeout - * }; - * get_state_timeout(MY_FSM_STATE_0, &my_fsm_timeouts) -> NULL, - * get_state_timeout(MY_FSM_STATE_7, &my_fsm_timeouts) -> { .T = 235 } - * - * The intention is then to obtain the timer like T_def_get(global_T_defs, T=235); see also - * fsm_inst_state_chg_T() below. - */ -const struct state_timeout *get_state_timeout(uint32_t state, - const struct state_timeout *timeouts_array) -{ - const struct state_timeout *t; - OSMO_ASSERT(state < 32); - t = &timeouts_array[state]; - if (!t->keep_timer && !t->T) - return NULL; - return t; -} - -/* Call osmo_fsm_inst_state_chg() or osmo_fsm_inst_state_chg_keep_timer(), depending on the T value - * defined for this state in the timeouts_array, and obtaining the actual timeout value from T_defs. - * A T timer configured in sub-second precision is rounded up to the next full second. - * - * See get_state_timeout() and T_def_get(). - * - * Should a T number be defined in timeouts_array that is not defined in T_defs, use default_timeout. - * This is best used by wrapping this function call in a macro suitable for a specific FSM - * implementation, which can become as short as: my_fsm_state_chg(fi, NEXT_STATE): - * - * #define my_fsm_state_chg(fi, NEXT_STATE) \ - * fsm_inst_state_chg_T(fi, NEXT_STATE, my_fsm_timeouts, global_T_defs, 5) - * - * my_fsm_state_chg(fi, MY_FSM_STATE_1); - * // -> No timeout configured, will enter state without timeout. - * - * my_fsm_state_chg(fi, MY_FSM_STATE_3); - * // T423 configured for this state, will look up T423 in T_defs, or use 5 seconds if unset. - * - * my_fsm_state_chg(fi, MY_FSM_STATE_8); - * // keep_timer configured for this state, will invoke osmo_fsm_inst_state_chg_keep_timer(). - * - */ -int _fsm_inst_state_chg_T(struct osmo_fsm_inst *fi, uint32_t state, - const struct state_timeout *timeouts_array, - const struct T_def *T_defs, int default_timeout, - const char *file, int line) -{ - const struct state_timeout *t = get_state_timeout(state, timeouts_array); - int val; - - /* No timeout defined for this state? */ - if (!t) - return _osmo_fsm_inst_state_chg(fi, state, 0, 0, file, line); - - if (t->keep_timer) { - int rc = _osmo_fsm_inst_state_chg_keep_timer(fi, state, file, line); - if (t->T && !rc) - fi->T = t->T; - return rc; - } - - val = T_def_get(T_defs, t->T, T_S, default_timeout); - return _osmo_fsm_inst_state_chg(fi, state, val, t->T, file, line); -} - -const struct value_string T_unit_names[] = { - { T_S, "s" }, - { T_MS, "ms" }, - { T_CUSTOM, "(custom)" }, - { 0, NULL } -}; diff --git a/src/osmo-bsc/gsm_timers_vty.c b/src/osmo-bsc/gsm_timers_vty.c deleted file mode 100644 index e744dfa..0000000 --- a/src/osmo-bsc/gsm_timers_vty.c +++ /dev/null @@ -1,118 +0,0 @@ -/* Implementation to configure Tnnn timers in VTY */ -/* (C) 2018 by sysmocom - s.f.m.c. GmbH - * - * Author: Neels Hofmeyr - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include - -#include -#include - -#include - -/* Global singleton list used for the VTY configuration. See T_defs_vty_init(). */ -static struct T_def *g_vty_T_defs = NULL; - -/* Parse an argument like "T1234", "t1234" or "1234" and return the corresponding T_def entry from - * g_vty_T_defs, if any. */ -struct T_def *parse_T_arg(struct vty *vty, const char *T_str) -{ - int T; - struct T_def *d; - - if (T_str[0] == 't' || T_str[0] == 'T') - T_str++; - T = atoi(T_str); - - d = T_def_get_entry(g_vty_T_defs, T); - if (!d) - vty_out(vty, "No such timer: T%d%s", T, VTY_NEWLINE); - return d; -} - -/* Installed in the VTY on T_defs_vty_init(). */ -DEFUN(cfg_timer, cfg_timer_cmd, - "timer TNNNN (default|<1-65535>)", - "Configure GSM Timers\n" - "T-number, optionally preceded by 't' or 'T'." - "See also 'show timer' for a list of available timers.\n" - "Set to default timer value\n" "Timer value\n") -{ - const char *val_str = argv[1]; - struct T_def *d; - - d = parse_T_arg(vty, argv[0]); - if (!d) - return CMD_WARNING; - - if (!strcmp(val_str, "default")) - d->val = d->default_val; - else - d->val = atoi(val_str); - vty_out(vty, "T%d = %u %s (%s)%s", d->T, d->val, T_unit_name(d->unit), d->desc, VTY_NEWLINE); - return CMD_SUCCESS; -} - -/* Print a T_def to the VTY. */ -static void show_one_timer(struct vty *vty, struct T_def *d) -{ - vty_out(vty, "T%d = %u %s (default = %u %s) \t%s%s", - d->T, d->val, T_unit_name(d->unit), - d->default_val, T_unit_name(d->unit), d->desc, VTY_NEWLINE); -} - -/* Installed in the VTY on T_defs_vty_init(). */ -DEFUN(show_timer, show_timer_cmd, - "show timer [TNNNN]", - SHOW_STR "GSM Timers\n" - "Specific timer to show, or all timers if omitted.\n") -{ - struct T_def *d; - - if (argc) { - d = parse_T_arg(vty, argv[0]); - if (!d) - return CMD_WARNING; - show_one_timer(vty, d); - return CMD_SUCCESS; - } - - for_each_T_def(d, g_vty_T_defs) - show_one_timer(vty, d); - return CMD_SUCCESS; -} - -/* Install GSM timer configuration commands in the VTY. */ -void T_defs_vty_init(struct T_def *T_defs, int cfg_parent_node) -{ - g_vty_T_defs = T_defs; - install_element_ve(&show_timer_cmd); - install_element(cfg_parent_node, &cfg_timer_cmd); -} - -/* Write GSM timer configuration to the vty. */ -void T_defs_vty_write(struct vty *vty, const char *indent) -{ - struct T_def *d; - for_each_T_def(d, g_vty_T_defs) { - if (d->val != d->default_val) - vty_out(vty, "%stimer t%d %u%s", indent, d->T, d->val, VTY_NEWLINE); - } -} diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 421c32e..fe3b8b2 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -159,7 +159,7 @@ return fi->priv; } -static const struct state_timeout ho_fsm_timeouts[32] = { +static const struct osmo_tdef_state_timeout ho_fsm_timeouts[32] = { [HO_ST_WAIT_LCHAN_ACTIVE] = { .T = 23042 }, [HO_ST_WAIT_RR_HO_DETECT] = { .T = 23042 }, [HO_ST_WAIT_RR_HO_COMPLETE] = { .T = 23042 }, @@ -173,10 +173,10 @@ * The actual timeout value is in turn obtained from network->T_defs. * Assumes local variable fi exists. */ #define ho_fsm_state_chg(state) \ - fsm_inst_state_chg_T(fi, state, \ - ho_fsm_timeouts, \ - ((struct gsm_subscriber_connection*)(fi->priv))->network->T_defs, \ - 5) + osmo_tdef_fsm_inst_state_chg(fi, state, \ + ho_fsm_timeouts, \ + ((struct gsm_subscriber_connection*)(fi->priv))->network->T_defs, \ + 5) /* Log failure and transition to HO_ST_FAILURE, which triggers the appropriate actions. */ #define ho_fail(result, fmt, args...) do { \ diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 7af2ea0..33abb1f 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -207,7 +207,7 @@ } } -struct state_timeout lchan_fsm_timeouts[32] = { +struct osmo_tdef_state_timeout lchan_fsm_timeouts[32] = { [LCHAN_ST_WAIT_TS_READY] = { .T=23001 }, [LCHAN_ST_WAIT_ACTIV_ACK] = { .T=23002 }, [LCHAN_ST_WAIT_RLL_RTP_ESTABLISH] = { .T=3101 }, @@ -221,10 +221,10 @@ * The actual timeout value is in turn obtained from network->T_defs. * Assumes local variable fi exists. */ #define lchan_fsm_state_chg(state) \ - fsm_inst_state_chg_T(fi, state, \ - lchan_fsm_timeouts, \ - ((struct gsm_lchan*)(fi->priv))->ts->trx->bts->network->T_defs, \ - 5) + osmo_tdef_fsm_inst_state_chg(fi, state, \ + lchan_fsm_timeouts, \ + ((struct gsm_lchan*)(fi->priv))->ts->trx->bts->network->T_defs, \ + 5) /* Set a failure message, trigger the common actions to take on failure, transition to a state to * continue with (using state timeouts from lchan_fsm_timeouts[]). Assumes local variable fi exists. */ diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c index 2d15bf2..5e2d758 100644 --- a/src/osmo-bsc/lchan_rtp_fsm.c +++ b/src/osmo-bsc/lchan_rtp_fsm.c @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -41,7 +40,7 @@ return fi->priv; } -struct state_timeout lchan_rtp_fsm_timeouts[32] = { +struct osmo_tdef_state_timeout lchan_rtp_fsm_timeouts[32] = { [LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE] = { .T=23004 }, [LCHAN_RTP_ST_WAIT_IPACC_CRCX_ACK] = { .T=23005 }, [LCHAN_RTP_ST_WAIT_IPACC_MDCX_ACK] = { .T=23006 }, @@ -52,10 +51,10 @@ * The actual timeout value is in turn obtained from network->T_defs. * Assumes local variable fi exists. */ #define lchan_rtp_fsm_state_chg(state) \ - fsm_inst_state_chg_T(fi, state, \ - lchan_rtp_fsm_timeouts, \ - ((struct gsm_lchan*)(fi->priv))->ts->trx->bts->network->T_defs, \ - 5) + osmo_tdef_fsm_inst_state_chg(fi, state, \ + lchan_rtp_fsm_timeouts, \ + ((struct gsm_lchan*)(fi->priv))->ts->trx->bts->network->T_defs, \ + 5) /* Set a failure message, trigger the common actions to take on failure, transition to a state to * continue with (using state timeouts from lchan_rtp_fsm_timeouts[]). Assumes local variable fi exists. */ diff --git a/src/osmo-bsc/mgw_endpoint_fsm.c b/src/osmo-bsc/mgw_endpoint_fsm.c index 5462914..fa65166 100644 --- a/src/osmo-bsc/mgw_endpoint_fsm.c +++ b/src/osmo-bsc/mgw_endpoint_fsm.c @@ -29,7 +29,6 @@ #include #include -#include #include #include @@ -196,9 +195,9 @@ } } -static struct T_def *g_T_defs = NULL; +static struct osmo_tdef *g_T_defs = NULL; -void mgw_endpoint_fsm_init(struct T_def *T_defs) +void mgw_endpoint_fsm_init(struct osmo_tdef *T_defs) { g_T_defs = T_defs; OSMO_ASSERT(osmo_fsm_register(&mgwep_fsm) == 0); @@ -380,7 +379,7 @@ } -static const struct state_timeout mgwep_fsm_timeouts[32] = { +static const struct osmo_tdef_state_timeout mgwep_fsm_timeouts[32] = { [MGWEP_ST_WAIT_MGW_RESPONSE] = { .T=23042 }, }; @@ -388,7 +387,7 @@ * The actual timeout value is in turn obtained from g_T_defs. * Assumes local variable fi exists. */ #define mgwep_fsm_state_chg(state) \ - fsm_inst_state_chg_T(fi, state, mgwep_fsm_timeouts, g_T_defs, 5) + osmo_tdef_fsm_inst_state_chg(fi, state, mgwep_fsm_timeouts, g_T_defs, 5) void mgw_endpoint_ci_request(struct mgwep_ci *ci, enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info, diff --git a/src/osmo-bsc/net_init.c b/src/osmo-bsc/net_init.c index b4ff489..c2a38bc 100644 --- a/src/osmo-bsc/net_init.c +++ b/src/osmo-bsc/net_init.c @@ -17,21 +17,22 @@ * */ +#include + #include #include #include #include #include -#include -static struct T_def gsm_network_T_defs[] = { +static struct osmo_tdef gsm_network_T_defs[] = { { .T=7, .default_val=10, .desc="inter-BSC Handover MO, HO Required to HO Command" }, { .T=8, .default_val=10, .desc="inter-BSC Handover MO, HO Command to final Clear" }, { .T=10, .default_val=6, .desc="RR Assignment" }, { .T=101, .default_val=10, .desc="inter-BSC Handover MT, HO Request to HO Accept" }, { .T=3101, .default_val=3, .desc="RR Immediate Assignment" }, { .T=3103, .default_val=5, .desc="Handover" }, - { .T=3105, .default_val=100, .unit=T_MS, .desc="Physical Information" }, + { .T=3105, .default_val=100, .unit=OSMO_TDEF_MS, .desc="Physical Information" }, { .T=3107, .default_val=5, .desc="(unused)" }, { .T=3109, .default_val=5, .desc="RSL SACCH deactivation" }, { .T=3111, .default_val=2, .desc="Wait time before RSL RF Channel Release" }, @@ -42,7 +43,7 @@ { .T=3119, .default_val=10, .desc="(unused)" }, { .T=3122, .default_val=GSM_T3122_DEFAULT, .desc="Wait time after RR Immediate Assignment Reject" }, { .T=3141, .default_val=10, .desc="(unused)" }, - { .T=3212, .default_val=5, .unit=T_CUSTOM, + { .T=3212, .default_val=5, .unit=OSMO_TDEF_CUSTOM, .desc="Periodic Location Update timer, sent to MS (1 = 6 minutes)" }, { .T=993210, .default_val=20, .desc="After L3 Complete, wait for MSC to confirm" }, { .T=999, .default_val=60, .desc="After Clear Request, wait for MSC to Clear Command (sanity)" }, @@ -78,7 +79,7 @@ net->num_bts = 0; net->T_defs = gsm_network_T_defs; - T_defs_reset(net->T_defs); + osmo_tdefs_reset(net->T_defs); return net; } diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index 066db1c..f1fd2ad 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -51,7 +52,6 @@ #include #include #include -#include #include void *tall_paging_ctx = NULL; @@ -294,11 +294,11 @@ static unsigned int calculate_timer_3113(struct gsm_bts *bts) { unsigned int to_us, to; - struct T_def *d = T_def_get_entry(bts->network->T_defs, 3113); + struct osmo_tdef *d = osmo_tdef_get_entry(bts->network->T_defs, 3113); /* Note: d should always contain a valid pointer since all timers, * including 3113 are statically pre-defined in - * struct T_def gsm_network_T_defs. */ + * struct osmo_tdef gsm_network_T_defs. */ OSMO_ASSERT(d); if (!bts->T3113_dynamic) diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 24cd230..e585e0d 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -51,7 +51,6 @@ $(top_builddir)/src/osmo-bsc/bts_siemens_bs11.o \ $(top_builddir)/src/osmo-bsc/e1_config.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -119,7 +118,6 @@ meas_json_LDADD = \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOABIS_LIBS) \ diff --git a/tests/abis/Makefile.am b/tests/abis/Makefile.am index 4fc3605..60054d9 100644 --- a/tests/abis/Makefile.am +++ b/tests/abis/Makefile.am @@ -27,7 +27,6 @@ abis_test_LDADD = \ $(top_builddir)/src/osmo-bsc/abis_nm.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOABIS_LIBS) \ diff --git a/tests/bsc/Makefile.am b/tests/bsc/Makefile.am index c8ad0e4..b301f9e 100644 --- a/tests/bsc/Makefile.am +++ b/tests/bsc/Makefile.am @@ -38,7 +38,6 @@ $(top_builddir)/src/osmo-bsc/osmo_bsc_filter.o \ $(top_builddir)/src/osmo-bsc/bsc_subscriber.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/handover_cfg.o \ $(top_builddir)/src/osmo-bsc/handover_logic.o \ $(top_builddir)/src/osmo-bsc/neighbor_ident.o \ diff --git a/tests/gsm0408/Makefile.am b/tests/gsm0408/Makefile.am index b207f8b..aff7c7d 100644 --- a/tests/gsm0408/Makefile.am +++ b/tests/gsm0408/Makefile.am @@ -26,7 +26,6 @@ $(top_builddir)/src/osmo-bsc/gsm_04_08_rr.o \ $(top_builddir)/src/osmo-bsc/arfcn_range_encode.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(top_builddir)/src/osmo-bsc/rest_octets.o \ $(top_builddir)/src/osmo-bsc/system_information.o \ diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 5e4440c..40ecf54 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -55,7 +55,6 @@ $(top_builddir)/src/osmo-bsc/gsm_04_08_rr.o \ $(top_builddir)/src/osmo-bsc/gsm_04_80_utils.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/handover_cfg.o \ $(top_builddir)/src/osmo-bsc/handover_decision.o \ $(top_builddir)/src/osmo-bsc/handover_decision_2.o \ diff --git a/tests/nanobts_omlattr/Makefile.am b/tests/nanobts_omlattr/Makefile.am index 312cf7d..aa7045e 100644 --- a/tests/nanobts_omlattr/Makefile.am +++ b/tests/nanobts_omlattr/Makefile.am @@ -26,7 +26,6 @@ $(top_builddir)/src/osmo-bsc/abis_nm.o \ $(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOABIS_LIBS) \ diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c index 38729ac..65eb055 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -21,7 +21,6 @@ #include #include -#include #include #include @@ -192,9 +191,9 @@ .num_cat = ARRAY_SIZE(log_categories), }; -static struct T_def gsm_network_T_defs[] = { - { .T=3105, .default_val=100, .val=13, .unit=T_MS, .desc="Physical Information" }, - { .T=3212, .default_val=5, .unit=T_CUSTOM, +static struct osmo_tdef gsm_network_T_defs[] = { + { .T=3105, .default_val=100, .val=13, .unit=OSMO_TDEF_MS, .desc="Physical Information" }, + { .T=3212, .default_val=5, .unit=OSMO_TDEF_CUSTOM, .desc="Periodic Location Update timer, sent to MS (1 = 6 minutes)" }, {} }; -- To view, visit https://gerrit.osmocom.org/13795 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I66674a5d8403d820038762888c846bae10ceac58 Gerrit-Change-Number: 13795 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 19:25:01 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 26 Apr 2019 19:25:01 +0000 Subject: Change in osmo-bsc[master]: move mgw endpoint FSM to osmo-mgw.git Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13796 Change subject: move mgw endpoint FSM to osmo-mgw.git ...................................................................... move mgw endpoint FSM to osmo-mgw.git osmo-mgw.git also includes fixes of the MGW endpoint FSM, for example I92a9944acc96398acd6649f9c3c5badec5dd6dcc. Depends: I9a3effd38e72841529df6c135c077116981dea36 (osmo-mgw) Change-Id: I03e6b48d9b0a5370310d5f56809259ff7909cf9d --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/bsc_subscr_conn_fsm.h M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/lchan_rtp_fsm.h D include/osmocom/bsc/mgw_endpoint_fsm.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/codec_pref.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c M src/osmo-bsc/lchan_rtp_fsm.c D src/osmo-bsc/mgw_endpoint_fsm.c M src/osmo-bsc/net_init.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_lcls.c M src/osmo-bsc/osmo_bsc_main.c M tests/handover/Makefile.am M tests/handover/handover_test.c 20 files changed, 189 insertions(+), 939 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/96/13796/1 diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 21e53d7..89323c0 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -33,7 +33,6 @@ meas_feed.h \ meas_rep.h \ misdn.h \ - mgw_endpoint_fsm.h \ neighbor_ident.h \ network_listen.h \ openbscdefines.h \ diff --git a/include/osmocom/bsc/bsc_subscr_conn_fsm.h b/include/osmocom/bsc/bsc_subscr_conn_fsm.h index f5ed7bd..5475272 100644 --- a/include/osmocom/bsc/bsc_subscr_conn_fsm.h +++ b/include/osmocom/bsc/bsc_subscr_conn_fsm.h @@ -43,7 +43,7 @@ struct gsm_subscriber_connection; struct gsm_network; struct msgb; -struct mgwep_ci; +struct osmo_mgcpc_ep_ci; struct assignment_request; struct gsm_lchan; @@ -57,15 +57,15 @@ struct msgb *msg, int link_id, int allow_sacch); int gscon_sigtran_send(struct gsm_subscriber_connection *conn, struct msgb *msg); -struct mgw_endpoint *gscon_ensure_mgw_endpoint(struct gsm_subscriber_connection *conn, - uint16_t msc_assigned_cic); +struct osmo_mgcpc_ep *gscon_ensure_mgw_endpoint(struct gsm_subscriber_connection *conn, + uint16_t msc_assigned_cic); bool gscon_connect_mgw_to_msc(struct gsm_subscriber_connection *conn, struct gsm_lchan *for_lchan, const char *addr, uint16_t port, struct osmo_fsm_inst *notify, uint32_t event_success, uint32_t event_failure, void *notify_data, - struct mgwep_ci **created_ci); + struct osmo_mgcpc_ep_ci **created_ci); void gscon_start_assignment(struct gsm_subscriber_connection *conn, struct assignment_request *req); @@ -76,7 +76,7 @@ void gscon_lchan_releasing(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan); void gscon_forget_lchan(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan); -void gscon_forget_mgw_endpoint_ci(struct gsm_subscriber_connection *conn, struct mgwep_ci *ci); +void gscon_forget_mgw_endpoint_ci(struct gsm_subscriber_connection *conn, struct osmo_mgcpc_ep_ci *ci); bool gscon_is_aoip(struct gsm_subscriber_connection *conn); bool gscon_is_sccplite(struct gsm_subscriber_connection *conn); diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 7b813a6..dacc63b 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -39,7 +39,7 @@ struct mgcp_client_conf; struct mgcp_client; struct gsm0808_cell_id; -struct mgw_endpoint; +struct osmo_mgcpc_ep; /** annotations for msgb ownership */ #define __uses @@ -136,7 +136,7 @@ /* Whether this assignment triggered creation of the MGW endpoint: if the assignment * fails, we will release that again as soon as possible. (If false, the endpoint already * existed before or isn't needed at all.)*/ - struct mgwep_ci *created_ci_for_msc; + struct osmo_mgcpc_ep_ci *created_ci_for_msc; enum gsm0808_cause failure_cause; enum gsm48_rr_cause rr_cause; @@ -205,7 +205,7 @@ struct gsm_lchan *new_lchan; bool async; struct handover_in_req inter_bsc_in; - struct mgwep_ci *created_ci_for_msc; + struct osmo_mgcpc_ep_ci *created_ci_for_msc; }; /* active radio connection of a mobile subscriber */ @@ -287,11 +287,11 @@ /* The endpoint at the MGW used to join both BTS and MSC side connections, e.g. * "rtpbridge/23 at mgw". */ - struct mgw_endpoint *mgw_endpoint; + struct osmo_mgcpc_ep *mgw_endpoint; - /* The connection identifier of the mgw_endpoint used to transceive RTP towards the MSC. + /* The connection identifier of the osmo_mgcpc_ep used to transceive RTP towards the MSC. * (The BTS side CI is handled by struct gsm_lchan and the lchan_fsm.) */ - struct mgwep_ci *mgw_endpoint_ci_msc; + struct osmo_mgcpc_ep_ci *mgw_endpoint_ci_msc; } user_plane; /* LCLS (local call, local switch) related state */ @@ -554,7 +554,7 @@ struct osmo_fsm_inst *fi; struct osmo_fsm_inst *fi_rtp; - struct mgwep_ci *mgw_endpoint_ci_bts; + struct osmo_mgcpc_ep_ci *mgw_endpoint_ci_bts; struct { struct lchan_activate_info info; @@ -1535,6 +1535,7 @@ struct { struct mgcp_client_conf *conf; struct mgcp_client *client; + struct osmo_tdef *tdefs; } mgw; /* Remote BSS Cell Identifier Lists */ diff --git a/include/osmocom/bsc/lchan_rtp_fsm.h b/include/osmocom/bsc/lchan_rtp_fsm.h index fa0e746..6ff8fe3 100644 --- a/include/osmocom/bsc/lchan_rtp_fsm.h +++ b/include/osmocom/bsc/lchan_rtp_fsm.h @@ -10,6 +10,7 @@ } while(0) struct gsm_lchan; +struct mgcp_conn_peer; enum lchan_rtp_fsm_state { LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE, @@ -40,6 +41,8 @@ }; void lchan_rtp_fsm_start(struct gsm_lchan *lchan); -struct mgwep_ci *lchan_use_mgw_endpoint_ci_bts(struct gsm_lchan *lchan); +struct osmo_mgcpc_ep_ci *lchan_use_mgw_endpoint_ci_bts(struct gsm_lchan *lchan); bool lchan_rtp_established(struct gsm_lchan *lchan); void lchan_forget_mgw_endpoint(struct gsm_lchan *lchan); + +void mgcp_pick_codec(struct mgcp_conn_peer *verb_info, const struct gsm_lchan *lchan, bool bss_side); diff --git a/include/osmocom/bsc/mgw_endpoint_fsm.h b/include/osmocom/bsc/mgw_endpoint_fsm.h deleted file mode 100644 index f86a7cd..0000000 --- a/include/osmocom/bsc/mgw_endpoint_fsm.h +++ /dev/null @@ -1,59 +0,0 @@ -/* osmo-bsc API to manage all sides of an MGW endpoint */ -#pragma once - -#include - -#include - -/* This macro automatically includes a final \n, if omitted. */ -#define LOG_MGWEP(mgwep, level, fmt, args...) do { \ - LOGPFSML(mgwep->fi, level, "(%s) " fmt, \ - mgw_endpoint_name(mgwep), ## args); \ - } while(0) - -enum mgwep_fsm_state { - MGWEP_ST_UNUSED, - MGWEP_ST_WAIT_MGW_RESPONSE, - MGWEP_ST_IN_USE, -}; - -enum mgwep_fsm_event { - _MGWEP_EV_LAST, - /* and MGW response events are allocated dynamically */ -}; - -struct mgw_endpoint; -struct mgwep_ci; -struct osmo_tdef; - -void mgw_endpoint_fsm_init(struct osmo_tdef *T_defs); - -struct mgw_endpoint *mgw_endpoint_alloc(struct osmo_fsm_inst *parent, uint32_t parent_term_event, - struct mgcp_client *mgcp_client, - const char *fsm_id, - const char *endpoint_str_fmt, ...); - -struct mgwep_ci *mgw_endpoint_ci_add(struct mgw_endpoint *mgwep, - const char *label_fmt, ...); -const struct mgcp_conn_peer *mgwep_ci_get_rtp_info(const struct mgwep_ci *ci); -bool mgwep_ci_get_crcx_info_to_sockaddr(const struct mgwep_ci *ci, struct sockaddr_storage *dest); - -void mgw_endpoint_ci_request(struct mgwep_ci *ci, - enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info, - struct osmo_fsm_inst *notify, - uint32_t event_success, uint32_t event_failure, - void *notify_data); - -static inline void mgw_endpoint_ci_dlcx(struct mgwep_ci *ci) -{ - mgw_endpoint_ci_request(ci, MGCP_VERB_DLCX, NULL, NULL, 0, 0, NULL); -} - -void mgw_endpoint_clear(struct mgw_endpoint *mgwep); - -const char *mgw_endpoint_name(const struct mgw_endpoint *mgwep); -const char *mgwep_ci_name(const struct mgwep_ci *ci); -const char *mgcp_conn_peer_name(const struct mgcp_conn_peer *info); - -enum mgcp_codecs chan_mode_to_mgcp_codec(enum gsm48_chan_mode chan_mode, bool full_rate); -void mgcp_pick_codec(struct mgcp_conn_peer *verb_info, const struct gsm_lchan *lchan, bool bss_side); diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index 11803da..e88e614 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -68,7 +68,6 @@ lchan_select.c \ meas_feed.c \ meas_rep.c \ - mgw_endpoint_fsm.c \ neighbor_ident.c \ neighbor_ident_vty.c \ net_init.c \ diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index 520498f..fdfc080 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -23,12 +23,11 @@ #include #include -#include +#include #include #include #include -#include #include #include #include @@ -105,7 +104,7 @@ gscon_forget_mgw_endpoint_ci(conn, conn->assignment.created_ci_for_msc); /* If this is the last endpoint released, the mgw_endpoint_fsm will terminate and tell * the gscon about it. */ - mgw_endpoint_ci_dlcx(conn->assignment.created_ci_for_msc); + osmo_mgcpc_ep_ci_dlcx(conn->assignment.created_ci_for_msc); } conn->assignment = (struct assignment_fsm_data){ @@ -156,8 +155,8 @@ perm_spch = gsm0808_permitted_speech(lchan->type, lchan->tch_mode); if (gscon_is_aoip(conn)) { - if (!mgwep_ci_get_crcx_info_to_sockaddr(conn->user_plane.mgw_endpoint_ci_msc, - &addr_local)) { + if (!osmo_mgcpc_ep_ci_get_crcx_info_to_sockaddr(conn->user_plane.mgw_endpoint_ci_msc, + &addr_local)) { assignment_fail(GSM0808_CAUSE_EQUIPMENT_FAILURE, "Unable to compose RTP address of MGW -> MSC"); return; @@ -626,7 +625,7 @@ /* For AoIP, we created the MGW endpoint. Ensure it is really there, and log it. */ if (gscon_is_aoip(conn)) { const struct mgcp_conn_peer *mgw_info; - mgw_info = mgwep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); + mgw_info = osmo_mgcpc_ep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); if (!mgw_info) { assignment_fail(GSM0808_CAUSE_EQUIPMENT_FAILURE, "Unable to retrieve RTP port info allocated by MGW for" diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 4466404..f944431 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -39,9 +39,9 @@ #include #include #include -#include #include -#include +#include +#include #include #define S(x) (1 << (x)) @@ -457,8 +457,8 @@ /* Make sure a conn->user_plane.mgw_endpoint is allocated with the proper mgw endpoint name. For * SCCPlite, pass in msc_assigned_cic the CIC received upon BSSMAP Assignment Command or BSSMAP Handover * Request form the MSC (which is only stored in conn->user_plane after success). Ignored for AoIP. */ -struct mgw_endpoint *gscon_ensure_mgw_endpoint(struct gsm_subscriber_connection *conn, - uint16_t msc_assigned_cic) +struct osmo_mgcpc_ep *gscon_ensure_mgw_endpoint(struct gsm_subscriber_connection *conn, + uint16_t msc_assigned_cic) { if (conn->user_plane.mgw_endpoint) return conn->user_plane.mgw_endpoint; @@ -466,19 +466,23 @@ if (gscon_is_sccplite(conn)) { /* derive endpoint name from CIC on A interface side */ conn->user_plane.mgw_endpoint = - mgw_endpoint_alloc(conn->fi, GSCON_EV_FORGET_MGW_ENDPOINT, - conn->network->mgw.client, conn->fi->id, - "%x@%s", msc_assigned_cic, - mgcp_client_endpoint_domain(conn->network->mgw.client)); + osmo_mgcpc_ep_alloc(conn->fi, GSCON_EV_FORGET_MGW_ENDPOINT, + conn->network->mgw.client, + conn->network->mgw.tdefs, + conn->fi->id, + "%x@%s", msc_assigned_cic, + mgcp_client_endpoint_domain(conn->network->mgw.client)); LOGPFSML(conn->fi, LOGL_DEBUG, "MGW endpoint name derived from CIC 0x%x: %s\n", - msc_assigned_cic, mgw_endpoint_name(conn->user_plane.mgw_endpoint)); + msc_assigned_cic, osmo_mgcpc_ep_name(conn->user_plane.mgw_endpoint)); } else if (gscon_is_aoip(conn)) { /* use dynamic RTPBRIDGE endpoint allocation in MGW */ conn->user_plane.mgw_endpoint = - mgw_endpoint_alloc(conn->fi, GSCON_EV_FORGET_MGW_ENDPOINT, - conn->network->mgw.client, conn->fi->id, - "%s", mgcp_client_rtpbridge_wildcard(conn->network->mgw.client)); + osmo_mgcpc_ep_alloc(conn->fi, GSCON_EV_FORGET_MGW_ENDPOINT, + conn->network->mgw.client, + conn->network->mgw.tdefs, + conn->fi->id, + "%s", mgcp_client_rtpbridge_wildcard(conn->network->mgw.client)); } else { LOGPFSML(conn->fi, LOGL_ERROR, "Conn is neither SCCPlite nor AoIP!?\n"); return NULL; @@ -493,10 +497,10 @@ struct osmo_fsm_inst *notify, uint32_t event_success, uint32_t event_failure, void *notify_data, - struct mgwep_ci **created_ci) + struct osmo_mgcpc_ep_ci **created_ci) { int rc; - struct mgwep_ci *ci; + struct osmo_mgcpc_ep_ci *ci; struct mgcp_conn_peer mgw_info; enum mgcp_verb verb; @@ -526,7 +530,7 @@ ci = conn->user_plane.mgw_endpoint_ci_msc; if (ci) { - const struct mgcp_conn_peer *prev_crcx_info = mgwep_ci_get_rtp_info(ci); + const struct mgcp_conn_peer *prev_crcx_info = osmo_mgcpc_ep_ci_get_rtp_info(ci); if (!conn->user_plane.mgw_endpoint) { LOGPFSML(conn->fi, LOGL_ERROR, "Internal error: conn has a CI but no endoint\n"); @@ -536,14 +540,14 @@ if (!prev_crcx_info) { LOGPFSML(conn->fi, LOGL_ERROR, "There already is an MGW connection for the MSC side," " but it seems to be broken. Will not CRCX another one (%s)\n", - mgwep_ci_name(ci)); + osmo_mgcpc_ep_ci_name(ci)); return false; } if (same_mgw_info(&mgw_info, prev_crcx_info)) { LOGPFSML(conn->fi, LOGL_DEBUG, "MSC side MGW endpoint ci is already configured to %s\n", - mgwep_ci_name(ci)); + osmo_mgcpc_ep_ci_name(ci)); return true; } @@ -559,7 +563,7 @@ } if (!ci) { - ci = mgw_endpoint_ci_add(conn->user_plane.mgw_endpoint, "to-MSC"); + ci = osmo_mgcpc_ep_ci_add(conn->user_plane.mgw_endpoint, "to-MSC"); if (created_ci) *created_ci = ci; conn->user_plane.mgw_endpoint_ci_msc = ci; @@ -569,7 +573,7 @@ return false; } - mgw_endpoint_ci_request(ci, verb, &mgw_info, notify, event_success, event_failure, notify_data); + osmo_mgcpc_ep_ci_request(ci, verb, &mgw_info, notify, event_success, event_failure, notify_data); return true; } @@ -705,7 +709,7 @@ lchan_forget_mgw_endpoint(conn->ho.new_lchan); } -void gscon_forget_mgw_endpoint_ci(struct gsm_subscriber_connection *conn, struct mgwep_ci *ci) +void gscon_forget_mgw_endpoint_ci(struct gsm_subscriber_connection *conn, struct osmo_mgcpc_ep_ci *ci) { if (conn->ho.created_ci_for_msc == ci) conn->ho.created_ci_for_msc = NULL; @@ -734,7 +738,7 @@ * CLEAR COMPLETE message" */ /* Close MGCP connections */ - mgw_endpoint_clear(conn->user_plane.mgw_endpoint); + osmo_mgcpc_ep_clear(conn->user_plane.mgw_endpoint); gscon_sigtran_send(conn, gsm0808_create_clear_complete()); break; @@ -794,7 +798,7 @@ { struct gsm_subscriber_connection *conn = fi->priv; - mgw_endpoint_clear(conn->user_plane.mgw_endpoint); + osmo_mgcpc_ep_clear(conn->user_plane.mgw_endpoint); if (conn->lcls.fi) { /* request termination of LCLS FSM */ diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 3a6ddd4..dc97d12 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -70,7 +70,7 @@ #include #include #include -#include +#include #include @@ -1584,7 +1584,7 @@ { vty_out(vty, "conn ID=%u, MSC=%u, hodec2_fail=%d, mgw_ep=%s%s", conn->sccp.conn_id, conn->sccp.msc->nr, conn->hodec2.failures, - mgw_endpoint_name(conn->user_plane.mgw_endpoint), VTY_NEWLINE); + osmo_mgcpc_ep_name(conn->user_plane.mgw_endpoint), VTY_NEWLINE); if (conn->lcls.global_call_ref_len) { vty_out(vty, " LCLS GCR: %s%s", osmo_hexdump_nospc(conn->lcls.global_call_ref, conn->lcls.global_call_ref_len), diff --git a/src/osmo-bsc/codec_pref.c b/src/osmo-bsc/codec_pref.c index 412ed9a..3e06114 100644 --- a/src/osmo-bsc/codec_pref.c +++ b/src/osmo-bsc/codec_pref.c @@ -20,6 +20,8 @@ */ #include +#include +#include #include #include #include diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index fe3b8b2..0d1449f 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -25,6 +25,8 @@ #include #include +#include + #include #include @@ -38,7 +40,6 @@ #include #include #include -#include #include #include @@ -240,7 +241,7 @@ static void handover_reset(struct gsm_subscriber_connection *conn) { - struct mgwep_ci *ci; + struct osmo_mgcpc_ep_ci *ci; if (conn->ho.new_lchan) /* New lchan was activated but never passed to a conn */ lchan_release(conn->ho.new_lchan, false, true, RSL_ERR_EQUIPMENT_FAIL); @@ -250,7 +251,7 @@ gscon_forget_mgw_endpoint_ci(conn, ci); /* If this is the last endpoint released, the mgw_endpoint_fsm will terminate and tell * the gscon about it. */ - mgw_endpoint_ci_dlcx(ci); + osmo_mgcpc_ep_ci_dlcx(ci); } conn->ho = (struct handover){ @@ -1074,7 +1075,7 @@ /* For AoIP, we created the MGW endpoint. Ensure it is really there, and log it. */ if (gscon_is_aoip(conn)) { const struct mgcp_conn_peer *mgw_info; - mgw_info = mgwep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); + mgw_info = osmo_mgcpc_ep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); if (!mgw_info) { ho_fail(HO_RESULT_ERROR, "Unable to retrieve RTP port info allocated by MGW for" diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 33abb1f..f2fef99 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -24,11 +24,12 @@ #include #include +#include + #include #include #include #include -#include #include #include #include @@ -387,7 +388,7 @@ if (lchan->fi_rtp) osmo_fsm_inst_term(lchan->fi_rtp, OSMO_FSM_TERM_REQUEST, 0); if (lchan->mgw_endpoint_ci_bts) { - mgw_endpoint_ci_dlcx(lchan->mgw_endpoint_ci_bts); + osmo_mgcpc_ep_ci_dlcx(lchan->mgw_endpoint_ci_bts); lchan->mgw_endpoint_ci_bts = NULL; } @@ -507,7 +508,7 @@ struct gsm_lchan *lchan = lchan_fi_lchan(fi); struct gsm48_multi_rate_conf mr_conf; struct gsm_bts *bts = lchan->ts->trx->bts; - struct mgwep_ci *use_mgwep_ci; + struct osmo_mgcpc_ep_ci *use_mgwep_ci; struct gsm_lchan *old_lchan = lchan->activate.info.re_use_mgw_endpoint_from_lchan; struct lchan_activate_info *info = &lchan->activate.info; @@ -581,7 +582,7 @@ lchan_activate_mode_name(lchan->activate.info.activ_for), lchan->activate.info.requires_voice_stream ? "yes" : "no", lchan->activate.info.requires_voice_stream ? - (use_mgwep_ci ? mgwep_ci_name(use_mgwep_ci) : "new") + (use_mgwep_ci ? osmo_mgcpc_ep_ci_name(use_mgwep_ci) : "new") : "none", gsm_lchant_name(lchan->type), gsm48_chan_mode_name(lchan->tch_mode), diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c index 5e2d758..a5efa3d 100644 --- a/src/osmo-bsc/lchan_rtp_fsm.c +++ b/src/osmo-bsc/lchan_rtp_fsm.c @@ -21,11 +21,12 @@ */ #include +#include +#include #include #include #include -#include #include #include #include @@ -120,7 +121,7 @@ /* While activating an lchan, for example for Handover, we may want to re-use another lchan's MGW * endpoint CI. If Handover fails half way, the old lchan must keep its MGW endpoint CI, and we must not * clean it up. Hence keep another lchan's mgw_endpoint_ci_bts out of lchan until all is done. */ -struct mgwep_ci *lchan_use_mgw_endpoint_ci_bts(struct gsm_lchan *lchan) +struct osmo_mgcpc_ep_ci *lchan_use_mgw_endpoint_ci_bts(struct gsm_lchan *lchan) { if (lchan->mgw_endpoint_ci_bts) return lchan->mgw_endpoint_ci_bts; @@ -135,13 +136,13 @@ uint32_t prev_state) { struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); - struct mgw_endpoint *mgwep; - struct mgwep_ci *use_mgwep_ci = lchan_use_mgw_endpoint_ci_bts(lchan); + struct osmo_mgcpc_ep *mgwep; + struct osmo_mgcpc_ep_ci *use_mgwep_ci = lchan_use_mgw_endpoint_ci_bts(lchan); struct mgcp_conn_peer crcx_info = {}; if (use_mgwep_ci) { LOG_LCHAN_RTP(lchan, LOGL_DEBUG, "MGW endpoint already available: %s\n", - mgwep_ci_name(use_mgwep_ci)); + osmo_mgcpc_ep_ci_name(use_mgwep_ci)); lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_LCHAN_READY); return; } @@ -152,7 +153,7 @@ return; } - lchan->mgw_endpoint_ci_bts = mgw_endpoint_ci_add(mgwep, "to-BTS"); + lchan->mgw_endpoint_ci_bts = osmo_mgcpc_ep_ci_add(mgwep, "to-BTS"); if (lchan->conn) { crcx_info.call_id = lchan->conn->sccp.conn_id; @@ -162,7 +163,7 @@ crcx_info.ptime = 20; mgcp_pick_codec(&crcx_info, lchan, true); - mgw_endpoint_ci_request(lchan->mgw_endpoint_ci_bts, MGCP_VERB_CRCX, &crcx_info, + osmo_mgcpc_ep_ci_request(lchan->mgw_endpoint_ci_bts, MGCP_VERB_CRCX, &crcx_info, fi, LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE, LCHAN_RTP_EV_MGW_ENDPOINT_ERROR, 0); } @@ -174,7 +175,7 @@ case LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE: LOG_LCHAN_RTP(lchan, LOGL_DEBUG, "MGW endpoint: %s\n", - mgwep_ci_name(lchan_use_mgw_endpoint_ci_bts(lchan))); + osmo_mgcpc_ep_ci_name(lchan_use_mgw_endpoint_ci_bts(lchan))); lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_LCHAN_READY); return; @@ -328,7 +329,7 @@ return; } - mgw_rtp = mgwep_ci_get_rtp_info(lchan_use_mgw_endpoint_ci_bts(lchan)); + mgw_rtp = osmo_mgcpc_ep_ci_get_rtp_info(lchan_use_mgw_endpoint_ci_bts(lchan)); if (!mgw_rtp) { lchan_rtp_fail("Cannot send IPACC MDCX to BTS:" @@ -396,7 +397,7 @@ } static void connect_mgw_endpoint_to_lchan(struct osmo_fsm_inst *fi, - struct mgwep_ci *ci, + struct osmo_mgcpc_ep_ci *ci, struct gsm_lchan *to_lchan) { int rc; @@ -426,8 +427,8 @@ } LOG_LCHAN_RTP(lchan, LOGL_DEBUG, "Sending BTS side RTP port info %s:%u to MGW %s\n", - mdcx_info.addr, mdcx_info.port, mgwep_ci_name(ci)); - mgw_endpoint_ci_request(ci, MGCP_VERB_MDCX, &mdcx_info, + mdcx_info.addr, mdcx_info.port, osmo_mgcpc_ep_ci_name(ci)); + osmo_mgcpc_ep_ci_request(ci, MGCP_VERB_MDCX, &mdcx_info, fi, LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED, LCHAN_RTP_EV_MGW_ENDPOINT_ERROR, 0); } @@ -539,7 +540,7 @@ LOG_LCHAN_RTP(lchan, LOGL_ERROR, "Error while connecting the MGW back to the old lchan's RTP port:" " %s %s\n", - mgwep_ci_name(lchan->mgw_endpoint_ci_bts), + osmo_mgcpc_ep_ci_name(lchan->mgw_endpoint_ci_bts), gsm_lchan_name(old_lchan)); osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, 0); return; @@ -575,7 +576,7 @@ case LCHAN_RTP_EV_IPACC_MDCX_ACK: LOG_LCHAN_RTP(lchan, LOGL_NOTICE, "Received MDCX ACK on established lchan's RTP port: %s\n", - mgwep_ci_name(lchan->mgw_endpoint_ci_bts)); + osmo_mgcpc_ep_ci_name(lchan->mgw_endpoint_ci_bts)); return; default: OSMO_ASSERT(false); @@ -740,7 +741,7 @@ { struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); if (lchan->mgw_endpoint_ci_bts) { - mgw_endpoint_ci_dlcx(lchan->mgw_endpoint_ci_bts); + osmo_mgcpc_ep_ci_dlcx(lchan->mgw_endpoint_ci_bts); lchan->mgw_endpoint_ci_bts = NULL; } lchan->fi_rtp = NULL; @@ -769,3 +770,86 @@ .timer_cb = lchan_rtp_fsm_timer_cb, .cleanup = lchan_rtp_fsm_cleanup, }; + +/* Depending on the channel mode and rate, return the codec type that is signalled towards the MGW. */ +static enum mgcp_codecs chan_mode_to_mgcp_codec(enum gsm48_chan_mode chan_mode, bool full_rate) +{ + switch (chan_mode) { + case GSM48_CMODE_SPEECH_V1: + if (full_rate) + return CODEC_GSM_8000_1; + return CODEC_GSMHR_8000_1; + + case GSM48_CMODE_SPEECH_EFR: + return CODEC_GSMEFR_8000_1; + + case GSM48_CMODE_SPEECH_AMR: + return CODEC_AMR_8000_1; + + default: + return -1; + } +} + +static int chan_mode_to_mgcp_bss_pt(enum mgcp_codecs codec) +{ + switch (codec) { + case CODEC_GSMHR_8000_1: + return RTP_PT_GSM_HALF; + + case CODEC_GSMEFR_8000_1: + return RTP_PT_GSM_EFR; + + case CODEC_AMR_8000_1: + return RTP_PT_AMR; + + default: + /* Not an error, we just leave it to libosmo-mgcp-client to + * decide over the PT. */ + return -1; + } +} + +void mgcp_pick_codec(struct mgcp_conn_peer *verb_info, const struct gsm_lchan *lchan, bool bss_side) +{ + enum mgcp_codecs codec = chan_mode_to_mgcp_codec(lchan->tch_mode, + lchan->type == GSM_LCHAN_TCH_H? false : true); + int custom_pt; + + if (codec < 0) { + LOG_LCHAN(lchan, LOGL_ERROR, + "Unable to determine MGCP codec type for %s in chan-mode %s\n", + gsm_lchant_name(lchan->type), gsm48_chan_mode_name(lchan->tch_mode)); + verb_info->codecs_len = 0; + return; + } + + verb_info->codecs[0] = codec; + verb_info->codecs_len = 1; + + /* Setup custom payload types (only for BSS side and when required) */ + custom_pt = chan_mode_to_mgcp_bss_pt(codec); + if (bss_side && custom_pt > 0) { + verb_info->ptmap[0].codec = codec; + verb_info->ptmap[0].pt = custom_pt; + verb_info->ptmap_len = 1; + } + + /* AMR requires additional parameters to be set up (framing mode) */ + if (verb_info->codecs[0] == CODEC_AMR_8000_1) { + verb_info->param_present = true; + verb_info->param.amr_octet_aligned_present = true; + } + + if (bss_side && verb_info->codecs[0] == CODEC_AMR_8000_1) { + /* FIXME: At the moment all BTSs we support are using the + * octet-aligned payload format. However, in the future + * we may support BTSs that are using bandwith-efficient + * format. In this case we will have to add functionality + * that distinguishes by the BTS model which mode to use. */ + verb_info->param.amr_octet_aligned = true; + } + else if (!bss_side && verb_info->codecs[0] == CODEC_AMR_8000_1) { + verb_info->param.amr_octet_aligned = lchan->conn->sccp.msc->amr_octet_aligned; + } +} diff --git a/src/osmo-bsc/mgw_endpoint_fsm.c b/src/osmo-bsc/mgw_endpoint_fsm.c deleted file mode 100644 index fa65166..0000000 --- a/src/osmo-bsc/mgw_endpoint_fsm.c +++ /dev/null @@ -1,795 +0,0 @@ -/* osmo-bsc API to manage all sides of an MGW endpoint - * - * (C) 2018 by sysmocom - s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include - -#define LOG_CI(ci, level, fmt, args...) do { \ - if (!ci || !ci->mgwep) \ - LOGP(DLGLOBAL, level, "(unknown MGW endpoint) " fmt, ## args); \ - else \ - LOG_MGWEP(ci->mgwep, level, "CI[%d] %s%s%s: " fmt, \ - (int)(ci - ci->mgwep->ci), \ - ci->label ? : "-", \ - ci->mgcp_ci_str[0] ? " CI=" : "", \ - ci->mgcp_ci_str[0] ? ci->mgcp_ci_str : "", \ - ## args); \ - } while(0) - -#define LOG_CI_VERB(ci, level, fmt, args...) do { \ - if (ci->verb_info.addr) \ - LOG_CI(ci, level, "%s %s:%u: " fmt, \ - mgcp_verb_name(ci->verb), ci->verb_info.addr, ci->verb_info.port, \ - ## args); \ - else \ - LOG_CI(ci, level, "%s: " fmt, \ - mgcp_verb_name(ci->verb), \ - ## args); \ - } while(0) - -#define FIRST_CI_EVENT (_MGWEP_EV_LAST + (_MGWEP_EV_LAST & 1)) /* rounded up to even nr */ -#define USABLE_CI ((32 - FIRST_CI_EVENT)/2) -#define EV_TO_CI_IDX(event) ((event - FIRST_CI_EVENT) / 2) - -#define CI_EV_SUCCESS(ci) (FIRST_CI_EVENT + (((ci) - ci->mgwep->ci) * 2)) -#define CI_EV_FAILURE(ci) (CI_EV_SUCCESS(ci) + 1) - -static struct osmo_fsm mgwep_fsm; - -struct mgwep_ci { - struct mgw_endpoint *mgwep; - - bool occupied; - char label[64]; - struct osmo_fsm_inst *mgcp_client_fi; - - bool pending; - bool sent; - enum mgcp_verb verb; - struct mgcp_conn_peer verb_info; - struct osmo_fsm_inst *notify; - uint32_t notify_success; - uint32_t notify_failure; - void *notify_data; - - bool got_port_info; - struct mgcp_conn_peer rtp_info; - char mgcp_ci_str[MGCP_CONN_ID_LENGTH]; -}; - -struct mgw_endpoint { - struct mgcp_client *mgcp_client; - struct osmo_fsm_inst *fi; - char endpoint[MGCP_ENDPOINT_MAXLEN]; - - struct mgwep_ci ci[USABLE_CI]; -}; - -static const struct value_string mgcp_verb_names[] = { - { MGCP_VERB_CRCX, "CRCX" }, - { MGCP_VERB_MDCX, "MDCX" }, - { MGCP_VERB_DLCX, "DLCX" }, - { MGCP_VERB_AUEP, "AUEP" }, - { MGCP_VERB_RSIP, "RSIP" }, - {} -}; - -static inline const char *mgcp_verb_name(enum mgcp_verb val) -{ return get_value_string(mgcp_verb_names, val); } - -static struct mgwep_ci *mgwep_check_ci(struct mgwep_ci *ci) -{ - if (!ci) - return NULL; - if (!ci->mgwep) - return NULL; - if (ci < ci->mgwep->ci || ci >= &ci->mgwep->ci[USABLE_CI]) - return NULL; - return ci; -} - -static struct mgwep_ci *mgwep_ci_for_event(struct mgw_endpoint *mgwep, uint32_t event) -{ - int idx; - if (event < FIRST_CI_EVENT) - return NULL; - idx = EV_TO_CI_IDX(event); - if (idx >= sizeof(mgwep->ci)) - return NULL; - return mgwep_check_ci(&mgwep->ci[idx]); -} - -const char *mgw_endpoint_name(const struct mgw_endpoint *mgwep) -{ - if (!mgwep) - return "NULL"; - if (mgwep->endpoint[0]) - return mgwep->endpoint; - return osmo_fsm_inst_name(mgwep->fi); -} - -const char *mgcp_conn_peer_name(const struct mgcp_conn_peer *info) -{ - /* I'd be fine with a smaller buffer and accept truncation, but gcc possibly refuses to build if - * this buffer is too small. */ - static char buf[1024]; - - if (!info) - return "NULL"; - - if (info->endpoint[0] - && info->addr[0]) - snprintf(buf, sizeof(buf), "%s:%s:%u", - info->endpoint, info->addr, info->port); - else if (info->endpoint[0]) - snprintf(buf, sizeof(buf), "%s", info->endpoint); - else if (info->addr[0]) - snprintf(buf, sizeof(buf), "%s:%u", info->addr, info->port); - else - return "empty"; - return buf; -} - -const char *mgwep_ci_name(const struct mgwep_ci *ci) -{ - const struct mgcp_conn_peer *rtp_info; - - if (!ci) - return "NULL"; - - rtp_info = mgwep_ci_get_rtp_info(ci); - - if (rtp_info) - return mgcp_conn_peer_name(rtp_info); - return mgw_endpoint_name(ci->mgwep); -} - -static struct value_string mgwep_fsm_event_names[33] = {}; - -static char mgwep_fsm_event_name_bufs[32][32] = {}; - -static void fill_event_names() -{ - int i; - for (i = 0; i < (ARRAY_SIZE(mgwep_fsm_event_names) - 1); i++) { - if (i < _MGWEP_EV_LAST) - continue; - if (i < FIRST_CI_EVENT || EV_TO_CI_IDX(i) > USABLE_CI) { - mgwep_fsm_event_names[i] = (struct value_string){i, "Unused"}; - continue; - } - snprintf(mgwep_fsm_event_name_bufs[i], sizeof(mgwep_fsm_event_name_bufs[i]), - "MGW Response for CI #%d", EV_TO_CI_IDX(i)); - mgwep_fsm_event_names[i] = (struct value_string){i, mgwep_fsm_event_name_bufs[i]}; - } -} - -static struct osmo_tdef *g_T_defs = NULL; - -void mgw_endpoint_fsm_init(struct osmo_tdef *T_defs) -{ - g_T_defs = T_defs; - OSMO_ASSERT(osmo_fsm_register(&mgwep_fsm) == 0); - fill_event_names(); -} - -struct mgw_endpoint *mgwep_fi_mgwep(struct osmo_fsm_inst *fi) -{ - OSMO_ASSERT(fi); - OSMO_ASSERT(fi->fsm == &mgwep_fsm); - OSMO_ASSERT(fi->priv); - return fi->priv; -} - -struct mgw_endpoint *mgw_endpoint_alloc(struct osmo_fsm_inst *parent, uint32_t parent_term_event, - struct mgcp_client *mgcp_client, - const char *fsm_id, - const char *endpoint_str_fmt, ...) -{ - va_list ap; - struct osmo_fsm_inst *fi; - struct mgw_endpoint *mgwep; - int rc; - - if (!mgcp_client) - return NULL; - - /* use mgcp_client as talloc ctx, so that the conn, lchan, ts can deallocate while MGCP DLCX are - * still going on. */ - fi = osmo_fsm_inst_alloc_child(&mgwep_fsm, parent, parent_term_event); - OSMO_ASSERT(fi); - - osmo_fsm_inst_update_id(fi, fsm_id); - - mgwep = talloc_zero(fi, struct mgw_endpoint); - OSMO_ASSERT(mgwep); - - mgwep->mgcp_client = mgcp_client; - mgwep->fi = fi; - mgwep->fi->priv = mgwep; - - va_start(ap, endpoint_str_fmt); - rc = vsnprintf(mgwep->endpoint, sizeof(mgwep->endpoint), endpoint_str_fmt, ap); - va_end(ap); - - if (rc <= 0 || rc >= sizeof(mgwep->endpoint)) { - LOG_MGWEP(mgwep, LOGL_ERROR, "Endpoint name too long or too short: %s\n", - mgwep->endpoint); - osmo_fsm_inst_term(mgwep->fi, OSMO_FSM_TERM_ERROR, 0); - return NULL; - } - - return mgwep; -} - -struct mgwep_ci *mgw_endpoint_ci_add(struct mgw_endpoint *mgwep, - const char *label_fmt, ...) -{ - va_list ap; - int i; - struct mgwep_ci *ci; - - for (i = 0; i < USABLE_CI; i++) { - ci = &mgwep->ci[i]; - - if (ci->occupied || ci->mgcp_client_fi) - continue; - - *ci = (struct mgwep_ci){ - .mgwep = mgwep, - .occupied = true, - }; - if (label_fmt) { - va_start(ap, label_fmt); - vsnprintf(ci->label, sizeof(ci->label), label_fmt, ap); - va_end(ap); - } - return ci; - } - - LOG_MGWEP(mgwep, LOGL_ERROR, - "Cannot allocate another endpoint, all " - OSMO_STRINGIFY_VAL(USABLE_CI) " are in use\n"); - - return NULL; -} - -static void mgwep_fsm_check_state_chg_after_response(struct osmo_fsm_inst *fi); - -static void on_failure(struct mgwep_ci *ci) -{ - if (!ci->occupied) - return; - - if (ci->notify) - osmo_fsm_inst_dispatch(ci->notify, ci->notify_failure, ci->notify_data); - - *ci = (struct mgwep_ci){ - .mgwep = ci->mgwep, - }; - - - mgwep_fsm_check_state_chg_after_response(ci->mgwep->fi); -} - -static void on_success(struct mgwep_ci *ci, void *data) -{ - struct mgcp_conn_peer *rtp_info; - - if (!ci->occupied) - return; - - ci->pending = false; - - switch (ci->verb) { - case MGCP_VERB_CRCX: - /* If we sent a wildcarded endpoint name on CRCX, we need to store the resulting endpoint - * name here. Also, we receive the MGW's RTP port information. */ - rtp_info = data; - OSMO_ASSERT(rtp_info); - ci->got_port_info = true; - ci->rtp_info = *rtp_info; - osmo_strlcpy(ci->mgcp_ci_str, mgcp_conn_get_ci(ci->mgcp_client_fi), - sizeof(ci->mgcp_ci_str)); - if (rtp_info->endpoint[0]) { - int rc; - rc = osmo_strlcpy(ci->mgwep->endpoint, rtp_info->endpoint, - sizeof(ci->mgwep->endpoint)); - if (rc <= 0 || rc >= sizeof(ci->mgwep->endpoint)) { - LOG_CI(ci, LOGL_ERROR, "Unable to copy endpoint name '%s'\n", - rtp_info->endpoint); - mgw_endpoint_ci_dlcx(ci); - on_failure(ci); - return; - } - } - break; - - default: - break; - } - - LOG_CI(ci, LOGL_DEBUG, "received successful response to %s RTP=%s%s\n", - mgcp_verb_name(ci->verb), - mgcp_conn_peer_name(ci->got_port_info? &ci->rtp_info : NULL), - ci->notify ? "" : " (not sending a notification)"); - - if (ci->notify) - osmo_fsm_inst_dispatch(ci->notify, ci->notify_success, ci->notify_data); - - mgwep_fsm_check_state_chg_after_response(ci->mgwep->fi); -} - -const struct mgcp_conn_peer *mgwep_ci_get_rtp_info(const struct mgwep_ci *ci) -{ - ci = mgwep_check_ci((struct mgwep_ci*)ci); - if (!ci) - return NULL; - if (!ci->got_port_info) - return NULL; - return &ci->rtp_info; -} - -bool mgwep_ci_get_crcx_info_to_sockaddr(const struct mgwep_ci *ci, struct sockaddr_storage *dest) -{ - const struct mgcp_conn_peer *rtp_info; - struct sockaddr_in *sin; - - rtp_info = mgwep_ci_get_rtp_info(ci); - if (!rtp_info) - return false; - - sin = (struct sockaddr_in *)dest; - - sin->sin_family = AF_INET; - sin->sin_addr.s_addr = inet_addr(rtp_info->addr); - sin->sin_port = osmo_ntohs(rtp_info->port); - return true; -} - - -static const struct osmo_tdef_state_timeout mgwep_fsm_timeouts[32] = { - [MGWEP_ST_WAIT_MGW_RESPONSE] = { .T=23042 }, -}; - -/* Transition to a state, using the T timer defined in assignment_fsm_timeouts. - * The actual timeout value is in turn obtained from g_T_defs. - * Assumes local variable fi exists. */ -#define mgwep_fsm_state_chg(state) \ - osmo_tdef_fsm_inst_state_chg(fi, state, mgwep_fsm_timeouts, g_T_defs, 5) - -void mgw_endpoint_ci_request(struct mgwep_ci *ci, - enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info, - struct osmo_fsm_inst *notify, - uint32_t event_success, uint32_t event_failure, - void *notify_data) -{ - struct mgw_endpoint *mgwep; - struct osmo_fsm_inst *fi; - struct mgwep_ci cleared_ci; - ci = mgwep_check_ci(ci); - - if (!ci) { - LOGP(DLGLOBAL, LOGL_ERROR, "Invalid MGW endpoint request: no ci\n"); - goto dispatch_error; - } - if (!verb_info && verb != MGCP_VERB_DLCX) { - LOG_CI(ci, LOGL_ERROR, "Invalid MGW endpoint request: missing verb details for %s\n", - mgcp_verb_name(verb)); - goto dispatch_error; - } - if ((verb < 0) || (verb > MGCP_VERB_RSIP)) { - LOG_CI(ci, LOGL_ERROR, "Invalid MGW endpoint request: unknown verb: %s\n", - mgcp_verb_name(verb)); - goto dispatch_error; - } - - mgwep = ci->mgwep; - fi = mgwep->fi; - - /* Clear volatile state by explicitly keeping those that should remain. Because we can't assign - * the char[] directly, dance through cleared_ci and copy back. */ - cleared_ci = (struct mgwep_ci){ - .mgwep = mgwep, - .mgcp_client_fi = ci->mgcp_client_fi, - .got_port_info = ci->got_port_info, - .rtp_info = ci->rtp_info, - - .occupied = true, - /* .pending = true follows below */ - .verb = verb, - .notify = notify, - .notify_success = event_success, - .notify_failure = event_failure, - .notify_data = notify_data, - }; - osmo_strlcpy(cleared_ci.label, ci->label, sizeof(cleared_ci.label)); - osmo_strlcpy(cleared_ci.mgcp_ci_str, ci->mgcp_ci_str, sizeof(cleared_ci.mgcp_ci_str)); - *ci = cleared_ci; - - LOG_CI_VERB(ci, LOGL_DEBUG, "notify=%s\n", osmo_fsm_inst_name(ci->notify)); - - if (verb_info) - ci->verb_info = *verb_info; - - if (mgwep->endpoint[0]) { - if (ci->verb_info.endpoint[0] && strcmp(ci->verb_info.endpoint, mgwep->endpoint)) - LOG_CI(ci, LOGL_ERROR, - "Warning: Requested %s on endpoint %s, but this CI is on endpoint %s." - " Using the proper endpoint instead.\n", - mgcp_verb_name(verb), ci->verb_info.endpoint, mgwep->endpoint); - osmo_strlcpy(ci->verb_info.endpoint, mgwep->endpoint, sizeof(ci->verb_info.endpoint)); - } - - switch (ci->verb) { - case MGCP_VERB_CRCX: - if (ci->mgcp_client_fi) { - LOG_CI(ci, LOGL_ERROR, "CRCX can be called only once per MGW endpoint CI\n"); - on_failure(ci); - return; - } - break; - - case MGCP_VERB_MDCX: - case MGCP_VERB_DLCX: - if (!ci->mgcp_client_fi) { - LOG_CI_VERB(ci, LOGL_ERROR, "The first verb on an unused MGW endpoint CI must be CRCX, not %s\n", - mgcp_verb_name(ci->verb)); - on_failure(ci); - return; - } - break; - - default: - LOG_CI(ci, LOGL_ERROR, "This verb is not supported: %s\n", mgcp_verb_name(ci->verb)); - on_failure(ci); - return; - } - - ci->pending = true; - - LOG_CI_VERB(ci, LOGL_DEBUG, "Scheduling\n"); - - if (mgwep->fi->state != MGWEP_ST_WAIT_MGW_RESPONSE) - mgwep_fsm_state_chg(MGWEP_ST_WAIT_MGW_RESPONSE); - - return; -dispatch_error: - if (notify) - osmo_fsm_inst_dispatch(notify, event_failure, notify_data); -} - -static int send_verb(struct mgwep_ci *ci) -{ - int rc; - struct mgw_endpoint *mgwep = ci->mgwep; - - if (!ci->occupied || !ci->pending || ci->sent) - return 0; - - switch (ci->verb) { - - case MGCP_VERB_CRCX: - OSMO_ASSERT(!ci->mgcp_client_fi); - LOG_CI_VERB(ci, LOGL_DEBUG, "Sending\n"); - ci->mgcp_client_fi = mgcp_conn_create(mgwep->mgcp_client, mgwep->fi, - CI_EV_FAILURE(ci), CI_EV_SUCCESS(ci), - &ci->verb_info); - ci->sent = true; - if (!ci->mgcp_client_fi){ - LOG_CI_VERB(ci, LOGL_ERROR, "Cannot send\n"); - on_failure(ci); - } - osmo_fsm_inst_update_id(ci->mgcp_client_fi, ci->label); - break; - - case MGCP_VERB_MDCX: - OSMO_ASSERT(ci->mgcp_client_fi); - LOG_CI_VERB(ci, LOGL_DEBUG, "Sending\n"); - rc = mgcp_conn_modify(ci->mgcp_client_fi, CI_EV_SUCCESS(ci), &ci->verb_info); - ci->sent = true; - if (rc) { - LOG_CI_VERB(ci, LOGL_ERROR, "Cannot send (rc=%d %s)\n", rc, strerror(-rc)); - on_failure(ci); - } - break; - - case MGCP_VERB_DLCX: - LOG_CI(ci, LOGL_DEBUG, "Sending MGCP: %s %s\n", - mgcp_verb_name(ci->verb), ci->mgcp_ci_str); - /* The way this is designed, we actually need to forget all about the ci right away. */ - mgcp_conn_delete(ci->mgcp_client_fi); - if (ci->notify) - osmo_fsm_inst_dispatch(ci->notify, ci->notify_success, ci->notify_data); - *ci = (struct mgwep_ci){ - .mgwep = mgwep, - }; - break; - - default: - OSMO_ASSERT(false); - } - - return 1; -} - -void mgw_endpoint_clear(struct mgw_endpoint *mgwep) -{ - if (!mgwep) - return; - osmo_fsm_inst_term(mgwep->fi, OSMO_FSM_TERM_REGULAR, 0); -} - -static void mgwep_count(struct mgw_endpoint *mgwep, int *occupied, int *pending_not_sent, - int *waiting_for_response) -{ - int i; - - if (occupied) - *occupied = 0; - - if (pending_not_sent) - *pending_not_sent = 0; - - if (waiting_for_response) - *waiting_for_response = 0; - - for (i = 0; i < ARRAY_SIZE(mgwep->ci); i++) { - struct mgwep_ci *ci = &mgwep->ci[i]; - if (ci->occupied) { - if (occupied) - (*occupied)++; - } else - continue; - - if (ci->pending) - LOG_CI_VERB(ci, LOGL_DEBUG, "%s\n", - ci->sent ? "waiting for response" : "waiting to be sent"); - else - LOG_CI_VERB(ci, LOGL_DEBUG, "%s\n", mgcp_conn_peer_name(mgwep_ci_get_rtp_info(ci))); - - if (ci->pending && ci->sent) - if (waiting_for_response) - (*waiting_for_response)++; - if (ci->pending && !ci->sent) - if (pending_not_sent) - (*pending_not_sent)++; - } -} - -static void mgwep_fsm_check_state_chg_after_response(struct osmo_fsm_inst *fi) -{ - int waiting_for_response; - int occupied; - struct mgw_endpoint *mgwep = mgwep_fi_mgwep(fi); - - mgwep_count(mgwep, &occupied, NULL, &waiting_for_response); - LOG_MGWEP(mgwep, LOGL_DEBUG, "CI in use: %d, waiting for response: %d\n", occupied, waiting_for_response); - - if (!occupied) { - /* All CI have been released. The endpoint no longer exists. Notify the parent FSM, by - * terminating. */ - osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, 0); - return; - } - - if (!waiting_for_response) { - if (fi->state != MGWEP_ST_IN_USE) - mgwep_fsm_state_chg(MGWEP_ST_IN_USE); - return; - } - -} - -static void mgwep_fsm_wait_mgw_response_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - int count = 0; - int i; - struct mgw_endpoint *mgwep = mgwep_fi_mgwep(fi); - - for (i = 0; i < ARRAY_SIZE(mgwep->ci); i++) { - count += send_verb(&mgwep->ci[i]); - } - - LOG_MGWEP(mgwep, LOGL_DEBUG, "Sent messages: %d\n", count); - mgwep_fsm_check_state_chg_after_response(fi); - -} - -static void mgwep_fsm_handle_ci_events(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - struct mgwep_ci *ci; - struct mgw_endpoint *mgwep = mgwep_fi_mgwep(fi); - ci = mgwep_ci_for_event(mgwep, event); - if (ci) { - if (event == CI_EV_SUCCESS(ci)) - on_success(ci, data); - else - on_failure(ci); - } -} - -static void mgwep_fsm_in_use_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - int pending_not_sent; - struct mgw_endpoint *mgwep = mgwep_fi_mgwep(fi); - - mgwep_count(mgwep, NULL, &pending_not_sent, NULL); - if (pending_not_sent) - mgwep_fsm_state_chg(MGWEP_ST_WAIT_MGW_RESPONSE); -} - -#define S(x) (1 << (x)) - -static const struct osmo_fsm_state mgwep_fsm_states[] = { - [MGWEP_ST_UNUSED] = { - .name = "UNUSED", - .in_event_mask = 0, - .out_state_mask = 0 - | S(MGWEP_ST_WAIT_MGW_RESPONSE) - , - }, - [MGWEP_ST_WAIT_MGW_RESPONSE] = { - .name = "WAIT_MGW_RESPONSE", - .onenter = mgwep_fsm_wait_mgw_response_onenter, - .action = mgwep_fsm_handle_ci_events, - .in_event_mask = 0xffffffff, - .out_state_mask = 0 - | S(MGWEP_ST_IN_USE) - , - }, - [MGWEP_ST_IN_USE] = { - .name = "IN_USE", - .onenter = mgwep_fsm_in_use_onenter, - .action = mgwep_fsm_handle_ci_events, - .in_event_mask = 0xffffffff, /* mgcp_client_fsm may send parent term anytime */ - .out_state_mask = 0 - | S(MGWEP_ST_WAIT_MGW_RESPONSE) - , - }, -}; - -static int mgwep_fsm_timer_cb(struct osmo_fsm_inst *fi) -{ - int i; - struct mgw_endpoint *mgwep = mgwep_fi_mgwep(fi); - - switch (fi->T) { - default: - for (i = 0; i < ARRAY_SIZE(mgwep->ci); i++) { - struct mgwep_ci *ci = &mgwep->ci[i]; - if (!ci->occupied) - continue; - if (!(ci->pending && ci->sent)) - continue; - on_failure(ci); - } - return 0; - } - - return 0; -} - -static struct osmo_fsm mgwep_fsm = { - .name = "mgw-endpoint", - .states = mgwep_fsm_states, - .num_states = ARRAY_SIZE(mgwep_fsm_states), - .log_subsys = DRSL, - .event_names = mgwep_fsm_event_names, - .timer_cb = mgwep_fsm_timer_cb, - /* The FSM termination will automatically trigger any mgcp_client_fsm instances to DLCX. */ -}; - -/* Depending on the channel mode and rate, return the codec type that is signalled towards the MGW. */ -enum mgcp_codecs chan_mode_to_mgcp_codec(enum gsm48_chan_mode chan_mode, bool full_rate) -{ - switch (chan_mode) { - case GSM48_CMODE_SPEECH_V1: - if (full_rate) - return CODEC_GSM_8000_1; - return CODEC_GSMHR_8000_1; - - case GSM48_CMODE_SPEECH_EFR: - return CODEC_GSMEFR_8000_1; - - case GSM48_CMODE_SPEECH_AMR: - return CODEC_AMR_8000_1; - - default: - return -1; - } -} - -int chan_mode_to_mgcp_bss_pt(enum mgcp_codecs codec) -{ - switch (codec) { - case CODEC_GSMHR_8000_1: - return RTP_PT_GSM_HALF; - - case CODEC_GSMEFR_8000_1: - return RTP_PT_GSM_EFR; - - case CODEC_AMR_8000_1: - return RTP_PT_AMR; - - default: - /* Not an error, we just leave it to libosmo-mgcp-client to - * decide over the PT. */ - return -1; - } -} - -void mgcp_pick_codec(struct mgcp_conn_peer *verb_info, const struct gsm_lchan *lchan, bool bss_side) -{ - enum mgcp_codecs codec = chan_mode_to_mgcp_codec(lchan->tch_mode, - lchan->type == GSM_LCHAN_TCH_H? false : true); - int custom_pt; - - if (codec < 0) { - LOG_LCHAN(lchan, LOGL_ERROR, - "Unable to determine MGCP codec type for %s in chan-mode %s\n", - gsm_lchant_name(lchan->type), gsm48_chan_mode_name(lchan->tch_mode)); - verb_info->codecs_len = 0; - return; - } - - verb_info->codecs[0] = codec; - verb_info->codecs_len = 1; - - /* Setup custom payload types (only for BSS side and when required) */ - custom_pt = chan_mode_to_mgcp_bss_pt(codec); - if (bss_side && custom_pt > 0) { - verb_info->ptmap[0].codec = codec; - verb_info->ptmap[0].pt = custom_pt; - verb_info->ptmap_len = 1; - } - - /* AMR requires additional parameters to be set up (framing mode) */ - if (verb_info->codecs[0] == CODEC_AMR_8000_1) { - verb_info->param_present = true; - verb_info->param.amr_octet_aligned_present = true; - } - - if (bss_side && verb_info->codecs[0] == CODEC_AMR_8000_1) { - /* FIXME: At the moment all BTSs we support are using the - * octet-aligned payload format. However, in the future - * we may support BTSs that are using bandwith-efficient - * format. In this case we will have to add functionality - * that distinguishes by the BTS model which mode to use. */ - verb_info->param.amr_octet_aligned = true; - } - else if (!bss_side && verb_info->codecs[0] == CODEC_AMR_8000_1) { - verb_info->param.amr_octet_aligned = lchan->conn->sccp.msc->amr_octet_aligned; - } -} diff --git a/src/osmo-bsc/net_init.c b/src/osmo-bsc/net_init.c index c2a38bc..1ef9bd5 100644 --- a/src/osmo-bsc/net_init.c +++ b/src/osmo-bsc/net_init.c @@ -51,6 +51,12 @@ {} }; +struct osmo_tdef g_mgw_tdefs[] = { + { .T=-1, .default_val=4, .desc="MGCP response timeout" }, + { .T=-2, .default_val=30, .desc="RTP stream establishing timeout" }, + {} +}; + /* Initialize the bare minimum of struct gsm_network, minimizing required dependencies. * This part is shared among the thin programs in osmo-bsc/src/utils/. * osmo-bsc requires further initialization that pulls in more dependencies (see bsc_network_init()). */ @@ -81,5 +87,8 @@ net->T_defs = gsm_network_T_defs; osmo_tdefs_reset(net->T_defs); + net->mgw.tdefs = g_mgw_tdefs; + osmo_tdefs_reset(net->mgw.tdefs); + return net; } diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 65618fd..2d5d4ae 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -19,7 +19,8 @@ * */ -#include +#include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_lcls.c b/src/osmo-bsc/osmo_bsc_lcls.c index 98c74c7..a01c02e 100644 --- a/src/osmo-bsc/osmo_bsc_lcls.c +++ b/src/osmo-bsc/osmo_bsc_lcls.c @@ -29,8 +29,8 @@ #include #include #include -#include -#include +#include +#include struct value_string lcls_event_names[] = { { LCLS_EV_UPDATE_CFG_CSC, "UPDATE_CFG_CSC" }, @@ -277,7 +277,7 @@ { mgcp_pick_codec(mdcx_info, conn->lchan, false); - mgw_endpoint_ci_request(conn->user_plane.mgw_endpoint_ci_msc, MGCP_VERB_MDCX, mdcx_info, + osmo_mgcpc_ep_ci_request(conn->user_plane.mgw_endpoint_ci_msc, MGCP_VERB_MDCX, mdcx_info, NULL, 0, 0, NULL); } @@ -647,7 +647,7 @@ return; } - other_mgw_info = mgwep_ci_get_rtp_info(conn_other->user_plane.mgw_endpoint_ci_msc); + other_mgw_info = osmo_mgcpc_ep_ci_get_rtp_info(conn_other->user_plane.mgw_endpoint_ci_msc); if (!other_mgw_info) { LOGPFSML(fi, LOGL_ERROR, "Cannot enable LCLS without RTP port info of MSC-side" " -- missing CRCX?\n"); diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 08bb40d..99a83dc 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -54,6 +53,8 @@ #include #include +#include + #include #include #include @@ -849,7 +850,7 @@ lchan_fsm_init(); bsc_subscr_conn_fsm_init(); assignment_fsm_init(); - mgw_endpoint_fsm_init(bsc_gsmnet->T_defs); + osmo_mgcpc_ep_fsm_init(bsc_gsmnet->T_defs); handover_fsm_init(); /* Read the config */ diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 40ecf54..56aea50 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -34,7 +34,7 @@ handover_test_LDFLAGS = \ -Wl,--wrap=abis_rsl_sendmsg \ - -Wl,--wrap=mgw_endpoint_ci_request \ + -Wl,--wrap=osmo_mgcpc_ep_ci_request \ $(NULL) handover_test_LDADD = \ @@ -64,7 +64,6 @@ $(top_builddir)/src/osmo-bsc/lchan_rtp_fsm.o \ $(top_builddir)/src/osmo-bsc/lchan_select.o \ $(top_builddir)/src/osmo-bsc/meas_rep.o \ - $(top_builddir)/src/osmo-bsc/mgw_endpoint_fsm.o \ $(top_builddir)/src/osmo-bsc/neighbor_ident.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(top_builddir)/src/osmo-bsc/osmo_bsc_lcls.o \ diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index cd3b749..a125c47 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -45,7 +45,6 @@ #include #include #include -#include #include #include @@ -53,14 +52,14 @@ struct gsm_network *bsc_gsmnet; -/* override, requires '-Wl,--wrap=mgw_endpoint_ci_request'. +/* override, requires '-Wl,--wrap=osmo_mgcpc_ep_ci_request'. * Catch modification of an MGCP connection. */ -void __real_mgw_endpoint_ci_request(struct mgwep_ci *ci, +void __real_osmo_mgcpc_ep_ci_request(struct osmo_mgcpc_ep_ci *ci, enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info, struct osmo_fsm_inst *notify, uint32_t event_success, uint32_t event_failure, void *notify_data); -void __wrap_mgw_endpoint_ci_request(struct mgwep_ci *ci, +void __wrap_osmo_mgcpc_ep_ci_request(struct osmo_mgcpc_ep_ci *ci, enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info, struct osmo_fsm_inst *notify, uint32_t event_success, uint32_t event_failure, @@ -234,9 +233,11 @@ conn = bsc_subscr_con_allocate(net); - conn->user_plane.mgw_endpoint = mgw_endpoint_alloc(conn->fi, + conn->user_plane.mgw_endpoint = osmo_mgcpc_ep_alloc(conn->fi, GSCON_EV_FORGET_MGW_ENDPOINT, - fake_mgcp_client, "test", + fake_mgcp_client, + net->mgw.tdefs, + "test", "fake endpoint"); conn->sccp.msc = &fake_msc_data; @@ -1432,7 +1433,7 @@ ts_fsm_init(); lchan_fsm_init(); - mgw_endpoint_fsm_init(bsc_gsmnet->T_defs); + osmo_mgcpc_ep_fsm_init(bsc_gsmnet->T_defs); bsc_subscr_conn_fsm_init(); handover_fsm_init(); -- To view, visit https://gerrit.osmocom.org/13796 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I03e6b48d9b0a5370310d5f56809259ff7909cf9d Gerrit-Change-Number: 13796 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 19:25:01 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 26 Apr 2019 19:25:01 +0000 Subject: Change in osmo-bsc[master]: fix inter-BSC-HO-incoming for AoIP (1/2) Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13797 Change subject: fix inter-BSC-HO-incoming for AoIP (1/2) ...................................................................... fix inter-BSC-HO-incoming for AoIP (1/2) Move the HO_ST_WAIT_MGW_ENDPOINT_TO_MSC state up to right after the lchan is done establishing. For AoIP, the local RTP address towards the MSC already needs to be known before the Handover Request Acknowledge is sent, so the AoIP Transport Layer Address IE can be included. This patch only modifies the handover FSM, a subsequent patch adds the IE. Change-Id: I00c18b78573386145af71c4b39f7f22aec24579b --- M include/osmocom/bsc/handover_fsm.h M src/osmo-bsc/handover_fsm.c 2 files changed, 105 insertions(+), 86 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/97/13797/1 diff --git a/include/osmocom/bsc/handover_fsm.h b/include/osmocom/bsc/handover_fsm.h index 4db0890..7c2145e 100644 --- a/include/osmocom/bsc/handover_fsm.h +++ b/include/osmocom/bsc/handover_fsm.h @@ -28,10 +28,10 @@ HO_ST_NOT_STARTED, HO_ST_WAIT_LCHAN_ACTIVE, + HO_ST_WAIT_MGW_ENDPOINT_TO_MSC, HO_ST_WAIT_RR_HO_DETECT, HO_ST_WAIT_RR_HO_COMPLETE, HO_ST_WAIT_LCHAN_ESTABLISHED, - HO_ST_WAIT_MGW_ENDPOINT_TO_MSC, /* The inter-BSC Outgoing Handover FSM has completely separate states, but since it makes sense for it * to also live in conn->ho.fi, it should share the same event enum. From there it is merely @@ -46,11 +46,11 @@ HO_EV_LCHAN_ACTIVE, HO_EV_LCHAN_ESTABLISHED, HO_EV_LCHAN_ERROR, + HO_EV_MSC_MGW_OK, + HO_EV_MSC_MGW_FAIL, HO_EV_RR_HO_DETECT, HO_EV_RR_HO_COMPLETE, HO_EV_RR_HO_FAIL, - HO_EV_MSC_MGW_OK, - HO_EV_MSC_MGW_FAIL, HO_EV_CONN_RELEASING, HO_OUT_EV_BSSMAP_HO_COMMAND, diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 0d1449f..6a07fbe 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -162,10 +162,10 @@ static const struct osmo_tdef_state_timeout ho_fsm_timeouts[32] = { [HO_ST_WAIT_LCHAN_ACTIVE] = { .T = 23042 }, + [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { .T = 23042 }, [HO_ST_WAIT_RR_HO_DETECT] = { .T = 23042 }, [HO_ST_WAIT_RR_HO_COMPLETE] = { .T = 23042 }, [HO_ST_WAIT_LCHAN_ESTABLISHED] = { .T = 23042 }, - [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { .T = 23042 }, [HO_OUT_ST_WAIT_HO_COMMAND] = { .T = 7 }, [HO_OUT_ST_WAIT_CLEAR] = { .T = 8 }, }; @@ -877,10 +877,24 @@ static void ho_fsm_wait_lchan_active(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + struct handover *ho = &conn->ho; switch (event) { case HO_EV_LCHAN_ACTIVE: - ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); + /* - If the lchan is voiceless, no need to even think about the MGW. + * - If this is an intra-BSC Handover, we already have an RTP stream towards the MSC and aren't + * touching it. + * - If we're on SCCPlite, the MSC manages the MGW endpoint, all we do is the BTS side CI, so we can + * skip the part that would CRCX towards the MSC. + * So create an MSC side endpoint CI only if a voice lchan is established for an incoming inter-BSC + * handover on AoIP. Otherwise go on to send a Handover Command and wait for the Detect. + */ + if (ho->new_lchan->activate.info.requires_voice_stream + && (ho->scope & HO_INTER_BSC_IN) + && gscon_is_aoip(conn)) + ho_fsm_state_chg(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC); + else + ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); return; case HO_EV_LCHAN_ERROR: @@ -893,6 +907,75 @@ } } +/* Only for voice, only for inter-BSC Handover into this BSC, and only for AoIP: + * + * Establish the MGW endpoint CI that points towards the MSC. This needs to happen after the lchan (lchan_rtp_fsm) has + * created an MGW endpoint with the first CRCX, so that an endpoint is available, and before sending the Handover + * Request Acknowledge, so that the RTP address and port established towards the MSC can be included in the Handover + * Request Acknowledge message. + * (For SCCPlite, the MSC manages the CN side endpoint CI itself, and we don't need to send any RTP address in the + * Handover Request Acknowledge.) + * + * Actually, it should be possible to kick this off even above in handover_start_inter_bsc_in(), to do the CRCX towards + * the MSC at the same time as establishing the lchan. The gscon_ensure_mgw_endpoint() doesn't care which one of + * lchan_rtp_fsm or handover_start_inter_bsc_in() calls it first. The benefit would be that we'd send out the Handover + * Command ever so slightly sooner -- which isn't critical really, because a) how long does a CRCX take, milliseconds? + * and b) the time critical part is *after* the Handover Command was kicked off to keep the transition between cells as + * short as possible. The drawback of doing this earlier is code complexity: receiving the HO_EV_MSC_MGW_OK / + * HO_EV_MSC_MGW_FAIL events would need to be juggled in between the HO_EV_LCHAN_ACTIVE / HO_EV_LCHAN_ERROR. So the + * decision for now is to leave it here. + */ +static void ho_fsm_wait_mgw_endpoint_to_msc_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + struct handover *ho = &conn->ho; + + if (!gscon_connect_mgw_to_msc(conn, + ho->new_lchan, + ho->inter_bsc_in.msc_assigned_rtp_addr, + ho->inter_bsc_in.msc_assigned_rtp_port, + fi, + HO_EV_MSC_MGW_OK, + HO_EV_MSC_MGW_FAIL, + NULL, + &ho->created_ci_for_msc)) { + ho_fail(HO_RESULT_ERROR, + "Unable to connect MGW endpoint to the MSC side"); + } +} + +static void ho_fsm_wait_mgw_endpoint_to_msc(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + const struct mgcp_conn_peer *mgw_info; + + switch (event) { + + case HO_EV_MSC_MGW_OK: + /* Ensure the endpoint is really there, and log it. This state is only entered for AoIP connections, see + * ho_fsm_wait_lchan_active() above. */ + mgw_info = osmo_mgcpc_ep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); + if (!mgw_info) { + ho_fail(HO_RESULT_ERROR, + "Unable to retrieve RTP port info allocated by MGW for" + " the MSC side."); + return; + } + LOG_HO(conn, LOGL_DEBUG, "MGW's MSC side CI: %s:%u\n", + mgw_info->addr, mgw_info->port); + ho_fsm_state_chg(HO_ST_WAIT_RR_HO_DETECT); + return; + + case HO_EV_MSC_MGW_FAIL: + ho_fail(HO_RESULT_ERROR, + "Unable to connect MGW endpoint to the MSC side"); + return; + + default: + OSMO_ASSERT(false); + } +} + static void ho_fsm_wait_rr_ho_detect_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { int rc; @@ -1010,24 +1093,23 @@ } } -static void ho_fsm_post_lchan_established(struct osmo_fsm_inst *fi); - static void ho_fsm_wait_lchan_established_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { struct gsm_subscriber_connection *conn = ho_fi_conn(fi); if (conn->ho.fi && lchan_state_is(conn->ho.new_lchan, LCHAN_ST_ESTABLISHED)) { LOG_HO(conn, LOGL_DEBUG, "lchan already established earlier\n"); - ho_fsm_post_lchan_established(fi); + ho_success(); } } static void ho_fsm_wait_lchan_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) { - switch (event) { + struct gsm_subscriber_connection *conn = ho_fi_conn(fi); + switch (event) { case HO_EV_LCHAN_ESTABLISHED: - ho_fsm_post_lchan_established(fi); + ho_success(); break; default: @@ -1035,69 +1117,6 @@ } } -static void ho_fsm_post_lchan_established(struct osmo_fsm_inst *fi) -{ - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - struct handover *ho = &conn->ho; - - if (ho->new_lchan->activate.info.requires_voice_stream - && (ho->scope & HO_INTER_BSC_IN)) - ho_fsm_state_chg(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC); - else - ho_success(); -} - -static void ho_fsm_wait_mgw_endpoint_to_msc_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - struct handover *ho = &conn->ho; - - if (!gscon_connect_mgw_to_msc(conn, - ho->new_lchan, - ho->inter_bsc_in.msc_assigned_rtp_addr, - ho->inter_bsc_in.msc_assigned_rtp_port, - fi, - HO_EV_MSC_MGW_OK, - HO_EV_MSC_MGW_FAIL, - NULL, - &ho->created_ci_for_msc)) { - ho_fail(HO_RESULT_ERROR, - "Unable to connect MGW endpoint to the MSC side"); - } -} - -static void ho_fsm_wait_mgw_endpoint_to_msc(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - switch (event) { - - case HO_EV_MSC_MGW_OK: - /* For AoIP, we created the MGW endpoint. Ensure it is really there, and log it. */ - if (gscon_is_aoip(conn)) { - const struct mgcp_conn_peer *mgw_info; - mgw_info = osmo_mgcpc_ep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); - if (!mgw_info) { - ho_fail(HO_RESULT_ERROR, - "Unable to retrieve RTP port info allocated by MGW for" - " the MSC side."); - return; - } - LOG_HO(conn, LOGL_DEBUG, "MGW's MSC side CI: %s:%u\n", - mgw_info->addr, mgw_info->port); - } - ho_success(); - return; - - case HO_EV_MSC_MGW_FAIL: - ho_fail(HO_RESULT_ERROR, - "Unable to connect MGW endpoint to the MSC side"); - return; - - default: - OSMO_ASSERT(false); - } -} - /* Inter-BSC OUT */ static void handover_start_inter_bsc_out(struct gsm_subscriber_connection *conn, @@ -1186,6 +1205,19 @@ , .out_state_mask = 0 | S(HO_ST_WAIT_LCHAN_ACTIVE) + | S(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC) + | S(HO_ST_WAIT_RR_HO_DETECT) + , + }, + [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { + .name = "WAIT_MGW_ENDPOINT_TO_MSC", + .onenter = ho_fsm_wait_mgw_endpoint_to_msc_onenter, + .action = ho_fsm_wait_mgw_endpoint_to_msc, + .in_event_mask = 0 + | S(HO_EV_MSC_MGW_OK) + | S(HO_EV_MSC_MGW_FAIL) + , + .out_state_mask = 0 | S(HO_ST_WAIT_RR_HO_DETECT) , }, @@ -1223,20 +1255,7 @@ .in_event_mask = 0 | S(HO_EV_LCHAN_ESTABLISHED) , - .out_state_mask = 0 - | S(HO_ST_WAIT_MGW_ENDPOINT_TO_MSC) - , }, - [HO_ST_WAIT_MGW_ENDPOINT_TO_MSC] = { - .name = "WAIT_MGW_ENDPOINT_TO_MSC", - .onenter = ho_fsm_wait_mgw_endpoint_to_msc_onenter, - .action = ho_fsm_wait_mgw_endpoint_to_msc, - .in_event_mask = 0 - | S(HO_EV_MSC_MGW_OK) - | S(HO_EV_MSC_MGW_FAIL) - , - }, - [HO_OUT_ST_WAIT_HO_COMMAND] = { .name = "inter-BSC-OUT:WAIT_HO_COMMAND", .action = ho_out_fsm_wait_ho_command, -- To view, visit https://gerrit.osmocom.org/13797 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I00c18b78573386145af71c4b39f7f22aec24579b Gerrit-Change-Number: 13797 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 19:43:54 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 26 Apr 2019 19:43:54 +0000 Subject: Change in libosmocore[master]: add gsm0808_create_handover_request_ack2 to add AoIP RTP addr In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13259 ) Change subject: add gsm0808_create_handover_request_ack2 to add AoIP RTP addr ...................................................................... Patch Set 11: Given the other patches waiting for this on this branch and all the depending patches in other repositories waiting for those, there is a bit of pressure to merge this now. If something else should happen with this, it would be good to make up our minds sooner rather than later... -- To view, visit https://gerrit.osmocom.org/13259 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia71542ea37d4fd2c9fb9b40357db7aeb111ec576 Gerrit-Change-Number: 13259 Gerrit-PatchSet: 11 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 26 Apr 2019 19:43:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Fri Apr 26 20:05:31 2019 From: admin at opensuse.org (OBS Notification) Date: Fri, 26 Apr 2019 20:05:31 +0000 Subject: Build failure of network:osmocom:nightly/libosmo-netif in xUbuntu_18.04/x86_64 In-Reply-To: References: Message-ID: <5cc3649b72424_2aa54805f83955ae@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/xUbuntu_18.04/x86_64 Package network:osmocom:nightly/libosmo-netif failed to build in xUbuntu_18.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmo-netif Last lines of build log: [ 110s] +non-reconnecting test step 0 [client OK, server OK], FD reg 1 [ 110s] --- expout 2019-04-26 20:05:14.332000000 +0000 [ 110s] +++ /usr/src/packages/BUILD/tests/testsuite.dir/at-groups/1/stdout 2019-04-26 20:05:23.352000000 +0000 [ 110s] @@ -44,8 +44,6 @@ [ 110s] [OK|OK] Server's read_cb_srv(): received 29(29) bytes: 44 6f 68 2c 20 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 73 65 72 76 65 72 20 3a 2d 44 [ 110s] [OK|OK] Server's read_cb_srv(): sent 11 bytes message: 72 65 61 64 5f 63 62 5f 73 72 76 [ 110s] [OK|OK] Server's read_cb_srv(): force client disconnect on subsequent call [ 110s] -[OK] Client's read_cb_cli(): callback triggered [ 110s] -[OK] Client's read_cb_cli(): 0-byte read, auto-reconnect will be triggered if enabled [ 110s] non-reconnecting test complete. [ 110s] [ 110s] Stream tests completed [ 110s] 1. testsuite.at:4: 1. stream_test (testsuite.at:4): FAILED (testsuite.at:8) [ 110s] debian/rules:27: recipe for target 'override_dh_auto_test' failed [ 110s] make[1]: *** [override_dh_auto_test] Error 1 [ 110s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 110s] debian/rules:13: recipe for target 'build' failed [ 110s] make: *** [build] Error 2 [ 110s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 110s] [ 110s] sheep82 failed "build libosmo-netif_0.4.0.25.e380.dsc" at Fri Apr 26 20:05:24 UTC 2019. [ 110s] [ 110s] ### VM INTERACTION START ### [ 113s] [ 105.254600] sysrq: SysRq : Power Off [ 113s] [ 105.261337] reboot: Power down [ 113s] ### VM INTERACTION END ### [ 113s] [ 113s] sheep82 failed "build libosmo-netif_0.4.0.25.e380.dsc" at Fri Apr 26 20:05:28 UTC 2019. [ 113s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Apr 26 20:26:14 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 26 Apr 2019 20:26:14 +0000 Subject: Change in osmo-mgw[master]: move MGW endpoint FSM from osmo-bsc to here In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13590 to look at the new patch set (#4). Change subject: move MGW endpoint FSM from osmo-bsc to here ...................................................................... move MGW endpoint FSM from osmo-bsc to here Move mgw_endpoint_fsm from osmo-bsc here as osmo_mgcpc_ep_fsm. Apply various renames for consistency. Use osmo_tdef from libosmocore instead of osmo-bsc's (so far) local T_defs API. Change T23042 to T2427001, which is a slightly less arbitrary number and slightly more extendable in the future (2427 corresponds to the default MGCP port at osmo-mgw, 001 is the first MGCP timer and so far the only one). Change-Id: I9a3effd38e72841529df6c135c077116981dea36 --- M include/Makefile.am A include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h M include/osmocom/mgcp_client/mgcp_client_fsm.h M src/libosmo-mgcp-client/Makefile.am A src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c M src/libosmo-mgcp-client/mgcp_client_fsm.c 6 files changed, 869 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/90/13590/4 -- To view, visit https://gerrit.osmocom.org/13590 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9a3effd38e72841529df6c135c077116981dea36 Gerrit-Change-Number: 13590 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Apr 26 20:26:14 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 26 Apr 2019 20:26:14 +0000 Subject: Change in osmo-mgw[master]: fix: multiple initial CRCX 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/13591 to look at the new patch set (#4). Change subject: fix: multiple initial CRCX ...................................................................... fix: multiple initial CRCX The first CRCX responds with the actual MGW endpoint name that is assigned (at least for rtpbridge/*@mgw requests). If multiple CRCX are scheduled at the same time on a fresh MGW endpoint, both get fired with a '*' and each creates a separate MGW endpoint. Make mgcp_client_endpoint_fsm avoid this, and schedule only one CRCX at first, and the rest once the MGW endpoint name is fixated. It is thus possible to safely issue two osmo_mgcpc_ep_ci_request() at the same time. Change-Id: I92a9944acc96398acd6649f9c3c5badec5dd6dcc --- M src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c 1 file changed, 90 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/91/13591/4 -- To view, visit https://gerrit.osmocom.org/13591 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I92a9944acc96398acd6649f9c3c5badec5dd6dcc Gerrit-Change-Number: 13591 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 27 09:15:49 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 27 Apr 2019 09:15:49 +0000 Subject: Change in osmocom-bb[master]: lua: Add a sentinel for the fd function table Message-ID: Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/13798 Change subject: lua: Add a sentinel for the fd function table ...................................................................... lua: Add a sentinel for the fd function table Change-Id: I4fe2fd6584a453a951361e1b67fb986583b176be --- M src/host/layer23/src/mobile/script_lua.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/98/13798/1 diff --git a/src/host/layer23/src/mobile/script_lua.c b/src/host/layer23/src/mobile/script_lua.c index 9117cdd..2979e7c 100644 --- a/src/host/layer23/src/mobile/script_lua.c +++ b/src/host/layer23/src/mobile/script_lua.c @@ -544,6 +544,7 @@ static const struct luaL_Reg fd_funcs[] = { { "unregister", lua_fd_unregister }, { "__gc", lua_fd_unregister }, + { NULL, NULL }, }; static const struct luaL_Reg ms_funcs[] = { -- To view, visit https://gerrit.osmocom.org/13798 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4fe2fd6584a453a951361e1b67fb986583b176be Gerrit-Change-Number: 13798 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 27 09:23:30 2019 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 27 Apr 2019 09:23:30 +0000 Subject: Change in osmocom-bb[master]: lua: Add a sentinel for the fd function table In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/13798 ) Change subject: lua: Add a sentinel for the fd function table ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13798 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4fe2fd6584a453a951361e1b67fb986583b176be Gerrit-Change-Number: 13798 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 27 Apr 2019 09:23:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 27 09:30:58 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 27 Apr 2019 09:30:58 +0000 Subject: Change in osmocom-bb[master]: lua: Add a sentinel for the fd function table In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/13798 ) Change subject: lua: Add a sentinel for the fd function table ...................................................................... lua: Add a sentinel for the fd function table Change-Id: I4fe2fd6584a453a951361e1b67fb986583b176be --- M src/host/layer23/src/mobile/script_lua.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, approved diff --git a/src/host/layer23/src/mobile/script_lua.c b/src/host/layer23/src/mobile/script_lua.c index 9117cdd..2979e7c 100644 --- a/src/host/layer23/src/mobile/script_lua.c +++ b/src/host/layer23/src/mobile/script_lua.c @@ -544,6 +544,7 @@ static const struct luaL_Reg fd_funcs[] = { { "unregister", lua_fd_unregister }, { "__gc", lua_fd_unregister }, + { NULL, NULL }, }; static const struct luaL_Reg ms_funcs[] = { -- To view, visit https://gerrit.osmocom.org/13798 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4fe2fd6584a453a951361e1b67fb986583b176be Gerrit-Change-Number: 13798 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 27 11:36:15 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 27 Apr 2019 11:36:15 +0000 Subject: Change in osmo-sgsn[master]: gprs_sndcp_comp_free: Replace ifelse with switch and better handling ... Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13799 Change subject: gprs_sndcp_comp_free: Replace ifelse with switch and better handling of error ...................................................................... gprs_sndcp_comp_free: Replace ifelse with switch and better handling of error gprs_sndcp_dcomp_term asserts if compclass is not SNDCP_XID_DATA_COMPRESSION, so this way by checking in the caller too we easily now if the unexpected value is in compclass or in algo.dcomp. Change-Id: I4600e6a137f42f20fdf69637e4a9048b265c1748 --- M src/gprs/gprs_sndcp_comp.c 1 file changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/99/13799/1 diff --git a/src/gprs/gprs_sndcp_comp.c b/src/gprs/gprs_sndcp_comp.c index 0b4c67c..c71cc89 100644 --- a/src/gprs/gprs_sndcp_comp.c +++ b/src/gprs/gprs_sndcp_comp.c @@ -160,16 +160,23 @@ llist_for_each_entry(comp_entity, comp_entities, list) { /* Free compression entity */ - if (comp_entity->compclass == SNDCP_XID_PROTOCOL_COMPRESSION) { + switch (comp_entity->compclass) { + case SNDCP_XID_PROTOCOL_COMPRESSION: LOGP(DSNDCP, LOGL_INFO, "Deleting header compression entity %d ...\n", comp_entity->entity); gprs_sndcp_pcomp_term(comp_entity); - } else { + break; + case SNDCP_XID_DATA_COMPRESSION: LOGP(DSNDCP, LOGL_INFO, "Deleting data compression entity %d ...\n", comp_entity->entity); gprs_sndcp_dcomp_term(comp_entity); + break; + default: + LOGP(DSNDCP, LOGL_INFO, + "Invalid compression class %d!\n", comp_entity->compclass); + OSMO_ASSERT(false); } } -- To view, visit https://gerrit.osmocom.org/13799 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4600e6a137f42f20fdf69637e4a9048b265c1748 Gerrit-Change-Number: 13799 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 27 12:48:26 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Apr 2019 12:48:26 +0000 Subject: Change in osmo-sgsn[master]: gprs_sndcp_comp_free: Replace ifelse with switch and better handling ... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13799 ) Change subject: gprs_sndcp_comp_free: Replace ifelse with switch and better handling of error ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13799 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4600e6a137f42f20fdf69637e4a9048b265c1748 Gerrit-Change-Number: 13799 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sat, 27 Apr 2019 12:48:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 27 12:49:11 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Apr 2019 12:49:11 +0000 Subject: Change in osmo-mgw[master]: move MGW endpoint FSM from osmo-bsc to here In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13590 ) Change subject: move MGW endpoint FSM from osmo-bsc to here ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13590 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9a3effd38e72841529df6c135c077116981dea36 Gerrit-Change-Number: 13590 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sat, 27 Apr 2019 12:49:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 27 12:49:31 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Apr 2019 12:49:31 +0000 Subject: Change in osmo-mgw[master]: fix: multiple initial CRCX In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13591 ) Change subject: fix: multiple initial CRCX ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13591 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I92a9944acc96398acd6649f9c3c5badec5dd6dcc Gerrit-Change-Number: 13591 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sat, 27 Apr 2019 12:49:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 27 15:42:36 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Sat, 27 Apr 2019 15:42:36 +0000 Subject: Change in osmo-msc[master]: remove msc specific db counters Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/13800 Change subject: remove msc specific db counters ...................................................................... remove msc specific db counters DB counters has been used to save osmo_counters & osmo_rate_ctr to a local sqlite databases every 60 seconds. This is quite slow e.g. 1000 subscriber might slow the msc down. Change-Id: Id64f1839a55b5326f74ec04b7a5dbed9d269b89c --- M include/osmocom/msc/db.h M src/libmsc/db.c M src/osmo-msc/msc_main.c 3 files changed, 2 insertions(+), 92 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/00/13800/1 diff --git a/include/osmocom/msc/db.h b/include/osmocom/msc/db.h index 6d07055..ff5f5ef 100644 --- a/include/osmocom/msc/db.h +++ b/include/osmocom/msc/db.h @@ -50,10 +50,4 @@ int db_sms_delete_expired_message_by_id(unsigned long long sms_id); void db_sms_delete_oldest_expired_message(void); -/* Statistics counter storage */ -struct osmo_counter; -int db_store_counter(struct osmo_counter *ctr); -struct rate_ctr_group; -int db_store_rate_ctr_group(struct rate_ctr_group *ctrg); - #endif /* _DB_H */ diff --git a/src/libmsc/db.c b/src/libmsc/db.c index b5e7ad8..9053b1b 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -1057,63 +1057,3 @@ dbi_result_free(result); } - -int db_store_counter(struct osmo_counter *ctr) -{ - dbi_result result; - char *q_name; - - dbi_conn_quote_string_copy(conn, ctr->name, &q_name); - - result = dbi_conn_queryf(conn, - "INSERT INTO Counters " - "(timestamp,name,value) VALUES " - "(datetime('now'),%s,%lu)", q_name, ctr->value); - - free(q_name); - - if (!result) - return -EIO; - - dbi_result_free(result); - return 0; -} - -static int db_store_rate_ctr(struct rate_ctr_group *ctrg, unsigned int num, - char *q_prefix) -{ - dbi_result result; - char *q_name; - - dbi_conn_quote_string_copy(conn, ctrg->desc->ctr_desc[num].name, - &q_name); - - result = dbi_conn_queryf(conn, - "Insert INTO RateCounters " - "(timestamp,name,idx,value) VALUES " - "(datetime('now'),%s.%s,%u,%"PRIu64")", - q_prefix, q_name, ctrg->idx, ctrg->ctr[num].current); - - free(q_name); - - if (!result) - return -EIO; - - dbi_result_free(result); - return 0; -} - -int db_store_rate_ctr_group(struct rate_ctr_group *ctrg) -{ - unsigned int i; - char *q_prefix; - - dbi_conn_quote_string_copy(conn, ctrg->desc->group_name_prefix, &q_prefix); - - for (i = 0; i < ctrg->desc->num_ctr; i++) - db_store_rate_ctr(ctrg, i, q_prefix); - - free(q_prefix); - - return 0; -} diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index b55d38f..c60a30c 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -97,19 +97,14 @@ const char *config_file; int daemonize; const char *mncc_sock_path; - int use_db_counter; } msc_cmdline_config = { .database_name = "sms.db", .config_file = "osmo-msc.cfg", - .use_db_counter = 1, }; /* timer to store statistics */ -#define DB_SYNC_INTERVAL 60, 0 #define EXPIRE_INTERVAL 10, 0 -static struct osmo_timer_list db_sync_timer; - static int quit = 0; static void print_usage() @@ -130,7 +125,6 @@ printf(" -V --version Print the version of OsmoMSC.\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(" -C --no-dbcounter Disable regular syncing of counters to database.\n"); } static void handle_options(int argc, char **argv) @@ -148,7 +142,7 @@ {"version", 0, 0, 'V' }, {"log-level", 1, 0, 'e'}, {"mncc-sock-path", 1, 0, 'M'}, - {"no-dbcounter", 0, 0, 'C'}, + {"no-dbcounter", 0, 0, 'C'}, /* deprecated */ {0, 0, 0, 0} }; @@ -187,7 +181,7 @@ msc_cmdline_config.mncc_sock_path = optarg; break; case 'C': - msc_cmdline_config.use_db_counter = 0; + fprintf(stderr, "-C is deprecated and does nothing."); break; case 'V': print_version(1); @@ -254,19 +248,6 @@ } } -/* timer handling */ -static int _db_store_counter(struct osmo_counter *counter, void *data) -{ - return db_store_counter(counter); -} - -static void db_sync_timer_cb(void *data) -{ - /* store counters to database and re-schedule */ - osmo_counters_for_each(_db_store_counter, NULL); - osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL); -} - static int msc_vty_go_parent(struct vty *vty) { switch (vty->node) { @@ -664,11 +645,6 @@ return 5; } - /* setup the timer */ - osmo_timer_setup(&db_sync_timer, db_sync_timer_cb, NULL); - if (msc_cmdline_config.use_db_counter) - osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL); - signal(SIGINT, &signal_handler); signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); -- To view, visit https://gerrit.osmocom.org/13800 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id64f1839a55b5326f74ec04b7a5dbed9d269b89c Gerrit-Change-Number: 13800 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 27 16:36:45 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Sat, 27 Apr 2019 16:36:45 +0000 Subject: Change in osmo-msc[master]: remove msc specific db counters In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13800 ) Change subject: remove msc specific db counters ...................................................................... Patch Set 1: Code-Review+1 It is also not needed since we have the statsd export to access the counters outside of osmo-msc -- To view, visit https://gerrit.osmocom.org/13800 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id64f1839a55b5326f74ec04b7a5dbed9d269b89c Gerrit-Change-Number: 13800 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sat, 27 Apr 2019 16:36:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 27 20:53:44 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Sat, 27 Apr 2019 20:53:44 +0000 Subject: Change in docker-playground[master]: Add script to bisect test failures with ttcn3 and docker In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/13790 ) Change subject: Add script to bisect test failures with ttcn3 and docker ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13790 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I11f7e61a9b30d58a0fdfcaf77dde447806bf661f Gerrit-Change-Number: 13790 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: osmith Gerrit-Comment-Date: Sat, 27 Apr 2019 20:53:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 27 21:21:05 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Sat, 27 Apr 2019 21:21:05 +0000 Subject: Change in libosmocore[master]: add osmo_stat_item_inc/osmo_stat_item_dec to set it relative Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/13801 Change subject: add osmo_stat_item_inc/osmo_stat_item_dec to set it relative ...................................................................... add osmo_stat_item_inc/osmo_stat_item_dec to set it relative Change-Id: Id2462c4866bd22bc2338c9c8f69b775f88ae7511 --- M include/osmocom/core/stat_item.h M src/stat_item.c M tests/stats/stats_test.c 3 files changed, 42 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/01/13801/1 diff --git a/include/osmocom/core/stat_item.h b/include/osmocom/core/stat_item.h index 260ffb1..806173a 100644 --- a/include/osmocom/core/stat_item.h +++ b/include/osmocom/core/stat_item.h @@ -79,6 +79,8 @@ void osmo_stat_item_group_free(struct osmo_stat_item_group *statg); +void osmo_stat_item_inc(struct osmo_stat_item *item, int32_t value); +void osmo_stat_item_dec(struct osmo_stat_item *item, int32_t value); void osmo_stat_item_set(struct osmo_stat_item *item, int32_t value); int osmo_stat_item_init(void *tall_ctx); diff --git a/src/stat_item.c b/src/stat_item.c index cb9b90f..6716575 100644 --- a/src/stat_item.c +++ b/src/stat_item.c @@ -150,6 +150,30 @@ talloc_free(grp); } +/*! Increase the stat_item to the given value. + * This function adds a new value for the given stat_item at the end of + * the FIFO. + * \param[in] item The stat_item whose \a value we want to set + * \param[in] value The numeric value we want to store at end of FIFO + */ +void osmo_stat_item_inc(struct osmo_stat_item *item, int32_t value) +{ + int32_t oldvalue = item->values[item->last_offs].value; + osmo_stat_item_set(item, oldvalue + value); +} + +/*! Descrease the stat_item to the given value. + * This function adds a new value for the given stat_item at the end of + * the FIFO. + * \param[in] item The stat_item whose \a value we want to set + * \param[in] value The numeric value we want to store at end of FIFO + */ +void osmo_stat_item_dec(struct osmo_stat_item *item, int32_t value) +{ + int32_t oldvalue = item->values[item->last_offs].value; + osmo_stat_item_set(item, oldvalue - value); +} + /*! Set the a given stat_item to the given value. * This function adds a new value for the given stat_item at the end of * the FIFO. diff --git a/tests/stats/stats_test.c b/tests/stats/stats_test.c index 6ef8841..71f710a 100644 --- a/tests/stats/stats_test.c +++ b/tests/stats/stats_test.c @@ -147,6 +147,22 @@ OSMO_ASSERT(value == 1000 + i); } + /* check if dec & inc is working */ + osmo_stat_item_set(statg->items[TEST_A_ITEM], 42); + rc = osmo_stat_item_get_next(statg->items[TEST_A_ITEM], &rd_a, &value); + OSMO_ASSERT(rc > 0); + OSMO_ASSERT(value == 42); + + osmo_stat_item_dec(statg->items[TEST_A_ITEM], 21); + rc = osmo_stat_item_get_next(statg->items[TEST_A_ITEM], &rd_a, &value); + OSMO_ASSERT(rc > 0); + OSMO_ASSERT(value == 21); + + osmo_stat_item_inc(statg->items[TEST_A_ITEM], 21); + rc = osmo_stat_item_get_next(statg->items[TEST_A_ITEM], &rd_a, &value); + OSMO_ASSERT(rc > 0); + OSMO_ASSERT(value == 42); + /* Keep 2 in FIFO */ osmo_stat_item_set(statg->items[TEST_A_ITEM], 33); osmo_stat_item_set(statg->items[TEST_B_ITEM], 1000 + 33); -- To view, visit https://gerrit.osmocom.org/13801 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id2462c4866bd22bc2338c9c8f69b775f88ae7511 Gerrit-Change-Number: 13801 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 27 21:46:00 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Sat, 27 Apr 2019 21:46:00 +0000 Subject: Change in osmo-msc[master]: replace osmo_counter with stat items Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/13802 Change subject: replace osmo_counter with stat items ...................................................................... replace osmo_counter with stat items Change-Id: I6a20123b263f4f808153794ee8a735092deb399e --- M include/osmocom/msc/gsm_data.h M src/libmsc/gsm_04_08_cc.c M src/libmsc/gsm_09_11.c M src/libmsc/osmo_msc.c 4 files changed, 29 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/02/13802/1 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 1a0d144..7049a63 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -101,6 +102,11 @@ [MSC_CTR_BSSMAP_CIPHER_MODE_COMPLETE] = {"bssmap:cipher_mode_complete", "Number of CIPHER MODE COMPLETE messages processed by BSSMAP layer"}, }; +enum { + MSC_STAT_ACTIVE_CALLS, + MSC_STAT_NC_SS, +}; + static const struct rate_ctr_group_desc msc_ctrg_desc = { "msc", "mobile switching center", @@ -109,6 +115,19 @@ msc_ctr_description, }; +static const struct osmo_stat_item_desc msc_stat_item_description[] = { + [MSC_STAT_ACTIVE_CALLS] = { "msc.active_calls", "Current active calls ", OSMO_STAT_ITEM_NO_UNIT, 4, 0}, + [MSC_STAT_NC_SS] = { "msc.active_nc_ss", "" , OSMO_STAT_ITEM_NO_UNIT, 4, 0}, +}; + +static const struct osmo_stat_item_group_desc msc_statg_desc = { + "net", + "network statistics", + OSMO_STATS_CLASS_GLOBAL, + ARRAY_SIZE(msc_stat_item_description), + msc_stat_item_description, +}; + #define MSC_PAGING_RESPONSE_TIMER_DEFAULT 10 struct gsm_tz { @@ -136,8 +155,7 @@ int send_mm_info; struct rate_ctr_group *msc_ctrs; - struct osmo_counter *active_calls; - struct osmo_counter *active_nc_ss; + struct osmo_stat_item_group *statg; /* layer 4 */ char *mncc_sock_path; diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c index 98c2aa3..f511601 100644 --- a/src/libmsc/gsm_04_08_cc.c +++ b/src/libmsc/gsm_04_08_cc.c @@ -149,7 +149,7 @@ /* state incoming */ switch (new_state) { case GSM_CSTATE_ACTIVE: - osmo_counter_inc(trans->net->active_calls); + osmo_stat_item_inc(trans->net->statg->items[MSC_STAT_ACTIVE_CALLS], 1); rate_ctr_inc(&msc->ctr[MSC_CTR_CALL_ACTIVE]); break; } @@ -157,7 +157,7 @@ /* state outgoing */ switch (old_state) { case GSM_CSTATE_ACTIVE: - osmo_counter_dec(trans->net->active_calls); + osmo_stat_item_dec(trans->net->statg->items[MSC_STAT_ACTIVE_CALLS], 1); if (new_state == GSM_CSTATE_DISCONNECT_REQ || new_state == GSM_CSTATE_DISCONNECT_IND) rate_ctr_inc(&msc->ctr[MSC_CTR_CALL_COMPLETE]); diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c index c133656..778d765 100644 --- a/src/libmsc/gsm_09_11.c +++ b/src/libmsc/gsm_09_11.c @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -146,7 +147,7 @@ ncss_session_timeout_handler, trans); /* Count active NC SS/USSD sessions */ - osmo_counter_inc(conn->network->active_nc_ss); + osmo_stat_item_inc(trans->net->statg->items[MSC_STAT_NC_SS], 1); trans->conn = ran_conn_get(conn, RAN_CONN_USE_TRANS_NC_SS); trans->dlci = OMSC_LINKID_CB(msg); @@ -352,7 +353,7 @@ } /* Count active NC SS/USSD sessions */ - osmo_counter_inc(net->active_nc_ss); + osmo_stat_item_inc(trans->net->statg->items[MSC_STAT_NC_SS], 1); /* Assign transaction ID */ tid = trans_assign_trans_id(trans->net, trans->vsub, GSM48_PDISC_NC_SS); @@ -428,7 +429,7 @@ osmo_timer_del(&trans->ss.timer_guard); /* One session less */ - osmo_counter_dec(trans->net->active_nc_ss); + osmo_stat_item_dec(trans->net->statg->items[MSC_STAT_NC_SS], 1); } int gsm0911_gsup_handler(struct vlr_subscr *vsub, diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 5c6f0aa..413b34c 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -37,6 +37,8 @@ #include #endif +#include + struct gsm_network *gsm_network_init(void *ctx, mncc_recv_cb_t mncc_recv) { struct gsm_network *net; @@ -68,8 +70,7 @@ talloc_free(net); return NULL; } - net->active_calls = osmo_counter_alloc("msc.active_calls"); - net->active_nc_ss = osmo_counter_alloc("msc.active_nc_ss"); + net->statg = osmo_stat_item_group_alloc(net, &msc_statg_desc, 0); net->mncc_recv = mncc_recv; -- To view, visit https://gerrit.osmocom.org/13802 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6a20123b263f4f808153794ee8a735092deb399e Gerrit-Change-Number: 13802 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Apr 27 22:39:17 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 27 Apr 2019 22:39:17 +0000 Subject: Change in osmo-sgsn[master]: gprs_sndcp_comp_free: Replace ifelse with switch and better handling ... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13799 ) Change subject: gprs_sndcp_comp_free: Replace ifelse with switch and better handling of error ...................................................................... gprs_sndcp_comp_free: Replace ifelse with switch and better handling of error gprs_sndcp_dcomp_term asserts if compclass is not SNDCP_XID_DATA_COMPRESSION, so this way by checking in the caller too we easily now if the unexpected value is in compclass or in algo.dcomp. Change-Id: I4600e6a137f42f20fdf69637e4a9048b265c1748 --- M src/gprs/gprs_sndcp_comp.c 1 file changed, 9 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/gprs/gprs_sndcp_comp.c b/src/gprs/gprs_sndcp_comp.c index 0b4c67c..c71cc89 100644 --- a/src/gprs/gprs_sndcp_comp.c +++ b/src/gprs/gprs_sndcp_comp.c @@ -160,16 +160,23 @@ llist_for_each_entry(comp_entity, comp_entities, list) { /* Free compression entity */ - if (comp_entity->compclass == SNDCP_XID_PROTOCOL_COMPRESSION) { + switch (comp_entity->compclass) { + case SNDCP_XID_PROTOCOL_COMPRESSION: LOGP(DSNDCP, LOGL_INFO, "Deleting header compression entity %d ...\n", comp_entity->entity); gprs_sndcp_pcomp_term(comp_entity); - } else { + break; + case SNDCP_XID_DATA_COMPRESSION: LOGP(DSNDCP, LOGL_INFO, "Deleting data compression entity %d ...\n", comp_entity->entity); gprs_sndcp_dcomp_term(comp_entity); + break; + default: + LOGP(DSNDCP, LOGL_INFO, + "Invalid compression class %d!\n", comp_entity->compclass); + OSMO_ASSERT(false); } } -- To view, visit https://gerrit.osmocom.org/13799 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4600e6a137f42f20fdf69637e4a9048b265c1748 Gerrit-Change-Number: 13799 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 09:36:34 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Sun, 28 Apr 2019 09:36:34 +0000 Subject: Change in libosmocore[master]: add osmo_stat_item_inc/osmo_stat_item_dec to set it relative In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13801 ) Change subject: add osmo_stat_item_inc/osmo_stat_item_dec to set it relative ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13801 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id2462c4866bd22bc2338c9c8f69b775f88ae7511 Gerrit-Change-Number: 13801 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sun, 28 Apr 2019 09:36:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 09:39:13 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Sun, 28 Apr 2019 09:39:13 +0000 Subject: Change in osmo-msc[master]: replace osmo_counter with stat items In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13802 ) Change subject: replace osmo_counter with stat items ...................................................................... Patch Set 1: Can you add the Depends: (or whatever it was called) for change ID d2462c4866bd22bc2338c9c8f69b775f88ae75 in libosmocore? -- To view, visit https://gerrit.osmocom.org/13802 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6a20123b263f4f808153794ee8a735092deb399e Gerrit-Change-Number: 13802 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Daniel Willmann Gerrit-Comment-Date: Sun, 28 Apr 2019 09:39:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 09:51:27 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Sun, 28 Apr 2019 09:51:27 +0000 Subject: Change in osmo-msc[master]: replace osmo_counter with stat items In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13802 ) Change subject: replace osmo_counter with stat items ...................................................................... Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/13802/1/include/osmocom/msc/gsm_data.h File include/osmocom/msc/gsm_data.h: https://gerrit.osmocom.org/#/c/13802/1/include/osmocom/msc/gsm_data.h at 119 PS1, Line 119: Current Currently https://gerrit.osmocom.org/#/c/13802/1/include/osmocom/msc/gsm_data.h at 120 PS1, Line 120: "" "Currently active SS/USSD sessions" -- To view, visit https://gerrit.osmocom.org/13802 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6a20123b263f4f808153794ee8a735092deb399e Gerrit-Change-Number: 13802 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sun, 28 Apr 2019 09:51:27 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 10:43:38 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 28 Apr 2019 10:43:38 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: The completion ratio is success / success+failure Message-ID: Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/13803 Change subject: virtual: The completion ratio is success / success+failure ...................................................................... virtual: The completion ratio is success / success+failure Fix the stats code to calculate the real completion ratio. Change-Id: I1b8f32dfbe8faa4c255a8d2d9806303fc8e5933b --- M suites/nitb_netreg_mass/register_default_mass.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/03/13803/1 diff --git a/suites/nitb_netreg_mass/register_default_mass.py b/suites/nitb_netreg_mass/register_default_mass.py index 76c53f1..306eb81 100644 --- a/suites/nitb_netreg_mass/register_default_mass.py +++ b/suites/nitb_netreg_mass/register_default_mass.py @@ -38,7 +38,7 @@ stats = ms_driver.get_stats() if len(modems) > 0 and stats.num_completed < 1: raise Exception("No run completed.") -completion_ratio = stats.num_attempted / stats.num_completed +completion_ratio = stats.num_completed / stats.num_attempted # Verify that 99% of LUs completed. if completion_ratio < 0.99: -- To view, visit https://gerrit.osmocom.org/13803 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1b8f32dfbe8faa4c255a8d2d9806303fc8e5933b Gerrit-Change-Number: 13803 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 10:43:39 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 28 Apr 2019 10:43:39 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Unify the lua script into a single one Message-ID: Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/13804 Change subject: virtual: Unify the lua script into a single one ...................................................................... virtual: Unify the lua script into a single one In the quest to support multiple testcases we will use a single script. Parts can be enabled/disabled depending on which tests we want/need to run. Change-Id: I8a093671173976eba9215c00a7aea0f6cab467c6 --- R src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl M src/osmo_ms_driver/location_update_test.py M src/osmo_ms_driver/starter.py 3 files changed, 12 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/04/13804/1 diff --git a/src/osmo_gsm_tester/templates/osmo-mobile-lu.lua.tmpl b/src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl similarity index 73% rename from src/osmo_gsm_tester/templates/osmo-mobile-lu.lua.tmpl rename to src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl index c25d799..5f2f482 100644 --- a/src/osmo_gsm_tester/templates/osmo-mobile-lu.lua.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl @@ -2,11 +2,20 @@ event = require('ms_support') send = 1 -function mm_cb(new_state, new_substate, old_substate) + +function lu_test_mm_cb(new_state, new_substate, old_substate) +%if test.run_lu_test: + if new_state == 19 and new_substate == 1 and send == 1 then send = 0 event.send({lu_done=1}) end + +% endif +end + +function mm_cb(new_state, new_substate, old_substate) + lu_test_mm_cb(new_state, new_substate, old_substate) end local cbs = { diff --git a/src/osmo_ms_driver/location_update_test.py b/src/osmo_ms_driver/location_update_test.py index 5ff2199..82c1cb3 100644 --- a/src/osmo_ms_driver/location_update_test.py +++ b/src/osmo_ms_driver/location_update_test.py @@ -59,7 +59,7 @@ decides how quickly to start them and a timeout. """ - TEMPLATE_LUA = "osmo-mobile-lu.lua" + TEMPLATE_LUA = "osmo-mobile.lua" TEMPLATE_CFG = "osmo-mobile.cfg" def __init__(self, name, options, cdf_function, diff --git a/src/osmo_ms_driver/starter.py b/src/osmo_ms_driver/starter.py index 010947b..20977d6 100644 --- a/src/osmo_ms_driver/starter.py +++ b/src/osmo_ms_driver/starter.py @@ -91,6 +91,7 @@ 'test': { 'event_path': self._ev_server_path, 'lua_support': lua_support, + 'run_lu_test': True, } } lua_cfg_file = os.path.join(self._tmp_dir, "lua_" + self._name_number + ".lua") -- To view, visit https://gerrit.osmocom.org/13804 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8a093671173976eba9215c00a7aea0f6cab467c6 Gerrit-Change-Number: 13804 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 10:43:39 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 28 Apr 2019 10:43:39 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Have a single result class that can store data Message-ID: Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/13805 Change subject: virtual: Have a single result class that can store data ...................................................................... virtual: Have a single result class that can store data We want to have LU, SMS and other tests run at the same time. Begin by creating a single result where testcases can store additional data. Move the stats code into the UL test case handling and out of the suite. Change-Id: Ie99351bee1515de8cf6870467f08256a53701907 --- M src/osmo_gsm_tester/ms_driver.py M src/osmo_ms_driver/location_update_test.py M src/osmo_ms_driver/test_support.py M suites/nitb_netreg_mass/register_default_mass.py 4 files changed, 69 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/05/13805/1 diff --git a/src/osmo_gsm_tester/ms_driver.py b/src/osmo_gsm_tester/ms_driver.py index 96b907a..3cfcad6 100644 --- a/src/osmo_gsm_tester/ms_driver.py +++ b/src/osmo_gsm_tester/ms_driver.py @@ -130,6 +130,12 @@ """ return self._test_case.get_result_values() + def lus_less_than(self, acceptable_delay): + """ + Returns the results that completed their LU within the acceptable delay. + """ + return self._test_case.lus_less_than(acceptable_delay) + def cleanup(self): """ Cleans up the driver (e.g. AF_UNIX files). diff --git a/src/osmo_ms_driver/location_update_test.py b/src/osmo_ms_driver/location_update_test.py index 82c1cb3..6681d85 100644 --- a/src/osmo_ms_driver/location_update_test.py +++ b/src/osmo_ms_driver/location_update_test.py @@ -19,32 +19,39 @@ from copy import copy from osmo_gsm_tester import log from .starter import OsmoVirtPhy, OsmoMobile -from .test_support import Results +from .test_support import Result from datetime import timedelta import collections import time -class LUResult(Results): - """Representation of a Location Updating Result.""" +# Key used for the result dictionary +LU_RESULT_NAME = 'lu_time' - def __init__(self, name): - super().__init__(name) - self._time_of_lu = None +def has_lu_time(result): + """ + Returns true if a LU occurred. + """ + return result.has_result(LU_RESULT_NAME) - def set_lu_time(self, time): - assert self._time_of_lu is None - self._time_of_lu = time +def lu_time(result): + """ + Returns the time of the LU occurrence. + """ + return result.get_result(LU_RESULT_NAME, default=0) - def has_lu_time(self): - return self._time_of_lu is not None +def lu_delay(result): + """ + Returns the delay from LU success to MS start time. + """ + return lu_time(result) - result.start_time() - def lu_time(self): - return self._time_of_lu or 0 - - def lu_delay(self): - return self.lu_time() - self.start_time() +def set_lu_time(result, time): + """ + Sets/Overrides the time of the LU success for this MS. + """ + result.set_result(LU_RESULT_NAME, time) LUStats = collections.namedtuple("LUStats", ["num_attempted", "num_completed", @@ -106,7 +113,7 @@ self.TEMPLATE_CFG, self._subscribers[i], phy.phy_filename(), self._event_server.server_path()) - self._results[ms_name] = LUResult(ms_name) + self._results[ms_name] = Result(ms_name) self._mobiles.append(launcher) self._unstarted = copy(self._mobiles) @@ -204,10 +211,10 @@ elif data['type'] == 'event': if data['data']['lu_done'] == 1: ms = self._results[data['ms']] - if not ms.has_lu_time(): + if not has_lu_time(ms): self._outstanding = self._outstanding - 1 - ms.set_lu_time(time) - self.log("MS performed LU ", ms=ms, at=time, lu_delay=ms.lu_delay()) + set_lu_time(ms, time) + self.log("MS performed LU ", ms=ms, at=time, lu_delay=lu_delay(ms)) else: print(time, data) raise Exception("Unknown event type..:" + _data.decode()) @@ -219,10 +226,10 @@ def find_min_max(self, results): min_value = max_value = None for result in results: - if min_value is None or result.lu_delay() < min_value: - min_value = result.lu_delay() - if max_value is None or result.lu_delay() > max_value: - max_value = result.lu_delay() + if min_value is None or lu_delay(result) < min_value: + min_value = lu_delay(result) + if max_value is None or lu_delay(result) > max_value: + max_value = lu_delay(result) return min_value, max_value def get_result_values(self): @@ -237,7 +244,7 @@ """ attempted = len(self._subscribers) completed = attempted - self._outstanding - min_latency, max_latency = self.find_min_max(filter(lambda x: x.has_lu_time(), self._results.values())) + min_latency, max_latency = self.find_min_max(filter(lambda x: has_lu_time(x), self._results.values())) return LUStats(attempted, completed, min_latency, max_latency) def print_stats(self): @@ -246,3 +253,16 @@ self.log("Tests done", all_completed=all_completed, min=stats.min_latency, max=stats.max_latency) + + def lus_less_than(self, acceptable_delay): + """ + Returns LUs that completed within the acceptable delay. + """ + res = [] + for result in self._results.values(): + if not has_lu_time(result): + continue + if timedelta(seconds=lu_delay(result)) >= acceptable_delay: + continue + res.append(result) + return res diff --git a/src/osmo_ms_driver/test_support.py b/src/osmo_ms_driver/test_support.py index f1c34fb..0fd321c 100644 --- a/src/osmo_ms_driver/test_support.py +++ b/src/osmo_ms_driver/test_support.py @@ -26,15 +26,17 @@ yield ("%.15d" % n, "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00") n += 1 -class Results(log.Origin): +class Result(log.Origin): """ - A base class to collect results from tests. + The class for results. There should be one result class per test subject. + Specific tests can use add_result to add their outcome to this object. """ def __init__(self, name): super().__init__(log.C_RUN, name) self._time_of_registration = None self._time_of_launch = None + self._results = {} def set_start_time(self, time): assert self._time_of_registration is None @@ -49,3 +51,15 @@ def launch_time(self): return self._time_of_launch or 0 + + def set_result(self, key, value): + """Sets a result with the given key and value.""" + self._results[key] = value + + def get_result(self, key, default=None): + """Returns the result for the given key or default.""" + return self._results.get(key, default) + + def has_result(self, key): + """Returns true if there is a value for the key.""" + return self._results.get(key) is not None diff --git a/suites/nitb_netreg_mass/register_default_mass.py b/suites/nitb_netreg_mass/register_default_mass.py index 306eb81..f4e5e80 100644 --- a/suites/nitb_netreg_mass/register_default_mass.py +++ b/suites/nitb_netreg_mass/register_default_mass.py @@ -46,15 +46,7 @@ # Check how many results are below our threshold. acceptable_delay = timedelta(seconds=30) -results = ms_driver.get_result_values() -quick_enough = 0 -for result in results: - if not result.has_lu_time(): - continue - if timedelta(seconds=result.lu_delay()) >= acceptable_delay: - continue - quick_enough = quick_enough + 1 - -latency_ratio = quick_enough / len(results) +quick_enough = len(ms_driver.lus_less_than(acceptable_delay)) +latency_ratio = quick_enough / stats.num_attempted if latency_ratio < 0.99: raise Exception("Latency ratio of %f%% lower than threshold." % (latency_ratio * 100.0)) -- To view, visit https://gerrit.osmocom.org/13805 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie99351bee1515de8cf6870467f08256a53701907 Gerrit-Change-Number: 13805 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 10:43:40 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 28 Apr 2019 10:43:40 +0000 Subject: Change in osmo-bsc[master]: assignment_fsm: Properly support assigning signalling mode TCH/x In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13172 ) Change subject: assignment_fsm: Properly support assigning signalling mode TCH/x ...................................................................... Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/13172/5/src/osmo-bsc/assignment_fsm.c File src/osmo-bsc/assignment_fsm.c: https://gerrit.osmocom.org/#/c/13172/5/src/osmo-bsc/assignment_fsm.c at 350 PS5, Line 350: here you forget to conn->assignment.requires_voice_stream = requires_voice_pref; and a voice call fails to get an actual RTP stream. With this line included, I tested voice calls to work fine again. -- To view, visit https://gerrit.osmocom.org/13172 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4c7499c8c866ea3ff7b1327edb3615d003d927d3 Gerrit-Change-Number: 13172 Gerrit-PatchSet: 5 Gerrit-Owner: tnt Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt Gerrit-CC: Max Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Sun, 28 Apr 2019 10:43:40 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 10:44:43 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 28 Apr 2019 10:44:43 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: The completion ratio is success / success+failure In-Reply-To: References: Message-ID: Holger Freyther has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13803 ) Change subject: virtual: The completion ratio is success / success+failure ...................................................................... virtual: The completion ratio is success / success+failure Fix the stats code to calculate the real completion ratio. Change-Id: I1b8f32dfbe8faa4c255a8d2d9806303fc8e5933b --- M suites/nitb_netreg_mass/register_default_mass.py M suites/nitb_netreg_mass/suite.conf 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/03/13803/2 -- To view, visit https://gerrit.osmocom.org/13803 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1b8f32dfbe8faa4c255a8d2d9806303fc8e5933b Gerrit-Change-Number: 13803 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 11:11:06 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Sun, 28 Apr 2019 11:11:06 +0000 Subject: Change in osmo-msc[master]: remove msc specific db counters In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13800 ) Change subject: remove msc specific db counters ...................................................................... Patch Set 1: Ah, did you check that it doesn't break neels' inter-msc ho branch? -- To view, visit https://gerrit.osmocom.org/13800 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id64f1839a55b5326f74ec04b7a5dbed9d269b89c Gerrit-Change-Number: 13800 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Sun, 28 Apr 2019 11:11:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 13:04:44 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Sun, 28 Apr 2019 13:04:44 +0000 Subject: Change in osmo-msc[master]: replace osmo_counter with stat items In-Reply-To: References: Message-ID: Hello Daniel Willmann, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13802 to look at the new patch set (#2). Change subject: replace osmo_counter with stat items ...................................................................... replace osmo_counter with stat items Change-Id: I6a20123b263f4f808153794ee8a735092deb399e --- M include/osmocom/msc/gsm_data.h M src/libmsc/gsm_04_08_cc.c M src/libmsc/gsm_09_11.c M src/libmsc/osmo_msc.c 4 files changed, 29 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/02/13802/2 -- To view, visit https://gerrit.osmocom.org/13802 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6a20123b263f4f808153794ee8a735092deb399e Gerrit-Change-Number: 13802 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 14:10:06 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Sun, 28 Apr 2019 14:10:06 +0000 Subject: Change in osmo-msc[master]: replace osmo_counter with stat items In-Reply-To: References: Message-ID: Hello Daniel Willmann, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13802 to look at the new patch set (#3). Change subject: replace osmo_counter with stat items ...................................................................... replace osmo_counter with stat items Depends on: Id2462c4866bd22bc2338c9c8f69b775f88ae7511 (libosmocore) Change-Id: I6a20123b263f4f808153794ee8a735092deb399e --- M include/osmocom/msc/gsm_data.h M src/libmsc/gsm_04_08_cc.c M src/libmsc/gsm_09_11.c M src/libmsc/osmo_msc.c 4 files changed, 29 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/02/13802/3 -- To view, visit https://gerrit.osmocom.org/13802 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6a20123b263f4f808153794ee8a735092deb399e Gerrit-Change-Number: 13802 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 14:27:31 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 28 Apr 2019 14:27:31 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: The completion ratio is success / success+failure In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13803 ) Change subject: virtual: The completion ratio is success / success+failure ...................................................................... Patch Set 2: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/13803/2/suites/nitb_netreg_mass/suite.conf File suites/nitb_netreg_mass/suite.conf: https://gerrit.osmocom.org/#/c/13803/2/suites/nitb_netreg_mass/suite.conf at 11 PS2, Line 11: timeout: 50s This change is actually unrelated but fine. -- To view, visit https://gerrit.osmocom.org/13803 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1b8f32dfbe8faa4c255a8d2d9806303fc8e5933b Gerrit-Change-Number: 13803 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sun, 28 Apr 2019 14:27:31 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 14:29:43 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 28 Apr 2019 14:29:43 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Unify the lua script into a single one In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13804 ) Change subject: virtual: Unify the lua script into a single one ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13804/2/src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl File src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl: https://gerrit.osmocom.org/#/c/13804/2/src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl at 18 PS2, Line 18: lu_test_mm_cb(new_state, new_substate, old_substate) shouldn't the %if and %endif stuff be here instead of the concrete function? -- To view, visit https://gerrit.osmocom.org/13804 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8a093671173976eba9215c00a7aea0f6cab467c6 Gerrit-Change-Number: 13804 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Sun, 28 Apr 2019 14:29:43 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 14:37:36 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 28 Apr 2019 14:37:36 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Have a single result class that can store data In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13805 ) Change subject: virtual: Have a single result class that can store data ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13805/2/src/osmo_ms_driver/test_support.py File src/osmo_ms_driver/test_support.py: https://gerrit.osmocom.org/#/c/13805/2/src/osmo_ms_driver/test_support.py at 29 PS2, Line 29: class Result(log.Origin): That's more like a ResultStorage or ResultStore right? Result which actually contains a set of different results is really confusing. -- To view, visit https://gerrit.osmocom.org/13805 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie99351bee1515de8cf6870467f08256a53701907 Gerrit-Change-Number: 13805 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Sun, 28 Apr 2019 14:37:36 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 14:50:43 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 28 Apr 2019 14:50:43 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Unify the lua script into a single one In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/13804 ) Change subject: virtual: Unify the lua script into a single one ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/13804/2/src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl File src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl: https://gerrit.osmocom.org/#/c/13804/2/src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl at 18 PS2, Line 18: lu_test_mm_cb(new_state, new_substate, old_substate) > shouldn't the %if and %endif stuff be here instead of the concrete function? Sure. I can move it here but then the above must always be well defined. -- To view, visit https://gerrit.osmocom.org/13804 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8a093671173976eba9215c00a7aea0f6cab467c6 Gerrit-Change-Number: 13804 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Sun, 28 Apr 2019 14:50:43 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 14:50:48 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 28 Apr 2019 14:50:48 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: The completion ratio is success / success+failure In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/13803 ) Change subject: virtual: The completion ratio is success / success+failure ...................................................................... Patch Set 2: (1 comment) > Patch Set 2: Code-Review+2 > > (1 comment) https://gerrit.osmocom.org/#/c/13803/2/suites/nitb_netreg_mass/suite.conf File suites/nitb_netreg_mass/suite.conf: https://gerrit.osmocom.org/#/c/13803/2/suites/nitb_netreg_mass/suite.conf at 11 PS2, Line 11: timeout: 50s > This change is actually unrelated but fine. Now that the ratio can be < 1.0 we need some more time to make the test pass. ;) -- To view, visit https://gerrit.osmocom.org/13803 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1b8f32dfbe8faa4c255a8d2d9806303fc8e5933b Gerrit-Change-Number: 13803 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sun, 28 Apr 2019 14:50:48 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 14:53:34 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 28 Apr 2019 14:53:34 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Unify the lua script into a single one In-Reply-To: References: Message-ID: Holger Freyther has uploaded a new patch set (#3). ( https://gerrit.osmocom.org/13804 ) Change subject: virtual: Unify the lua script into a single one ...................................................................... virtual: Unify the lua script into a single one In the quest to support multiple testcases we will use a single script. Parts can be enabled/disabled depending on which tests we want/need to run. Change-Id: I8a093671173976eba9215c00a7aea0f6cab467c6 --- R src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl M src/osmo_ms_driver/location_update_test.py M src/osmo_ms_driver/starter.py 3 files changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/04/13804/3 -- To view, visit https://gerrit.osmocom.org/13804 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8a093671173976eba9215c00a7aea0f6cab467c6 Gerrit-Change-Number: 13804 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 14:53:34 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 28 Apr 2019 14:53:34 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Have a single result class that can store data In-Reply-To: References: Message-ID: Holger Freyther has uploaded a new patch set (#3). ( https://gerrit.osmocom.org/13805 ) Change subject: virtual: Have a single result class that can store data ...................................................................... virtual: Have a single result class that can store data We want to have LU, SMS and other tests run at the same time. Begin by creating a single result where testcases can store additional data. Move the stats code into the UL test case handling and out of the suite. Change-Id: Ie99351bee1515de8cf6870467f08256a53701907 --- M src/osmo_gsm_tester/ms_driver.py M src/osmo_ms_driver/location_update_test.py M src/osmo_ms_driver/test_support.py M suites/nitb_netreg_mass/register_default_mass.py 4 files changed, 69 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/05/13805/3 -- To view, visit https://gerrit.osmocom.org/13805 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie99351bee1515de8cf6870467f08256a53701907 Gerrit-Change-Number: 13805 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 15:06:02 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Apr 2019 15:06:02 +0000 Subject: Change in docker-playground[master]: Add script to bisect test failures with ttcn3 and docker In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13790 ) Change subject: Add script to bisect test failures with ttcn3 and docker ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13790 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I11f7e61a9b30d58a0fdfcaf77dde447806bf661f Gerrit-Change-Number: 13790 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: osmith Gerrit-Comment-Date: Sun, 28 Apr 2019 15:06:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 15:06:08 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Apr 2019 15:06:08 +0000 Subject: Change in docker-playground[master]: Add script to bisect test failures with ttcn3 and docker In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13790 ) Change subject: Add script to bisect test failures with ttcn3 and docker ...................................................................... Add script to bisect test failures with ttcn3 and docker With this script you can now use docker ttcn3 test results to bisect a regression and find the offending commit. Use like this from the osmo-* git repository: $ git bisect start $ git bisect run ~/scm/osmo/docker-playground/osmo-bisect.sh e.g.: $ git bisect run ~/scm/osmo/docker-playground/osmo-bisect.sh bsc BSC_Tests.TC_ho_in_fail_no_detect Change-Id: I11f7e61a9b30d58a0fdfcaf77dde447806bf661f --- A osmo-bisect.sh 1 file changed, 53 insertions(+), 0 deletions(-) Approvals: Daniel Willmann: Verified lynxis lazus: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/osmo-bisect.sh b/osmo-bisect.sh new file mode 100755 index 0000000..5ca69cd --- /dev/null +++ b/osmo-bisect.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +# Script to bisect an osmo-* project with the docker ttcn3 images +# You need the git checkout of the project you wand to test as well as a +# checkout of the docker-playground repository. + +# Use like this from the osmo-* project repository where the regression +# occurs: +# $ git bisect start +# $ git bisect run ~/scm/osmo/docker-playground/osmo-bisect.sh +# e.g.: +# $ git bisect run ~/scm/osmo/docker-playground/osmo-bisect.sh bsc BSC_Tests.TC_ho_in_fail_no_detect + + +DOCKER_PLAYGROUND=$(dirname "$0") +COMP_UPPER=$(echo "$1" | tr '[:lower:]' '[:upper:]') +COMP_LOWER=$(echo "$1" | tr '[:upper:]' '[:lower:]') +TESTCASE=$2 + +COMMIT=$(git log -1 --format=format:%H) + +case $COMP_LOWER in + "hnbgw") + BRANCH="OSMO_IUH_BRANCH" + SUITE="ttcn3-hnbgw-test" + ;; + "bsc"|\ + "bts"|\ + "ggsn"|\ + "hlr"|\ + "mgw"|\ + "msc"|\ + "nitb"|\ + "pcu"|\ + "sgsn"|\ + "sip"|\ + "stp") + BRANCH="OSMO_${COMP_UPPER}_BRANCH" + SUITE="ttcn3-${COMP_LOWER}-test" + ;; + *) + echo "Unknown repo, please fix the script!" + exit 125 + ;; +esac + +export "$BRANCH=$COMMIT" + +cd "$DOCKER_PLAYGROUND/$SUITE" || exit 125 + +echo "Testing for $COMMIT" +./jenkins.sh | grep -- "====== $TESTCASE pass ======" +exit $? -- To view, visit https://gerrit.osmocom.org/13790 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I11f7e61a9b30d58a0fdfcaf77dde447806bf661f Gerrit-Change-Number: 13790 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 15:40:34 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 28 Apr 2019 15:40:34 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Unify the lua script into a single one In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13804 ) Change subject: virtual: Unify the lua script into a single one ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13804 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8a093671173976eba9215c00a7aea0f6cab467c6 Gerrit-Change-Number: 13804 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sun, 28 Apr 2019 15:40:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Apr 28 15:43:09 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 28 Apr 2019 15:43:09 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Have a single result class that can store data In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13805 ) Change subject: virtual: Have a single result class that can store data ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13805 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie99351bee1515de8cf6870467f08256a53701907 Gerrit-Change-Number: 13805 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sun, 28 Apr 2019 15:43:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 07:01:36 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Mon, 29 Apr 2019 07:01:36 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Mykola Shchetinin has posted comments on this change. ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... Patch Set 7: Alexander and Pau, could you please review the updated change when you have time and will to do so :) -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 7 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Mon, 29 Apr 2019 07:01:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 07:17:50 2019 From: gerrit-no-reply at lists.osmocom.org (Mykola Shchetinin) Date: Mon, 29 Apr 2019 07:17:50 +0000 Subject: Change in libosmocore[master]: Add expect script: 'vty' for easy access to all vtys In-Reply-To: References: Message-ID: Mykola Shchetinin has posted comments on this change. ( https://gerrit.osmocom.org/13756 ) Change subject: Add expect script: 'vty' for easy access to all vtys ...................................................................... Patch Set 1: Code-Review+1 Very nice! -- To view, visit https://gerrit.osmocom.org/13756 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice4532be7cb3139da29cb9d84dd4769e8d826dfa Gerrit-Change-Number: 13756 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 29 Apr 2019 07:17:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 08:22:53 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 29 Apr 2019 08:22:53 +0000 Subject: Change in osmo-msc[master]: replace osmo_counter with stat items In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13802 ) Change subject: replace osmo_counter with stat items ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13802 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6a20123b263f4f808153794ee8a735092deb399e Gerrit-Change-Number: 13802 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Mon, 29 Apr 2019 08:22:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 09:43:50 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Apr 2019 09:43:50 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available. In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13744 ) Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available. ...................................................................... Patch Set 7: Code-Review+1 Looks good to me code-wise, leaving +2 to lynxis since he seems to know about the related spec stuff. -- To view, visit https://gerrit.osmocom.org/13744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437 Gerrit-Change-Number: 13744 Gerrit-PatchSet: 7 Gerrit-Owner: Mykola Shchetinin Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Mon, 29 Apr 2019 09:43:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 09:44:00 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 29 Apr 2019 09:44:00 +0000 Subject: Change in libosmocore[master]: Add expect script: 'vty' for easy access to all vtys In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13756 ) Change subject: Add expect script: 'vty' for easy access to all vtys ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13756 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice4532be7cb3139da29cb9d84dd4769e8d826dfa Gerrit-Change-Number: 13756 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Mykola Shchetinin Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 29 Apr 2019 09:44:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 10:28:19 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 29 Apr 2019 10:28:19 +0000 Subject: Change in osmo-sip-connector[master]: Properly indent config file Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13806 Change subject: Properly indent config file ...................................................................... Properly indent config file osmo-config-merge expects only one space indentation for each level and the VTY also outputs the config formatted like that. Change-Id: I9c7a5bc6b3eae955288dada80abc856779ca9336 --- M doc/examples/osmo-sip-connector.cfg 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/06/13806/1 diff --git a/doc/examples/osmo-sip-connector.cfg b/doc/examples/osmo-sip-connector.cfg index 550cba6..bf4967e 100644 --- a/doc/examples/osmo-sip-connector.cfg +++ b/doc/examples/osmo-sip-connector.cfg @@ -1,6 +1,6 @@ app mncc - socket-path /tmp/msc_mncc + socket-path /tmp/msc_mncc sip - local 0.0.0.0 5060 - remote pbx 5060 + local 0.0.0.0 5060 + remote pbx 5060 -- To view, visit https://gerrit.osmocom.org/13806 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9c7a5bc6b3eae955288dada80abc856779ca9336 Gerrit-Change-Number: 13806 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 11:12:16 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 29 Apr 2019 11:12:16 +0000 Subject: Change in libosmocore[master]: stats: Don't report osmo_counters Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13807 Change subject: stats: Don't report osmo_counters ...................................................................... stats: Don't report osmo_counters In the case of statsd this has never worked because it was reported as a rate (c)ounter and not a (g)auge. Nowadays we don't seem to have so many osmo_counters anyway, so let's just remove support for them here and migrate existing ones to osmo_stat_item. Change-Id: I78578122aaea07d541b377ad39dd830c38c55e7a --- M src/stats.c 1 file changed, 4 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/07/13807/1 diff --git a/src/stats.c b/src/stats.c index b5adbf2..729301f 100644 --- a/src/stats.c +++ b/src/stats.c @@ -667,30 +667,15 @@ return 0; } -/*** osmo counter support ***/ +/*** osmo counter support (deprecated) ***/ static int handle_counter(struct osmo_counter *counter, void *sctx_) { - struct osmo_stats_reporter *srep; - struct rate_ctr_desc desc = {0}; - /* Fake a rate counter description */ - desc.name = counter->name; - desc.description = counter->description; - int delta = osmo_counter_difference(counter); + LOGP(DLSTATS, LOGL_NOTICE, + "osmo_counter stats export not reported: name=%s desc=%s\n", + counter->name, counter->description); - llist_for_each_entry(srep, &osmo_stats_reporter_list, list) { - if (!srep->running) - continue; - - if (delta == 0 && !srep->force_single_flush) - continue; - - osmo_stats_reporter_send_counter(srep, NULL, &desc, - counter->value, delta); - - /* TODO: handle result (log?, inc counter(!)?) */ - } return 0; } -- To view, visit https://gerrit.osmocom.org/13807 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I78578122aaea07d541b377ad39dd830c38c55e7a Gerrit-Change-Number: 13807 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 11:12:17 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 29 Apr 2019 11:12:17 +0000 Subject: Change in libosmocore[master]: Deprecate usage of osmo_counter_* Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13808 Change subject: Deprecate usage of osmo_counter_* ...................................................................... Deprecate usage of osmo_counter_* There's not many of those around any more, let's try to move them to osmo_stat_items Change-Id: If67f64c6ec7a3f3114c962df9db50107d9ea86e2 --- M include/osmocom/core/counter.h 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/08/13808/1 diff --git a/include/osmocom/core/counter.h b/include/osmocom/core/counter.h index 259f1ed..5ab6578 100644 --- a/include/osmocom/core/counter.h +++ b/include/osmocom/core/counter.h @@ -15,6 +15,7 @@ /*! Decrement given counter by one * \param[in] ctr Counter that's to be decremented */ static inline void osmo_counter_dec(struct osmo_counter *ctr) + OSMO_DEPRECATED("Implement as osmo_stat_item instead") { ctr->value--; } @@ -22,25 +23,30 @@ /*! Increment counter by one. * \param[in] Counter that's to be incremented */ static inline void osmo_counter_inc(struct osmo_counter *ctr) + OSMO_DEPRECATED("Implement as osmo_stat_item instead") { ctr->value++; } /*! Get current value of counter */ static inline unsigned long osmo_counter_get(struct osmo_counter *ctr) + OSMO_DEPRECATED("Implement as osmo_stat_item instead") { return ctr->value; } /*! Reset current value of counter to 0 */ static inline void osmo_counter_reset(struct osmo_counter *ctr) + OSMO_DEPRECATED("Implement as osmo_stat_item instead") { ctr->value = 0; } -struct osmo_counter *osmo_counter_alloc(const char *name); +struct osmo_counter *osmo_counter_alloc(const char *name) + OSMO_DEPRECATED("Implement as osmo_stat_item instead"); -void osmo_counter_free(struct osmo_counter *ctr); +void osmo_counter_free(struct osmo_counter *ctr) + OSMO_DEPRECATED("Implement as osmo_stat_item instead"); int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), void *data); -- To view, visit https://gerrit.osmocom.org/13808 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If67f64c6ec7a3f3114c962df9db50107d9ea86e2 Gerrit-Change-Number: 13808 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 11:21:40 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 29 Apr 2019 11:21:40 +0000 Subject: Change in libosmocore[master]: Deprecate usage of osmo_counter_* In-Reply-To: References: Message-ID: Hello lynxis lazus, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13808 to look at the new patch set (#2). Change subject: Deprecate usage of osmo_counter_* ...................................................................... Deprecate usage of osmo_counter_* There's not many of those around any more, let's try to move them to osmo_stat_items Change-Id: If67f64c6ec7a3f3114c962df9db50107d9ea86e2 --- M include/osmocom/core/counter.h 1 file changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/08/13808/2 -- To view, visit https://gerrit.osmocom.org/13808 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If67f64c6ec7a3f3114c962df9db50107d9ea86e2 Gerrit-Change-Number: 13808 Gerrit-PatchSet: 2 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 11:28:11 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Mon, 29 Apr 2019 11:28:11 +0000 Subject: Change in libosmocore[master]: Deprecate usage of osmo_counter_* In-Reply-To: References: Message-ID: Hello lynxis lazus, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13808 to look at the new patch set (#3). Change subject: Deprecate usage of osmo_counter_* ...................................................................... Deprecate usage of osmo_counter_* There's not many of those around any more, let's try to move them to osmo_stat_items Change-Id: If67f64c6ec7a3f3114c962df9db50107d9ea86e2 --- M include/osmocom/core/counter.h 1 file changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/08/13808/3 -- To view, visit https://gerrit.osmocom.org/13808 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If67f64c6ec7a3f3114c962df9db50107d9ea86e2 Gerrit-Change-Number: 13808 Gerrit-PatchSet: 3 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 12:41:24 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Apr 2019 12:41:24 +0000 Subject: Change in osmo-sip-connector[master]: Properly indent config file In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13806 ) Change subject: Properly indent config file ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13806 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9c7a5bc6b3eae955288dada80abc856779ca9336 Gerrit-Change-Number: 13806 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-Comment-Date: Mon, 29 Apr 2019 12:41:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 13:00:51 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Mon, 29 Apr 2019 13:00:51 +0000 Subject: Change in libosmocore[master]: stats: Don't report osmo_counters In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/13807 ) Change subject: stats: Don't report osmo_counters ...................................................................... Patch Set 1: Code-Review-1 This will be called multiple times (or every x seconds depending on your statsd rate). I would prefer a warning when statsd get's enabled. -- To view, visit https://gerrit.osmocom.org/13807 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I78578122aaea07d541b377ad39dd830c38c55e7a Gerrit-Change-Number: 13807 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Mon, 29 Apr 2019 13:00:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 15:25:43 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Apr 2019 15:25:43 +0000 Subject: Change in osmo-trx[master]: cosmetic: uhd: Move smpl_buf out of UHDDevice, move UHDDevice class d... Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13809 Change subject: cosmetic: uhd: Move smpl_buf out of UHDDevice, move UHDDevice class definition to .h ...................................................................... cosmetic: uhd: Move smpl_buf out of UHDDevice, move UHDDevice class definition to .h * move class definition to .h file, like we do for other devices. * move smpl_buf class to a different file inside uhd/. * Preparation work to have smpl_buf being used in a generic way for devices other than UHD (LMS). Change-Id: Ib4594320da9bb7f6e9f52e7d70d11ecd11106aae --- M Transceiver52M/device/uhd/Makefile.am M Transceiver52M/device/uhd/UHDDevice.cpp A Transceiver52M/device/uhd/UHDDevice.h A Transceiver52M/device/uhd/smpl_buf.cpp A Transceiver52M/device/uhd/smpl_buf.h 5 files changed, 418 insertions(+), 362 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/09/13809/1 diff --git a/Transceiver52M/device/uhd/Makefile.am b/Transceiver52M/device/uhd/Makefile.am index bb34d2f..4fcc0d7 100644 --- a/Transceiver52M/device/uhd/Makefile.am +++ b/Transceiver52M/device/uhd/Makefile.am @@ -3,6 +3,8 @@ AM_CPPFLAGS = -Wall $(STD_DEFINES_AND_INCLUDES) -I${srcdir}/.. AM_CXXFLAGS = -lpthread $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(UHD_CFLAGS) +noinst_HEADERS = UHDDevice.h smpl_buf.h + noinst_LTLIBRARIES = libdevice.la -libdevice_la_SOURCES = UHDDevice.cpp +libdevice_la_SOURCES = UHDDevice.cpp smpl_buf.cpp diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp index 46284e5..67b7416 100644 --- a/Transceiver52M/device/uhd/UHDDevice.cpp +++ b/Transceiver52M/device/uhd/UHDDevice.cpp @@ -23,11 +23,9 @@ #include #include "radioDevice.h" +#include "UHDDevice.h" #include "Threads.h" #include "Logger.h" -#include -#include -#include #ifdef HAVE_CONFIG_H #include "config.h" @@ -58,20 +56,6 @@ */ #define UMTRX_VGA1_DEF -18 -enum uhd_dev_type { - USRP1, - USRP2, - B100, - B200, - B210, - B2XX_MCBTS, - E1XX, - E3XX, - X3XX, - UMTRX, - LIMESDR, -}; - /* * USRP version dependent device timings */ @@ -136,190 +120,6 @@ { std::make_tuple(B2XX_MCBTS, 4, 4), { 1, 51.2e6, MCBTS_SPACING*4, B2XX_TIMING_MCBTS, "B200/B210 4 SPS Multi-ARFCN" } }, }; -/* - Sample Buffer - Allows reading and writing of timed samples using osmo-trx - or UHD style timestamps. Time conversions are handled - internally or accessable through the static convert calls. -*/ -class smpl_buf { -public: - /** Sample buffer constructor - @param len number of 32-bit samples the buffer should hold - @param rate sample clockrate - @param timestamp - */ - smpl_buf(size_t len, double rate); - ~smpl_buf(); - - /** Query number of samples available for reading - @param timestamp time of first sample - @return number of available samples or error - */ - ssize_t avail_smpls(TIMESTAMP timestamp) const; - ssize_t avail_smpls(uhd::time_spec_t timestamp) const; - - /** Read and write - @param buf pointer to buffer - @param len number of samples desired to read or write - @param timestamp time of first stample - @return number of actual samples read or written or error - */ - ssize_t read(void *buf, size_t len, TIMESTAMP timestamp); - ssize_t read(void *buf, size_t len, uhd::time_spec_t timestamp); - ssize_t write(void *buf, size_t len, TIMESTAMP timestamp); - ssize_t write(void *buf, size_t len, uhd::time_spec_t timestamp); - - /** Buffer status string - @return a formatted string describing internal buffer state - */ - std::string str_status(size_t ts) const; - - /** Formatted error string - @param code an error code - @return a formatted error string - */ - static std::string str_code(ssize_t code); - - enum err_code { - ERROR_TIMESTAMP = -1, - ERROR_READ = -2, - ERROR_WRITE = -3, - ERROR_OVERFLOW = -4 - }; - -private: - uint32_t *data; - size_t buf_len; - - double clk_rt; - - TIMESTAMP time_start; - TIMESTAMP time_end; - - size_t data_start; - size_t data_end; -}; - -/* - uhd_device - UHD implementation of the Device interface. Timestamped samples - are sent to and received from the device. An intermediate buffer - on the receive side collects and aligns packets of samples. - Events and errors such as underruns are reported asynchronously - by the device and received in a separate thread. -*/ -class uhd_device : public RadioDevice { -public: - uhd_device(size_t tx_sps, size_t rx_sps, InterfaceType type, - size_t chans, double offset, - const std::vector& tx_paths, - const std::vector& rx_paths); - ~uhd_device(); - - int open(const std::string &args, int ref, bool swap_channels); - bool start(); - bool stop(); - bool restart(); - void setPriority(float prio); - enum TxWindowType getWindowType() { return tx_window; } - - int readSamples(std::vector &bufs, int len, bool *overrun, - TIMESTAMP timestamp, bool *underrun, unsigned *RSSI); - - int writeSamples(std::vector &bufs, int len, bool *underrun, - TIMESTAMP timestamp, bool isControl); - - bool updateAlignment(TIMESTAMP timestamp); - - bool setTxFreq(double wFreq, size_t chan); - bool setRxFreq(double wFreq, size_t chan); - - TIMESTAMP initialWriteTimestamp(); - TIMESTAMP initialReadTimestamp(); - - double fullScaleInputValue(); - double fullScaleOutputValue(); - - double setRxGain(double db, size_t chan); - double getRxGain(size_t chan); - double maxRxGain(void) { return rx_gain_max; } - double minRxGain(void) { return rx_gain_min; } - - double setTxGain(double db, size_t chan); - double maxTxGain(void) { return tx_gain_max; } - double minTxGain(void) { return tx_gain_min; } - - double getTxFreq(size_t chan); - double getRxFreq(size_t chan); - double getRxFreq(); - - bool setRxAntenna(const std::string &ant, size_t chan); - std::string getRxAntenna(size_t chan); - bool setTxAntenna(const std::string &ant, size_t chan); - std::string getTxAntenna(size_t chan); - - bool requiresRadioAlign(); - - GSM::Time minLatency(); - - inline double getSampleRate() { return tx_rate; } - inline double numberRead() { return rx_pkt_cnt; } - inline double numberWritten() { return 0; } - - /** Receive and process asynchronous message - @return true if message received or false on timeout or error - */ - bool recv_async_msg(); - - enum err_code { - ERROR_TIMING = -1, - ERROR_TIMEOUT = -2, - ERROR_UNRECOVERABLE = -3, - ERROR_UNHANDLED = -4, - }; - -private: - uhd::usrp::multi_usrp::sptr usrp_dev; - uhd::tx_streamer::sptr tx_stream; - uhd::rx_streamer::sptr rx_stream; - enum TxWindowType tx_window; - enum uhd_dev_type dev_type; - - double tx_rate, rx_rate; - - double tx_gain_min, tx_gain_max; - double rx_gain_min, rx_gain_max; - - std::vector tx_gains, rx_gains; - std::vector tx_freqs, rx_freqs; - size_t tx_spp, rx_spp; - - bool started; - bool aligned; - - size_t rx_pkt_cnt; - size_t drop_cnt; - uhd::time_spec_t prev_ts; - - TIMESTAMP ts_initial, ts_offset; - std::vector rx_buffers; - - void init_gains(); - void set_channels(bool swap); - void set_rates(); - bool parse_dev_type(); - bool flush_recv(size_t num_pkts); - int check_rx_md_err(uhd::rx_metadata_t &md, ssize_t num_smpls); - - std::string str_code(uhd::rx_metadata_t metadata); - std::string str_code(uhd::async_metadata_t metadata); - - uhd::tune_request_t select_freq(double wFreq, size_t chan, bool tx); - bool set_freq(double freq, size_t chan, bool tx); - - Thread *async_event_thrd; - Mutex tune_lock; -}; - void *async_event_loop(uhd_device *dev) { set_selfthread_name("UHDAsyncEvent"); @@ -1386,166 +1186,6 @@ return ost.str(); } -smpl_buf::smpl_buf(size_t len, double rate) - : buf_len(len), clk_rt(rate), - time_start(0), time_end(0), data_start(0), data_end(0) -{ - data = new uint32_t[len]; -} - -smpl_buf::~smpl_buf() -{ - delete[] data; -} - -ssize_t smpl_buf::avail_smpls(TIMESTAMP timestamp) const -{ - if (timestamp < time_start) - return ERROR_TIMESTAMP; - else if (timestamp >= time_end) - return 0; - else - return time_end - timestamp; -} - -ssize_t smpl_buf::avail_smpls(uhd::time_spec_t timespec) const -{ - return avail_smpls(timespec.to_ticks(clk_rt)); -} - -ssize_t smpl_buf::read(void *buf, size_t len, TIMESTAMP timestamp) -{ - int type_sz = 2 * sizeof(short); - - // Check for valid read - if (timestamp < time_start) - return ERROR_TIMESTAMP; - if (timestamp >= time_end) - return 0; - if (len >= buf_len) - return ERROR_READ; - - // How many samples should be copied - size_t num_smpls = time_end - timestamp; - if (num_smpls > len) - num_smpls = len; - - // Starting index - size_t read_start = (data_start + (timestamp - time_start)) % buf_len; - - // Read it - if (read_start + num_smpls < buf_len) { - size_t numBytes = len * type_sz; - memcpy(buf, data + read_start, numBytes); - } else { - size_t first_cp = (buf_len - read_start) * type_sz; - size_t second_cp = len * type_sz - first_cp; - - memcpy(buf, data + read_start, first_cp); - memcpy((char*) buf + first_cp, data, second_cp); - } - - data_start = (read_start + len) % buf_len; - time_start = timestamp + len; - - if (time_start > time_end) - return ERROR_READ; - else - return num_smpls; -} - -ssize_t smpl_buf::read(void *buf, size_t len, uhd::time_spec_t ts) -{ - return read(buf, len, ts.to_ticks(clk_rt)); -} - -ssize_t smpl_buf::write(void *buf, size_t len, TIMESTAMP timestamp) -{ - int type_sz = 2 * sizeof(short); - - // Check for valid write - if ((len == 0) || (len >= buf_len)) - return ERROR_WRITE; - if ((timestamp + len) <= time_end) - return ERROR_TIMESTAMP; - - if (timestamp < time_end) { - LOGC(DDEV, ERR) << "Overwriting old buffer data: timestamp="<& tx_paths, diff --git a/Transceiver52M/device/uhd/UHDDevice.h b/Transceiver52M/device/uhd/UHDDevice.h new file mode 100644 index 0000000..93a9660 --- /dev/null +++ b/Transceiver52M/device/uhd/UHDDevice.h @@ -0,0 +1,164 @@ +/* +* Copyright 2019 sysmocom - s.f.m.c. GmbH +* +* This software is distributed under multiple licenses; see the COPYING file in the main directory for licensing information for this specific distribuion. +* +* This use of this software may be subject to additional restrictions. +* See the LEGAL file in the main directory for details. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +*/ + +#ifndef _UHD_DEVICE_H_ +#define _UHD_DEVICE_H_ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "radioDevice.h" +#include "smpl_buf.h" + +#include +#include +#include + + +enum uhd_dev_type { + USRP1, + USRP2, + B100, + B200, + B210, + B2XX_MCBTS, + E1XX, + E3XX, + X3XX, + UMTRX, + LIMESDR, +}; + +/* + uhd_device - UHD implementation of the Device interface. Timestamped samples + are sent to and received from the device. An intermediate buffer + on the receive side collects and aligns packets of samples. + Events and errors such as underruns are reported asynchronously + by the device and received in a separate thread. +*/ +class uhd_device : public RadioDevice { +public: + uhd_device(size_t tx_sps, size_t rx_sps, InterfaceType type, + size_t chans, double offset, + const std::vector& tx_paths, + const std::vector& rx_paths); + ~uhd_device(); + + int open(const std::string &args, int ref, bool swap_channels); + bool start(); + bool stop(); + bool restart(); + void setPriority(float prio); + enum TxWindowType getWindowType() { return tx_window; } + + int readSamples(std::vector &bufs, int len, bool *overrun, + TIMESTAMP timestamp, bool *underrun, unsigned *RSSI); + + int writeSamples(std::vector &bufs, int len, bool *underrun, + TIMESTAMP timestamp, bool isControl); + + bool updateAlignment(TIMESTAMP timestamp); + + bool setTxFreq(double wFreq, size_t chan); + bool setRxFreq(double wFreq, size_t chan); + + TIMESTAMP initialWriteTimestamp(); + TIMESTAMP initialReadTimestamp(); + + double fullScaleInputValue(); + double fullScaleOutputValue(); + + double setRxGain(double db, size_t chan); + double getRxGain(size_t chan); + double maxRxGain(void) { return rx_gain_max; } + double minRxGain(void) { return rx_gain_min; } + + double setTxGain(double db, size_t chan); + double maxTxGain(void) { return tx_gain_max; } + double minTxGain(void) { return tx_gain_min; } + + double getTxFreq(size_t chan); + double getRxFreq(size_t chan); + double getRxFreq(); + + bool setRxAntenna(const std::string &ant, size_t chan); + std::string getRxAntenna(size_t chan); + bool setTxAntenna(const std::string &ant, size_t chan); + std::string getTxAntenna(size_t chan); + + bool requiresRadioAlign(); + + GSM::Time minLatency(); + + inline double getSampleRate() { return tx_rate; } + inline double numberRead() { return rx_pkt_cnt; } + inline double numberWritten() { return 0; } + + /** Receive and process asynchronous message + @return true if message received or false on timeout or error + */ + bool recv_async_msg(); + + enum err_code { + ERROR_TIMING = -1, + ERROR_TIMEOUT = -2, + ERROR_UNRECOVERABLE = -3, + ERROR_UNHANDLED = -4, + }; + +private: + uhd::usrp::multi_usrp::sptr usrp_dev; + uhd::tx_streamer::sptr tx_stream; + uhd::rx_streamer::sptr rx_stream; + enum TxWindowType tx_window; + enum uhd_dev_type dev_type; + + double tx_rate, rx_rate; + + double tx_gain_min, tx_gain_max; + double rx_gain_min, rx_gain_max; + + std::vector tx_gains, rx_gains; + std::vector tx_freqs, rx_freqs; + size_t tx_spp, rx_spp; + + bool started; + bool aligned; + + size_t rx_pkt_cnt; + size_t drop_cnt; + uhd::time_spec_t prev_ts; + + TIMESTAMP ts_initial, ts_offset; + std::vector rx_buffers; + + void init_gains(); + void set_channels(bool swap); + void set_rates(); + bool parse_dev_type(); + bool flush_recv(size_t num_pkts); + int check_rx_md_err(uhd::rx_metadata_t &md, ssize_t num_smpls); + + std::string str_code(uhd::rx_metadata_t metadata); + std::string str_code(uhd::async_metadata_t metadata); + + uhd::tune_request_t select_freq(double wFreq, size_t chan, bool tx); + bool set_freq(double freq, size_t chan, bool tx); + + Thread *async_event_thrd; + Mutex tune_lock; +}; + +#endif // _UHD_DEVICE_H_ diff --git a/Transceiver52M/device/uhd/smpl_buf.cpp b/Transceiver52M/device/uhd/smpl_buf.cpp new file mode 100644 index 0000000..f1a6a89 --- /dev/null +++ b/Transceiver52M/device/uhd/smpl_buf.cpp @@ -0,0 +1,162 @@ +#include "smpl_buf.h" +#include + +smpl_buf::smpl_buf(size_t len, double rate) + : buf_len(len), clk_rt(rate), + time_start(0), time_end(0), data_start(0), data_end(0) +{ + data = new uint32_t[len]; +} + +smpl_buf::~smpl_buf() +{ + delete[] data; +} + +ssize_t smpl_buf::avail_smpls(TIMESTAMP timestamp) const +{ + if (timestamp < time_start) + return ERROR_TIMESTAMP; + else if (timestamp >= time_end) + return 0; + else + return time_end - timestamp; +} + +ssize_t smpl_buf::avail_smpls(uhd::time_spec_t timespec) const +{ + return avail_smpls(timespec.to_ticks(clk_rt)); +} + +ssize_t smpl_buf::read(void *buf, size_t len, TIMESTAMP timestamp) +{ + int type_sz = 2 * sizeof(short); + + // Check for valid read + if (timestamp < time_start) + return ERROR_TIMESTAMP; + if (timestamp >= time_end) + return 0; + if (len >= buf_len) + return ERROR_READ; + + // How many samples should be copied + size_t num_smpls = time_end - timestamp; + if (num_smpls > len) + num_smpls = len; + + // Starting index + size_t read_start = (data_start + (timestamp - time_start)) % buf_len; + + // Read it + if (read_start + num_smpls < buf_len) { + size_t numBytes = len * type_sz; + memcpy(buf, data + read_start, numBytes); + } else { + size_t first_cp = (buf_len - read_start) * type_sz; + size_t second_cp = len * type_sz - first_cp; + + memcpy(buf, data + read_start, first_cp); + memcpy((char*) buf + first_cp, data, second_cp); + } + + data_start = (read_start + len) % buf_len; + time_start = timestamp + len; + + if (time_start > time_end) + return ERROR_READ; + else + return num_smpls; +} + +ssize_t smpl_buf::read(void *buf, size_t len, uhd::time_spec_t ts) +{ + return read(buf, len, ts.to_ticks(clk_rt)); +} + +ssize_t smpl_buf::write(void *buf, size_t len, TIMESTAMP timestamp) +{ + int type_sz = 2 * sizeof(short); + + // Check for valid write + if ((len == 0) || (len >= buf_len)) + return ERROR_WRITE; + if ((timestamp + len) <= time_end) + return ERROR_TIMESTAMP; + + if (timestamp < time_end) { + LOGC(DDEV, ERR) << "Overwriting old buffer data: timestamp="< +#include + +#include "radioDevice.h" + +/* + Sample Buffer - Allows reading and writing of timed samples using osmo-trx + or UHD style timestamps. Time conversions are handled + internally or accessable through the static convert calls. +*/ +class smpl_buf { +public: + /** Sample buffer constructor + @param len number of 32-bit samples the buffer should hold + @param rate sample clockrate + @param timestamp + */ + smpl_buf(size_t len, double rate); + ~smpl_buf(); + + /** Query number of samples available for reading + @param timestamp time of first sample + @return number of available samples or error + */ + ssize_t avail_smpls(TIMESTAMP timestamp) const; + ssize_t avail_smpls(uhd::time_spec_t timestamp) const; + + /** Read and write + @param buf pointer to buffer + @param len number of samples desired to read or write + @param timestamp time of first stample + @return number of actual samples read or written or error + */ + ssize_t read(void *buf, size_t len, TIMESTAMP timestamp); + ssize_t read(void *buf, size_t len, uhd::time_spec_t timestamp); + ssize_t write(void *buf, size_t len, TIMESTAMP timestamp); + ssize_t write(void *buf, size_t len, uhd::time_spec_t timestamp); + + /** Buffer status string + @return a formatted string describing internal buffer state + */ + std::string str_status(size_t ts) const; + + /** Formatted error string + @param code an error code + @return a formatted error string + */ + static std::string str_code(ssize_t code); + + enum err_code { + ERROR_TIMESTAMP = -1, + ERROR_READ = -2, + ERROR_WRITE = -3, + ERROR_OVERFLOW = -4 + }; + +private: + uint32_t *data; + size_t buf_len; + + double clk_rt; + + TIMESTAMP time_start; + TIMESTAMP time_end; + + size_t data_start; + size_t data_end; +}; + + +#endif // _SAMPLE_BUF_H_ -- To view, visit https://gerrit.osmocom.org/13809 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib4594320da9bb7f6e9f52e7d70d11ecd11106aae Gerrit-Change-Number: 13809 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 15:47:33 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Apr 2019 15:47:33 +0000 Subject: Change in osmo-trx[master]: uhd: smpl_buf: Drop unused avail_smpls uhd:time_spect_t API Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13810 Change subject: uhd: smpl_buf: Drop unused avail_smpls uhd:time_spect_t API ...................................................................... uhd: smpl_buf: Drop unused avail_smpls uhd:time_spect_t API Change-Id: I94061328d46a550d4147121d85baffa29c700c45 --- M Transceiver52M/device/uhd/smpl_buf.cpp M Transceiver52M/device/uhd/smpl_buf.h 2 files changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/10/13810/1 diff --git a/Transceiver52M/device/uhd/smpl_buf.cpp b/Transceiver52M/device/uhd/smpl_buf.cpp index f1a6a89..750c394 100644 --- a/Transceiver52M/device/uhd/smpl_buf.cpp +++ b/Transceiver52M/device/uhd/smpl_buf.cpp @@ -23,11 +23,6 @@ return time_end - timestamp; } -ssize_t smpl_buf::avail_smpls(uhd::time_spec_t timespec) const -{ - return avail_smpls(timespec.to_ticks(clk_rt)); -} - ssize_t smpl_buf::read(void *buf, size_t len, TIMESTAMP timestamp) { int type_sz = 2 * sizeof(short); diff --git a/Transceiver52M/device/uhd/smpl_buf.h b/Transceiver52M/device/uhd/smpl_buf.h index 2c1e435..dca13d0 100644 --- a/Transceiver52M/device/uhd/smpl_buf.h +++ b/Transceiver52M/device/uhd/smpl_buf.h @@ -40,7 +40,6 @@ @return number of available samples or error */ ssize_t avail_smpls(TIMESTAMP timestamp) const; - ssize_t avail_smpls(uhd::time_spec_t timestamp) const; /** Read and write @param buf pointer to buffer -- To view, visit https://gerrit.osmocom.org/13810 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I94061328d46a550d4147121d85baffa29c700c45 Gerrit-Change-Number: 13810 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 16:53:21 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 29 Apr 2019 16:53:21 +0000 Subject: Change in osmo-msc[master]: large refactoring: support inter-BSC and inter-MSC Handover In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/13137 ) Change subject: large refactoring: support inter-BSC and inter-MSC Handover ...................................................................... Patch Set 6: (1 comment) https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc_fsm.h File include/osmocom/msc/mncc_fsm.h: https://gerrit.osmocom.org/#/c/13137/6/include/osmocom/msc/mncc_fsm.h at 105 PS6, Line 105: struct mncc { > came from removing "fsm" from "mncc_fsm" ... it is the FSM instance's "priv pointer struct". [?] renamed to mncc_call and mncc_call_fsm -- To view, visit https://gerrit.osmocom.org/13137 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I27e4988e0371808b512c757d2b52ada1615067bd Gerrit-Change-Number: 13137 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 29 Apr 2019 16:53:21 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 17:43:34 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Mon, 29 Apr 2019 17:43:34 +0000 Subject: Change in osmo-sgsn[master]: Echo XID-Field of Type L3_PAR even when zero length Message-ID: Keith Whyte has uploaded this change for review. ( https://gerrit.osmocom.org/13811 Change subject: Echo XID-Field of Type L3_PAR even when zero length ...................................................................... Echo XID-Field of Type L3_PAR even when zero length After Activate PDP Context request, Motorola KRZR sends a zero length XID-Field of Type L3 Parameters If this is not echoed back, the phone will send Deactivate PDP Context request with SM Cause: LLC or SNDCP failure(A/Gb only) (25) Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 --- M src/gprs/gprs_llc.c M src/gprs/gprs_sndcp.c 2 files changed, 15 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/11/13811/1 diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index acf4b54..02455b1 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -256,11 +256,20 @@ struct gprs_llc_xid_field); rc = sndcp_sn_xid_ind(xid_field, xid_field_response, lle); - if (rc == 0) - llist_add(&xid_field_response->list, - xid_fields_response); - else + if (rc == 0) { + LOGP(DLLC, LOGL_NOTICE, + "Echoing XID-Field: XID: type %s, data_len=%d, data=%s\n", + get_value_string(gprs_llc_xid_type_names, + xid_field->type), + xid_field->data_len, + osmo_hexdump_nospc(xid_field->data, + xid_field->data_len)); + xid_field_response = gprs_llc_dup_xid_field(lle->llme, xid_field); + llist_add(&xid_field_response->list, xid_fields_response); + } + else { talloc_free(xid_field_response); + } } } diff --git a/src/gprs/gprs_sndcp.c b/src/gprs/gprs_sndcp.c index 23d1e9a..33d8cf6 100644 --- a/src/gprs/gprs_sndcp.c +++ b/src/gprs/gprs_sndcp.c @@ -1125,6 +1125,8 @@ xid_field_indication->data, xid_field_indication->data_len, NULL); + if (comp_fields == NULL) + return 0; if (!comp_fields) return -EINVAL; -- To view, visit https://gerrit.osmocom.org/13811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 Gerrit-Change-Number: 13811 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 17:50:27 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Mon, 29 Apr 2019 17:50:27 +0000 Subject: Change in osmo-sgsn[master]: Echo XID-Field of Type L3_PAR even when zero length In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/13811 ) Change subject: Echo XID-Field of Type L3_PAR even when zero length ...................................................................... Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/13811/1/src/gprs/gprs_llc.c File src/gprs/gprs_llc.c: https://gerrit.osmocom.org/#/c/13811/1/src/gprs/gprs_llc.c at 267 PS1, Line 267: xid_field_response = gprs_llc_dup_xid_field(lle->llme, xid_field); I don't get something here.. This is needed to echo back what the phone wants. Does not work without this line. https://gerrit.osmocom.org/#/c/13811/1/src/gprs/gprs_sndcp.c File src/gprs/gprs_sndcp.c: https://gerrit.osmocom.org/#/c/13811/1/src/gprs/gprs_sndcp.c at 1128 PS1, Line 1128: if (comp_fields == NULL) I suppose NULL == false.. but just in case i did it this way to test. anyway, something else is needed to test if we return EINVAL -- To view, visit https://gerrit.osmocom.org/13811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 Gerrit-Change-Number: 13811 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Comment-Date: Mon, 29 Apr 2019 17:50:27 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 17:51:55 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Mon, 29 Apr 2019 17:51:55 +0000 Subject: Change in osmo-sgsn[master]: Echo XID-Field of Type L3_PAR even when zero length In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/13811 ) Change subject: Echo XID-Field of Type L3_PAR even when zero length ...................................................................... Patch Set 1: BTW, This would close #OS3426 when done -- To view, visit https://gerrit.osmocom.org/13811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 Gerrit-Change-Number: 13811 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Mon, 29 Apr 2019 17:51:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 21:12:50 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 29 Apr 2019 21:12:50 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: The completion ratio is success / success+failure In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/13803 ) Change subject: virtual: The completion ratio is success / success+failure ...................................................................... virtual: The completion ratio is success / success+failure Fix the stats code to calculate the real completion ratio. Change-Id: I1b8f32dfbe8faa4c255a8d2d9806303fc8e5933b --- M suites/nitb_netreg_mass/register_default_mass.py M suites/nitb_netreg_mass/suite.conf 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/suites/nitb_netreg_mass/register_default_mass.py b/suites/nitb_netreg_mass/register_default_mass.py index 76c53f1..306eb81 100644 --- a/suites/nitb_netreg_mass/register_default_mass.py +++ b/suites/nitb_netreg_mass/register_default_mass.py @@ -38,7 +38,7 @@ stats = ms_driver.get_stats() if len(modems) > 0 and stats.num_completed < 1: raise Exception("No run completed.") -completion_ratio = stats.num_attempted / stats.num_completed +completion_ratio = stats.num_completed / stats.num_attempted # Verify that 99% of LUs completed. if completion_ratio < 0.99: diff --git a/suites/nitb_netreg_mass/suite.conf b/suites/nitb_netreg_mass/suite.conf index 44de0b6..bb1585b 100644 --- a/suites/nitb_netreg_mass/suite.conf +++ b/suites/nitb_netreg_mass/suite.conf @@ -8,4 +8,4 @@ type: osmo-mobile defaults: - timeout: 40s + timeout: 50s -- To view, visit https://gerrit.osmocom.org/13803 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1b8f32dfbe8faa4c255a8d2d9806303fc8e5933b Gerrit-Change-Number: 13803 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 21:31:38 2019 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Mon, 29 Apr 2019 21:31:38 +0000 Subject: Change in osmo-sgsn[master]: Echo XID-Field of Type L3_PAR even when zero length In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/13811 ) Change subject: Echo XID-Field of Type L3_PAR even when zero length ...................................................................... Patch Set 1: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/13811/1/src/gprs/gprs_llc.c File src/gprs/gprs_llc.c: https://gerrit.osmocom.org/#/c/13811/1/src/gprs/gprs_llc.c at 267 PS1, Line 267: xid_field_response = gprs_llc_dup_xid_field(lle->llme, xid_field); > I don't get something here.. This is needed to echo back what the phone wants. [?] If you "echo" something backs, it means you accept the XID. The code in this file looks correct, the layer 3 decides what do write back, if this is a L3 XID https://gerrit.osmocom.org/#/c/13811/1/src/gprs/gprs_sndcp.c File src/gprs/gprs_sndcp.c: https://gerrit.osmocom.org/#/c/13811/1/src/gprs/gprs_sndcp.c at 1122 PS1, Line 1122: Better to do here an `if (xid_field_indication->data_len == 0) gprs_llc_copy_xid()` and add a comment, that some phones actually sent zero byte length SNDCP frames. https://gerrit.osmocom.org/#/c/13811/1/src/gprs/gprs_sndcp.c at 1128 PS1, Line 1128: if (comp_fields == NULL) > I suppose NULL == false.. but just in case i did it this way to test. [?] (!comp_fields) is equivalent to (comp_fields == NULL). -- To view, visit https://gerrit.osmocom.org/13811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 Gerrit-Change-Number: 13811 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Mon, 29 Apr 2019 21:31:38 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Apr 29 22:32:26 2019 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Mon, 29 Apr 2019 22:32:26 +0000 Subject: Change in gr-gsm[master]: Filter out SoapyAudio devices Message-ID: Hello Piotr Krysik, Vadim Yanitskiy, I'd like you to do a code review. Please visit https://gerrit.osmocom.org/13812 to review the following change. Change subject: Filter out SoapyAudio devices ...................................................................... Filter out SoapyAudio devices When gr-osmosdr is compiled with SoapySDR support and SoapyAudio is installed the audio device is picked as a first choice when detecting devices but grgsm tools are not able to work with audio devices. So in such cases the user has to always specify the correct SDR device in the args parameter which is a bit inconvenient. When args is not specified call osmosdr.device_find to get all devices and filter out unspported ones like SoapyAudio devices. When args is specifed just try to create osmosdr.source with whatever value has been specified. Add -l and --list-devices command line option that prints information about all detected devices. Example commands: grgsm_capture --list-devices grgsm_capture --list-devices --args=nofake grgsm_capture --args=uhd,type=b210 -a 111 capture.cfile grgsm_livemon --args=rtl grgsm_livemon --args=uhd,type=b210 Change-Id: Ib84081041ca6c2bc18b9da0c32bac9d3ecef65ca --- M apps/grgsm_livemon.grc M apps/grgsm_livemon_headless.grc M apps/grgsm_scanner M apps/helpers/grgsm_capture M python/__init__.py M python/misc_utils/CMakeLists.txt A python/misc_utils/device.py 7 files changed, 66 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/12/13812/1 diff --git a/apps/grgsm_livemon.grc b/apps/grgsm_livemon.grc index 46b83e2..176aa6c 100644 --- a/apps/grgsm_livemon.grc +++ b/apps/grgsm_livemon.grc @@ -2844,7 +2844,7 @@ args - args + str(grgsm.device.get_default_args(args)) _enabled diff --git a/apps/grgsm_livemon_headless.grc b/apps/grgsm_livemon_headless.grc index a1ce284..2f3e981 100644 --- a/apps/grgsm_livemon_headless.grc +++ b/apps/grgsm_livemon_headless.grc @@ -2414,7 +2414,7 @@ args - args + str(grgsm.device.get_default_args(args)) _enabled diff --git a/apps/grgsm_scanner b/apps/grgsm_scanner index 32210ed..83b99d1 100755 --- a/apps/grgsm_scanner +++ b/apps/grgsm_scanner @@ -36,7 +36,7 @@ import osmosdr import pmt import time - +import sys # from wideband_receiver import * @@ -208,7 +208,8 @@ # if no file name is given process data from rtl_sdr source print "Args=", args - self.rtlsdr_source = osmosdr.source(args="numchan=" + str(1) + " " + args) + self.rtlsdr_source = osmosdr.source(args="numchan=" + str(1) + " " + + str(grgsm.device.get_default_args(args))) #self.rtlsdr_source.set_min_output_buffer(int(sample_rate*rec_len)) #this line causes segfaults on HackRF self.rtlsdr_source.set_sample_rate(sample_rate) @@ -387,7 +388,10 @@ parser.add_option("-g", "--gain", dest="gain", type="eng_float", default=24.0, help="Set gain [default=%default]") parser.add_option("", "--args", dest="args", type="string", default="", - help="Set device arguments [default=%default]") + help="Set device arguments [default=%default]." + "Use --list-devices the view the available devices") + parser.add_option("-l", "--list-devices", action="store_true", + help="List available SDR devices, use --args to specify hints") parser.add_option("--speed", dest="speed", type="intx", default=4, help="Scan speed [default=%default]. Value range 0-5.") parser.add_option("-v", "--verbose", action="store_true", @@ -404,6 +408,10 @@ if options is None: (options, args) = argument_parser().parse_args() + if options.list_devices: + grgsm.device.print_devices(options.args) + sys.exit(0) + if options.band not in grgsm.arfcn.get_bands(): parser.error("Invalid GSM band\n") diff --git a/apps/helpers/grgsm_capture b/apps/helpers/grgsm_capture index 081544a..f3886ba 100755 --- a/apps/helpers/grgsm_capture +++ b/apps/helpers/grgsm_capture @@ -53,8 +53,8 @@ # Setting up RF source ################################################## - self.sdr_source = \ - osmosdr.source(args="numchan=" + str(1) + " " + device_args) + self.sdr_source = osmosdr.source(args="numchan=" + str(1) + " " + + str(grgsm.device.get_default_args(device_args))) self.sdr_source.set_sample_rate(samp_rate) self.sdr_source.set_center_freq(freq, 0) @@ -141,12 +141,19 @@ osmogroup.add_option("", "--args", dest="device_args", type="string", default="", help="Set device arguments " - "[default=%default]") + "[default=%default]. Use --list-devices the view the available devices") + + osmogroup.add_option("-l", "--list-devices", action="store_true", + help="List available SDR devices, use --args to specify hints") parser.add_option_group(osmogroup) (options, args) = parser.parse_args() + if options.list_devices: + grgsm.device.print_devices(options.device_args) + sys.exit(0) + if not args: parser.error("Please provide an output file name to save the captured data\n") diff --git a/python/__init__.py b/python/__init__.py index 00d14ac..e2905e8 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -59,6 +59,7 @@ from fn_time import * from txtime_bursts_tagger import * import arfcn +import device # diff --git a/python/misc_utils/CMakeLists.txt b/python/misc_utils/CMakeLists.txt index ec732a4..76304ca 100644 --- a/python/misc_utils/CMakeLists.txt +++ b/python/misc_utils/CMakeLists.txt @@ -23,5 +23,6 @@ clock_offset_corrector_tagged.py hier_block.py fn_time.py + device.py DESTINATION ${GR_PYTHON_DIR}/grgsm ) diff --git a/python/misc_utils/device.py b/python/misc_utils/device.py new file mode 100644 index 0000000..eac1388 --- /dev/null +++ b/python/misc_utils/device.py @@ -0,0 +1,41 @@ +import osmosdr +import os + +def get_devices(hint=""): + return osmosdr.device_find(osmosdr.device_t(hint)) + +def match(dev, filters): + for f in filters: + for k, v in f.items(): + if (k not in dev or dev[k] != v): + break + else: + return True + return False + +def exclude(devices, filters = ({'driver': 'audio'},)): + return [dev for dev in devices if not match(dev, filters)] + +def get_all_args(hint="nofake"): + return map(lambda dev: dev.to_string(), exclude(get_devices(hint))) + +def get_default_args(args): + # The presence of GRC_BLOCKS_PATH environment variable indicates that + # gnuradio-companion compiles a flowgraph and in this case no exception + # have to be thrown otherwise the generaged python script will be invalid. + # This allows compilation of flowgraphs without an SDR device. + if args or os.getenv("GRC_BLOCKS_PATH"): + return args + + devices = get_all_args("nofake") + if not devices: + raise RuntimeError("Unable to find any supported SDR devices") + + return devices[0] + +def print_devices(hint=""): + devices = exclude(get_devices(hint)) + if devices: + print("\n".join(map(lambda dev: dev.to_string(), devices))) + else: + print("Unable to find any supported SDR devices") -- To view, visit https://gerrit.osmocom.org/13812 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib84081041ca6c2bc18b9da0c32bac9d3ecef65ca Gerrit-Change-Number: 13812 Gerrit-PatchSet: 1 Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 00:53:28 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 30 Apr 2019 00:53:28 +0000 Subject: Change in osmo-mgw[master]: move MGW endpoint FSM from osmo-bsc to here 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/13590 to look at the new patch set (#5). Change subject: move MGW endpoint FSM from osmo-bsc to here ...................................................................... move MGW endpoint FSM from osmo-bsc to here Move mgw_endpoint_fsm from osmo-bsc here as osmo_mgcpc_ep_fsm. Apply various renames for consistency. Use osmo_tdef from libosmocore instead of osmo-bsc's (so far) local T_defs API. Change T23042 to T2427001, which is a slightly less arbitrary number and slightly more extendable in the future (2427 corresponds to the default MGCP port at osmo-mgw, 001 is the first MGCP timer and so far the only one). Change-Id: I9a3effd38e72841529df6c135c077116981dea36 --- M include/Makefile.am A include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h M include/osmocom/mgcp_client/mgcp_client_fsm.h M src/libosmo-mgcp-client/Makefile.am A src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c M src/libosmo-mgcp-client/mgcp_client_fsm.c 6 files changed, 866 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/90/13590/5 -- To view, visit https://gerrit.osmocom.org/13590 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9a3effd38e72841529df6c135c077116981dea36 Gerrit-Change-Number: 13590 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 00:53:29 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 30 Apr 2019 00:53:29 +0000 Subject: Change in osmo-mgw[master]: constify map_codec_to_pt() ptmap arg Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13813 Change subject: constify map_codec_to_pt() ptmap arg ...................................................................... constify map_codec_to_pt() ptmap arg Change-Id: I030843d2d692b7a73cca8f427df070d2806ab695 --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/13/13813/1 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index ac3e2b1..9b57f10 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -154,7 +154,7 @@ } enum mgcp_codecs map_str_to_codec(const char *str); -unsigned int map_codec_to_pt(struct ptmap *ptmap, unsigned int ptmap_len, +unsigned int map_codec_to_pt(const struct ptmap *ptmap, unsigned int ptmap_len, enum mgcp_codecs codec); enum mgcp_codecs map_pt_to_codec(struct ptmap *ptmap, unsigned int ptmap_len, unsigned int pt); diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 2dcab62..c28f5d2 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -93,7 +93,7 @@ } /* Check the ptmap for illegal mappings */ -static int check_ptmap(struct ptmap *ptmap) +static int check_ptmap(const struct ptmap *ptmap) { /* Check if there are mappings that leave the IANA assigned dynamic * payload type range. Under normal conditions such mappings should @@ -122,7 +122,7 @@ * \ptmap[in] ptmap_len length of the payload type map. * \ptmap[in] codec the codec for which the payload type should be looked up. * \returns assigned payload type */ -unsigned int map_codec_to_pt(struct ptmap *ptmap, unsigned int ptmap_len, +unsigned int map_codec_to_pt(const struct ptmap *ptmap, unsigned int ptmap_len, enum mgcp_codecs codec) { unsigned int i; -- To view, visit https://gerrit.osmocom.org/13813 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I030843d2d692b7a73cca8f427df070d2806ab695 Gerrit-Change-Number: 13813 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 00:54:55 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 30 Apr 2019 00:54:55 +0000 Subject: Change in libosmocore[master]: add comment to gsm_mncc_bearer_cap.speech_ver Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13814 Change subject: add comment to gsm_mncc_bearer_cap.speech_ver ...................................................................... add comment to gsm_mncc_bearer_cap.speech_ver Change-Id: Ib657b1eb55aab400f3682a89bbd428bdee02581c --- M include/osmocom/gsm/mncc.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/14/13814/1 diff --git a/include/osmocom/gsm/mncc.h b/include/osmocom/gsm/mncc.h index 7e7d12c..e5e9607 100644 --- a/include/osmocom/gsm/mncc.h +++ b/include/osmocom/gsm/mncc.h @@ -15,7 +15,7 @@ int coding; /* Coding Standard */ int radio; /* Radio Channel Requirement */ int speech_ctm; /* CTM text telephony indication */ - int speech_ver[8]; /* Speech version indication */ + int speech_ver[8]; /* Speech version indication, see enum gsm48_bcap_speech_ver; -1 marks end */ struct { enum gsm48_bcap_ra rate_adaption; enum gsm48_bcap_sig_access sig_access; -- To view, visit https://gerrit.osmocom.org/13814 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib657b1eb55aab400f3682a89bbd428bdee02581c Gerrit-Change-Number: 13814 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 00:54:56 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 30 Apr 2019 00:54:56 +0000 Subject: Change in libosmocore[master]: gsm48_decode_bcd_number2(): fix input len check Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13815 Change subject: gsm48_decode_bcd_number2(): fix input len check ...................................................................... gsm48_decode_bcd_number2(): fix input len check The input_len argument for gsm48_decode_bcd_number2() includes the BCD length *and* the length byte itself, so add the missing +1. Also clarify the API doc for the input_len argument. Change-Id: I87599641325c04aae2be224ec350b1a145039528 --- M src/gsm/gsm48_ie.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/13815/1 diff --git a/src/gsm/gsm48_ie.c b/src/gsm/gsm48_ie.c index 049f5dc..0e5f253 100644 --- a/src/gsm/gsm48_ie.c +++ b/src/gsm/gsm48_ie.c @@ -80,7 +80,7 @@ * \param[out] output Caller-provided output buffer. * \param[in] output_len sizeof(output). * \param[in] bcd_lv Length-Value part of to-be-decoded IE. - * \param[in] input_len Size of the buffer to read the IE from. + * \param[in] input_len Size of the bcd_lv buffer for bounds checking. * \param[in] h_len Length of an optional header between L and V parts. * \return 0 in case of success, negative on error. Errors checked: no or too little input data, no or too little * output buffer size, IE length exceeds input data size, decoded number exceeds size of the output buffer. The output @@ -97,7 +97,8 @@ if (input_len < 1) return -EIO; len = bcd_lv[0]; - if (input_len < len) + /* len + 1: the BCD length plus the length byte itself must fit in the input buffer. */ + if (input_len < len + 1) return -EIO; return gsm48_decode_bcd_number(output, output_len, bcd_lv, h_len); } -- To view, visit https://gerrit.osmocom.org/13815 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I87599641325c04aae2be224ec350b1a145039528 Gerrit-Change-Number: 13815 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 00:54:56 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 30 Apr 2019 00:54:56 +0000 Subject: Change in libosmocore[master]: gsm48_decode_bcd_number2(): allow avoiding deprecation Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13816 Change subject: gsm48_decode_bcd_number2(): allow avoiding deprecation ...................................................................... gsm48_decode_bcd_number2(): allow avoiding deprecation gsm48_decode_bcd_number() is marked as deprecated, so gsm48_decode_bcd_number2() will cause deprecation warnings as long as it calls gsm48_decode_bcd_number(). Hence move the code to gsm48_decode_bcd_number2(). Change-Id: I81925e9afb3451de9b8a268d482f79ee20ca14d6 --- M src/gsm/gsm48_ie.c 1 file changed, 29 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/13816/1 diff --git a/src/gsm/gsm48_ie.c b/src/gsm/gsm48_ie.c index 0e5f253..ca6489a 100644 --- a/src/gsm/gsm48_ie.c +++ b/src/gsm/gsm48_ie.c @@ -55,7 +55,36 @@ const uint8_t *bcd_lv, int h_len) { uint8_t in_len = bcd_lv[0]; + /* Just assume the input buffer is big enough for the length byte and the following data, so pass in_len + 1 for + * the input buffer size. */ + return gsm48_decode_bcd_number2(output, output_len, bcd_lv, in_len + 1, h_len); +} + +/*! Decode a 'called/calling/connect party BCD number' as in 10.5.4.7. + * \param[out] output Caller-provided output buffer. + * \param[in] output_len sizeof(output). + * \param[in] bcd_lv Length-Value part of to-be-decoded IE. + * \param[in] input_len Size of the bcd_lv buffer for bounds checking. + * \param[in] h_len Length of an optional header between L and V parts. + * \return 0 in case of success, negative on error. Errors checked: no or too little input data, no or too little + * output buffer size, IE length exceeds input data size, decoded number exceeds size of the output buffer. The output + * is guaranteed to be nul terminated iff output_len > 0. + */ +int gsm48_decode_bcd_number2(char *output, size_t output_len, + const uint8_t *bcd_lv, size_t input_len, + size_t h_len) +{ + uint8_t in_len; int i; + if (output_len < 1) + return -ENOSPC; + *output = '\0'; + if (input_len < 1) + return -EIO; + in_len = bcd_lv[0]; + /* len + 1: the BCD length plus the length byte itself must fit in the input buffer. */ + if (input_len < in_len + 1) + return -EIO; for (i = 1 + h_len; i <= in_len; i++) { /* lower nibble */ @@ -76,33 +105,6 @@ return 0; } -/*! Decode a 'called/calling/connect party BCD number' as in 10.5.4.7. - * \param[out] output Caller-provided output buffer. - * \param[in] output_len sizeof(output). - * \param[in] bcd_lv Length-Value part of to-be-decoded IE. - * \param[in] input_len Size of the bcd_lv buffer for bounds checking. - * \param[in] h_len Length of an optional header between L and V parts. - * \return 0 in case of success, negative on error. Errors checked: no or too little input data, no or too little - * output buffer size, IE length exceeds input data size, decoded number exceeds size of the output buffer. The output - * is guaranteed to be nul terminated iff output_len > 0. - */ -int gsm48_decode_bcd_number2(char *output, size_t output_len, - const uint8_t *bcd_lv, size_t input_len, - size_t h_len) -{ - uint8_t len; - if (output_len < 1) - return -ENOSPC; - *output = '\0'; - if (input_len < 1) - return -EIO; - len = bcd_lv[0]; - /* len + 1: the BCD length plus the length byte itself must fit in the input buffer. */ - if (input_len < len + 1) - return -EIO; - return gsm48_decode_bcd_number(output, output_len, bcd_lv, h_len); -} - /*! convert a single ASCII character to call-control BCD */ static int asc_to_bcd(const char asc) { -- To view, visit https://gerrit.osmocom.org/13816 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I81925e9afb3451de9b8a268d482f79ee20ca14d6 Gerrit-Change-Number: 13816 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 00:54:57 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 30 Apr 2019 00:54:57 +0000 Subject: Change in libosmocore[master]: osmo_gsup_decode(): properly check IMSI, avoid deprecation Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13817 Change subject: osmo_gsup_decode(): properly check IMSI, avoid deprecation ...................................................................... osmo_gsup_decode(): properly check IMSI, avoid deprecation In osmo_gsup_decode(), call gsm48_decode_bcd_number2() to avoid deprecation warning, and also actually check the return value to detect invalid IMSI IEs. Change-Id: Iaded84d91baad5386c8f353c283b6b9e40a43b05 --- M src/gsm/gsup.c 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/17/13817/1 diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index a3d9eef..2e6690e 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -332,9 +332,11 @@ * before the value part already contains this length so we can use it * here. */ - OSMO_ASSERT(value[-1] == value_len); - gsm48_decode_bcd_number(gsup_msg->imsi, sizeof(gsup_msg->imsi), - value - 1, 0); + if (gsm48_decode_bcd_number2(gsup_msg->imsi, sizeof(gsup_msg->imsi), + value - 1, value_len + 1, 0)) { + LOGP(DLGSUP, LOGL_ERROR, "Cannot decode IMSI\n"); + return -GMM_CAUSE_INV_MAND_INFO; + } /* specific parts */ while (data_len > 0) { -- To view, visit https://gerrit.osmocom.org/13817 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iaded84d91baad5386c8f353c283b6b9e40a43b05 Gerrit-Change-Number: 13817 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 00:58:40 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 30 Apr 2019 00:58:40 +0000 Subject: Change in osmo-bsc[master]: move mgw endpoint FSM to osmo-mgw.git In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13796 to look at the new patch set (#2). Change subject: move mgw endpoint FSM to osmo-mgw.git ...................................................................... move mgw endpoint FSM to osmo-mgw.git osmo-mgw.git also includes fixes of the MGW endpoint FSM, for example I92a9944acc96398acd6649f9c3c5badec5dd6dcc. Depends: I9a3effd38e72841529df6c135c077116981dea36 (osmo-mgw) Change-Id: I03e6b48d9b0a5370310d5f56809259ff7909cf9d --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/bsc_subscr_conn_fsm.h M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/lchan_rtp_fsm.h D include/osmocom/bsc/mgw_endpoint_fsm.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/codec_pref.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c M src/osmo-bsc/lchan_rtp_fsm.c D src/osmo-bsc/mgw_endpoint_fsm.c M src/osmo-bsc/net_init.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_lcls.c M src/osmo-bsc/osmo_bsc_main.c M tests/handover/Makefile.am M tests/handover/handover_test.c 20 files changed, 187 insertions(+), 939 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/96/13796/2 -- To view, visit https://gerrit.osmocom.org/13796 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I03e6b48d9b0a5370310d5f56809259ff7909cf9d Gerrit-Change-Number: 13796 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 00:58:41 2019 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 30 Apr 2019 00:58:41 +0000 Subject: Change in osmo-bsc[master]: assignment_fsm: Properly support assigning signalling mode TCH/x Message-ID: Hello tnt, I'd like you to do a code review. Please visit https://gerrit.osmocom.org/13818 to review the following change. Change subject: assignment_fsm: Properly support assigning signalling mode TCH/x ...................................................................... assignment_fsm: Properly support assigning signalling mode TCH/x To support the 3 possible preferences, the changes needed were: - Replace 'full_rate' bool with a 3 option enum to represent the channels types for signalling - Switch from _pref/_alt to using an array sorted in preference order Originally merged as Change-Id I4c7499c8c866ea3ff7b1327edb3615d003d927d3, reverted because the change broke voice calls. Re-submitting with the fix: don't forget to set conn->assignment.requires_voice_stream. Signed-off-by: Sylvain Munaut Change-Id: I7513d2cbe8b695ba6f031ad11560c63a6535cf2d --- M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/lchan_select.h M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/codec_pref.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_select.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/codec_pref/codec_pref_test.c 8 files changed, 169 insertions(+), 133 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/18/13818/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index dacc63b..dc686c3 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -98,9 +98,15 @@ SUBSCR_SCCP_ST_CONNECTED }; +enum channel_rate { + CH_RATE_SDCCH, + CH_RATE_HALF, + CH_RATE_FULL, +}; + struct channel_mode_and_rate { enum gsm48_chan_mode chan_mode; - bool full_rate; + enum channel_rate chan_rate; uint16_t s15_s0; }; @@ -115,12 +121,9 @@ char msc_rtp_addr[INET_ADDRSTRLEN]; uint16_t msc_rtp_port; - /* Prefered rate/codec setting (mandatory) */ - struct channel_mode_and_rate ch_mode_rate_pref; - - /* Alternate rate/codec setting (optional) */ - bool ch_mode_rate_alt_present; - struct channel_mode_and_rate ch_mode_rate_alt; + /* Rate/codec setting in preference order (need at least 1 !) */ + int n_ch_mode_rate; + struct channel_mode_and_rate ch_mode_rate[3]; }; /* State of an ongoing Assignment, while the assignment_fsm is still busy. This serves as state separation to keep the diff --git a/include/osmocom/bsc/lchan_select.h b/include/osmocom/bsc/lchan_select.h index 4aecdf6..865181b 100644 --- a/include/osmocom/bsc/lchan_select.h +++ b/include/osmocom/bsc/lchan_select.h @@ -3,4 +3,4 @@ struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, enum gsm_chan_t type); struct gsm_lchan *lchan_select_by_chan_mode(struct gsm_bts *bts, - enum gsm48_chan_mode chan_mode, bool full_rate); + enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate); diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index fdfc080..834b58b 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -250,17 +250,15 @@ static bool lchan_type_compat_with_mode(enum gsm_chan_t type, const struct channel_mode_and_rate *ch_mode_rate) { enum gsm48_chan_mode chan_mode = ch_mode_rate->chan_mode; - bool full_rate = ch_mode_rate->full_rate; + enum channel_rate chan_rate = ch_mode_rate->chan_rate; switch (chan_mode) { case GSM48_CMODE_SIGN: switch (type) { - case GSM_LCHAN_TCH_F: - case GSM_LCHAN_TCH_H: - case GSM_LCHAN_SDCCH: - return true; - default: - return false; + case GSM_LCHAN_TCH_F: return chan_rate == CH_RATE_FULL; + case GSM_LCHAN_TCH_H: return chan_rate == CH_RATE_HALF; + case GSM_LCHAN_SDCCH: return chan_rate == CH_RATE_SDCCH; + default: return false; } case GSM48_CMODE_SPEECH_V1: @@ -268,12 +266,12 @@ case GSM48_CMODE_DATA_3k6: case GSM48_CMODE_DATA_6k0: /* these services can all run on TCH/H, but we may have - * an explicit override by the 'full_rate' argument */ + * an explicit override by the 'chan_rate' argument */ switch (type) { case GSM_LCHAN_TCH_F: - return full_rate; + return chan_rate == CH_RATE_FULL; case GSM_LCHAN_TCH_H: - return !full_rate; + return chan_rate == CH_RATE_HALF; default: return false; } @@ -319,47 +317,37 @@ * sure that both are consistent. */ static int check_requires_voice_stream(struct gsm_subscriber_connection *conn) { - bool result_requires_voice_alt; - bool result_requires_voice_pref; + bool requires_voice_pref = false, requires_voice_alt; struct assignment_request *req = &conn->assignment.req; struct osmo_fsm_inst *fi = conn->fi; - int rc; + int i, rc; /* When the assignment request indicates that there is an alternate * rate available (e.g. "Full or Half rate channel, Half rate * preferred..."), then both must be either voice or either signalling, * a mismatch is not permitted */ - /* Check the prefered setting */ - rc = check_requires_voice(&result_requires_voice_pref, req->ch_mode_rate_pref.chan_mode); - if (rc < 0) { - assignment_fail(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP, - "Prefered channel mode not supported: %s", - gsm48_chan_mode_name(req->ch_mode_rate_pref.chan_mode)); - return -EINVAL; - } - conn->assignment.requires_voice_stream = result_requires_voice_pref; + for (i = 0; i < req->n_ch_mode_rate; i++) { + rc = check_requires_voice(&requires_voice_alt, req->ch_mode_rate[i].chan_mode); + if (rc < 0) { + assignment_fail(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP, + "Channel mode not supported (prev level %d): %s", i, + gsm48_chan_mode_name(req->ch_mode_rate[i].chan_mode)); + return -EINVAL; + } - /* If there is an alternate setting, check that one as well */ - if (!req->ch_mode_rate_alt_present) - return 0; - rc = check_requires_voice(&result_requires_voice_alt, req->ch_mode_rate_alt.chan_mode); - if (rc < 0) { - assignment_fail(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP, - "Alternate channel mode not supported: %s", - gsm48_chan_mode_name(req->ch_mode_rate_alt.chan_mode)); - return -EINVAL; + if (i==0) + requires_voice_pref = requires_voice_alt; + else if (requires_voice_alt != requires_voice_pref) { + assignment_fail(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP, + "Inconsistent channel modes: %s != %s", + gsm48_chan_mode_name(req->ch_mode_rate[0].chan_mode), + gsm48_chan_mode_name(req->ch_mode_rate[i].chan_mode)); + return -EINVAL; + } } - /* Make sure both settings match */ - if (result_requires_voice_pref != result_requires_voice_alt) { - assignment_fail(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP, - "Inconsistent channel modes: %s != %s", - gsm48_chan_mode_name(req->ch_mode_rate_pref.chan_mode), - gsm48_chan_mode_name(req->ch_mode_rate_alt.chan_mode)); - return -EINVAL; - } - + conn->assignment.requires_voice_stream = requires_voice_pref; return 0; } @@ -369,18 +357,20 @@ static bool reuse_existing_lchan(struct gsm_subscriber_connection *conn) { struct assignment_request *req = &conn->assignment.req; + int i; if (!conn->lchan) return false; /* Check if the currently existing lchan is compatible with the * preferred rate/codec. */ - if (lchan_type_compat_with_mode(conn->lchan->type, &req->ch_mode_rate_pref)) - conn->lchan->ch_mode_rate = req->ch_mode_rate_pref; - else if (req->ch_mode_rate_alt_present - && lchan_type_compat_with_mode(conn->lchan->type, &req->ch_mode_rate_alt)) - conn->lchan->ch_mode_rate = req->ch_mode_rate_alt; - else + for (i = 0; i < req->n_ch_mode_rate; i++) + if (lchan_type_compat_with_mode(conn->lchan->type, &req->ch_mode_rate[i])) { + conn->lchan->ch_mode_rate = req->ch_mode_rate[i]; + break; + } + + if (i == req->n_ch_mode_rate) return false; if (conn->lchan->tch_mode != conn->lchan->ch_mode_rate.chan_mode) { @@ -398,8 +388,14 @@ void assignment_fsm_start(struct gsm_subscriber_connection *conn, struct gsm_bts *bts, struct assignment_request *req) { + static const char *rate_names[] = { + [CH_RATE_SDCCH] = "SDCCH", + [CH_RATE_HALF] = "HR", + [CH_RATE_FULL] = "FR", + }; struct osmo_fsm_inst *fi; struct lchan_activate_info info; + int i; OSMO_ASSERT(conn); OSMO_ASSERT(conn->fi); @@ -442,17 +438,13 @@ return; } - /* Try to allocate a new lchan with the preferred codec/rate choice */ - conn->assignment.new_lchan = - lchan_select_by_chan_mode(bts, req->ch_mode_rate_pref.chan_mode, req->ch_mode_rate_pref.full_rate); - conn->lchan->ch_mode_rate = req->ch_mode_rate_pref; - - /* In case the lchan allocation fails, we try with the alternat codec/ - * rate choice (if possible) */ - if (!conn->assignment.new_lchan && req->ch_mode_rate_alt_present) { - conn->assignment.new_lchan = - lchan_select_by_chan_mode(bts, req->ch_mode_rate_alt.chan_mode, req->ch_mode_rate_alt.full_rate); - conn->lchan->ch_mode_rate = req->ch_mode_rate_alt; + /* Try to allocate a new lchan in order of preference */ + for (i = 0; i < req->n_ch_mode_rate; i++) { + conn->assignment.new_lchan = lchan_select_by_chan_mode(bts, + req->ch_mode_rate[i].chan_mode, req->ch_mode_rate[i].chan_rate); + conn->lchan->ch_mode_rate = req->ch_mode_rate[i]; + if (conn->assignment.new_lchan) + break; } /* Check whether the lchan allocation was successful or not and tear @@ -461,21 +453,22 @@ assignment_count_result(BSC_CTR_ASSIGNMENT_NO_CHANNEL); assignment_fail(GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE, "BSSMAP Assignment Command:" - " No lchan available for: preferred=%s%s / alternate=%s%s\n", - gsm48_chan_mode_name(req->ch_mode_rate_pref.chan_mode), - req->ch_mode_rate_pref.full_rate ? ",FR" : ",HR", - req->ch_mode_rate_alt_present ? - gsm48_chan_mode_name(req->ch_mode_rate_alt.chan_mode) : "none", - req->ch_mode_rate_alt_present ? - (req->ch_mode_rate_alt.full_rate ? ",FR" : ",HR") : ""); + " No lchan available for: pref=%s:%s / alt1=%s:%s / alt2=%s:%s\n", + gsm48_chan_mode_name(req->ch_mode_rate[0].chan_mode), + rate_names[req->ch_mode_rate[0].chan_rate], + req->n_ch_mode_rate >= 1 ? gsm48_chan_mode_name(req->ch_mode_rate[0].chan_mode) : "", + req->n_ch_mode_rate >= 1 ? rate_names[req->ch_mode_rate[0].chan_rate] : "", + req->n_ch_mode_rate >= 2 ? gsm48_chan_mode_name(req->ch_mode_rate[0].chan_mode) : "", + req->n_ch_mode_rate >= 2 ? rate_names[req->ch_mode_rate[0].chan_rate] : "" + ); return; } assignment_fsm_update_id(conn); - LOG_ASSIGNMENT(conn, LOGL_INFO, "Starting Assignment: chan_mode=%s, full_rate=%d," + LOG_ASSIGNMENT(conn, LOGL_INFO, "Starting Assignment: chan_mode=%s, chan_type=%s," " aoip=%s MSC-rtp=%s:%u\n", gsm48_chan_mode_name(conn->lchan->ch_mode_rate.chan_mode), - conn->lchan->ch_mode_rate.full_rate, + rate_names[conn->lchan->ch_mode_rate.chan_rate], req->aoip ? "yes" : "no", req->msc_rtp_addr, req->msc_rtp_port); assignment_fsm_state_chg(ASSIGNMENT_ST_WAIT_LCHAN_ACTIVE); diff --git a/src/osmo-bsc/codec_pref.c b/src/osmo-bsc/codec_pref.c index 3e06114..b27defc 100644 --- a/src/osmo-bsc/codec_pref.c +++ b/src/osmo-bsc/codec_pref.c @@ -324,6 +324,7 @@ { unsigned int i; uint8_t perm_spch; + bool full_rate; bool match = false; const struct gsm0808_speech_codec *sc_match = NULL; int rc; @@ -337,15 +338,16 @@ perm_spch = audio_support_to_gsm88(msc->audio_support[i]); /* Determine if the result is a half or full rate codec */ - rc = full_rate_from_perm_spch(&ch_mode_rate->full_rate, perm_spch); + rc = full_rate_from_perm_spch(&full_rate, perm_spch); if (rc < 0) return -EINVAL; + ch_mode_rate->chan_rate = full_rate ? CH_RATE_FULL : CH_RATE_HALF; /* If we have a preference for FR or HR in our request, we * discard the potential match */ - if (rate_pref == RATE_PREF_HR && ch_mode_rate->full_rate) + if (rate_pref == RATE_PREF_HR && ch_mode_rate->chan_rate == CH_RATE_FULL) continue; - if (rate_pref == RATE_PREF_FR && !ch_mode_rate->full_rate) + if (rate_pref == RATE_PREF_FR && ch_mode_rate->chan_rate == CH_RATE_HALF) continue; /* Check this permitted speech value against the BTS specific parameters. @@ -375,8 +377,8 @@ /* Exit without result, in case no match can be deteched */ if (!match) { - ch_mode_rate->full_rate = false; ch_mode_rate->chan_mode = GSM48_CMODE_SIGN; + ch_mode_rate->chan_rate = CH_RATE_SDCCH; ch_mode_rate->s15_s0 = 0; return -1; } diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 6a07fbe..442f7be 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -582,10 +582,11 @@ } LOG_HO(conn, LOGL_DEBUG, "BTS %u: Found matching audio type: %s %s (for %s)\n", - bts->nr, gsm48_chan_mode_name(ch_mode_rate.chan_mode), ch_mode_rate.full_rate? "full-rate" : "half-rate", + bts->nr, gsm48_chan_mode_name(ch_mode_rate.chan_mode), + ch_mode_rate.chan_rate == CH_RATE_FULL ? "full-rate" : "half-rate", gsm0808_channel_type_name(&req->ct)); - lchan = lchan_select_by_chan_mode(bts, ch_mode_rate.chan_mode, ch_mode_rate.full_rate); + lchan = lchan_select_by_chan_mode(bts, ch_mode_rate.chan_mode, ch_mode_rate.chan_rate); if (!lchan) { LOG_HO(conn, LOGL_DEBUG, "BTS %u has no matching free channels\n", bts->nr); continue; diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c index 0f4dd65..0a9752e 100644 --- a/src/osmo-bsc/lchan_select.c +++ b/src/osmo-bsc/lchan_select.c @@ -128,22 +128,31 @@ } struct gsm_lchan *lchan_select_by_chan_mode(struct gsm_bts *bts, - enum gsm48_chan_mode chan_mode, bool full_rate) + enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate) { enum gsm_chan_t type; switch (chan_mode) { case GSM48_CMODE_SIGN: - type = GSM_LCHAN_SDCCH; + switch (chan_rate) { + case CH_RATE_SDCCH: type = GSM_LCHAN_SDCCH; break; + case CH_RATE_HALF: type = GSM_LCHAN_TCH_H; break; + case CH_RATE_FULL: type = GSM_LCHAN_TCH_F; break; + default: return NULL; + } break; case GSM48_CMODE_SPEECH_EFR: /* EFR works over FR channels only */ - if (!full_rate) + if (chan_rate != CH_RATE_FULL) return NULL; /* fall through */ case GSM48_CMODE_SPEECH_V1: case GSM48_CMODE_SPEECH_AMR: - type = full_rate ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H; + switch (chan_rate) { + case CH_RATE_HALF: type = GSM_LCHAN_TCH_H; break; + case CH_RATE_FULL: type = GSM_LCHAN_TCH_F; break; + default: return NULL; + } break; default: return NULL; diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 6aa7815..e79a344 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -628,60 +628,48 @@ static int select_codecs(struct assignment_request *req, struct gsm0808_channel_type *ct, struct gsm_subscriber_connection *conn) { - int rc; + int rc, i, nc = 0; struct bsc_msc_data *msc; msc = conn->sccp.msc; - req->ch_mode_rate_alt_present = false; switch (ct->ch_rate_type) { case GSM0808_SPEECH_FULL_BM: - rc = match_codec_pref(&req->ch_mode_rate_pref, ct, &conn->codec_list, msc, conn_get_bts(conn), + rc = match_codec_pref(&req->ch_mode_rate[nc], ct, &conn->codec_list, msc, conn_get_bts(conn), RATE_PREF_FR); + nc += (rc == 0); break; case GSM0808_SPEECH_HALF_LM: - rc = match_codec_pref(&req->ch_mode_rate_pref, ct, &conn->codec_list, msc, conn_get_bts(conn), + rc = match_codec_pref(&req->ch_mode_rate[nc], ct, &conn->codec_list, msc, conn_get_bts(conn), RATE_PREF_HR); + nc += (rc == 0); break; case GSM0808_SPEECH_PERM: case GSM0808_SPEECH_PERM_NO_CHANGE: case GSM0808_SPEECH_FULL_PREF_NO_CHANGE: case GSM0808_SPEECH_FULL_PREF: - rc = match_codec_pref(&req->ch_mode_rate_pref, ct, &conn->codec_list, msc, conn_get_bts(conn), + rc = match_codec_pref(&req->ch_mode_rate[nc], ct, &conn->codec_list, msc, conn_get_bts(conn), RATE_PREF_FR); - if (rc < 0) { - rc = match_codec_pref(&req->ch_mode_rate_pref, ct, &conn->codec_list, msc, conn_get_bts(conn), - RATE_PREF_HR); - break; - } - rc = match_codec_pref(&req->ch_mode_rate_alt, ct, &conn->codec_list, msc, conn_get_bts(conn), + nc += (rc == 0); + rc = match_codec_pref(&req->ch_mode_rate[nc], ct, &conn->codec_list, msc, conn_get_bts(conn), RATE_PREF_HR); - if (rc == 0) - req->ch_mode_rate_alt_present = true; - rc = 0; + nc += (rc == 0); break; case GSM0808_SPEECH_HALF_PREF_NO_CHANGE: case GSM0808_SPEECH_HALF_PREF: - rc = match_codec_pref(&req->ch_mode_rate_pref, ct, &conn->codec_list, msc, conn_get_bts(conn), + rc = match_codec_pref(&req->ch_mode_rate[nc], ct, &conn->codec_list, msc, conn_get_bts(conn), RATE_PREF_HR); - - if (rc < 0) { - rc = match_codec_pref(&req->ch_mode_rate_pref, ct, &conn->codec_list, msc, conn_get_bts(conn), - RATE_PREF_FR); - break; - } - rc = match_codec_pref(&req->ch_mode_rate_alt, ct, &conn->codec_list, msc, conn_get_bts(conn), + nc += (rc == 0); + rc = match_codec_pref(&req->ch_mode_rate[nc], ct, &conn->codec_list, msc, conn_get_bts(conn), RATE_PREF_FR); - if (rc == 0) - req->ch_mode_rate_alt_present = true; - rc = 0; + nc += (rc == 0); break; default: rc = -EINVAL; break; } - if (rc < 0) { + if (!nc) { LOGP(DMSC, LOGL_ERROR, "No supported audio type found for channel_type =" " { ch_indctr=0x%x, ch_rate_type=0x%x, perm_spch=[%s] }\n", ct->ch_indctr, ct->ch_rate_type, osmo_hexdump(ct->perm_spch, ct->perm_spch_len)); @@ -690,29 +678,69 @@ return -EINVAL; } - if (req->ch_mode_rate_alt_present) { - DEBUGP(DMSC, "Found matching audio type (preferred): %s %s for channel_type =" + for (i = 0; i < nc; i++ ) { + DEBUGP(DMSC, "Found matching audio type (pref=%d): %s %s for channel_type =" " { ch_indctr=0x%x, ch_rate_type=0x%x, perm_spch=[ %s] }\n", - req->ch_mode_rate_pref.full_rate ? "full rate" : "half rate", - get_value_string(gsm48_chan_mode_names, req->ch_mode_rate_pref.chan_mode), + i, + req->ch_mode_rate[i].chan_rate == CH_RATE_FULL ? "full rate" : "half rate", + get_value_string(gsm48_chan_mode_names, req->ch_mode_rate[i].chan_mode), ct->ch_indctr, ct->ch_rate_type, osmo_hexdump(ct->perm_spch, ct->perm_spch_len)); - DEBUGP(DMSC, "Found matching audio type (alternative): %s %s for channel_type =" - " { ch_indctr=0x%x, ch_rate_type=0x%x, perm_spch=[ %s] }\n", - req->ch_mode_rate_alt.full_rate ? "full rate" : "half rate", - get_value_string(gsm48_chan_mode_names, req->ch_mode_rate_alt.chan_mode), - ct->ch_indctr, ct->ch_rate_type, osmo_hexdump(ct->perm_spch, ct->perm_spch_len)); - } else { - DEBUGP(DMSC, "Found matching audio type: %s %s for channel_type =" - " { ch_indctr=0x%x, ch_rate_type=0x%x, perm_spch=[ %s] }\n", - req->ch_mode_rate_pref.full_rate ? "full rate" : "half rate", - get_value_string(gsm48_chan_mode_names, req->ch_mode_rate_pref.chan_mode), - ct->ch_indctr, ct->ch_rate_type, osmo_hexdump(ct->perm_spch, ct->perm_spch_len)); - } + req->n_ch_mode_rate = nc; + return 0; } +static int select_sign_chan(struct assignment_request *req, struct gsm0808_channel_type *ct) +{ + int i, nc = 0; + + switch (ct->ch_rate_type) { + case GSM0808_SIGN_ANY: + req->ch_mode_rate[nc++].chan_rate = CH_RATE_SDCCH; + req->ch_mode_rate[nc++].chan_rate = CH_RATE_HALF; + req->ch_mode_rate[nc++].chan_rate = CH_RATE_FULL; + break; + case GSM0808_SIGN_SDCCH: + req->ch_mode_rate[nc++].chan_rate = CH_RATE_SDCCH; + break; + case GSM0808_SIGN_SDCCH_FULL_BM: + req->ch_mode_rate[nc++].chan_rate = CH_RATE_SDCCH; + req->ch_mode_rate[nc++].chan_rate = CH_RATE_FULL; + break; + case GSM0808_SIGN_SDCCH_HALF_LM: + req->ch_mode_rate[nc++].chan_rate = CH_RATE_SDCCH; + req->ch_mode_rate[nc++].chan_rate = CH_RATE_HALF; + break; + case GSM0808_SIGN_FULL_BM: + req->ch_mode_rate[nc++].chan_rate = CH_RATE_FULL; + break; + case GSM0808_SIGN_HALF_LM: + req->ch_mode_rate[nc++].chan_rate = CH_RATE_HALF; + break; + case GSM0808_SIGN_FULL_PREF: + case GSM0808_SIGN_FULL_PREF_NO_CHANGE: + req->ch_mode_rate[nc++].chan_rate = CH_RATE_FULL; + req->ch_mode_rate[nc++].chan_rate = CH_RATE_HALF; + break; + case GSM0808_SIGN_HALF_PREF: + case GSM0808_SIGN_HALF_PREF_NO_CHANGE: + req->ch_mode_rate[nc++].chan_rate = CH_RATE_HALF; + req->ch_mode_rate[nc++].chan_rate = CH_RATE_FULL; + break; + default: + break; + } + + for (i = 0; i < nc; i++) + req->ch_mode_rate[i].chan_mode = GSM48_CMODE_SIGN; + + req->n_ch_mode_rate = nc; + + return nc > 0 ? 0 : -EINVAL; +} + /* * Handle the assignment request message. * @@ -730,7 +758,6 @@ uint8_t cause; int rc; struct assignment_request req = {}; - struct channel_mode_and_rate ch_mode_rate_pref = {}; if (!conn) { LOGP(DMSC, LOGL_ERROR, @@ -851,14 +878,15 @@ } break; case GSM0808_CHAN_SIGN: - ch_mode_rate_pref = (struct channel_mode_and_rate) { - .chan_mode = GSM48_CMODE_SIGN, - }; - req = (struct assignment_request){ .aoip = aoip, - .ch_mode_rate_pref = ch_mode_rate_pref, }; + + rc = select_sign_chan(&req, &ct); + if (rc < 0) { + cause = GSM0808_CAUSE_INCORRECT_VALUE; + goto reject; + } break; default: cause = GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS; diff --git a/tests/codec_pref/codec_pref_test.c b/tests/codec_pref/codec_pref_test.c index bb5468a..ce82f3d 100644 --- a/tests/codec_pref/codec_pref_test.c +++ b/tests/codec_pref/codec_pref_test.c @@ -407,7 +407,7 @@ rc = match_codec_pref(&ch_mode_rate, ct, scl, msc, bts, RATE_PREF_NONE); printf(" * result: rc=%i, full_rate=%i, s15_s0=%04x, chan_mode=%s\n", - rc, ch_mode_rate.full_rate, ch_mode_rate.s15_s0, gsm48_chan_mode_name(ch_mode_rate.chan_mode)); + rc, ch_mode_rate.chan_rate == CH_RATE_FULL, ch_mode_rate.s15_s0, gsm48_chan_mode_name(ch_mode_rate.chan_mode)); printf("\n"); -- To view, visit https://gerrit.osmocom.org/13818 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7513d2cbe8b695ba6f031ad11560c63a6535cf2d Gerrit-Change-Number: 13818 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: tnt -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 01:04:40 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Tue, 30 Apr 2019 01:04:40 +0000 Subject: Change in osmo-sgsn[master]: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13628 ) Change subject: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK ...................................................................... Patch Set 1: The parse context is reinitialized for each packet, so resetting the apn is not needed. -- To view, visit https://gerrit.osmocom.org/13628 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I20bf4db8da746e0b994bfe3f8178188831b67ed3 Gerrit-Change-Number: 13628 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 30 Apr 2019 01:04:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 01:18:44 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Tue, 30 Apr 2019 01:18:44 +0000 Subject: Change in osmo-sip-connector[master]: Properly indent config file In-Reply-To: References: Message-ID: Daniel Willmann has submitted this change and it was merged. ( https://gerrit.osmocom.org/13806 ) Change subject: Properly indent config file ...................................................................... Properly indent config file osmo-config-merge expects only one space indentation for each level and the VTY also outputs the config formatted like that. Change-Id: I9c7a5bc6b3eae955288dada80abc856779ca9336 --- M doc/examples/osmo-sip-connector.cfg 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/doc/examples/osmo-sip-connector.cfg b/doc/examples/osmo-sip-connector.cfg index 550cba6..bf4967e 100644 --- a/doc/examples/osmo-sip-connector.cfg +++ b/doc/examples/osmo-sip-connector.cfg @@ -1,6 +1,6 @@ app mncc - socket-path /tmp/msc_mncc + socket-path /tmp/msc_mncc sip - local 0.0.0.0 5060 - remote pbx 5060 + local 0.0.0.0 5060 + remote pbx 5060 -- To view, visit https://gerrit.osmocom.org/13806 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9c7a5bc6b3eae955288dada80abc856779ca9336 Gerrit-Change-Number: 13806 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 02:19:26 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Tue, 30 Apr 2019 02:19:26 +0000 Subject: Change in openbsc[master]: libmgcp: Parse CI as hex string in verify_ci() Message-ID: Daniel Willmann has uploaded this change for review. ( https://gerrit.osmocom.org/13819 Change subject: libmgcp: Parse CI as hex string in verify_ci() ...................................................................... libmgcp: Parse CI as hex string in verify_ci() In verify_ci CI needs to be parsed as hex instead of dec number as well. Fixes: OS#3951 Change-Id: I687b467756fa30cbc454e3583c86159d9abcc7d9 --- M openbsc/src/libmgcp/mgcp_protocol.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/19/13819/1 diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c index 689c91f..3ecf6e2 100644 --- a/openbsc/src/libmgcp/mgcp_protocol.c +++ b/openbsc/src/libmgcp/mgcp_protocol.c @@ -509,7 +509,7 @@ static int verify_ci(const struct mgcp_endpoint *endp, const char *_ci) { - uint32_t ci = strtoul(_ci, NULL, 10); + uint32_t ci = strtoul(_ci, NULL, 16); if (ci != endp->ci) { LOGP(DMGCP, LOGL_ERROR, "ConnectionIdentifiers do not match on 0x%x. %x != %x\n", -- To view, visit https://gerrit.osmocom.org/13819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I687b467756fa30cbc454e3583c86159d9abcc7d9 Gerrit-Change-Number: 13819 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 02:24:35 2019 From: gerrit-no-reply at lists.osmocom.org (Daniel Willmann) Date: Tue, 30 Apr 2019 02:24:35 +0000 Subject: Change in osmo-sgsn[master]: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK In-Reply-To: References: Message-ID: Daniel Willmann has posted comments on this change. ( https://gerrit.osmocom.org/13628 ) Change subject: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK ...................................................................... Patch Set 2: @lynxis: I will not merge it the day I go on vacation, but if you want to merge (and watch out for possible fall out) feel free. -- To view, visit https://gerrit.osmocom.org/13628 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I20bf4db8da746e0b994bfe3f8178188831b67ed3 Gerrit-Change-Number: 13628 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 30 Apr 2019 02:24:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 05:55:25 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 05:55:25 +0000 Subject: Change in osmo-sgsn[master]: Echo XID-Field of Type L3_PAR even when zero length In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13811 ) Change subject: Echo XID-Field of Type L3_PAR even when zero length ...................................................................... Patch Set 1: Code-Review-1 agreeing with Lynxis: the "echoing back" of the empty L3 XID must happen in SNDCP. Ideally, gprs_llc.c would not need any change -- To view, visit https://gerrit.osmocom.org/13811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 Gerrit-Change-Number: 13811 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 30 Apr 2019 05:55:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 05:55:39 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 05:55:39 +0000 Subject: Change in openbsc[master]: libmgcp: Parse CI as hex string in verify_ci() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13819 ) Change subject: libmgcp: Parse CI as hex string in verify_ci() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I687b467756fa30cbc454e3583c86159d9abcc7d9 Gerrit-Change-Number: 13819 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: dexter Gerrit-Comment-Date: Tue, 30 Apr 2019 05:55:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 05:55:41 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 05:55:41 +0000 Subject: Change in openbsc[master]: libmgcp: Parse CI as hex string in verify_ci() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13819 ) Change subject: libmgcp: Parse CI as hex string in verify_ci() ...................................................................... libmgcp: Parse CI as hex string in verify_ci() In verify_ci CI needs to be parsed as hex instead of dec number as well. Fixes: OS#3951 Change-Id: I687b467756fa30cbc454e3583c86159d9abcc7d9 --- M openbsc/src/libmgcp/mgcp_protocol.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c index 689c91f..3ecf6e2 100644 --- a/openbsc/src/libmgcp/mgcp_protocol.c +++ b/openbsc/src/libmgcp/mgcp_protocol.c @@ -509,7 +509,7 @@ static int verify_ci(const struct mgcp_endpoint *endp, const char *_ci) { - uint32_t ci = strtoul(_ci, NULL, 10); + uint32_t ci = strtoul(_ci, NULL, 16); if (ci != endp->ci) { LOGP(DMGCP, LOGL_ERROR, "ConnectionIdentifiers do not match on 0x%x. %x != %x\n", -- To view, visit https://gerrit.osmocom.org/13819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I687b467756fa30cbc454e3583c86159d9abcc7d9 Gerrit-Change-Number: 13819 Gerrit-PatchSet: 1 Gerrit-Owner: Daniel Willmann Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 05:56:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 05:56:54 +0000 Subject: Change in osmo-sgsn[master]: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13628 ) Change subject: gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK ...................................................................... gbproxy: parse dtap GSM48_MT_GSM_DEACT_PDP_REQ|ACK Fix a warning "Unhandled GSM 04.08 message type ...". Fixes: OS#3466 Change-Id: I20bf4db8da746e0b994bfe3f8178188831b67ed3 --- M src/gprs/gprs_gb_parse.c 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Daniel Willmann: Looks good to me, but someone else must approve diff --git a/src/gprs/gprs_gb_parse.c b/src/gprs/gprs_gb_parse.c index 93b90a2..379674a 100644 --- a/src/gprs/gprs_gb_parse.c +++ b/src/gprs/gprs_gb_parse.c @@ -383,6 +383,14 @@ parse_ctx->invalidate_tlli = 1; break; + case GSM48_MT_GSM_DEACT_PDP_REQ: + parse_ctx->llc_msg_name = "DEACT_PDP_REQ"; + break; + + case GSM48_MT_GSM_DEACT_PDP_ACK: + parse_ctx->llc_msg_name = "DEACT_PDP_ACK"; + break; + default: LOGP(DLLC, LOGL_NOTICE, "Unhandled GSM 04.08 message type %s for protocol discriminator %s.\n", -- To view, visit https://gerrit.osmocom.org/13628 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I20bf4db8da746e0b994bfe3f8178188831b67ed3 Gerrit-Change-Number: 13628 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 05:58:28 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 05:58:28 +0000 Subject: Change in libosmocore[master]: GSUP: add inter-MSC handover related msgs and IEs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/12860 ) Change subject: GSUP: add inter-MSC handover related msgs and IEs ...................................................................... Patch Set 10: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/12860 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic00b0601eacff6d72927cea51767801142ee75db Gerrit-Change-Number: 12860 Gerrit-PatchSet: 10 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 30 Apr 2019 05:58:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 05:59:39 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 05:59:39 +0000 Subject: Change in libosmocore[master]: add comment to gsm_mncc_bearer_cap.speech_ver In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13814 ) Change subject: add comment to gsm_mncc_bearer_cap.speech_ver ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13814 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib657b1eb55aab400f3682a89bbd428bdee02581c Gerrit-Change-Number: 13814 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 30 Apr 2019 05:59:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 06:00:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 06:00:13 +0000 Subject: Change in libosmocore[master]: osmo_gsup_decode(): properly check IMSI, avoid deprecation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13817 ) Change subject: osmo_gsup_decode(): properly check IMSI, avoid deprecation ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13817 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaded84d91baad5386c8f353c283b6b9e40a43b05 Gerrit-Change-Number: 13817 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 30 Apr 2019 06:00:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 06:00:47 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 06:00:47 +0000 Subject: Change in libosmocore[master]: gsm48_decode_bcd_number2(): allow avoiding deprecation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13816 ) Change subject: gsm48_decode_bcd_number2(): allow avoiding deprecation ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13816 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I81925e9afb3451de9b8a268d482f79ee20ca14d6 Gerrit-Change-Number: 13816 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 30 Apr 2019 06:00:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 06:50:38 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 06:50:38 +0000 Subject: Change in osmo-mgw[master]: move MGW endpoint FSM from osmo-bsc to here In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13590 ) Change subject: move MGW endpoint FSM from osmo-bsc to here ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13590 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9a3effd38e72841529df6c135c077116981dea36 Gerrit-Change-Number: 13590 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 30 Apr 2019 06:50:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 06:50:56 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 06:50:56 +0000 Subject: Change in osmo-mgw[master]: constify map_codec_to_pt() ptmap arg In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13813 ) Change subject: constify map_codec_to_pt() ptmap arg ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13813 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I030843d2d692b7a73cca8f427df070d2806ab695 Gerrit-Change-Number: 13813 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 30 Apr 2019 06:50:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 06:51:28 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 06:51:28 +0000 Subject: Change in osmo-mgw[master]: move MGW endpoint FSM from osmo-bsc to here In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13590 ) Change subject: move MGW endpoint FSM from osmo-bsc to here ...................................................................... move MGW endpoint FSM from osmo-bsc to here Move mgw_endpoint_fsm from osmo-bsc here as osmo_mgcpc_ep_fsm. Apply various renames for consistency. Use osmo_tdef from libosmocore instead of osmo-bsc's (so far) local T_defs API. Change T23042 to T2427001, which is a slightly less arbitrary number and slightly more extendable in the future (2427 corresponds to the default MGCP port at osmo-mgw, 001 is the first MGCP timer and so far the only one). Change-Id: I9a3effd38e72841529df6c135c077116981dea36 --- M include/Makefile.am A include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h M include/osmocom/mgcp_client/mgcp_client_fsm.h M src/libosmo-mgcp-client/Makefile.am A src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c M src/libosmo-mgcp-client/mgcp_client_fsm.c 6 files changed, 866 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/Makefile.am b/include/Makefile.am index c34553a..2daaf20 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,6 +4,7 @@ nobase_include_HEADERS = \ osmocom/mgcp_client/mgcp_client.h \ + osmocom/mgcp_client/mgcp_client_endpoint_fsm.h \ osmocom/mgcp_client/mgcp_client_fsm.h \ osmocom/mgcp_client/mgcp_common.h \ osmocom/mgcp/mgcp.h \ diff --git a/include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h b/include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h new file mode 100644 index 0000000..73de292 --- /dev/null +++ b/include/osmocom/mgcp_client/mgcp_client_endpoint_fsm.h @@ -0,0 +1,47 @@ +/* FSM to manage multiple connections of an MGW endpoint */ +#pragma once + +#include + +#define LOG_MGCPC_EP(ep, level, fmt, args...) do { \ + LOGPFSML(ep->fi, level, "%s " fmt, \ + osmo_mgcpc_ep_name(ep), ## args); \ + } while(0) + +struct osmo_mgcpc_ep; +struct osmo_mgcpc_ep_ci; +struct osmo_tdef; + +struct osmo_mgcpc_ep *osmo_mgcpc_ep_alloc(struct osmo_fsm_inst *parent, uint32_t parent_term_event, + struct mgcp_client *mgcp_client, + const struct osmo_tdef *T_defs, + const char *fsm_id, + const char *endpoint_str_fmt, ...); + +struct osmo_mgcpc_ep_ci *osmo_mgcpc_ep_ci_add(struct osmo_mgcpc_ep *ep, const char *label_fmt, ...); +const struct mgcp_conn_peer *osmo_mgcpc_ep_ci_get_rtp_info(const struct osmo_mgcpc_ep_ci *ci); +bool osmo_mgcpc_ep_ci_get_crcx_info_to_sockaddr(const struct osmo_mgcpc_ep_ci *ci, struct sockaddr_storage *dest); + +void osmo_mgcpc_ep_ci_request(struct osmo_mgcpc_ep_ci *ci, + enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info, + struct osmo_fsm_inst *notify, + uint32_t event_success, uint32_t event_failure, + void *notify_data); + +/*! Dispatch a DLCX for the given connection. + * \param ci Connection identifier as obtained from osmo_mgcpc_ep_ci_add(). + */ +static inline void osmo_mgcpc_ep_ci_dlcx(struct osmo_mgcpc_ep_ci *ci) +{ + osmo_mgcpc_ep_ci_request(ci, MGCP_VERB_DLCX, NULL, NULL, 0, 0, NULL); +} + +void osmo_mgcpc_ep_clear(struct osmo_mgcpc_ep *ep); + +const char *osmo_mgcpc_ep_name(const struct osmo_mgcpc_ep *ep); +const char *osmo_mgcpc_ep_ci_name(const struct osmo_mgcpc_ep_ci *ci); +const char *osmo_mgcpc_ep_ci_id(const struct osmo_mgcpc_ep_ci *ci); + +extern const struct value_string osmo_mgcp_verb_names[]; +static inline const char *osmo_mgcp_verb_name(enum mgcp_verb val) +{ return get_value_string(osmo_mgcp_verb_names, val); } diff --git a/include/osmocom/mgcp_client/mgcp_client_fsm.h b/include/osmocom/mgcp_client/mgcp_client_fsm.h index dabfcca..e170a25 100644 --- a/include/osmocom/mgcp_client/mgcp_client_fsm.h +++ b/include/osmocom/mgcp_client/mgcp_client_fsm.h @@ -64,3 +64,5 @@ void mgcp_conn_delete(struct osmo_fsm_inst *fi); const char *mgcp_conn_get_ci(struct osmo_fsm_inst *fi); + +const char *osmo_mgcpc_conn_peer_name(const struct mgcp_conn_peer *info); diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index e59da2f..1529853 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -30,6 +30,7 @@ mgcp_client.c \ mgcp_client_vty.c \ mgcp_client_fsm.c \ + mgcp_client_endpoint_fsm.c \ $(NULL) libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) diff --git a/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c b/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c new file mode 100644 index 0000000..76552fb --- /dev/null +++ b/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c @@ -0,0 +1,793 @@ +/* FSM to manage multiple connections of an MGW endpoint + * + * (C) 2018-2019 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 + +#define LOG_CI(ci, level, fmt, args...) do { \ + if (!ci || !ci->ep) \ + LOGP(DLGLOBAL, level, "(unknown MGW endpoint) " fmt, ## args); \ + else \ + LOG_MGCPC_EP(ci->ep, level, "CI[%d] %s%s%s: " fmt, \ + (int)(ci - ci->ep->ci), \ + ci->label ? : "-", \ + ci->mgcp_ci_str[0] ? " CI=" : "", \ + ci->mgcp_ci_str[0] ? ci->mgcp_ci_str : "", \ + ## args); \ + } while(0) + +#define LOG_CI_VERB(ci, level, fmt, args...) do { \ + if (ci->verb_info.addr[0]) \ + LOG_CI(ci, level, "%s %s:%u: " fmt, \ + osmo_mgcp_verb_name(ci->verb), ci->verb_info.addr, ci->verb_info.port, \ + ## args); \ + else \ + LOG_CI(ci, level, "%s: " fmt, \ + osmo_mgcp_verb_name(ci->verb), \ + ## args); \ + } while(0) + +enum osmo_mgcpc_ep_fsm_state { + OSMO_MGCPC_EP_ST_UNUSED = 0, + OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE, + OSMO_MGCPC_EP_ST_IN_USE, +}; + +enum osmo_mgcpc_ep_fsm_event { + _OSMO_MGCPC_EP_EV_LAST = 0, + /* and MGW response events are allocated dynamically */ +}; + +#define FIRST_CI_EVENT (_OSMO_MGCPC_EP_EV_LAST + (_OSMO_MGCPC_EP_EV_LAST & 1)) /* rounded up to even nr */ +#define USABLE_CI ((32 - FIRST_CI_EVENT)/2) +#define EV_TO_CI_IDX(event) ((event - FIRST_CI_EVENT) / 2) + +#define CI_EV_SUCCESS(ci) (FIRST_CI_EVENT + (((ci) - ci->ep->ci) * 2)) +#define CI_EV_FAILURE(ci) (CI_EV_SUCCESS(ci) + 1) + +static struct osmo_fsm osmo_mgcpc_ep_fsm; + +/*! One connection on an endpoint, corresponding to a connection identifier (CI) as returned by the MGW. + * An endpoint has a fixed number of slots of these, which may or may not be in use. + */ +struct osmo_mgcpc_ep_ci { + struct osmo_mgcpc_ep *ep; + + bool occupied; + char label[64]; + struct osmo_fsm_inst *mgcp_client_fi; + + bool pending; + bool sent; + enum mgcp_verb verb; + struct mgcp_conn_peer verb_info; + struct osmo_fsm_inst *notify; + uint32_t notify_success; + uint32_t notify_failure; + void *notify_data; + + bool got_port_info; + struct mgcp_conn_peer rtp_info; + char mgcp_ci_str[MGCP_CONN_ID_LENGTH]; +}; + +/*! An MGW endpoint with N connections, like "rtpbridge/23 at mgw". */ +struct osmo_mgcpc_ep { + /*! MGCP client connection to the MGW. */ + struct mgcp_client *mgcp_client; + struct osmo_fsm_inst *fi; + + /*! Endpoint string; at first this might be a wildcard, and upon the first CRCX OK response, this will reflect + * the endpoint name returned by the MGW. */ + char endpoint[MGCP_ENDPOINT_MAXLEN]; + + /*! Timeout definitions used for this endpoint, see osmo_mgcpc_ep_fsm_timeouts. */ + const struct osmo_tdef *T_defs; + + /*! Endpoint connection slots. Note that each connection has its own set of FSM event numbers to signal success + * and failure, depending on its index within this array. See CI_EV_SUCCESS and CI_EV_FAILURE. */ + struct osmo_mgcpc_ep_ci ci[USABLE_CI]; +}; + +const struct value_string osmo_mgcp_verb_names[] = { + { MGCP_VERB_CRCX, "CRCX" }, + { MGCP_VERB_MDCX, "MDCX" }, + { MGCP_VERB_DLCX, "DLCX" }, + { MGCP_VERB_AUEP, "AUEP" }, + { MGCP_VERB_RSIP, "RSIP" }, + {} +}; + +static struct osmo_mgcpc_ep_ci *osmo_mgcpc_ep_check_ci(struct osmo_mgcpc_ep_ci *ci) +{ + if (!ci) + return NULL; + if (!ci->ep) + return NULL; + if (ci < ci->ep->ci || ci >= &ci->ep->ci[USABLE_CI]) + return NULL; + return ci; +} + +static struct osmo_mgcpc_ep_ci *osmo_mgcpc_ep_ci_for_event(struct osmo_mgcpc_ep *ep, uint32_t event) +{ + int idx; + if (event < FIRST_CI_EVENT) + return NULL; + idx = EV_TO_CI_IDX(event); + if (idx >= sizeof(ep->ci)) + return NULL; + return osmo_mgcpc_ep_check_ci(&ep->ci[idx]); +} + +const char *osmo_mgcpc_ep_name(const struct osmo_mgcpc_ep *ep) +{ + if (!ep) + return "NULL"; + if (ep->endpoint[0]) + return ep->endpoint; + return osmo_fsm_inst_name(ep->fi); +} + +const char *mgcp_conn_peer_name(const struct mgcp_conn_peer *info) +{ + /* I'd be fine with a smaller buffer and accept truncation, but gcc possibly refuses to build if + * this buffer is too small. */ + static char buf[1024]; + + if (!info) + return "NULL"; + + if (info->endpoint[0] + && info->addr[0]) + snprintf(buf, sizeof(buf), "%s:%s:%u", + info->endpoint, info->addr, info->port); + else if (info->endpoint[0]) + snprintf(buf, sizeof(buf), "%s", info->endpoint); + else if (info->addr[0]) + snprintf(buf, sizeof(buf), "%s:%u", info->addr, info->port); + else + return "empty"; + return buf; +} + +const char *osmo_mgcpc_ep_ci_name(const struct osmo_mgcpc_ep_ci *ci) +{ + const struct mgcp_conn_peer *rtp_info; + + if (!ci) + return "NULL"; + + rtp_info = osmo_mgcpc_ep_ci_get_rtp_info(ci); + + if (rtp_info) + return mgcp_conn_peer_name(rtp_info); + return osmo_mgcpc_ep_name(ci->ep); +} + +const char *osmo_mgcpc_ep_ci_id(const struct osmo_mgcpc_ep_ci *ci) +{ + if (!ci || !ci->mgcp_ci_str[0]) + return NULL; + return ci->mgcp_ci_str; +} + +static struct value_string osmo_mgcpc_ep_fsm_event_names[33] = {}; + +static char osmo_mgcpc_ep_fsm_event_name_bufs[32][32] = {}; + +static void fill_event_names() +{ + int i; + for (i = 0; i < (ARRAY_SIZE(osmo_mgcpc_ep_fsm_event_names) - 1); i++) { + if (i < _OSMO_MGCPC_EP_EV_LAST) + continue; + if (i < FIRST_CI_EVENT || EV_TO_CI_IDX(i) > USABLE_CI) { + osmo_mgcpc_ep_fsm_event_names[i] = (struct value_string){i, "Unused"}; + continue; + } + snprintf(osmo_mgcpc_ep_fsm_event_name_bufs[i], sizeof(osmo_mgcpc_ep_fsm_event_name_bufs[i]), + "MGW Response for CI #%d", EV_TO_CI_IDX(i)); + osmo_mgcpc_ep_fsm_event_names[i] = (struct value_string){i, osmo_mgcpc_ep_fsm_event_name_bufs[i]}; + } +} + +/* T_defs is used to obtain an (Osmocom specific) T2427001: timeout for an MGCP response (note, 2427 corresponds to the + * default MGCP port in osmo-mgw). */ +static __attribute__((constructor)) void osmo_mgcpc_ep_fsm_init() +{ + OSMO_ASSERT(osmo_fsm_register(&osmo_mgcpc_ep_fsm) == 0); + fill_event_names(); +} + +struct osmo_mgcpc_ep *osmo_mgcpc_ep_fi_mgwep(struct osmo_fsm_inst *fi) +{ + OSMO_ASSERT(fi); + OSMO_ASSERT(fi->fsm == &osmo_mgcpc_ep_fsm); + OSMO_ASSERT(fi->priv); + return fi->priv; +} + +/*! Allocate an osmo_mgcpc_ep FSM. + * MGCP messages to set up the endpoint will be sent on the given mgcp_client, as soon as the first + * osmo_mgcpc_ep_ci_request() is invoked. + * + * A typical sequence of events would be: + * + * ep = osmo_mgcpc_ep_alloc(..., mgcp_client_rtpbridge_wildcard(client)); + * ci_to_ran = osmo_mgcpc_ep_ci_add(ep); + * osmo_mgcpc_ep_ci_request(ci_to_ran, MGCP_VERB_CRCX, verb_info, + * my_call_fsm, MY_EVENT_MGCP_OK, MY_EVENT_MGCP_FAIL); + * ci_to_cn = osmo_mgcpc_ep_ci_add(ep); + * osmo_mgcpc_ep_ci_request(ci_to_cn, MGCP_VERB_CRCX, verb_info, + * my_call_fsm, MY_EVENT_MGCP_OK, MY_EVENT_MGCP_FAIL); + * ... + * osmo_mgcpc_ep_ci_request(ci_to_ran, MGCP_VERB_MDCX, ...); + * ... + * osmo_mgcpc_ep_clear(ep); + * ep = NULL; + * + * \param parent Parent FSM. + * \param parent_term_event Event to dispatch to the parent on termination of this FSM instance. + * \param mgcp_client Connection to the MGW. + * \param T_defs Timeout definitions to be used for FSM states, see osmo_mgcpc_ep_fsm_timeouts. + * \param fsm_id FSM instance ID. + * \param endpoint_str_fmt The endpoint string format to send to the MGW upon the first CRCX. + * See mgcp_client_rtpbridge_wildcard() for "rtpbridge" endpoints. + */ +struct osmo_mgcpc_ep *osmo_mgcpc_ep_alloc(struct osmo_fsm_inst *parent, uint32_t parent_term_event, + struct mgcp_client *mgcp_client, + const struct osmo_tdef *T_defs, + const char *fsm_id, + const char *endpoint_str_fmt, ...) +{ + va_list ap; + struct osmo_fsm_inst *fi; + struct osmo_mgcpc_ep *ep; + int rc; + + if (!mgcp_client) + return NULL; + + fi = osmo_fsm_inst_alloc_child(&osmo_mgcpc_ep_fsm, parent, parent_term_event); + OSMO_ASSERT(fi); + + osmo_fsm_inst_update_id(fi, fsm_id); + + ep = talloc_zero(fi, struct osmo_mgcpc_ep); + OSMO_ASSERT(ep); + + *ep = (struct osmo_mgcpc_ep){ + .mgcp_client = mgcp_client, + .fi = fi, + .T_defs = T_defs, + }; + fi->priv = ep; + + va_start(ap, endpoint_str_fmt); + rc = vsnprintf(ep->endpoint, sizeof(ep->endpoint), endpoint_str_fmt ? : "", ap); + va_end(ap); + + if (rc <= 0 || rc >= sizeof(ep->endpoint)) { + LOG_MGCPC_EP(ep, LOGL_ERROR, "Endpoint name too long or too short: %s\n", + ep->endpoint); + osmo_fsm_inst_term(ep->fi, OSMO_FSM_TERM_ERROR, 0); + return NULL; + } + + return ep; +} + +/*! Add a connection to an endpoint. + * Allocate a connection identifier slot in the osmo_mgcpc_ep instance, do not yet dispatch a CRCX. + * The CRCX is dispatched only upon the first osmo_mgcpc_ep_ci_request(). + * \param ep Parent endpoint instance. + * \param label_fmt Label for logging. + */ +struct osmo_mgcpc_ep_ci *osmo_mgcpc_ep_ci_add(struct osmo_mgcpc_ep *ep, + const char *label_fmt, ...) +{ + va_list ap; + int i; + struct osmo_mgcpc_ep_ci *ci; + + for (i = 0; i < USABLE_CI; i++) { + ci = &ep->ci[i]; + + if (ci->occupied || ci->mgcp_client_fi) + continue; + + *ci = (struct osmo_mgcpc_ep_ci){ + .ep = ep, + .occupied = true, + }; + if (label_fmt) { + va_start(ap, label_fmt); + vsnprintf(ci->label, sizeof(ci->label), label_fmt, ap); + va_end(ap); + } + return ci; + } + + LOG_MGCPC_EP(ep, LOGL_ERROR, + "Cannot allocate another endpoint, all " + OSMO_STRINGIFY_VAL(USABLE_CI) " are in use\n"); + + return NULL; +} + +static bool osmo_mgcpc_ep_fsm_check_state_chg_after_response(struct osmo_fsm_inst *fi); + +static void on_failure(struct osmo_mgcpc_ep_ci *ci) +{ + struct osmo_fsm_inst *notify = ci->notify; + uint32_t notify_failure = ci->notify_failure; + void *notify_data = ci->notify_data; + + if (!ci->occupied) + return; + + *ci = (struct osmo_mgcpc_ep_ci){ + .ep = ci->ep, + }; + + /* If this check has terminated the FSM instance, don't fire any more events to prevent use-after-free problems. + * The endpoint FSM does dispatch a term event to its parent, and everything should be cleaned like that. */ + if (!osmo_mgcpc_ep_fsm_check_state_chg_after_response(ci->ep->fi)) + return; + + if (notify) + osmo_fsm_inst_dispatch(notify, notify_failure, notify_data); +} + +static void on_success(struct osmo_mgcpc_ep_ci *ci, void *data) +{ + struct mgcp_conn_peer *rtp_info; + + if (!ci->occupied) + return; + + ci->pending = false; + + switch (ci->verb) { + case MGCP_VERB_CRCX: + /* If we sent a wildcarded endpoint name on CRCX, we need to store the resulting endpoint + * name here. Also, we receive the MGW's RTP port information. */ + rtp_info = data; + OSMO_ASSERT(rtp_info); + ci->got_port_info = true; + ci->rtp_info = *rtp_info; + osmo_strlcpy(ci->mgcp_ci_str, mgcp_conn_get_ci(ci->mgcp_client_fi), + sizeof(ci->mgcp_ci_str)); + if (rtp_info->endpoint[0]) { + int rc; + rc = osmo_strlcpy(ci->ep->endpoint, rtp_info->endpoint, + sizeof(ci->ep->endpoint)); + if (rc <= 0 || rc >= sizeof(ci->ep->endpoint)) { + LOG_CI(ci, LOGL_ERROR, "Unable to copy endpoint name '%s'\n", + rtp_info->endpoint); + osmo_mgcpc_ep_ci_dlcx(ci); + on_failure(ci); + return; + } + } + break; + + default: + break; + } + + LOG_CI(ci, LOGL_DEBUG, "received successful response to %s: RTP=%s%s\n", + osmo_mgcp_verb_name(ci->verb), + mgcp_conn_peer_name(ci->got_port_info? &ci->rtp_info : NULL), + ci->notify ? "" : " (not sending a notification)"); + + if (ci->notify) + osmo_fsm_inst_dispatch(ci->notify, ci->notify_success, ci->notify_data); + + osmo_mgcpc_ep_fsm_check_state_chg_after_response(ci->ep->fi); +} + +/*! Return the MGW's RTP port information for this connection, as returned by the last CRCX/MDCX OK message. */ +const struct mgcp_conn_peer *osmo_mgcpc_ep_ci_get_rtp_info(const struct osmo_mgcpc_ep_ci *ci) +{ + ci = osmo_mgcpc_ep_check_ci((struct osmo_mgcpc_ep_ci*)ci); + if (!ci) + return NULL; + if (!ci->got_port_info) + return NULL; + return &ci->rtp_info; +} + +/*! Return the MGW's RTP port information for this connection, as returned by the last CRCX/MDCX OK message. */ +bool osmo_mgcpc_ep_ci_get_crcx_info_to_sockaddr(const struct osmo_mgcpc_ep_ci *ci, struct sockaddr_storage *dest) +{ + const struct mgcp_conn_peer *rtp_info; + struct sockaddr_in *sin; + + rtp_info = osmo_mgcpc_ep_ci_get_rtp_info(ci); + if (!rtp_info) + return false; + + sin = (struct sockaddr_in *)dest; + + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = inet_addr(rtp_info->addr); + sin->sin_port = osmo_ntohs(rtp_info->port); + return true; +} + + +static const struct osmo_tdef_state_timeout osmo_mgcpc_ep_fsm_timeouts[32] = { + [OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE] = { .T=2427001 }, +}; + +/* Transition to a state, using the T timer defined in assignment_fsm_timeouts. + * The actual timeout value is in turn obtained from osmo_mgcpc_ep.T_defs. + * Assumes local variable fi exists. */ +#define osmo_mgcpc_ep_fsm_state_chg(state) \ + osmo_tdef_fsm_inst_state_chg(fi, state, osmo_mgcpc_ep_fsm_timeouts, \ + ((struct osmo_mgcpc_ep*)fi->priv)->T_defs, 5) + +/*! Dispatch an actual CRCX/MDCX/DLCX message for this connection. + * \param ci Connection identifier as obtained from osmo_mgcpc_ep_ci_add(). + * \param verb MGCP operation to dispatch. + * \param verb_info Parameters for the MGCP operation. + * \param notify Peer FSM instance to notify of completed/failed operation. + * \param event_success Which event to dispatch to 'notify' upon OK response. + * \param event_failure Which event to dispatch to 'notify' upon failure response. + * \param notify_data Data pointer to pass to the event dispatch for both success and failure. + */ +void osmo_mgcpc_ep_ci_request(struct osmo_mgcpc_ep_ci *ci, + enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info, + struct osmo_fsm_inst *notify, + uint32_t event_success, uint32_t event_failure, + void *notify_data) +{ + struct osmo_mgcpc_ep *ep; + struct osmo_fsm_inst *fi; + struct osmo_mgcpc_ep_ci cleared_ci; + ci = osmo_mgcpc_ep_check_ci(ci); + + if (!ci) { + LOGP(DLGLOBAL, LOGL_ERROR, "Invalid MGW endpoint request: no ci\n"); + goto dispatch_error; + } + if (!verb_info && verb != MGCP_VERB_DLCX) { + LOG_CI(ci, LOGL_ERROR, "Invalid MGW endpoint request: missing verb details for %s\n", + osmo_mgcp_verb_name(verb)); + goto dispatch_error; + } + if ((verb < 0) || (verb > MGCP_VERB_RSIP)) { + LOG_CI(ci, LOGL_ERROR, "Invalid MGW endpoint request: unknown verb: %s\n", + osmo_mgcp_verb_name(verb)); + goto dispatch_error; + } + + ep = ci->ep; + fi = ep->fi; + + /* Clear volatile state by explicitly keeping those that should remain. Because we can't assign + * the char[] directly, dance through cleared_ci and copy back. */ + cleared_ci = (struct osmo_mgcpc_ep_ci){ + .ep = ep, + .mgcp_client_fi = ci->mgcp_client_fi, + .got_port_info = ci->got_port_info, + .rtp_info = ci->rtp_info, + + .occupied = true, + /* .pending = true follows below */ + .verb = verb, + .notify = notify, + .notify_success = event_success, + .notify_failure = event_failure, + .notify_data = notify_data, + }; + osmo_strlcpy(cleared_ci.label, ci->label, sizeof(cleared_ci.label)); + osmo_strlcpy(cleared_ci.mgcp_ci_str, ci->mgcp_ci_str, sizeof(cleared_ci.mgcp_ci_str)); + *ci = cleared_ci; + + LOG_CI_VERB(ci, LOGL_DEBUG, "notify=%s\n", osmo_fsm_inst_name(ci->notify)); + + if (verb_info) + ci->verb_info = *verb_info; + + if (ep->endpoint[0]) { + if (ci->verb_info.endpoint[0] && strcmp(ci->verb_info.endpoint, ep->endpoint)) + LOG_CI(ci, LOGL_ERROR, + "Warning: Requested %s on endpoint %s, but this CI is on endpoint %s." + " Using the proper endpoint instead.\n", + osmo_mgcp_verb_name(verb), ci->verb_info.endpoint, ep->endpoint); + osmo_strlcpy(ci->verb_info.endpoint, ep->endpoint, sizeof(ci->verb_info.endpoint)); + } + + switch (ci->verb) { + case MGCP_VERB_CRCX: + if (ci->mgcp_client_fi) { + LOG_CI(ci, LOGL_ERROR, "CRCX can be called only once per MGW endpoint CI\n"); + on_failure(ci); + return; + } + break; + + case MGCP_VERB_MDCX: + if (!ci->mgcp_client_fi) { + LOG_CI_VERB(ci, LOGL_ERROR, "The first verb on an unused MGW endpoint CI must be CRCX, not %s\n", + osmo_mgcp_verb_name(ci->verb)); + on_failure(ci); + return; + } + break; + + case MGCP_VERB_DLCX: + if (!ci->mgcp_client_fi) { + LOG_CI_VERB(ci, LOGL_DEBUG, "Ignoring DLCX on unused MGW endpoint CI\n"); + return; + } + break; + + default: + LOG_CI(ci, LOGL_ERROR, "This verb is not supported: %s\n", osmo_mgcp_verb_name(ci->verb)); + on_failure(ci); + return; + } + + ci->pending = true; + + LOG_CI_VERB(ci, LOGL_DEBUG, "Scheduling\n"); + + if (ep->fi->state != OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE) + osmo_mgcpc_ep_fsm_state_chg(OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE); + + return; +dispatch_error: + if (notify) + osmo_fsm_inst_dispatch(notify, event_failure, notify_data); +} + +static int send_verb(struct osmo_mgcpc_ep_ci *ci) +{ + int rc; + struct osmo_mgcpc_ep *ep = ci->ep; + + if (!ci->occupied || !ci->pending || ci->sent) + return 0; + + switch (ci->verb) { + + case MGCP_VERB_CRCX: + OSMO_ASSERT(!ci->mgcp_client_fi); + LOG_CI_VERB(ci, LOGL_DEBUG, "Sending\n"); + ci->mgcp_client_fi = mgcp_conn_create(ep->mgcp_client, ep->fi, + CI_EV_FAILURE(ci), CI_EV_SUCCESS(ci), + &ci->verb_info); + ci->sent = true; + if (!ci->mgcp_client_fi){ + LOG_CI_VERB(ci, LOGL_ERROR, "Cannot send\n"); + on_failure(ci); + } + osmo_fsm_inst_update_id(ci->mgcp_client_fi, ci->label); + break; + + case MGCP_VERB_MDCX: + OSMO_ASSERT(ci->mgcp_client_fi); + LOG_CI_VERB(ci, LOGL_DEBUG, "Sending\n"); + rc = mgcp_conn_modify(ci->mgcp_client_fi, CI_EV_SUCCESS(ci), &ci->verb_info); + ci->sent = true; + if (rc) { + LOG_CI_VERB(ci, LOGL_ERROR, "Cannot send (rc=%d %s)\n", rc, strerror(-rc)); + on_failure(ci); + } + break; + + case MGCP_VERB_DLCX: + LOG_CI(ci, LOGL_DEBUG, "Sending MGCP: %s %s\n", + osmo_mgcp_verb_name(ci->verb), ci->mgcp_ci_str); + /* The way this is designed, we actually need to forget all about the ci right away. */ + mgcp_conn_delete(ci->mgcp_client_fi); + if (ci->notify) + osmo_fsm_inst_dispatch(ci->notify, ci->notify_success, ci->notify_data); + *ci = (struct osmo_mgcpc_ep_ci){ + .ep = ep, + }; + break; + + default: + OSMO_ASSERT(false); + } + + return 1; +} + +/*! DLCX all connections, terminate the endpoint FSM and free. */ +void osmo_mgcpc_ep_clear(struct osmo_mgcpc_ep *ep) +{ + if (!ep) + return; + osmo_fsm_inst_term(ep->fi, OSMO_FSM_TERM_REGULAR, 0); +} + +static void osmo_mgcpc_ep_count(struct osmo_mgcpc_ep *ep, int *occupied, int *pending_not_sent, + int *waiting_for_response) +{ + int i; + + if (occupied) + *occupied = 0; + + if (pending_not_sent) + *pending_not_sent = 0; + + if (waiting_for_response) + *waiting_for_response = 0; + + for (i = 0; i < ARRAY_SIZE(ep->ci); i++) { + struct osmo_mgcpc_ep_ci *ci = &ep->ci[i]; + if (ci->occupied) { + if (occupied) + (*occupied)++; + } else + continue; + + if (ci->pending) + LOG_CI_VERB(ci, LOGL_DEBUG, "%s\n", + ci->sent ? "waiting for response" : "waiting to be sent"); + else + LOG_CI_VERB(ci, LOGL_DEBUG, "done (%s)\n", mgcp_conn_peer_name(osmo_mgcpc_ep_ci_get_rtp_info(ci))); + + if (ci->pending && ci->sent) + if (waiting_for_response) + (*waiting_for_response)++; + if (ci->pending && !ci->sent) + if (pending_not_sent) + (*pending_not_sent)++; + } +} + +static bool osmo_mgcpc_ep_fsm_check_state_chg_after_response(struct osmo_fsm_inst *fi) +{ + int waiting_for_response; + int occupied; + struct osmo_mgcpc_ep *ep = osmo_mgcpc_ep_fi_mgwep(fi); + + osmo_mgcpc_ep_count(ep, &occupied, NULL, &waiting_for_response); + LOG_MGCPC_EP(ep, LOGL_DEBUG, "CI in use: %d, waiting for response: %d\n", occupied, waiting_for_response); + + if (!occupied) { + /* All CI have been released. The endpoint no longer exists. Notify the parent FSM, by + * terminating. */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, 0); + return false; + } + + if (!waiting_for_response) { + if (fi->state != OSMO_MGCPC_EP_ST_IN_USE) + osmo_mgcpc_ep_fsm_state_chg(OSMO_MGCPC_EP_ST_IN_USE); + } + + return true; +} + +static void osmo_mgcpc_ep_fsm_wait_mgw_response_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + int count = 0; + int i; + struct osmo_mgcpc_ep *ep = osmo_mgcpc_ep_fi_mgwep(fi); + + for (i = 0; i < ARRAY_SIZE(ep->ci); i++) { + count += send_verb(&ep->ci[i]); + } + + LOG_MGCPC_EP(ep, LOGL_DEBUG, "Sent messages: %d\n", count); + osmo_mgcpc_ep_fsm_check_state_chg_after_response(fi); +} + +static void osmo_mgcpc_ep_fsm_handle_ci_events(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct osmo_mgcpc_ep_ci *ci; + struct osmo_mgcpc_ep *ep = osmo_mgcpc_ep_fi_mgwep(fi); + ci = osmo_mgcpc_ep_ci_for_event(ep, event); + if (ci) { + if (event == CI_EV_SUCCESS(ci)) + on_success(ci, data); + else + on_failure(ci); + } +} + +static void osmo_mgcpc_ep_fsm_in_use_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + int pending_not_sent; + struct osmo_mgcpc_ep *ep = osmo_mgcpc_ep_fi_mgwep(fi); + + osmo_mgcpc_ep_count(ep, NULL, &pending_not_sent, NULL); + if (pending_not_sent) + osmo_mgcpc_ep_fsm_state_chg(OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE); +} + +#define S(x) (1 << (x)) + +static const struct osmo_fsm_state osmo_mgcpc_ep_fsm_states[] = { + [OSMO_MGCPC_EP_ST_UNUSED] = { + .name = "UNUSED", + .in_event_mask = 0, + .out_state_mask = 0 + | S(OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE) + , + }, + [OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE] = { + .name = "WAIT_MGW_RESPONSE", + .onenter = osmo_mgcpc_ep_fsm_wait_mgw_response_onenter, + .action = osmo_mgcpc_ep_fsm_handle_ci_events, + .in_event_mask = 0xffffffff, + .out_state_mask = 0 + | S(OSMO_MGCPC_EP_ST_IN_USE) + , + }, + [OSMO_MGCPC_EP_ST_IN_USE] = { + .name = "IN_USE", + .onenter = osmo_mgcpc_ep_fsm_in_use_onenter, + .action = osmo_mgcpc_ep_fsm_handle_ci_events, + .in_event_mask = 0xffffffff, /* mgcp_client_fsm may send parent term anytime */ + .out_state_mask = 0 + | S(OSMO_MGCPC_EP_ST_WAIT_MGW_RESPONSE) + , + }, +}; + +static int osmo_mgcpc_ep_fsm_timer_cb(struct osmo_fsm_inst *fi) +{ + int i; + struct osmo_mgcpc_ep *ep = osmo_mgcpc_ep_fi_mgwep(fi); + + switch (fi->T) { + default: + for (i = 0; i < ARRAY_SIZE(ep->ci); i++) { + struct osmo_mgcpc_ep_ci *ci = &ep->ci[i]; + if (!ci->occupied) + continue; + if (!(ci->pending && ci->sent)) + continue; + on_failure(ci); + } + return 0; + } + + return 0; +} + +static struct osmo_fsm osmo_mgcpc_ep_fsm = { + .name = "mgw-endpoint", + .states = osmo_mgcpc_ep_fsm_states, + .num_states = ARRAY_SIZE(osmo_mgcpc_ep_fsm_states), + .log_subsys = DLMGCP, + .event_names = osmo_mgcpc_ep_fsm_event_names, + .timer_cb = osmo_mgcpc_ep_fsm_timer_cb, + /* The FSM termination will automatically trigger any mgcp_client_fsm instances to DLCX. */ +}; diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c index 71f4310..75d583b 100644 --- a/src/libosmo-mgcp-client/mgcp_client_fsm.c +++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c @@ -700,3 +700,25 @@ } osmo_fsm_inst_dispatch(fi, EV_DLCX, mgcp_ctx); } + +const char *osmo_mgcpc_conn_peer_name(const struct mgcp_conn_peer *info) +{ + /* I'd be fine with a smaller buffer and accept truncation, but gcc possibly refuses to build if + * this buffer is too small. */ + static char buf[1024]; + + if (!info) + return "NULL"; + + if (info->endpoint[0] + && info->addr[0]) + snprintf(buf, sizeof(buf), "%s:%s:%u", + info->endpoint, info->addr, info->port); + else if (info->endpoint[0]) + snprintf(buf, sizeof(buf), "%s", info->endpoint); + else if (info->addr[0]) + snprintf(buf, sizeof(buf), "%s:%u", info->addr, info->port); + else + return "empty"; + return buf; +} -- To view, visit https://gerrit.osmocom.org/13590 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9a3effd38e72841529df6c135c077116981dea36 Gerrit-Change-Number: 13590 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 06:51:29 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 06:51:29 +0000 Subject: Change in osmo-mgw[master]: fix: multiple initial CRCX In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13591 ) Change subject: fix: multiple initial CRCX ...................................................................... fix: multiple initial CRCX The first CRCX responds with the actual MGW endpoint name that is assigned (at least for rtpbridge/*@mgw requests). If multiple CRCX are scheduled at the same time on a fresh MGW endpoint, both get fired with a '*' and each creates a separate MGW endpoint. Make mgcp_client_endpoint_fsm avoid this, and schedule only one CRCX at first, and the rest once the MGW endpoint name is fixated. It is thus possible to safely issue two osmo_mgcpc_ep_ci_request() at the same time. Change-Id: I92a9944acc96398acd6649f9c3c5badec5dd6dcc --- M src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c 1 file changed, 90 insertions(+), 11 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c b/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c index 76552fb..0e59f58 100644 --- a/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c +++ b/src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c @@ -110,6 +110,11 @@ /*! Timeout definitions used for this endpoint, see osmo_mgcpc_ep_fsm_timeouts. */ const struct osmo_tdef *T_defs; + /*! True as soon as the first CRCX OK is received. The endpoint name may be determined by the first CRCX + * response, so to dispatch any other messages, the FSM instance *must* wait for the first CRCX OK to arrive + * first. Once the endpoint name is pinpointed, any amount of operations may be dispatched concurrently. */ + bool first_crcx_complete; + /*! Endpoint connection slots. Note that each connection has its own set of FSM event numbers to signal success * and failure, depending on its index within this array. See CI_EV_SUCCESS and CI_EV_FAILURE. */ struct osmo_mgcpc_ep_ci ci[USABLE_CI]; @@ -124,6 +129,9 @@ {} }; +static void osmo_mgcpc_ep_count(struct osmo_mgcpc_ep *ep, int *occupied, int *pending_not_sent, + int *waiting_for_response); + static struct osmo_mgcpc_ep_ci *osmo_mgcpc_ep_check_ci(struct osmo_mgcpc_ep_ci *ci) { if (!ci) @@ -366,6 +374,49 @@ osmo_fsm_inst_dispatch(notify, notify_failure, notify_data); } +static int update_endpoint_name(struct osmo_mgcpc_ep_ci *ci, const char *new_endpoint_name) +{ + struct osmo_mgcpc_ep *ep = ci->ep; + int rc; + int i; + + if (!strcmp(ep->endpoint, new_endpoint_name)) { + /* Same endpoint name, nothing to do. */ + return 0; + } + + /* The endpoint name should only change on the very first CRCX response. */ + if (ep->first_crcx_complete) { + LOG_CI(ci, LOGL_ERROR, "Reponse returned mismatching endpoint name." + " This is endpoint %s, instead received %s\n", + ep->endpoint, new_endpoint_name); + on_failure(ci); + return -EINVAL; + } + + /* This is the first CRCX response, update endpoint name. */ + rc = OSMO_STRLCPY_ARRAY(ep->endpoint, new_endpoint_name); + if (rc <= 0 || rc >= sizeof(ep->endpoint)) { + LOG_CI(ci, LOGL_ERROR, "Unable to copy endpoint name %s\n", osmo_quote_str(new_endpoint_name, -1)); + osmo_mgcpc_ep_ci_dlcx(ci); + on_failure(ci); + return -ENOSPC; + } + + /* Make sure already pending requests use this updated endpoint name. */ + for (i = 0; i < ARRAY_SIZE(ep->ci); i++) { + struct osmo_mgcpc_ep_ci *other_ci = &ep->ci[i]; + if (!other_ci->occupied) + continue; + if (!other_ci->pending) + continue; + if (other_ci->sent) + continue; + OSMO_STRLCPY_ARRAY(other_ci->verb_info.endpoint, ep->endpoint); + } + return 0; +} + static void on_success(struct osmo_mgcpc_ep_ci *ci, void *data) { struct mgcp_conn_peer *rtp_info; @@ -386,17 +437,12 @@ osmo_strlcpy(ci->mgcp_ci_str, mgcp_conn_get_ci(ci->mgcp_client_fi), sizeof(ci->mgcp_ci_str)); if (rtp_info->endpoint[0]) { - int rc; - rc = osmo_strlcpy(ci->ep->endpoint, rtp_info->endpoint, - sizeof(ci->ep->endpoint)); - if (rc <= 0 || rc >= sizeof(ci->ep->endpoint)) { - LOG_CI(ci, LOGL_ERROR, "Unable to copy endpoint name '%s'\n", - rtp_info->endpoint); - osmo_mgcpc_ep_ci_dlcx(ci); - on_failure(ci); + /* On errors, this instance might already be deallocated. Make sure to not access anything after + * error. */ + if (update_endpoint_name(ci, rtp_info->endpoint)) return; - } } + ci->ep->first_crcx_complete = true; break; default: @@ -591,6 +637,7 @@ if (!ci->mgcp_client_fi){ LOG_CI_VERB(ci, LOGL_ERROR, "Cannot send\n"); on_failure(ci); + return -EINVAL; } osmo_fsm_inst_update_id(ci->mgcp_client_fi, ci->label); break; @@ -603,6 +650,7 @@ if (rc) { LOG_CI_VERB(ci, LOGL_ERROR, "Cannot send (rc=%d %s)\n", rc, strerror(-rc)); on_failure(ci); + return -EINVAL; } break; @@ -696,16 +744,47 @@ static void osmo_mgcpc_ep_fsm_wait_mgw_response_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { + static int re_enter = 0; + int rc; int count = 0; int i; struct osmo_mgcpc_ep *ep = osmo_mgcpc_ep_fi_mgwep(fi); + re_enter++; + OSMO_ASSERT(re_enter < 10); + + /* The first CRCX gives us the endpoint name in the CRCX response. So we must wait for the first CRCX endpoint + * response to come in before sending any other MGCP requests -- otherwise we might end up creating new + * endpoints instead of acting on the same. This FSM always sends out N requests and waits for all of them to + * complete before sending out new requests. Hence we're safe when the very first time at most one request is + * sent (which needs to be a CRCX). */ + for (i = 0; i < ARRAY_SIZE(ep->ci); i++) { - count += send_verb(&ep->ci[i]); + struct osmo_mgcpc_ep_ci *ci = &ep->ci[i]; + + /* Make sure that only CRCX get dispatched if no CRCX were sent yet. */ + if (!ep->first_crcx_complete) { + if (ci->occupied && ci->verb != MGCP_VERB_CRCX) + continue; + } + + rc = send_verb(&ep->ci[i]); + /* Need to be careful not to access the instance after failure. Event chains may already have + * deallocated this memory. */ + if (rc < 0) + return; + if (!rc) + continue; + count++; + /* Make sure that we wait for the first CRCX response before dispatching more requests. */ + if (!ep->first_crcx_complete) + break; } LOG_MGCPC_EP(ep, LOGL_DEBUG, "Sent messages: %d\n", count); - osmo_mgcpc_ep_fsm_check_state_chg_after_response(fi); + if (ep->first_crcx_complete) + osmo_mgcpc_ep_fsm_check_state_chg_after_response(fi); + re_enter--; } static void osmo_mgcpc_ep_fsm_handle_ci_events(struct osmo_fsm_inst *fi, uint32_t event, void *data) -- To view, visit https://gerrit.osmocom.org/13591 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I92a9944acc96398acd6649f9c3c5badec5dd6dcc Gerrit-Change-Number: 13591 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 06:51:29 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 06:51:29 +0000 Subject: Change in osmo-mgw[master]: constify map_codec_to_pt() ptmap arg In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13813 ) Change subject: constify map_codec_to_pt() ptmap arg ...................................................................... constify map_codec_to_pt() ptmap arg Change-Id: I030843d2d692b7a73cca8f427df070d2806ab695 --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index ac3e2b1..9b57f10 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -154,7 +154,7 @@ } enum mgcp_codecs map_str_to_codec(const char *str); -unsigned int map_codec_to_pt(struct ptmap *ptmap, unsigned int ptmap_len, +unsigned int map_codec_to_pt(const struct ptmap *ptmap, unsigned int ptmap_len, enum mgcp_codecs codec); enum mgcp_codecs map_pt_to_codec(struct ptmap *ptmap, unsigned int ptmap_len, unsigned int pt); diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 2dcab62..c28f5d2 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -93,7 +93,7 @@ } /* Check the ptmap for illegal mappings */ -static int check_ptmap(struct ptmap *ptmap) +static int check_ptmap(const struct ptmap *ptmap) { /* Check if there are mappings that leave the IANA assigned dynamic * payload type range. Under normal conditions such mappings should @@ -122,7 +122,7 @@ * \ptmap[in] ptmap_len length of the payload type map. * \ptmap[in] codec the codec for which the payload type should be looked up. * \returns assigned payload type */ -unsigned int map_codec_to_pt(struct ptmap *ptmap, unsigned int ptmap_len, +unsigned int map_codec_to_pt(const struct ptmap *ptmap, unsigned int ptmap_len, enum mgcp_codecs codec) { unsigned int i; -- To view, visit https://gerrit.osmocom.org/13813 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I030843d2d692b7a73cca8f427df070d2806ab695 Gerrit-Change-Number: 13813 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 06:52:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 06:52:21 +0000 Subject: Change in osmo-bsc[master]: use libosmocore osmo_tdef In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13795 ) Change subject: use libosmocore osmo_tdef ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13795 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I66674a5d8403d820038762888c846bae10ceac58 Gerrit-Change-Number: 13795 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 30 Apr 2019 06:52:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 06:53:32 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 06:53:32 +0000 Subject: Change in osmo-bsc[master]: fix inter-BSC-HO-incoming for AoIP (1/2) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13797 ) Change subject: fix inter-BSC-HO-incoming for AoIP (1/2) ...................................................................... Patch Set 2: do we have a test case that validates this behavior (i.e. fails before this patch and succeeds after it)? -- To view, visit https://gerrit.osmocom.org/13797 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I00c18b78573386145af71c4b39f7f22aec24579b Gerrit-Change-Number: 13797 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 30 Apr 2019 06:53:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 06:53:45 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 06:53:45 +0000 Subject: Change in osmo-bsc[master]: fix inter-BSC-HO-incoming for AoIP (2/2) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13585 ) Change subject: fix inter-BSC-HO-incoming for AoIP (2/2) ...................................................................... Patch Set 3: do we have a test case that validates this behavior (i.e. fails before this patch and succeeds after it)? -- To view, visit https://gerrit.osmocom.org/13585 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia05e37da125eb6e7b7be9b974b73261bd72de1f4 Gerrit-Change-Number: 13585 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 30 Apr 2019 06:53:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 06:59:51 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 30 Apr 2019 06:59:51 +0000 Subject: Change in osmo-sgsn[master]: Echo XID-Field of Type L3_PAR even when zero length In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/13811 ) Change subject: Echo XID-Field of Type L3_PAR even when zero length ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13811/1/src/gprs/gprs_llc.c File src/gprs/gprs_llc.c: https://gerrit.osmocom.org/#/c/13811/1/src/gprs/gprs_llc.c at 267 PS1, Line 267: xid_field_response = gprs_llc_dup_xid_field(lle->llme, xid_field); > If you "echo" something backs, it means you accept the XID. [?] I understand that the "echo" is a confirmation. What I was referring to here is the need to call gprs_lls_cup_xid_field() but now I'm guessing that sndcp_sn_xid_ind() was "populating" the talloc_zero'd struct? or something like that? My lack of C and pointer foo strikes again... -- To view, visit https://gerrit.osmocom.org/13811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 Gerrit-Change-Number: 13811 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 30 Apr 2019 06:59:51 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 07:17:12 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 07:17:12 +0000 Subject: Change in osmo-bsc[master]: move mgw endpoint FSM to osmo-mgw.git In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13796 ) Change subject: move mgw endpoint FSM to osmo-mgw.git ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13796 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I03e6b48d9b0a5370310d5f56809259ff7909cf9d Gerrit-Change-Number: 13796 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 30 Apr 2019 07:17:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 07:17:40 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 07:17:40 +0000 Subject: Change in osmo-bsc[master]: use libosmocore osmo_tdef In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13795 ) Change subject: use libosmocore osmo_tdef ...................................................................... use libosmocore osmo_tdef Move the T_defs API to libosmocore as osmo_tdefs: remove the local T_defs API and use libosmocore's osmo_tdef* API instead. The root reason is moving the mgw_endpoint_fsm to libosmo-mgcp-client to be able to use it in osmo-msc for inter-MSC handover. When adding osmo_tdef, the new concept of timer groups was added to the API. It would make sense to apply group names here as well, but do not modify the VTY configuration for timers. The future might bring separate groups (or not). Depends: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5 (libosmocore) Change-Id: I66674a5d8403d820038762888c846bae10ceac58 --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h D include/osmocom/bsc/gsm_timers.h M include/osmocom/bsc/mgw_endpoint_fsm.h M src/ipaccess/Makefile.am M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c M src/osmo-bsc/bts_siemens_bs11.c M src/osmo-bsc/gsm_data.c D src/osmo-bsc/gsm_timers.c D src/osmo-bsc/gsm_timers_vty.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c M src/osmo-bsc/lchan_rtp_fsm.c M src/osmo-bsc/mgw_endpoint_fsm.c M src/osmo-bsc/net_init.c M src/osmo-bsc/paging.c M src/utils/Makefile.am M tests/abis/Makefile.am M tests/bsc/Makefile.am M tests/gsm0408/Makefile.am M tests/handover/Makefile.am M tests/nanobts_omlattr/Makefile.am M tests/nanobts_omlattr/nanobts_omlattr_test.c 29 files changed, 94 insertions(+), 468 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 044fdc9..21e53d7 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -20,7 +20,6 @@ gsm_04_08_rr.h \ gsm_04_80.h \ gsm_data.h \ - gsm_timers.h \ handover.h \ handover_cfg.h \ handover_decision.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index dc133e1..7b813a6 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -31,7 +32,6 @@ #include #include #include -#include #include #define GSM_T3122_DEFAULT 10 @@ -1495,7 +1495,7 @@ struct llist_head bts_rejected; /* shall reference gsm_network_T[] */ - struct T_def *T_defs; + struct osmo_tdef *T_defs; enum gsm_chan_t ctype_by_chreq[_NUM_CHREQ_T]; diff --git a/include/osmocom/bsc/gsm_timers.h b/include/osmocom/bsc/gsm_timers.h deleted file mode 100644 index 699c461..0000000 --- a/include/osmocom/bsc/gsm_timers.h +++ /dev/null @@ -1,56 +0,0 @@ -/* API to define Tnnn timers globally, configure in VTY and use for FSM state changes. */ -#pragma once - -#include -#include - -struct osmo_fsm_inst; -struct vty; - -enum T_unit { - T_S = 0, /*< most T are in seconds, keep 0 as default. */ - T_MS, /*< milliseconds */ - T_M, /*< minutes */ - T_CUSTOM, -}; - -extern const struct value_string T_unit_names[]; -static inline const char *T_unit_name(enum T_unit val) -{ return get_value_string(T_unit_names, val); } - -/* Define a GSM timer of the form Tnnn, with unit, default value and doc string. */ -struct T_def { - const int T; /*< T1234 number */ - const int default_val; /*< timeout duration (according to unit), default value. */ - const enum T_unit unit; - const char *desc; - int val; /*< currently active value, e.g. set by user config. */ -}; - -/* Iterate an array of struct T_def, the last item should be fully zero, i.e. "{}" */ -#define for_each_T_def(d, T_defs) \ - for (d = T_defs; d && (d->T || d->default_val || d->desc); d++) - -int T_def_get(const struct T_def *T_defs, int T, enum T_unit as_unit, int val_if_not_present); -void T_defs_reset(struct T_def *T_defs); -struct T_def *T_def_get_entry(struct T_def *T_defs, int T); - -void T_defs_vty_init(struct T_def *T_defs, int cfg_parent_node); -void T_defs_vty_write(struct vty *vty, const char *indent); -struct T_def *parse_T_arg(struct vty *vty, const char *T_str); - -struct state_timeout { - int T; - bool keep_timer; -}; - -const struct state_timeout *get_state_timeout(uint32_t state, - const struct state_timeout *timeouts_array); - -#define fsm_inst_state_chg_T(fi, state, timeouts_array, T_defs, default_timeout) \ - _fsm_inst_state_chg_T(fi, state, timeouts_array, T_defs, default_timeout, \ - __FILE__, __LINE__) -int _fsm_inst_state_chg_T(struct osmo_fsm_inst *fi, uint32_t state, - const struct state_timeout *timeouts_array, - const struct T_def *T_defs, int default_timeout, - const char *file, int line); diff --git a/include/osmocom/bsc/mgw_endpoint_fsm.h b/include/osmocom/bsc/mgw_endpoint_fsm.h index e264a3c..f86a7cd 100644 --- a/include/osmocom/bsc/mgw_endpoint_fsm.h +++ b/include/osmocom/bsc/mgw_endpoint_fsm.h @@ -24,9 +24,9 @@ struct mgw_endpoint; struct mgwep_ci; -struct T_def; +struct osmo_tdef; -void mgw_endpoint_fsm_init(struct T_def *T_defs); +void mgw_endpoint_fsm_init(struct osmo_tdef *T_defs); struct mgw_endpoint *mgw_endpoint_alloc(struct osmo_fsm_inst *parent, uint32_t parent_term_event, struct mgcp_client *mgcp_client, diff --git a/src/ipaccess/Makefile.am b/src/ipaccess/Makefile.am index 3578a40..145ea39 100644 --- a/src/ipaccess/Makefile.am +++ b/src/ipaccess/Makefile.am @@ -50,7 +50,6 @@ $(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts.o \ $(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(OSMO_LIBS) \ $(NULL) @@ -62,6 +61,5 @@ $(NULL) ipaccess_proxy_LDADD = \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(OSMO_LIBS) \ $(NULL) diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index 364228d..11803da 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -57,8 +57,6 @@ gsm_04_08_rr.c \ gsm_04_80_utils.c \ gsm_data.c \ - gsm_timers.c \ - gsm_timers_vty.c \ handover_cfg.c \ handover_decision.c \ handover_decision_2.c \ diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c index 9715dfc..fda273d 100644 --- a/src/osmo-bsc/abis_om2000.c +++ b/src/osmo-bsc/abis_om2000.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include @@ -1381,7 +1380,7 @@ break; case GSM_PCHAN_CCCH_SDCCH4: msgb_tv_put(msg, OM2K_DEI_T3105, - T_def_get(ts->trx->bts->network->T_defs, 3105, T_MS, -1) / 10); + osmo_tdef_get(ts->trx->bts->network->T_defs, 3105, OSMO_TDEF_MS, -1) / 10); msgb_tv_put(msg, OM2K_DEI_NY1, 35); msgb_tv_put(msg, OM2K_DEI_BA_PA_MFRMS, 0x06); msgb_tv_put(msg, OM2K_DEI_CBCH_INDICATOR, 0); @@ -1396,7 +1395,7 @@ break; case GSM_PCHAN_SDCCH8_SACCH8C: msgb_tv_put(msg, OM2K_DEI_T3105, - T_def_get(ts->trx->bts->network->T_defs, 3105, T_MS, -1) / 10); + osmo_tdef_get(ts->trx->bts->network->T_defs, 3105, OSMO_TDEF_MS, -1) / 10); msgb_tv_put(msg, OM2K_DEI_NY1, 35); msgb_tv_put(msg, OM2K_DEI_CBCH_INDICATOR, 0); msgb_tv_put(msg, OM2K_DEI_TSC, gsm_ts_tsc(ts)); @@ -1407,7 +1406,7 @@ break; default: msgb_tv_put(msg, OM2K_DEI_T3105, - T_def_get(ts->trx->bts->network->T_defs, 3105, T_MS, -1) / 10); + osmo_tdef_get(ts->trx->bts->network->T_defs, 3105, OSMO_TDEF_MS, -1) / 10); msgb_tv_put(msg, OM2K_DEI_NY1, 35); msgb_tv_put(msg, OM2K_DEI_TSC, gsm_ts_tsc(ts)); /* Disable RF RESOURCE INDICATION on idle channels */ diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index fd6dbdb..0117435 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include @@ -1291,7 +1291,7 @@ uint8_t wait_ind; wait_ind = bts->T3122; if (!wait_ind) - wait_ind = T_def_get(bts->network->T_defs, 3122, T_S, -1); + wait_ind = osmo_tdef_get(bts->network->T_defs, 3122, OSMO_TDEF_S, -1); if (!wait_ind) wait_ind = GSM_T3122_DEFAULT; /* The BTS will gather multiple CHAN RQD and reject up to 4 MS at the same time. */ diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index 9c0c400..520498f 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -20,13 +20,13 @@ * */ +#include #include #include #include #include -#include #include #include #include @@ -48,7 +48,7 @@ return fi->priv; } -static const struct state_timeout assignment_fsm_timeouts[32] = { +static const struct osmo_tdef_state_timeout assignment_fsm_timeouts[32] = { [ASSIGNMENT_ST_WAIT_LCHAN_ACTIVE] = { .T=10 }, [ASSIGNMENT_ST_WAIT_RR_ASS_COMPLETE] = { .keep_timer=true }, [ASSIGNMENT_ST_WAIT_LCHAN_ESTABLISHED] = { .keep_timer=true }, @@ -59,10 +59,10 @@ * The actual timeout value is in turn obtained from network->T_defs. * Assumes local variable fi exists. */ #define assignment_fsm_state_chg(state) \ - fsm_inst_state_chg_T(fi, state, \ - assignment_fsm_timeouts, \ - ((struct gsm_subscriber_connection*)(fi->priv))->network->T_defs, \ - 5) + osmo_tdef_fsm_inst_state_chg(fi, state, \ + assignment_fsm_timeouts, \ + ((struct gsm_subscriber_connection*)(fi->priv))->network->T_defs, \ + 5) /* Log failure and transition to ASSIGNMENT_ST_FAILURE, which triggers the appropriate actions. */ #define assignment_fail(cause, fmt, args...) do { \ diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 1cc0c78..4466404 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -85,7 +85,7 @@ {} }; -struct state_timeout conn_fsm_timeouts[32] = { +struct osmo_tdef_state_timeout conn_fsm_timeouts[32] = { [ST_WAIT_CC] = { .T = 993210 }, [ST_CLEARING] = { .T = 999 }, }; @@ -94,10 +94,10 @@ * The actual timeout value is in turn obtained from network->T_defs. * Assumes local variable 'conn' exists. */ #define conn_fsm_state_chg(state) \ - fsm_inst_state_chg_T(conn->fi, state, \ - conn_fsm_timeouts, \ - conn->network->T_defs, \ - -1) + osmo_tdef_fsm_inst_state_chg(conn->fi, state, \ + conn_fsm_timeouts, \ + conn->network->T_defs, \ + -1) /* forward MT DTAP from BSSAP side to RSL side */ static inline void submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg) diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 767d565..3a6ddd4 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -66,11 +67,9 @@ #include #include #include -#include #include #include #include -#include #include #include @@ -1046,7 +1045,7 @@ ho_vty_write_net(vty, gsmnet); - T_defs_vty_write(vty, " "); + osmo_tdef_vty_write(vty, gsmnet->T_defs, " "); if (!gsmnet->dyn_ts_allow_tch_f) vty_out(vty, " dyn_ts_allow_tch_f 0%s", VTY_NEWLINE); @@ -1060,7 +1059,7 @@ gsmnet->tz.hr, gsmnet->tz.mn, VTY_NEWLINE); } - /* writing T3212 from the common T_defs_vty_write() instead. */ + osmo_tdef_vty_write(vty, gsmnet->T_defs, " timer "); { uint16_t meas_port; @@ -4005,10 +4004,11 @@ "Calculate T3113 dynamically based on channel config and load\n" TNUM_STR) { - struct T_def *d; + struct osmo_tdef *d; struct gsm_bts *bts = vty->index; + struct gsm_network *gsmnet = gsmnet_from_vty(vty); - d = parse_T_arg(vty, argv[0]); + d = osmo_tdef_vty_parse_T_arg(vty, gsmnet->T_defs, argv[0]); if (!d) return CMD_WARNING; @@ -4030,10 +4030,11 @@ "Set given timer to non-dynamic and use the default or user provided fixed value\n" TNUM_STR) { - struct T_def *d; + struct osmo_tdef *d; struct gsm_bts *bts = vty->index; + struct gsm_network *gsmnet = gsmnet_from_vty(vty); - d = parse_T_arg(vty, argv[0]); + d = osmo_tdef_vty_parse_T_arg(vty, gsmnet->T_defs, argv[0]); if (!d) return CMD_WARNING; @@ -5042,11 +5043,11 @@ "Periodic Location Updating Interval in Minutes\n") { struct gsm_network *net = vty->index; - struct T_def *d = T_def_get_entry(net->T_defs, 3212); + struct osmo_tdef *d = osmo_tdef_get_entry(net->T_defs, 3212); OSMO_ASSERT(d); d->val = atoi(argv[0]) / 6; - vty_out(vty, "T%d = %u %s (%s)%s", d->T, d->val, "* 6min", d->desc, VTY_NEWLINE); + vty_out(vty, "T%d = %lu %s (%s)%s", d->T, d->val, "* 6min", d->desc, VTY_NEWLINE); return CMD_SUCCESS; } @@ -5058,11 +5059,11 @@ "Periodic Location Updating Interval\n") { struct gsm_network *net = vty->index; - struct T_def *d = T_def_get_entry(net->T_defs, 3212); + struct osmo_tdef *d = osmo_tdef_get_entry(net->T_defs, 3212); OSMO_ASSERT(d); d->val = 0; - vty_out(vty, "T%d = %u %s (%s)%s", d->T, d->val, "* 6min", d->desc, VTY_NEWLINE); + vty_out(vty, "T%d = %lu %s (%s)%s", d->T, d->val, "* 6min", d->desc, VTY_NEWLINE); return CMD_SUCCESS; } @@ -5092,6 +5093,28 @@ return CMD_SUCCESS; } +DEFUN(show_timer, show_timer_cmd, + "show timer " OSMO_TDEF_VTY_ARG_T_OPTIONAL, + SHOW_STR "Show timers\n" + OSMO_TDEF_VTY_DOC_T) +{ + struct gsm_network *net = gsmnet_from_vty(vty); + const char *T_arg = argc > 0 ? argv[0] : NULL; + return osmo_tdef_vty_show_cmd(vty, net->T_defs, T_arg, NULL); +} + +DEFUN(cfg_net_timer, cfg_net_timer_cmd, + "timer " OSMO_TDEF_VTY_ARG_SET_OPTIONAL, + "Configure or show timers\n" + OSMO_TDEF_VTY_DOC_SET) +{ + struct gsm_network *net = gsmnet_from_vty(vty); + /* If any arguments are missing, redirect to 'show' */ + if (argc < 2) + return show_timer(self, vty, argc, argv); + return osmo_tdef_vty_set_cmd(vty, net->T_defs, argv); +} + extern int bsc_vty_init_extra(void); int bsc_vty_init(struct gsm_network *network) @@ -5136,6 +5159,7 @@ install_element(GSMNET_NODE, &cfg_net_dyn_ts_allow_tch_f_cmd); install_element(GSMNET_NODE, &cfg_net_meas_feed_dest_cmd); install_element(GSMNET_NODE, &cfg_net_meas_feed_scenario_cmd); + install_element(GSMNET_NODE, &cfg_net_timer_cmd); install_element_ve(&bsc_show_net_cmd); install_element_ve(&show_bts_cmd); @@ -5146,6 +5170,7 @@ install_element_ve(&show_lchan_cmd); install_element_ve(&show_lchan_summary_cmd); install_element_ve(&show_lchan_summary_all_cmd); + install_element_ve(&show_timer_cmd); install_element_ve(&show_subscr_conn_cmd); @@ -5159,8 +5184,6 @@ logging_vty_add_cmds(NULL); osmo_talloc_vty_add_cmds(); - T_defs_vty_init(network->T_defs, GSMNET_NODE); - install_element(GSMNET_NODE, &cfg_net_neci_cmd); install_element(GSMNET_NODE, &cfg_net_dtx_cmd); install_element(GSMNET_NODE, &cfg_net_pag_any_tch_cmd); diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c index be40410..8a370da 100644 --- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c +++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c @@ -23,7 +23,6 @@ #include #include #include -#include struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts) @@ -82,7 +81,7 @@ msgb_tv_fixed_put(msgb, NM_ATT_LDAVG_SLOTS, 2, buf); /* 10 milliseconds */ - msgb_tv_put(msgb, NM_ATT_BTS_AIR_TIMER, T_def_get(bts->network->T_defs, 3105, T_MS, -1)); + msgb_tv_put(msgb, NM_ATT_BTS_AIR_TIMER, osmo_tdef_get(bts->network->T_defs, 3105, OSMO_TDEF_MS, -1)); /* 10 retransmissions of physical config */ msgb_tv_put(msgb, NM_ATT_NY1, 10); diff --git a/src/osmo-bsc/bts_siemens_bs11.c b/src/osmo-bsc/bts_siemens_bs11.c index 2cb676c..b1688f3 100644 --- a/src/osmo-bsc/bts_siemens_bs11.c +++ b/src/osmo-bsc/bts_siemens_bs11.c @@ -20,6 +20,8 @@ */ +#include + #include #include @@ -27,7 +29,6 @@ #include #include #include -#include #include static int bts_model_bs11_start(struct gsm_network *net); @@ -360,7 +361,7 @@ uint8_t arfcn_high = (bts->c0->arfcn >> 8) & 0x0f; /* T3105 attribute in units of 10ms */ - bs11_attr_bts[2] = T_def_get(bts->network->T_defs, 3105, T_MS, -1) / 10; + bs11_attr_bts[2] = osmo_tdef_get(bts->network->T_defs, 3105, OSMO_TDEF_MS, -1) / 10; /* patch ARFCN into BTS Attributes */ bs11_attr_bts[69] &= 0xf0; diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index 45c433c..88690a7 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -872,7 +871,7 @@ bts->si_common.chan_desc.att = 1; /* attachment required */ bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ - bts->si_common.chan_desc.t3212 = T_def_get(net->T_defs, 3212, T_CUSTOM, -1); + bts->si_common.chan_desc.t3212 = osmo_tdef_get(net->T_defs, 3212, OSMO_TDEF_CUSTOM, -1); gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */ INIT_LLIST_HEAD(&bts->abis_queue); diff --git a/src/osmo-bsc/gsm_timers.c b/src/osmo-bsc/gsm_timers.c deleted file mode 100644 index fc3ec24..0000000 --- a/src/osmo-bsc/gsm_timers.c +++ /dev/null @@ -1,207 +0,0 @@ -/* Implementation to define Tnnn timers globally and use for FSM state changes. */ -/* (C) 2018 by sysmocom - s.f.m.c. GmbH - * - * Author: Neels Hofmeyr - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include - -#include - -/* a = return_val * b. Return 0 if factor is below 1. */ -static int T_factor(enum T_unit a, enum T_unit b) -{ - if (b == a - || b == T_CUSTOM || a == T_CUSTOM) - return 1; - - switch (b) { - case T_MS: - switch (a) { - case T_S: - return 1000; - case T_M: - return 60*1000; - default: - return 0; - } - case T_S: - switch (a) { - case T_M: - return 60; - default: - return 0; - } - default: - return 0; - } -} - -static int T_round(int val, enum T_unit from_unit, enum T_unit to_unit) -{ - int f; - if (!val) - return 0; - - f = T_factor(from_unit, to_unit); - if (f < 1) { - f = T_factor(to_unit, from_unit); - return (val / f) + (val % f? 1 : 0); - } - return val * f; -} - -/* Return the value of a T timer from a list of T_defs. - * Any value is rounded up to match as_unit: 1100 ms as T_S becomes 2 seconds, as T_M becomes one minute. - * If no such timer is defined, return the default value passed, or abort the program if default < 0. - * - * Usage examples: - * - * - Initialization: - * - * struct T_def global_T_defs[] = { - * { .T=7, .default_val=50, .desc="Water Boiling Timeout" }, // default is .unit=T_S == 0 - * { .T=8, .default_val=300, .desc="Tea brewing" }, - * { .T=9, .default_val=5, .unit=T_M, .desc="Let tea cool down before drinking" }, - * { .T=10, .default_val=20, .unit=T_M, .desc="Forgot to drink tea while it's warm" }, - * {} // <-- important! last entry shall be zero - * }; - * T_defs_reset(global_T_defs); // make all values the default - * T_defs_vty_init(global_T_defs, CONFIG_NODE); - * - * val = T_def_get(global_T_defs, 7, T_S, -1); // -> 50 - * sleep(val); - * - * val = T_def_get(global_T_defs, 7, T_M, -1); // 50 seconds becomes 1 minute -> 1 - * sleep_minutes(val); - * - * val = T_def_get(global_T_defs, 99, T_S, -1); // not defined, program aborts! - * - * val = T_def_get(global_T_defs, 99, T_S, 3); // not defined, returns 3 - */ -int T_def_get(const struct T_def *T_defs, int T, enum T_unit as_unit, int val_if_not_present) -{ - const struct T_def *d = T_def_get_entry((struct T_def*)T_defs, T); - if (!d) { - OSMO_ASSERT(val_if_not_present >= 0); - return val_if_not_present; - } - return T_round(d->val, d->unit, as_unit); -} - -/* Set all T_def values to the default_val. */ -void T_defs_reset(struct T_def *T_defs) -{ - struct T_def *d; - for_each_T_def(d, T_defs) - d->val = d->default_val; -} - -/* Return a pointer to a T_def from an array, or NULL. */ -struct T_def *T_def_get_entry(struct T_def *T_defs, int T) -{ - struct T_def *d; - for_each_T_def(d, T_defs) { - if (d->T == T) - return d; - } - return NULL; -} - -/* Return a state_timeout entry from an array, or return NULL if the entry is zero. - * - * The timeouts_array shall contain exactly 32 elements, which corresponds to the number of states - * allowed by osmo_fsm_*. Lookup is by array index. - * - * For example: - * struct state_timeout my_fsm_timeouts[32] = { - * [MY_FSM_STATE_3] = { .T = 423 }, - * [MY_FSM_STATE_7] = { .T = 235 }, - * [MY_FSM_STATE_8] = { .keep_timer = true }, - * // any state that is omitted will remain zero == no timeout - * }; - * get_state_timeout(MY_FSM_STATE_0, &my_fsm_timeouts) -> NULL, - * get_state_timeout(MY_FSM_STATE_7, &my_fsm_timeouts) -> { .T = 235 } - * - * The intention is then to obtain the timer like T_def_get(global_T_defs, T=235); see also - * fsm_inst_state_chg_T() below. - */ -const struct state_timeout *get_state_timeout(uint32_t state, - const struct state_timeout *timeouts_array) -{ - const struct state_timeout *t; - OSMO_ASSERT(state < 32); - t = &timeouts_array[state]; - if (!t->keep_timer && !t->T) - return NULL; - return t; -} - -/* Call osmo_fsm_inst_state_chg() or osmo_fsm_inst_state_chg_keep_timer(), depending on the T value - * defined for this state in the timeouts_array, and obtaining the actual timeout value from T_defs. - * A T timer configured in sub-second precision is rounded up to the next full second. - * - * See get_state_timeout() and T_def_get(). - * - * Should a T number be defined in timeouts_array that is not defined in T_defs, use default_timeout. - * This is best used by wrapping this function call in a macro suitable for a specific FSM - * implementation, which can become as short as: my_fsm_state_chg(fi, NEXT_STATE): - * - * #define my_fsm_state_chg(fi, NEXT_STATE) \ - * fsm_inst_state_chg_T(fi, NEXT_STATE, my_fsm_timeouts, global_T_defs, 5) - * - * my_fsm_state_chg(fi, MY_FSM_STATE_1); - * // -> No timeout configured, will enter state without timeout. - * - * my_fsm_state_chg(fi, MY_FSM_STATE_3); - * // T423 configured for this state, will look up T423 in T_defs, or use 5 seconds if unset. - * - * my_fsm_state_chg(fi, MY_FSM_STATE_8); - * // keep_timer configured for this state, will invoke osmo_fsm_inst_state_chg_keep_timer(). - * - */ -int _fsm_inst_state_chg_T(struct osmo_fsm_inst *fi, uint32_t state, - const struct state_timeout *timeouts_array, - const struct T_def *T_defs, int default_timeout, - const char *file, int line) -{ - const struct state_timeout *t = get_state_timeout(state, timeouts_array); - int val; - - /* No timeout defined for this state? */ - if (!t) - return _osmo_fsm_inst_state_chg(fi, state, 0, 0, file, line); - - if (t->keep_timer) { - int rc = _osmo_fsm_inst_state_chg_keep_timer(fi, state, file, line); - if (t->T && !rc) - fi->T = t->T; - return rc; - } - - val = T_def_get(T_defs, t->T, T_S, default_timeout); - return _osmo_fsm_inst_state_chg(fi, state, val, t->T, file, line); -} - -const struct value_string T_unit_names[] = { - { T_S, "s" }, - { T_MS, "ms" }, - { T_CUSTOM, "(custom)" }, - { 0, NULL } -}; diff --git a/src/osmo-bsc/gsm_timers_vty.c b/src/osmo-bsc/gsm_timers_vty.c deleted file mode 100644 index e744dfa..0000000 --- a/src/osmo-bsc/gsm_timers_vty.c +++ /dev/null @@ -1,118 +0,0 @@ -/* Implementation to configure Tnnn timers in VTY */ -/* (C) 2018 by sysmocom - s.f.m.c. GmbH - * - * Author: Neels Hofmeyr - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include - -#include -#include - -#include - -/* Global singleton list used for the VTY configuration. See T_defs_vty_init(). */ -static struct T_def *g_vty_T_defs = NULL; - -/* Parse an argument like "T1234", "t1234" or "1234" and return the corresponding T_def entry from - * g_vty_T_defs, if any. */ -struct T_def *parse_T_arg(struct vty *vty, const char *T_str) -{ - int T; - struct T_def *d; - - if (T_str[0] == 't' || T_str[0] == 'T') - T_str++; - T = atoi(T_str); - - d = T_def_get_entry(g_vty_T_defs, T); - if (!d) - vty_out(vty, "No such timer: T%d%s", T, VTY_NEWLINE); - return d; -} - -/* Installed in the VTY on T_defs_vty_init(). */ -DEFUN(cfg_timer, cfg_timer_cmd, - "timer TNNNN (default|<1-65535>)", - "Configure GSM Timers\n" - "T-number, optionally preceded by 't' or 'T'." - "See also 'show timer' for a list of available timers.\n" - "Set to default timer value\n" "Timer value\n") -{ - const char *val_str = argv[1]; - struct T_def *d; - - d = parse_T_arg(vty, argv[0]); - if (!d) - return CMD_WARNING; - - if (!strcmp(val_str, "default")) - d->val = d->default_val; - else - d->val = atoi(val_str); - vty_out(vty, "T%d = %u %s (%s)%s", d->T, d->val, T_unit_name(d->unit), d->desc, VTY_NEWLINE); - return CMD_SUCCESS; -} - -/* Print a T_def to the VTY. */ -static void show_one_timer(struct vty *vty, struct T_def *d) -{ - vty_out(vty, "T%d = %u %s (default = %u %s) \t%s%s", - d->T, d->val, T_unit_name(d->unit), - d->default_val, T_unit_name(d->unit), d->desc, VTY_NEWLINE); -} - -/* Installed in the VTY on T_defs_vty_init(). */ -DEFUN(show_timer, show_timer_cmd, - "show timer [TNNNN]", - SHOW_STR "GSM Timers\n" - "Specific timer to show, or all timers if omitted.\n") -{ - struct T_def *d; - - if (argc) { - d = parse_T_arg(vty, argv[0]); - if (!d) - return CMD_WARNING; - show_one_timer(vty, d); - return CMD_SUCCESS; - } - - for_each_T_def(d, g_vty_T_defs) - show_one_timer(vty, d); - return CMD_SUCCESS; -} - -/* Install GSM timer configuration commands in the VTY. */ -void T_defs_vty_init(struct T_def *T_defs, int cfg_parent_node) -{ - g_vty_T_defs = T_defs; - install_element_ve(&show_timer_cmd); - install_element(cfg_parent_node, &cfg_timer_cmd); -} - -/* Write GSM timer configuration to the vty. */ -void T_defs_vty_write(struct vty *vty, const char *indent) -{ - struct T_def *d; - for_each_T_def(d, g_vty_T_defs) { - if (d->val != d->default_val) - vty_out(vty, "%stimer t%d %u%s", indent, d->T, d->val, VTY_NEWLINE); - } -} diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 421c32e..fe3b8b2 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -159,7 +159,7 @@ return fi->priv; } -static const struct state_timeout ho_fsm_timeouts[32] = { +static const struct osmo_tdef_state_timeout ho_fsm_timeouts[32] = { [HO_ST_WAIT_LCHAN_ACTIVE] = { .T = 23042 }, [HO_ST_WAIT_RR_HO_DETECT] = { .T = 23042 }, [HO_ST_WAIT_RR_HO_COMPLETE] = { .T = 23042 }, @@ -173,10 +173,10 @@ * The actual timeout value is in turn obtained from network->T_defs. * Assumes local variable fi exists. */ #define ho_fsm_state_chg(state) \ - fsm_inst_state_chg_T(fi, state, \ - ho_fsm_timeouts, \ - ((struct gsm_subscriber_connection*)(fi->priv))->network->T_defs, \ - 5) + osmo_tdef_fsm_inst_state_chg(fi, state, \ + ho_fsm_timeouts, \ + ((struct gsm_subscriber_connection*)(fi->priv))->network->T_defs, \ + 5) /* Log failure and transition to HO_ST_FAILURE, which triggers the appropriate actions. */ #define ho_fail(result, fmt, args...) do { \ diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 7af2ea0..33abb1f 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -207,7 +207,7 @@ } } -struct state_timeout lchan_fsm_timeouts[32] = { +struct osmo_tdef_state_timeout lchan_fsm_timeouts[32] = { [LCHAN_ST_WAIT_TS_READY] = { .T=23001 }, [LCHAN_ST_WAIT_ACTIV_ACK] = { .T=23002 }, [LCHAN_ST_WAIT_RLL_RTP_ESTABLISH] = { .T=3101 }, @@ -221,10 +221,10 @@ * The actual timeout value is in turn obtained from network->T_defs. * Assumes local variable fi exists. */ #define lchan_fsm_state_chg(state) \ - fsm_inst_state_chg_T(fi, state, \ - lchan_fsm_timeouts, \ - ((struct gsm_lchan*)(fi->priv))->ts->trx->bts->network->T_defs, \ - 5) + osmo_tdef_fsm_inst_state_chg(fi, state, \ + lchan_fsm_timeouts, \ + ((struct gsm_lchan*)(fi->priv))->ts->trx->bts->network->T_defs, \ + 5) /* Set a failure message, trigger the common actions to take on failure, transition to a state to * continue with (using state timeouts from lchan_fsm_timeouts[]). Assumes local variable fi exists. */ diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c index 2d15bf2..5e2d758 100644 --- a/src/osmo-bsc/lchan_rtp_fsm.c +++ b/src/osmo-bsc/lchan_rtp_fsm.c @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -41,7 +40,7 @@ return fi->priv; } -struct state_timeout lchan_rtp_fsm_timeouts[32] = { +struct osmo_tdef_state_timeout lchan_rtp_fsm_timeouts[32] = { [LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE] = { .T=23004 }, [LCHAN_RTP_ST_WAIT_IPACC_CRCX_ACK] = { .T=23005 }, [LCHAN_RTP_ST_WAIT_IPACC_MDCX_ACK] = { .T=23006 }, @@ -52,10 +51,10 @@ * The actual timeout value is in turn obtained from network->T_defs. * Assumes local variable fi exists. */ #define lchan_rtp_fsm_state_chg(state) \ - fsm_inst_state_chg_T(fi, state, \ - lchan_rtp_fsm_timeouts, \ - ((struct gsm_lchan*)(fi->priv))->ts->trx->bts->network->T_defs, \ - 5) + osmo_tdef_fsm_inst_state_chg(fi, state, \ + lchan_rtp_fsm_timeouts, \ + ((struct gsm_lchan*)(fi->priv))->ts->trx->bts->network->T_defs, \ + 5) /* Set a failure message, trigger the common actions to take on failure, transition to a state to * continue with (using state timeouts from lchan_rtp_fsm_timeouts[]). Assumes local variable fi exists. */ diff --git a/src/osmo-bsc/mgw_endpoint_fsm.c b/src/osmo-bsc/mgw_endpoint_fsm.c index 5462914..fa65166 100644 --- a/src/osmo-bsc/mgw_endpoint_fsm.c +++ b/src/osmo-bsc/mgw_endpoint_fsm.c @@ -29,7 +29,6 @@ #include #include -#include #include #include @@ -196,9 +195,9 @@ } } -static struct T_def *g_T_defs = NULL; +static struct osmo_tdef *g_T_defs = NULL; -void mgw_endpoint_fsm_init(struct T_def *T_defs) +void mgw_endpoint_fsm_init(struct osmo_tdef *T_defs) { g_T_defs = T_defs; OSMO_ASSERT(osmo_fsm_register(&mgwep_fsm) == 0); @@ -380,7 +379,7 @@ } -static const struct state_timeout mgwep_fsm_timeouts[32] = { +static const struct osmo_tdef_state_timeout mgwep_fsm_timeouts[32] = { [MGWEP_ST_WAIT_MGW_RESPONSE] = { .T=23042 }, }; @@ -388,7 +387,7 @@ * The actual timeout value is in turn obtained from g_T_defs. * Assumes local variable fi exists. */ #define mgwep_fsm_state_chg(state) \ - fsm_inst_state_chg_T(fi, state, mgwep_fsm_timeouts, g_T_defs, 5) + osmo_tdef_fsm_inst_state_chg(fi, state, mgwep_fsm_timeouts, g_T_defs, 5) void mgw_endpoint_ci_request(struct mgwep_ci *ci, enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info, diff --git a/src/osmo-bsc/net_init.c b/src/osmo-bsc/net_init.c index b4ff489..c2a38bc 100644 --- a/src/osmo-bsc/net_init.c +++ b/src/osmo-bsc/net_init.c @@ -17,21 +17,22 @@ * */ +#include + #include #include #include #include #include -#include -static struct T_def gsm_network_T_defs[] = { +static struct osmo_tdef gsm_network_T_defs[] = { { .T=7, .default_val=10, .desc="inter-BSC Handover MO, HO Required to HO Command" }, { .T=8, .default_val=10, .desc="inter-BSC Handover MO, HO Command to final Clear" }, { .T=10, .default_val=6, .desc="RR Assignment" }, { .T=101, .default_val=10, .desc="inter-BSC Handover MT, HO Request to HO Accept" }, { .T=3101, .default_val=3, .desc="RR Immediate Assignment" }, { .T=3103, .default_val=5, .desc="Handover" }, - { .T=3105, .default_val=100, .unit=T_MS, .desc="Physical Information" }, + { .T=3105, .default_val=100, .unit=OSMO_TDEF_MS, .desc="Physical Information" }, { .T=3107, .default_val=5, .desc="(unused)" }, { .T=3109, .default_val=5, .desc="RSL SACCH deactivation" }, { .T=3111, .default_val=2, .desc="Wait time before RSL RF Channel Release" }, @@ -42,7 +43,7 @@ { .T=3119, .default_val=10, .desc="(unused)" }, { .T=3122, .default_val=GSM_T3122_DEFAULT, .desc="Wait time after RR Immediate Assignment Reject" }, { .T=3141, .default_val=10, .desc="(unused)" }, - { .T=3212, .default_val=5, .unit=T_CUSTOM, + { .T=3212, .default_val=5, .unit=OSMO_TDEF_CUSTOM, .desc="Periodic Location Update timer, sent to MS (1 = 6 minutes)" }, { .T=993210, .default_val=20, .desc="After L3 Complete, wait for MSC to confirm" }, { .T=999, .default_val=60, .desc="After Clear Request, wait for MSC to Clear Command (sanity)" }, @@ -78,7 +79,7 @@ net->num_bts = 0; net->T_defs = gsm_network_T_defs; - T_defs_reset(net->T_defs); + osmo_tdefs_reset(net->T_defs); return net; } diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index 066db1c..f1fd2ad 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -51,7 +52,6 @@ #include #include #include -#include #include void *tall_paging_ctx = NULL; @@ -294,11 +294,11 @@ static unsigned int calculate_timer_3113(struct gsm_bts *bts) { unsigned int to_us, to; - struct T_def *d = T_def_get_entry(bts->network->T_defs, 3113); + struct osmo_tdef *d = osmo_tdef_get_entry(bts->network->T_defs, 3113); /* Note: d should always contain a valid pointer since all timers, * including 3113 are statically pre-defined in - * struct T_def gsm_network_T_defs. */ + * struct osmo_tdef gsm_network_T_defs. */ OSMO_ASSERT(d); if (!bts->T3113_dynamic) diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 24cd230..e585e0d 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -51,7 +51,6 @@ $(top_builddir)/src/osmo-bsc/bts_siemens_bs11.o \ $(top_builddir)/src/osmo-bsc/e1_config.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -119,7 +118,6 @@ meas_json_LDADD = \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOABIS_LIBS) \ diff --git a/tests/abis/Makefile.am b/tests/abis/Makefile.am index 4fc3605..60054d9 100644 --- a/tests/abis/Makefile.am +++ b/tests/abis/Makefile.am @@ -27,7 +27,6 @@ abis_test_LDADD = \ $(top_builddir)/src/osmo-bsc/abis_nm.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOABIS_LIBS) \ diff --git a/tests/bsc/Makefile.am b/tests/bsc/Makefile.am index c8ad0e4..b301f9e 100644 --- a/tests/bsc/Makefile.am +++ b/tests/bsc/Makefile.am @@ -38,7 +38,6 @@ $(top_builddir)/src/osmo-bsc/osmo_bsc_filter.o \ $(top_builddir)/src/osmo-bsc/bsc_subscriber.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/handover_cfg.o \ $(top_builddir)/src/osmo-bsc/handover_logic.o \ $(top_builddir)/src/osmo-bsc/neighbor_ident.o \ diff --git a/tests/gsm0408/Makefile.am b/tests/gsm0408/Makefile.am index b207f8b..aff7c7d 100644 --- a/tests/gsm0408/Makefile.am +++ b/tests/gsm0408/Makefile.am @@ -26,7 +26,6 @@ $(top_builddir)/src/osmo-bsc/gsm_04_08_rr.o \ $(top_builddir)/src/osmo-bsc/arfcn_range_encode.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(top_builddir)/src/osmo-bsc/rest_octets.o \ $(top_builddir)/src/osmo-bsc/system_information.o \ diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 5e4440c..40ecf54 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -55,7 +55,6 @@ $(top_builddir)/src/osmo-bsc/gsm_04_08_rr.o \ $(top_builddir)/src/osmo-bsc/gsm_04_80_utils.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/handover_cfg.o \ $(top_builddir)/src/osmo-bsc/handover_decision.o \ $(top_builddir)/src/osmo-bsc/handover_decision_2.o \ diff --git a/tests/nanobts_omlattr/Makefile.am b/tests/nanobts_omlattr/Makefile.am index 312cf7d..aa7045e 100644 --- a/tests/nanobts_omlattr/Makefile.am +++ b/tests/nanobts_omlattr/Makefile.am @@ -26,7 +26,6 @@ $(top_builddir)/src/osmo-bsc/abis_nm.o \ $(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ - $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOABIS_LIBS) \ diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c index 38729ac..65eb055 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -21,7 +21,6 @@ #include #include -#include #include #include @@ -192,9 +191,9 @@ .num_cat = ARRAY_SIZE(log_categories), }; -static struct T_def gsm_network_T_defs[] = { - { .T=3105, .default_val=100, .val=13, .unit=T_MS, .desc="Physical Information" }, - { .T=3212, .default_val=5, .unit=T_CUSTOM, +static struct osmo_tdef gsm_network_T_defs[] = { + { .T=3105, .default_val=100, .val=13, .unit=OSMO_TDEF_MS, .desc="Physical Information" }, + { .T=3212, .default_val=5, .unit=OSMO_TDEF_CUSTOM, .desc="Periodic Location Update timer, sent to MS (1 = 6 minutes)" }, {} }; -- To view, visit https://gerrit.osmocom.org/13795 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I66674a5d8403d820038762888c846bae10ceac58 Gerrit-Change-Number: 13795 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 07:17:40 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 07:17:40 +0000 Subject: Change in osmo-bsc[master]: move mgw endpoint FSM to osmo-mgw.git In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13796 ) Change subject: move mgw endpoint FSM to osmo-mgw.git ...................................................................... move mgw endpoint FSM to osmo-mgw.git osmo-mgw.git also includes fixes of the MGW endpoint FSM, for example I92a9944acc96398acd6649f9c3c5badec5dd6dcc. Depends: I9a3effd38e72841529df6c135c077116981dea36 (osmo-mgw) Change-Id: I03e6b48d9b0a5370310d5f56809259ff7909cf9d --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/bsc_subscr_conn_fsm.h M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/lchan_rtp_fsm.h D include/osmocom/bsc/mgw_endpoint_fsm.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/codec_pref.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c M src/osmo-bsc/lchan_rtp_fsm.c D src/osmo-bsc/mgw_endpoint_fsm.c M src/osmo-bsc/net_init.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_lcls.c M src/osmo-bsc/osmo_bsc_main.c M tests/handover/Makefile.am M tests/handover/handover_test.c 20 files changed, 187 insertions(+), 939 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 21e53d7..89323c0 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -33,7 +33,6 @@ meas_feed.h \ meas_rep.h \ misdn.h \ - mgw_endpoint_fsm.h \ neighbor_ident.h \ network_listen.h \ openbscdefines.h \ diff --git a/include/osmocom/bsc/bsc_subscr_conn_fsm.h b/include/osmocom/bsc/bsc_subscr_conn_fsm.h index f5ed7bd..5475272 100644 --- a/include/osmocom/bsc/bsc_subscr_conn_fsm.h +++ b/include/osmocom/bsc/bsc_subscr_conn_fsm.h @@ -43,7 +43,7 @@ struct gsm_subscriber_connection; struct gsm_network; struct msgb; -struct mgwep_ci; +struct osmo_mgcpc_ep_ci; struct assignment_request; struct gsm_lchan; @@ -57,15 +57,15 @@ struct msgb *msg, int link_id, int allow_sacch); int gscon_sigtran_send(struct gsm_subscriber_connection *conn, struct msgb *msg); -struct mgw_endpoint *gscon_ensure_mgw_endpoint(struct gsm_subscriber_connection *conn, - uint16_t msc_assigned_cic); +struct osmo_mgcpc_ep *gscon_ensure_mgw_endpoint(struct gsm_subscriber_connection *conn, + uint16_t msc_assigned_cic); bool gscon_connect_mgw_to_msc(struct gsm_subscriber_connection *conn, struct gsm_lchan *for_lchan, const char *addr, uint16_t port, struct osmo_fsm_inst *notify, uint32_t event_success, uint32_t event_failure, void *notify_data, - struct mgwep_ci **created_ci); + struct osmo_mgcpc_ep_ci **created_ci); void gscon_start_assignment(struct gsm_subscriber_connection *conn, struct assignment_request *req); @@ -76,7 +76,7 @@ void gscon_lchan_releasing(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan); void gscon_forget_lchan(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan); -void gscon_forget_mgw_endpoint_ci(struct gsm_subscriber_connection *conn, struct mgwep_ci *ci); +void gscon_forget_mgw_endpoint_ci(struct gsm_subscriber_connection *conn, struct osmo_mgcpc_ep_ci *ci); bool gscon_is_aoip(struct gsm_subscriber_connection *conn); bool gscon_is_sccplite(struct gsm_subscriber_connection *conn); diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 7b813a6..dacc63b 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -39,7 +39,7 @@ struct mgcp_client_conf; struct mgcp_client; struct gsm0808_cell_id; -struct mgw_endpoint; +struct osmo_mgcpc_ep; /** annotations for msgb ownership */ #define __uses @@ -136,7 +136,7 @@ /* Whether this assignment triggered creation of the MGW endpoint: if the assignment * fails, we will release that again as soon as possible. (If false, the endpoint already * existed before or isn't needed at all.)*/ - struct mgwep_ci *created_ci_for_msc; + struct osmo_mgcpc_ep_ci *created_ci_for_msc; enum gsm0808_cause failure_cause; enum gsm48_rr_cause rr_cause; @@ -205,7 +205,7 @@ struct gsm_lchan *new_lchan; bool async; struct handover_in_req inter_bsc_in; - struct mgwep_ci *created_ci_for_msc; + struct osmo_mgcpc_ep_ci *created_ci_for_msc; }; /* active radio connection of a mobile subscriber */ @@ -287,11 +287,11 @@ /* The endpoint at the MGW used to join both BTS and MSC side connections, e.g. * "rtpbridge/23 at mgw". */ - struct mgw_endpoint *mgw_endpoint; + struct osmo_mgcpc_ep *mgw_endpoint; - /* The connection identifier of the mgw_endpoint used to transceive RTP towards the MSC. + /* The connection identifier of the osmo_mgcpc_ep used to transceive RTP towards the MSC. * (The BTS side CI is handled by struct gsm_lchan and the lchan_fsm.) */ - struct mgwep_ci *mgw_endpoint_ci_msc; + struct osmo_mgcpc_ep_ci *mgw_endpoint_ci_msc; } user_plane; /* LCLS (local call, local switch) related state */ @@ -554,7 +554,7 @@ struct osmo_fsm_inst *fi; struct osmo_fsm_inst *fi_rtp; - struct mgwep_ci *mgw_endpoint_ci_bts; + struct osmo_mgcpc_ep_ci *mgw_endpoint_ci_bts; struct { struct lchan_activate_info info; @@ -1535,6 +1535,7 @@ struct { struct mgcp_client_conf *conf; struct mgcp_client *client; + struct osmo_tdef *tdefs; } mgw; /* Remote BSS Cell Identifier Lists */ diff --git a/include/osmocom/bsc/lchan_rtp_fsm.h b/include/osmocom/bsc/lchan_rtp_fsm.h index fa0e746..6ff8fe3 100644 --- a/include/osmocom/bsc/lchan_rtp_fsm.h +++ b/include/osmocom/bsc/lchan_rtp_fsm.h @@ -10,6 +10,7 @@ } while(0) struct gsm_lchan; +struct mgcp_conn_peer; enum lchan_rtp_fsm_state { LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE, @@ -40,6 +41,8 @@ }; void lchan_rtp_fsm_start(struct gsm_lchan *lchan); -struct mgwep_ci *lchan_use_mgw_endpoint_ci_bts(struct gsm_lchan *lchan); +struct osmo_mgcpc_ep_ci *lchan_use_mgw_endpoint_ci_bts(struct gsm_lchan *lchan); bool lchan_rtp_established(struct gsm_lchan *lchan); void lchan_forget_mgw_endpoint(struct gsm_lchan *lchan); + +void mgcp_pick_codec(struct mgcp_conn_peer *verb_info, const struct gsm_lchan *lchan, bool bss_side); diff --git a/include/osmocom/bsc/mgw_endpoint_fsm.h b/include/osmocom/bsc/mgw_endpoint_fsm.h deleted file mode 100644 index f86a7cd..0000000 --- a/include/osmocom/bsc/mgw_endpoint_fsm.h +++ /dev/null @@ -1,59 +0,0 @@ -/* osmo-bsc API to manage all sides of an MGW endpoint */ -#pragma once - -#include - -#include - -/* This macro automatically includes a final \n, if omitted. */ -#define LOG_MGWEP(mgwep, level, fmt, args...) do { \ - LOGPFSML(mgwep->fi, level, "(%s) " fmt, \ - mgw_endpoint_name(mgwep), ## args); \ - } while(0) - -enum mgwep_fsm_state { - MGWEP_ST_UNUSED, - MGWEP_ST_WAIT_MGW_RESPONSE, - MGWEP_ST_IN_USE, -}; - -enum mgwep_fsm_event { - _MGWEP_EV_LAST, - /* and MGW response events are allocated dynamically */ -}; - -struct mgw_endpoint; -struct mgwep_ci; -struct osmo_tdef; - -void mgw_endpoint_fsm_init(struct osmo_tdef *T_defs); - -struct mgw_endpoint *mgw_endpoint_alloc(struct osmo_fsm_inst *parent, uint32_t parent_term_event, - struct mgcp_client *mgcp_client, - const char *fsm_id, - const char *endpoint_str_fmt, ...); - -struct mgwep_ci *mgw_endpoint_ci_add(struct mgw_endpoint *mgwep, - const char *label_fmt, ...); -const struct mgcp_conn_peer *mgwep_ci_get_rtp_info(const struct mgwep_ci *ci); -bool mgwep_ci_get_crcx_info_to_sockaddr(const struct mgwep_ci *ci, struct sockaddr_storage *dest); - -void mgw_endpoint_ci_request(struct mgwep_ci *ci, - enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info, - struct osmo_fsm_inst *notify, - uint32_t event_success, uint32_t event_failure, - void *notify_data); - -static inline void mgw_endpoint_ci_dlcx(struct mgwep_ci *ci) -{ - mgw_endpoint_ci_request(ci, MGCP_VERB_DLCX, NULL, NULL, 0, 0, NULL); -} - -void mgw_endpoint_clear(struct mgw_endpoint *mgwep); - -const char *mgw_endpoint_name(const struct mgw_endpoint *mgwep); -const char *mgwep_ci_name(const struct mgwep_ci *ci); -const char *mgcp_conn_peer_name(const struct mgcp_conn_peer *info); - -enum mgcp_codecs chan_mode_to_mgcp_codec(enum gsm48_chan_mode chan_mode, bool full_rate); -void mgcp_pick_codec(struct mgcp_conn_peer *verb_info, const struct gsm_lchan *lchan, bool bss_side); diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index 11803da..e88e614 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -68,7 +68,6 @@ lchan_select.c \ meas_feed.c \ meas_rep.c \ - mgw_endpoint_fsm.c \ neighbor_ident.c \ neighbor_ident_vty.c \ net_init.c \ diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index 520498f..fdfc080 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -23,12 +23,11 @@ #include #include -#include +#include #include #include #include -#include #include #include #include @@ -105,7 +104,7 @@ gscon_forget_mgw_endpoint_ci(conn, conn->assignment.created_ci_for_msc); /* If this is the last endpoint released, the mgw_endpoint_fsm will terminate and tell * the gscon about it. */ - mgw_endpoint_ci_dlcx(conn->assignment.created_ci_for_msc); + osmo_mgcpc_ep_ci_dlcx(conn->assignment.created_ci_for_msc); } conn->assignment = (struct assignment_fsm_data){ @@ -156,8 +155,8 @@ perm_spch = gsm0808_permitted_speech(lchan->type, lchan->tch_mode); if (gscon_is_aoip(conn)) { - if (!mgwep_ci_get_crcx_info_to_sockaddr(conn->user_plane.mgw_endpoint_ci_msc, - &addr_local)) { + if (!osmo_mgcpc_ep_ci_get_crcx_info_to_sockaddr(conn->user_plane.mgw_endpoint_ci_msc, + &addr_local)) { assignment_fail(GSM0808_CAUSE_EQUIPMENT_FAILURE, "Unable to compose RTP address of MGW -> MSC"); return; @@ -626,7 +625,7 @@ /* For AoIP, we created the MGW endpoint. Ensure it is really there, and log it. */ if (gscon_is_aoip(conn)) { const struct mgcp_conn_peer *mgw_info; - mgw_info = mgwep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); + mgw_info = osmo_mgcpc_ep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); if (!mgw_info) { assignment_fail(GSM0808_CAUSE_EQUIPMENT_FAILURE, "Unable to retrieve RTP port info allocated by MGW for" diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 4466404..f944431 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -39,9 +39,9 @@ #include #include #include -#include #include -#include +#include +#include #include #define S(x) (1 << (x)) @@ -457,8 +457,8 @@ /* Make sure a conn->user_plane.mgw_endpoint is allocated with the proper mgw endpoint name. For * SCCPlite, pass in msc_assigned_cic the CIC received upon BSSMAP Assignment Command or BSSMAP Handover * Request form the MSC (which is only stored in conn->user_plane after success). Ignored for AoIP. */ -struct mgw_endpoint *gscon_ensure_mgw_endpoint(struct gsm_subscriber_connection *conn, - uint16_t msc_assigned_cic) +struct osmo_mgcpc_ep *gscon_ensure_mgw_endpoint(struct gsm_subscriber_connection *conn, + uint16_t msc_assigned_cic) { if (conn->user_plane.mgw_endpoint) return conn->user_plane.mgw_endpoint; @@ -466,19 +466,23 @@ if (gscon_is_sccplite(conn)) { /* derive endpoint name from CIC on A interface side */ conn->user_plane.mgw_endpoint = - mgw_endpoint_alloc(conn->fi, GSCON_EV_FORGET_MGW_ENDPOINT, - conn->network->mgw.client, conn->fi->id, - "%x@%s", msc_assigned_cic, - mgcp_client_endpoint_domain(conn->network->mgw.client)); + osmo_mgcpc_ep_alloc(conn->fi, GSCON_EV_FORGET_MGW_ENDPOINT, + conn->network->mgw.client, + conn->network->mgw.tdefs, + conn->fi->id, + "%x@%s", msc_assigned_cic, + mgcp_client_endpoint_domain(conn->network->mgw.client)); LOGPFSML(conn->fi, LOGL_DEBUG, "MGW endpoint name derived from CIC 0x%x: %s\n", - msc_assigned_cic, mgw_endpoint_name(conn->user_plane.mgw_endpoint)); + msc_assigned_cic, osmo_mgcpc_ep_name(conn->user_plane.mgw_endpoint)); } else if (gscon_is_aoip(conn)) { /* use dynamic RTPBRIDGE endpoint allocation in MGW */ conn->user_plane.mgw_endpoint = - mgw_endpoint_alloc(conn->fi, GSCON_EV_FORGET_MGW_ENDPOINT, - conn->network->mgw.client, conn->fi->id, - "%s", mgcp_client_rtpbridge_wildcard(conn->network->mgw.client)); + osmo_mgcpc_ep_alloc(conn->fi, GSCON_EV_FORGET_MGW_ENDPOINT, + conn->network->mgw.client, + conn->network->mgw.tdefs, + conn->fi->id, + "%s", mgcp_client_rtpbridge_wildcard(conn->network->mgw.client)); } else { LOGPFSML(conn->fi, LOGL_ERROR, "Conn is neither SCCPlite nor AoIP!?\n"); return NULL; @@ -493,10 +497,10 @@ struct osmo_fsm_inst *notify, uint32_t event_success, uint32_t event_failure, void *notify_data, - struct mgwep_ci **created_ci) + struct osmo_mgcpc_ep_ci **created_ci) { int rc; - struct mgwep_ci *ci; + struct osmo_mgcpc_ep_ci *ci; struct mgcp_conn_peer mgw_info; enum mgcp_verb verb; @@ -526,7 +530,7 @@ ci = conn->user_plane.mgw_endpoint_ci_msc; if (ci) { - const struct mgcp_conn_peer *prev_crcx_info = mgwep_ci_get_rtp_info(ci); + const struct mgcp_conn_peer *prev_crcx_info = osmo_mgcpc_ep_ci_get_rtp_info(ci); if (!conn->user_plane.mgw_endpoint) { LOGPFSML(conn->fi, LOGL_ERROR, "Internal error: conn has a CI but no endoint\n"); @@ -536,14 +540,14 @@ if (!prev_crcx_info) { LOGPFSML(conn->fi, LOGL_ERROR, "There already is an MGW connection for the MSC side," " but it seems to be broken. Will not CRCX another one (%s)\n", - mgwep_ci_name(ci)); + osmo_mgcpc_ep_ci_name(ci)); return false; } if (same_mgw_info(&mgw_info, prev_crcx_info)) { LOGPFSML(conn->fi, LOGL_DEBUG, "MSC side MGW endpoint ci is already configured to %s\n", - mgwep_ci_name(ci)); + osmo_mgcpc_ep_ci_name(ci)); return true; } @@ -559,7 +563,7 @@ } if (!ci) { - ci = mgw_endpoint_ci_add(conn->user_plane.mgw_endpoint, "to-MSC"); + ci = osmo_mgcpc_ep_ci_add(conn->user_plane.mgw_endpoint, "to-MSC"); if (created_ci) *created_ci = ci; conn->user_plane.mgw_endpoint_ci_msc = ci; @@ -569,7 +573,7 @@ return false; } - mgw_endpoint_ci_request(ci, verb, &mgw_info, notify, event_success, event_failure, notify_data); + osmo_mgcpc_ep_ci_request(ci, verb, &mgw_info, notify, event_success, event_failure, notify_data); return true; } @@ -705,7 +709,7 @@ lchan_forget_mgw_endpoint(conn->ho.new_lchan); } -void gscon_forget_mgw_endpoint_ci(struct gsm_subscriber_connection *conn, struct mgwep_ci *ci) +void gscon_forget_mgw_endpoint_ci(struct gsm_subscriber_connection *conn, struct osmo_mgcpc_ep_ci *ci) { if (conn->ho.created_ci_for_msc == ci) conn->ho.created_ci_for_msc = NULL; @@ -734,7 +738,7 @@ * CLEAR COMPLETE message" */ /* Close MGCP connections */ - mgw_endpoint_clear(conn->user_plane.mgw_endpoint); + osmo_mgcpc_ep_clear(conn->user_plane.mgw_endpoint); gscon_sigtran_send(conn, gsm0808_create_clear_complete()); break; @@ -794,7 +798,7 @@ { struct gsm_subscriber_connection *conn = fi->priv; - mgw_endpoint_clear(conn->user_plane.mgw_endpoint); + osmo_mgcpc_ep_clear(conn->user_plane.mgw_endpoint); if (conn->lcls.fi) { /* request termination of LCLS FSM */ diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 3a6ddd4..dc97d12 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -70,7 +70,7 @@ #include #include #include -#include +#include #include @@ -1584,7 +1584,7 @@ { vty_out(vty, "conn ID=%u, MSC=%u, hodec2_fail=%d, mgw_ep=%s%s", conn->sccp.conn_id, conn->sccp.msc->nr, conn->hodec2.failures, - mgw_endpoint_name(conn->user_plane.mgw_endpoint), VTY_NEWLINE); + osmo_mgcpc_ep_name(conn->user_plane.mgw_endpoint), VTY_NEWLINE); if (conn->lcls.global_call_ref_len) { vty_out(vty, " LCLS GCR: %s%s", osmo_hexdump_nospc(conn->lcls.global_call_ref, conn->lcls.global_call_ref_len), diff --git a/src/osmo-bsc/codec_pref.c b/src/osmo-bsc/codec_pref.c index 412ed9a..3e06114 100644 --- a/src/osmo-bsc/codec_pref.c +++ b/src/osmo-bsc/codec_pref.c @@ -20,6 +20,8 @@ */ #include +#include +#include #include #include #include diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index fe3b8b2..0d1449f 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -25,6 +25,8 @@ #include #include +#include + #include #include @@ -38,7 +40,6 @@ #include #include #include -#include #include #include @@ -240,7 +241,7 @@ static void handover_reset(struct gsm_subscriber_connection *conn) { - struct mgwep_ci *ci; + struct osmo_mgcpc_ep_ci *ci; if (conn->ho.new_lchan) /* New lchan was activated but never passed to a conn */ lchan_release(conn->ho.new_lchan, false, true, RSL_ERR_EQUIPMENT_FAIL); @@ -250,7 +251,7 @@ gscon_forget_mgw_endpoint_ci(conn, ci); /* If this is the last endpoint released, the mgw_endpoint_fsm will terminate and tell * the gscon about it. */ - mgw_endpoint_ci_dlcx(ci); + osmo_mgcpc_ep_ci_dlcx(ci); } conn->ho = (struct handover){ @@ -1074,7 +1075,7 @@ /* For AoIP, we created the MGW endpoint. Ensure it is really there, and log it. */ if (gscon_is_aoip(conn)) { const struct mgcp_conn_peer *mgw_info; - mgw_info = mgwep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); + mgw_info = osmo_mgcpc_ep_ci_get_rtp_info(conn->user_plane.mgw_endpoint_ci_msc); if (!mgw_info) { ho_fail(HO_RESULT_ERROR, "Unable to retrieve RTP port info allocated by MGW for" diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 33abb1f..f2fef99 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -24,11 +24,12 @@ #include #include +#include + #include #include #include #include -#include #include #include #include @@ -387,7 +388,7 @@ if (lchan->fi_rtp) osmo_fsm_inst_term(lchan->fi_rtp, OSMO_FSM_TERM_REQUEST, 0); if (lchan->mgw_endpoint_ci_bts) { - mgw_endpoint_ci_dlcx(lchan->mgw_endpoint_ci_bts); + osmo_mgcpc_ep_ci_dlcx(lchan->mgw_endpoint_ci_bts); lchan->mgw_endpoint_ci_bts = NULL; } @@ -507,7 +508,7 @@ struct gsm_lchan *lchan = lchan_fi_lchan(fi); struct gsm48_multi_rate_conf mr_conf; struct gsm_bts *bts = lchan->ts->trx->bts; - struct mgwep_ci *use_mgwep_ci; + struct osmo_mgcpc_ep_ci *use_mgwep_ci; struct gsm_lchan *old_lchan = lchan->activate.info.re_use_mgw_endpoint_from_lchan; struct lchan_activate_info *info = &lchan->activate.info; @@ -581,7 +582,7 @@ lchan_activate_mode_name(lchan->activate.info.activ_for), lchan->activate.info.requires_voice_stream ? "yes" : "no", lchan->activate.info.requires_voice_stream ? - (use_mgwep_ci ? mgwep_ci_name(use_mgwep_ci) : "new") + (use_mgwep_ci ? osmo_mgcpc_ep_ci_name(use_mgwep_ci) : "new") : "none", gsm_lchant_name(lchan->type), gsm48_chan_mode_name(lchan->tch_mode), diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c index 5e2d758..a5efa3d 100644 --- a/src/osmo-bsc/lchan_rtp_fsm.c +++ b/src/osmo-bsc/lchan_rtp_fsm.c @@ -21,11 +21,12 @@ */ #include +#include +#include #include #include #include -#include #include #include #include @@ -120,7 +121,7 @@ /* While activating an lchan, for example for Handover, we may want to re-use another lchan's MGW * endpoint CI. If Handover fails half way, the old lchan must keep its MGW endpoint CI, and we must not * clean it up. Hence keep another lchan's mgw_endpoint_ci_bts out of lchan until all is done. */ -struct mgwep_ci *lchan_use_mgw_endpoint_ci_bts(struct gsm_lchan *lchan) +struct osmo_mgcpc_ep_ci *lchan_use_mgw_endpoint_ci_bts(struct gsm_lchan *lchan) { if (lchan->mgw_endpoint_ci_bts) return lchan->mgw_endpoint_ci_bts; @@ -135,13 +136,13 @@ uint32_t prev_state) { struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); - struct mgw_endpoint *mgwep; - struct mgwep_ci *use_mgwep_ci = lchan_use_mgw_endpoint_ci_bts(lchan); + struct osmo_mgcpc_ep *mgwep; + struct osmo_mgcpc_ep_ci *use_mgwep_ci = lchan_use_mgw_endpoint_ci_bts(lchan); struct mgcp_conn_peer crcx_info = {}; if (use_mgwep_ci) { LOG_LCHAN_RTP(lchan, LOGL_DEBUG, "MGW endpoint already available: %s\n", - mgwep_ci_name(use_mgwep_ci)); + osmo_mgcpc_ep_ci_name(use_mgwep_ci)); lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_LCHAN_READY); return; } @@ -152,7 +153,7 @@ return; } - lchan->mgw_endpoint_ci_bts = mgw_endpoint_ci_add(mgwep, "to-BTS"); + lchan->mgw_endpoint_ci_bts = osmo_mgcpc_ep_ci_add(mgwep, "to-BTS"); if (lchan->conn) { crcx_info.call_id = lchan->conn->sccp.conn_id; @@ -162,7 +163,7 @@ crcx_info.ptime = 20; mgcp_pick_codec(&crcx_info, lchan, true); - mgw_endpoint_ci_request(lchan->mgw_endpoint_ci_bts, MGCP_VERB_CRCX, &crcx_info, + osmo_mgcpc_ep_ci_request(lchan->mgw_endpoint_ci_bts, MGCP_VERB_CRCX, &crcx_info, fi, LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE, LCHAN_RTP_EV_MGW_ENDPOINT_ERROR, 0); } @@ -174,7 +175,7 @@ case LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE: LOG_LCHAN_RTP(lchan, LOGL_DEBUG, "MGW endpoint: %s\n", - mgwep_ci_name(lchan_use_mgw_endpoint_ci_bts(lchan))); + osmo_mgcpc_ep_ci_name(lchan_use_mgw_endpoint_ci_bts(lchan))); lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_LCHAN_READY); return; @@ -328,7 +329,7 @@ return; } - mgw_rtp = mgwep_ci_get_rtp_info(lchan_use_mgw_endpoint_ci_bts(lchan)); + mgw_rtp = osmo_mgcpc_ep_ci_get_rtp_info(lchan_use_mgw_endpoint_ci_bts(lchan)); if (!mgw_rtp) { lchan_rtp_fail("Cannot send IPACC MDCX to BTS:" @@ -396,7 +397,7 @@ } static void connect_mgw_endpoint_to_lchan(struct osmo_fsm_inst *fi, - struct mgwep_ci *ci, + struct osmo_mgcpc_ep_ci *ci, struct gsm_lchan *to_lchan) { int rc; @@ -426,8 +427,8 @@ } LOG_LCHAN_RTP(lchan, LOGL_DEBUG, "Sending BTS side RTP port info %s:%u to MGW %s\n", - mdcx_info.addr, mdcx_info.port, mgwep_ci_name(ci)); - mgw_endpoint_ci_request(ci, MGCP_VERB_MDCX, &mdcx_info, + mdcx_info.addr, mdcx_info.port, osmo_mgcpc_ep_ci_name(ci)); + osmo_mgcpc_ep_ci_request(ci, MGCP_VERB_MDCX, &mdcx_info, fi, LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED, LCHAN_RTP_EV_MGW_ENDPOINT_ERROR, 0); } @@ -539,7 +540,7 @@ LOG_LCHAN_RTP(lchan, LOGL_ERROR, "Error while connecting the MGW back to the old lchan's RTP port:" " %s %s\n", - mgwep_ci_name(lchan->mgw_endpoint_ci_bts), + osmo_mgcpc_ep_ci_name(lchan->mgw_endpoint_ci_bts), gsm_lchan_name(old_lchan)); osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, 0); return; @@ -575,7 +576,7 @@ case LCHAN_RTP_EV_IPACC_MDCX_ACK: LOG_LCHAN_RTP(lchan, LOGL_NOTICE, "Received MDCX ACK on established lchan's RTP port: %s\n", - mgwep_ci_name(lchan->mgw_endpoint_ci_bts)); + osmo_mgcpc_ep_ci_name(lchan->mgw_endpoint_ci_bts)); return; default: OSMO_ASSERT(false); @@ -740,7 +741,7 @@ { struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); if (lchan->mgw_endpoint_ci_bts) { - mgw_endpoint_ci_dlcx(lchan->mgw_endpoint_ci_bts); + osmo_mgcpc_ep_ci_dlcx(lchan->mgw_endpoint_ci_bts); lchan->mgw_endpoint_ci_bts = NULL; } lchan->fi_rtp = NULL; @@ -769,3 +770,86 @@ .timer_cb = lchan_rtp_fsm_timer_cb, .cleanup = lchan_rtp_fsm_cleanup, }; + +/* Depending on the channel mode and rate, return the codec type that is signalled towards the MGW. */ +static enum mgcp_codecs chan_mode_to_mgcp_codec(enum gsm48_chan_mode chan_mode, bool full_rate) +{ + switch (chan_mode) { + case GSM48_CMODE_SPEECH_V1: + if (full_rate) + return CODEC_GSM_8000_1; + return CODEC_GSMHR_8000_1; + + case GSM48_CMODE_SPEECH_EFR: + return CODEC_GSMEFR_8000_1; + + case GSM48_CMODE_SPEECH_AMR: + return CODEC_AMR_8000_1; + + default: + return -1; + } +} + +static int chan_mode_to_mgcp_bss_pt(enum mgcp_codecs codec) +{ + switch (codec) { + case CODEC_GSMHR_8000_1: + return RTP_PT_GSM_HALF; + + case CODEC_GSMEFR_8000_1: + return RTP_PT_GSM_EFR; + + case CODEC_AMR_8000_1: + return RTP_PT_AMR; + + default: + /* Not an error, we just leave it to libosmo-mgcp-client to + * decide over the PT. */ + return -1; + } +} + +void mgcp_pick_codec(struct mgcp_conn_peer *verb_info, const struct gsm_lchan *lchan, bool bss_side) +{ + enum mgcp_codecs codec = chan_mode_to_mgcp_codec(lchan->tch_mode, + lchan->type == GSM_LCHAN_TCH_H? false : true); + int custom_pt; + + if (codec < 0) { + LOG_LCHAN(lchan, LOGL_ERROR, + "Unable to determine MGCP codec type for %s in chan-mode %s\n", + gsm_lchant_name(lchan->type), gsm48_chan_mode_name(lchan->tch_mode)); + verb_info->codecs_len = 0; + return; + } + + verb_info->codecs[0] = codec; + verb_info->codecs_len = 1; + + /* Setup custom payload types (only for BSS side and when required) */ + custom_pt = chan_mode_to_mgcp_bss_pt(codec); + if (bss_side && custom_pt > 0) { + verb_info->ptmap[0].codec = codec; + verb_info->ptmap[0].pt = custom_pt; + verb_info->ptmap_len = 1; + } + + /* AMR requires additional parameters to be set up (framing mode) */ + if (verb_info->codecs[0] == CODEC_AMR_8000_1) { + verb_info->param_present = true; + verb_info->param.amr_octet_aligned_present = true; + } + + if (bss_side && verb_info->codecs[0] == CODEC_AMR_8000_1) { + /* FIXME: At the moment all BTSs we support are using the + * octet-aligned payload format. However, in the future + * we may support BTSs that are using bandwith-efficient + * format. In this case we will have to add functionality + * that distinguishes by the BTS model which mode to use. */ + verb_info->param.amr_octet_aligned = true; + } + else if (!bss_side && verb_info->codecs[0] == CODEC_AMR_8000_1) { + verb_info->param.amr_octet_aligned = lchan->conn->sccp.msc->amr_octet_aligned; + } +} diff --git a/src/osmo-bsc/mgw_endpoint_fsm.c b/src/osmo-bsc/mgw_endpoint_fsm.c deleted file mode 100644 index fa65166..0000000 --- a/src/osmo-bsc/mgw_endpoint_fsm.c +++ /dev/null @@ -1,795 +0,0 @@ -/* osmo-bsc API to manage all sides of an MGW endpoint - * - * (C) 2018 by sysmocom - s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include - -#define LOG_CI(ci, level, fmt, args...) do { \ - if (!ci || !ci->mgwep) \ - LOGP(DLGLOBAL, level, "(unknown MGW endpoint) " fmt, ## args); \ - else \ - LOG_MGWEP(ci->mgwep, level, "CI[%d] %s%s%s: " fmt, \ - (int)(ci - ci->mgwep->ci), \ - ci->label ? : "-", \ - ci->mgcp_ci_str[0] ? " CI=" : "", \ - ci->mgcp_ci_str[0] ? ci->mgcp_ci_str : "", \ - ## args); \ - } while(0) - -#define LOG_CI_VERB(ci, level, fmt, args...) do { \ - if (ci->verb_info.addr) \ - LOG_CI(ci, level, "%s %s:%u: " fmt, \ - mgcp_verb_name(ci->verb), ci->verb_info.addr, ci->verb_info.port, \ - ## args); \ - else \ - LOG_CI(ci, level, "%s: " fmt, \ - mgcp_verb_name(ci->verb), \ - ## args); \ - } while(0) - -#define FIRST_CI_EVENT (_MGWEP_EV_LAST + (_MGWEP_EV_LAST & 1)) /* rounded up to even nr */ -#define USABLE_CI ((32 - FIRST_CI_EVENT)/2) -#define EV_TO_CI_IDX(event) ((event - FIRST_CI_EVENT) / 2) - -#define CI_EV_SUCCESS(ci) (FIRST_CI_EVENT + (((ci) - ci->mgwep->ci) * 2)) -#define CI_EV_FAILURE(ci) (CI_EV_SUCCESS(ci) + 1) - -static struct osmo_fsm mgwep_fsm; - -struct mgwep_ci { - struct mgw_endpoint *mgwep; - - bool occupied; - char label[64]; - struct osmo_fsm_inst *mgcp_client_fi; - - bool pending; - bool sent; - enum mgcp_verb verb; - struct mgcp_conn_peer verb_info; - struct osmo_fsm_inst *notify; - uint32_t notify_success; - uint32_t notify_failure; - void *notify_data; - - bool got_port_info; - struct mgcp_conn_peer rtp_info; - char mgcp_ci_str[MGCP_CONN_ID_LENGTH]; -}; - -struct mgw_endpoint { - struct mgcp_client *mgcp_client; - struct osmo_fsm_inst *fi; - char endpoint[MGCP_ENDPOINT_MAXLEN]; - - struct mgwep_ci ci[USABLE_CI]; -}; - -static const struct value_string mgcp_verb_names[] = { - { MGCP_VERB_CRCX, "CRCX" }, - { MGCP_VERB_MDCX, "MDCX" }, - { MGCP_VERB_DLCX, "DLCX" }, - { MGCP_VERB_AUEP, "AUEP" }, - { MGCP_VERB_RSIP, "RSIP" }, - {} -}; - -static inline const char *mgcp_verb_name(enum mgcp_verb val) -{ return get_value_string(mgcp_verb_names, val); } - -static struct mgwep_ci *mgwep_check_ci(struct mgwep_ci *ci) -{ - if (!ci) - return NULL; - if (!ci->mgwep) - return NULL; - if (ci < ci->mgwep->ci || ci >= &ci->mgwep->ci[USABLE_CI]) - return NULL; - return ci; -} - -static struct mgwep_ci *mgwep_ci_for_event(struct mgw_endpoint *mgwep, uint32_t event) -{ - int idx; - if (event < FIRST_CI_EVENT) - return NULL; - idx = EV_TO_CI_IDX(event); - if (idx >= sizeof(mgwep->ci)) - return NULL; - return mgwep_check_ci(&mgwep->ci[idx]); -} - -const char *mgw_endpoint_name(const struct mgw_endpoint *mgwep) -{ - if (!mgwep) - return "NULL"; - if (mgwep->endpoint[0]) - return mgwep->endpoint; - return osmo_fsm_inst_name(mgwep->fi); -} - -const char *mgcp_conn_peer_name(const struct mgcp_conn_peer *info) -{ - /* I'd be fine with a smaller buffer and accept truncation, but gcc possibly refuses to build if - * this buffer is too small. */ - static char buf[1024]; - - if (!info) - return "NULL"; - - if (info->endpoint[0] - && info->addr[0]) - snprintf(buf, sizeof(buf), "%s:%s:%u", - info->endpoint, info->addr, info->port); - else if (info->endpoint[0]) - snprintf(buf, sizeof(buf), "%s", info->endpoint); - else if (info->addr[0]) - snprintf(buf, sizeof(buf), "%s:%u", info->addr, info->port); - else - return "empty"; - return buf; -} - -const char *mgwep_ci_name(const struct mgwep_ci *ci) -{ - const struct mgcp_conn_peer *rtp_info; - - if (!ci) - return "NULL"; - - rtp_info = mgwep_ci_get_rtp_info(ci); - - if (rtp_info) - return mgcp_conn_peer_name(rtp_info); - return mgw_endpoint_name(ci->mgwep); -} - -static struct value_string mgwep_fsm_event_names[33] = {}; - -static char mgwep_fsm_event_name_bufs[32][32] = {}; - -static void fill_event_names() -{ - int i; - for (i = 0; i < (ARRAY_SIZE(mgwep_fsm_event_names) - 1); i++) { - if (i < _MGWEP_EV_LAST) - continue; - if (i < FIRST_CI_EVENT || EV_TO_CI_IDX(i) > USABLE_CI) { - mgwep_fsm_event_names[i] = (struct value_string){i, "Unused"}; - continue; - } - snprintf(mgwep_fsm_event_name_bufs[i], sizeof(mgwep_fsm_event_name_bufs[i]), - "MGW Response for CI #%d", EV_TO_CI_IDX(i)); - mgwep_fsm_event_names[i] = (struct value_string){i, mgwep_fsm_event_name_bufs[i]}; - } -} - -static struct osmo_tdef *g_T_defs = NULL; - -void mgw_endpoint_fsm_init(struct osmo_tdef *T_defs) -{ - g_T_defs = T_defs; - OSMO_ASSERT(osmo_fsm_register(&mgwep_fsm) == 0); - fill_event_names(); -} - -struct mgw_endpoint *mgwep_fi_mgwep(struct osmo_fsm_inst *fi) -{ - OSMO_ASSERT(fi); - OSMO_ASSERT(fi->fsm == &mgwep_fsm); - OSMO_ASSERT(fi->priv); - return fi->priv; -} - -struct mgw_endpoint *mgw_endpoint_alloc(struct osmo_fsm_inst *parent, uint32_t parent_term_event, - struct mgcp_client *mgcp_client, - const char *fsm_id, - const char *endpoint_str_fmt, ...) -{ - va_list ap; - struct osmo_fsm_inst *fi; - struct mgw_endpoint *mgwep; - int rc; - - if (!mgcp_client) - return NULL; - - /* use mgcp_client as talloc ctx, so that the conn, lchan, ts can deallocate while MGCP DLCX are - * still going on. */ - fi = osmo_fsm_inst_alloc_child(&mgwep_fsm, parent, parent_term_event); - OSMO_ASSERT(fi); - - osmo_fsm_inst_update_id(fi, fsm_id); - - mgwep = talloc_zero(fi, struct mgw_endpoint); - OSMO_ASSERT(mgwep); - - mgwep->mgcp_client = mgcp_client; - mgwep->fi = fi; - mgwep->fi->priv = mgwep; - - va_start(ap, endpoint_str_fmt); - rc = vsnprintf(mgwep->endpoint, sizeof(mgwep->endpoint), endpoint_str_fmt, ap); - va_end(ap); - - if (rc <= 0 || rc >= sizeof(mgwep->endpoint)) { - LOG_MGWEP(mgwep, LOGL_ERROR, "Endpoint name too long or too short: %s\n", - mgwep->endpoint); - osmo_fsm_inst_term(mgwep->fi, OSMO_FSM_TERM_ERROR, 0); - return NULL; - } - - return mgwep; -} - -struct mgwep_ci *mgw_endpoint_ci_add(struct mgw_endpoint *mgwep, - const char *label_fmt, ...) -{ - va_list ap; - int i; - struct mgwep_ci *ci; - - for (i = 0; i < USABLE_CI; i++) { - ci = &mgwep->ci[i]; - - if (ci->occupied || ci->mgcp_client_fi) - continue; - - *ci = (struct mgwep_ci){ - .mgwep = mgwep, - .occupied = true, - }; - if (label_fmt) { - va_start(ap, label_fmt); - vsnprintf(ci->label, sizeof(ci->label), label_fmt, ap); - va_end(ap); - } - return ci; - } - - LOG_MGWEP(mgwep, LOGL_ERROR, - "Cannot allocate another endpoint, all " - OSMO_STRINGIFY_VAL(USABLE_CI) " are in use\n"); - - return NULL; -} - -static void mgwep_fsm_check_state_chg_after_response(struct osmo_fsm_inst *fi); - -static void on_failure(struct mgwep_ci *ci) -{ - if (!ci->occupied) - return; - - if (ci->notify) - osmo_fsm_inst_dispatch(ci->notify, ci->notify_failure, ci->notify_data); - - *ci = (struct mgwep_ci){ - .mgwep = ci->mgwep, - }; - - - mgwep_fsm_check_state_chg_after_response(ci->mgwep->fi); -} - -static void on_success(struct mgwep_ci *ci, void *data) -{ - struct mgcp_conn_peer *rtp_info; - - if (!ci->occupied) - return; - - ci->pending = false; - - switch (ci->verb) { - case MGCP_VERB_CRCX: - /* If we sent a wildcarded endpoint name on CRCX, we need to store the resulting endpoint - * name here. Also, we receive the MGW's RTP port information. */ - rtp_info = data; - OSMO_ASSERT(rtp_info); - ci->got_port_info = true; - ci->rtp_info = *rtp_info; - osmo_strlcpy(ci->mgcp_ci_str, mgcp_conn_get_ci(ci->mgcp_client_fi), - sizeof(ci->mgcp_ci_str)); - if (rtp_info->endpoint[0]) { - int rc; - rc = osmo_strlcpy(ci->mgwep->endpoint, rtp_info->endpoint, - sizeof(ci->mgwep->endpoint)); - if (rc <= 0 || rc >= sizeof(ci->mgwep->endpoint)) { - LOG_CI(ci, LOGL_ERROR, "Unable to copy endpoint name '%s'\n", - rtp_info->endpoint); - mgw_endpoint_ci_dlcx(ci); - on_failure(ci); - return; - } - } - break; - - default: - break; - } - - LOG_CI(ci, LOGL_DEBUG, "received successful response to %s RTP=%s%s\n", - mgcp_verb_name(ci->verb), - mgcp_conn_peer_name(ci->got_port_info? &ci->rtp_info : NULL), - ci->notify ? "" : " (not sending a notification)"); - - if (ci->notify) - osmo_fsm_inst_dispatch(ci->notify, ci->notify_success, ci->notify_data); - - mgwep_fsm_check_state_chg_after_response(ci->mgwep->fi); -} - -const struct mgcp_conn_peer *mgwep_ci_get_rtp_info(const struct mgwep_ci *ci) -{ - ci = mgwep_check_ci((struct mgwep_ci*)ci); - if (!ci) - return NULL; - if (!ci->got_port_info) - return NULL; - return &ci->rtp_info; -} - -bool mgwep_ci_get_crcx_info_to_sockaddr(const struct mgwep_ci *ci, struct sockaddr_storage *dest) -{ - const struct mgcp_conn_peer *rtp_info; - struct sockaddr_in *sin; - - rtp_info = mgwep_ci_get_rtp_info(ci); - if (!rtp_info) - return false; - - sin = (struct sockaddr_in *)dest; - - sin->sin_family = AF_INET; - sin->sin_addr.s_addr = inet_addr(rtp_info->addr); - sin->sin_port = osmo_ntohs(rtp_info->port); - return true; -} - - -static const struct osmo_tdef_state_timeout mgwep_fsm_timeouts[32] = { - [MGWEP_ST_WAIT_MGW_RESPONSE] = { .T=23042 }, -}; - -/* Transition to a state, using the T timer defined in assignment_fsm_timeouts. - * The actual timeout value is in turn obtained from g_T_defs. - * Assumes local variable fi exists. */ -#define mgwep_fsm_state_chg(state) \ - osmo_tdef_fsm_inst_state_chg(fi, state, mgwep_fsm_timeouts, g_T_defs, 5) - -void mgw_endpoint_ci_request(struct mgwep_ci *ci, - enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info, - struct osmo_fsm_inst *notify, - uint32_t event_success, uint32_t event_failure, - void *notify_data) -{ - struct mgw_endpoint *mgwep; - struct osmo_fsm_inst *fi; - struct mgwep_ci cleared_ci; - ci = mgwep_check_ci(ci); - - if (!ci) { - LOGP(DLGLOBAL, LOGL_ERROR, "Invalid MGW endpoint request: no ci\n"); - goto dispatch_error; - } - if (!verb_info && verb != MGCP_VERB_DLCX) { - LOG_CI(ci, LOGL_ERROR, "Invalid MGW endpoint request: missing verb details for %s\n", - mgcp_verb_name(verb)); - goto dispatch_error; - } - if ((verb < 0) || (verb > MGCP_VERB_RSIP)) { - LOG_CI(ci, LOGL_ERROR, "Invalid MGW endpoint request: unknown verb: %s\n", - mgcp_verb_name(verb)); - goto dispatch_error; - } - - mgwep = ci->mgwep; - fi = mgwep->fi; - - /* Clear volatile state by explicitly keeping those that should remain. Because we can't assign - * the char[] directly, dance through cleared_ci and copy back. */ - cleared_ci = (struct mgwep_ci){ - .mgwep = mgwep, - .mgcp_client_fi = ci->mgcp_client_fi, - .got_port_info = ci->got_port_info, - .rtp_info = ci->rtp_info, - - .occupied = true, - /* .pending = true follows below */ - .verb = verb, - .notify = notify, - .notify_success = event_success, - .notify_failure = event_failure, - .notify_data = notify_data, - }; - osmo_strlcpy(cleared_ci.label, ci->label, sizeof(cleared_ci.label)); - osmo_strlcpy(cleared_ci.mgcp_ci_str, ci->mgcp_ci_str, sizeof(cleared_ci.mgcp_ci_str)); - *ci = cleared_ci; - - LOG_CI_VERB(ci, LOGL_DEBUG, "notify=%s\n", osmo_fsm_inst_name(ci->notify)); - - if (verb_info) - ci->verb_info = *verb_info; - - if (mgwep->endpoint[0]) { - if (ci->verb_info.endpoint[0] && strcmp(ci->verb_info.endpoint, mgwep->endpoint)) - LOG_CI(ci, LOGL_ERROR, - "Warning: Requested %s on endpoint %s, but this CI is on endpoint %s." - " Using the proper endpoint instead.\n", - mgcp_verb_name(verb), ci->verb_info.endpoint, mgwep->endpoint); - osmo_strlcpy(ci->verb_info.endpoint, mgwep->endpoint, sizeof(ci->verb_info.endpoint)); - } - - switch (ci->verb) { - case MGCP_VERB_CRCX: - if (ci->mgcp_client_fi) { - LOG_CI(ci, LOGL_ERROR, "CRCX can be called only once per MGW endpoint CI\n"); - on_failure(ci); - return; - } - break; - - case MGCP_VERB_MDCX: - case MGCP_VERB_DLCX: - if (!ci->mgcp_client_fi) { - LOG_CI_VERB(ci, LOGL_ERROR, "The first verb on an unused MGW endpoint CI must be CRCX, not %s\n", - mgcp_verb_name(ci->verb)); - on_failure(ci); - return; - } - break; - - default: - LOG_CI(ci, LOGL_ERROR, "This verb is not supported: %s\n", mgcp_verb_name(ci->verb)); - on_failure(ci); - return; - } - - ci->pending = true; - - LOG_CI_VERB(ci, LOGL_DEBUG, "Scheduling\n"); - - if (mgwep->fi->state != MGWEP_ST_WAIT_MGW_RESPONSE) - mgwep_fsm_state_chg(MGWEP_ST_WAIT_MGW_RESPONSE); - - return; -dispatch_error: - if (notify) - osmo_fsm_inst_dispatch(notify, event_failure, notify_data); -} - -static int send_verb(struct mgwep_ci *ci) -{ - int rc; - struct mgw_endpoint *mgwep = ci->mgwep; - - if (!ci->occupied || !ci->pending || ci->sent) - return 0; - - switch (ci->verb) { - - case MGCP_VERB_CRCX: - OSMO_ASSERT(!ci->mgcp_client_fi); - LOG_CI_VERB(ci, LOGL_DEBUG, "Sending\n"); - ci->mgcp_client_fi = mgcp_conn_create(mgwep->mgcp_client, mgwep->fi, - CI_EV_FAILURE(ci), CI_EV_SUCCESS(ci), - &ci->verb_info); - ci->sent = true; - if (!ci->mgcp_client_fi){ - LOG_CI_VERB(ci, LOGL_ERROR, "Cannot send\n"); - on_failure(ci); - } - osmo_fsm_inst_update_id(ci->mgcp_client_fi, ci->label); - break; - - case MGCP_VERB_MDCX: - OSMO_ASSERT(ci->mgcp_client_fi); - LOG_CI_VERB(ci, LOGL_DEBUG, "Sending\n"); - rc = mgcp_conn_modify(ci->mgcp_client_fi, CI_EV_SUCCESS(ci), &ci->verb_info); - ci->sent = true; - if (rc) { - LOG_CI_VERB(ci, LOGL_ERROR, "Cannot send (rc=%d %s)\n", rc, strerror(-rc)); - on_failure(ci); - } - break; - - case MGCP_VERB_DLCX: - LOG_CI(ci, LOGL_DEBUG, "Sending MGCP: %s %s\n", - mgcp_verb_name(ci->verb), ci->mgcp_ci_str); - /* The way this is designed, we actually need to forget all about the ci right away. */ - mgcp_conn_delete(ci->mgcp_client_fi); - if (ci->notify) - osmo_fsm_inst_dispatch(ci->notify, ci->notify_success, ci->notify_data); - *ci = (struct mgwep_ci){ - .mgwep = mgwep, - }; - break; - - default: - OSMO_ASSERT(false); - } - - return 1; -} - -void mgw_endpoint_clear(struct mgw_endpoint *mgwep) -{ - if (!mgwep) - return; - osmo_fsm_inst_term(mgwep->fi, OSMO_FSM_TERM_REGULAR, 0); -} - -static void mgwep_count(struct mgw_endpoint *mgwep, int *occupied, int *pending_not_sent, - int *waiting_for_response) -{ - int i; - - if (occupied) - *occupied = 0; - - if (pending_not_sent) - *pending_not_sent = 0; - - if (waiting_for_response) - *waiting_for_response = 0; - - for (i = 0; i < ARRAY_SIZE(mgwep->ci); i++) { - struct mgwep_ci *ci = &mgwep->ci[i]; - if (ci->occupied) { - if (occupied) - (*occupied)++; - } else - continue; - - if (ci->pending) - LOG_CI_VERB(ci, LOGL_DEBUG, "%s\n", - ci->sent ? "waiting for response" : "waiting to be sent"); - else - LOG_CI_VERB(ci, LOGL_DEBUG, "%s\n", mgcp_conn_peer_name(mgwep_ci_get_rtp_info(ci))); - - if (ci->pending && ci->sent) - if (waiting_for_response) - (*waiting_for_response)++; - if (ci->pending && !ci->sent) - if (pending_not_sent) - (*pending_not_sent)++; - } -} - -static void mgwep_fsm_check_state_chg_after_response(struct osmo_fsm_inst *fi) -{ - int waiting_for_response; - int occupied; - struct mgw_endpoint *mgwep = mgwep_fi_mgwep(fi); - - mgwep_count(mgwep, &occupied, NULL, &waiting_for_response); - LOG_MGWEP(mgwep, LOGL_DEBUG, "CI in use: %d, waiting for response: %d\n", occupied, waiting_for_response); - - if (!occupied) { - /* All CI have been released. The endpoint no longer exists. Notify the parent FSM, by - * terminating. */ - osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, 0); - return; - } - - if (!waiting_for_response) { - if (fi->state != MGWEP_ST_IN_USE) - mgwep_fsm_state_chg(MGWEP_ST_IN_USE); - return; - } - -} - -static void mgwep_fsm_wait_mgw_response_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - int count = 0; - int i; - struct mgw_endpoint *mgwep = mgwep_fi_mgwep(fi); - - for (i = 0; i < ARRAY_SIZE(mgwep->ci); i++) { - count += send_verb(&mgwep->ci[i]); - } - - LOG_MGWEP(mgwep, LOGL_DEBUG, "Sent messages: %d\n", count); - mgwep_fsm_check_state_chg_after_response(fi); - -} - -static void mgwep_fsm_handle_ci_events(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - struct mgwep_ci *ci; - struct mgw_endpoint *mgwep = mgwep_fi_mgwep(fi); - ci = mgwep_ci_for_event(mgwep, event); - if (ci) { - if (event == CI_EV_SUCCESS(ci)) - on_success(ci, data); - else - on_failure(ci); - } -} - -static void mgwep_fsm_in_use_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - int pending_not_sent; - struct mgw_endpoint *mgwep = mgwep_fi_mgwep(fi); - - mgwep_count(mgwep, NULL, &pending_not_sent, NULL); - if (pending_not_sent) - mgwep_fsm_state_chg(MGWEP_ST_WAIT_MGW_RESPONSE); -} - -#define S(x) (1 << (x)) - -static const struct osmo_fsm_state mgwep_fsm_states[] = { - [MGWEP_ST_UNUSED] = { - .name = "UNUSED", - .in_event_mask = 0, - .out_state_mask = 0 - | S(MGWEP_ST_WAIT_MGW_RESPONSE) - , - }, - [MGWEP_ST_WAIT_MGW_RESPONSE] = { - .name = "WAIT_MGW_RESPONSE", - .onenter = mgwep_fsm_wait_mgw_response_onenter, - .action = mgwep_fsm_handle_ci_events, - .in_event_mask = 0xffffffff, - .out_state_mask = 0 - | S(MGWEP_ST_IN_USE) - , - }, - [MGWEP_ST_IN_USE] = { - .name = "IN_USE", - .onenter = mgwep_fsm_in_use_onenter, - .action = mgwep_fsm_handle_ci_events, - .in_event_mask = 0xffffffff, /* mgcp_client_fsm may send parent term anytime */ - .out_state_mask = 0 - | S(MGWEP_ST_WAIT_MGW_RESPONSE) - , - }, -}; - -static int mgwep_fsm_timer_cb(struct osmo_fsm_inst *fi) -{ - int i; - struct mgw_endpoint *mgwep = mgwep_fi_mgwep(fi); - - switch (fi->T) { - default: - for (i = 0; i < ARRAY_SIZE(mgwep->ci); i++) { - struct mgwep_ci *ci = &mgwep->ci[i]; - if (!ci->occupied) - continue; - if (!(ci->pending && ci->sent)) - continue; - on_failure(ci); - } - return 0; - } - - return 0; -} - -static struct osmo_fsm mgwep_fsm = { - .name = "mgw-endpoint", - .states = mgwep_fsm_states, - .num_states = ARRAY_SIZE(mgwep_fsm_states), - .log_subsys = DRSL, - .event_names = mgwep_fsm_event_names, - .timer_cb = mgwep_fsm_timer_cb, - /* The FSM termination will automatically trigger any mgcp_client_fsm instances to DLCX. */ -}; - -/* Depending on the channel mode and rate, return the codec type that is signalled towards the MGW. */ -enum mgcp_codecs chan_mode_to_mgcp_codec(enum gsm48_chan_mode chan_mode, bool full_rate) -{ - switch (chan_mode) { - case GSM48_CMODE_SPEECH_V1: - if (full_rate) - return CODEC_GSM_8000_1; - return CODEC_GSMHR_8000_1; - - case GSM48_CMODE_SPEECH_EFR: - return CODEC_GSMEFR_8000_1; - - case GSM48_CMODE_SPEECH_AMR: - return CODEC_AMR_8000_1; - - default: - return -1; - } -} - -int chan_mode_to_mgcp_bss_pt(enum mgcp_codecs codec) -{ - switch (codec) { - case CODEC_GSMHR_8000_1: - return RTP_PT_GSM_HALF; - - case CODEC_GSMEFR_8000_1: - return RTP_PT_GSM_EFR; - - case CODEC_AMR_8000_1: - return RTP_PT_AMR; - - default: - /* Not an error, we just leave it to libosmo-mgcp-client to - * decide over the PT. */ - return -1; - } -} - -void mgcp_pick_codec(struct mgcp_conn_peer *verb_info, const struct gsm_lchan *lchan, bool bss_side) -{ - enum mgcp_codecs codec = chan_mode_to_mgcp_codec(lchan->tch_mode, - lchan->type == GSM_LCHAN_TCH_H? false : true); - int custom_pt; - - if (codec < 0) { - LOG_LCHAN(lchan, LOGL_ERROR, - "Unable to determine MGCP codec type for %s in chan-mode %s\n", - gsm_lchant_name(lchan->type), gsm48_chan_mode_name(lchan->tch_mode)); - verb_info->codecs_len = 0; - return; - } - - verb_info->codecs[0] = codec; - verb_info->codecs_len = 1; - - /* Setup custom payload types (only for BSS side and when required) */ - custom_pt = chan_mode_to_mgcp_bss_pt(codec); - if (bss_side && custom_pt > 0) { - verb_info->ptmap[0].codec = codec; - verb_info->ptmap[0].pt = custom_pt; - verb_info->ptmap_len = 1; - } - - /* AMR requires additional parameters to be set up (framing mode) */ - if (verb_info->codecs[0] == CODEC_AMR_8000_1) { - verb_info->param_present = true; - verb_info->param.amr_octet_aligned_present = true; - } - - if (bss_side && verb_info->codecs[0] == CODEC_AMR_8000_1) { - /* FIXME: At the moment all BTSs we support are using the - * octet-aligned payload format. However, in the future - * we may support BTSs that are using bandwith-efficient - * format. In this case we will have to add functionality - * that distinguishes by the BTS model which mode to use. */ - verb_info->param.amr_octet_aligned = true; - } - else if (!bss_side && verb_info->codecs[0] == CODEC_AMR_8000_1) { - verb_info->param.amr_octet_aligned = lchan->conn->sccp.msc->amr_octet_aligned; - } -} diff --git a/src/osmo-bsc/net_init.c b/src/osmo-bsc/net_init.c index c2a38bc..1ef9bd5 100644 --- a/src/osmo-bsc/net_init.c +++ b/src/osmo-bsc/net_init.c @@ -51,6 +51,12 @@ {} }; +struct osmo_tdef g_mgw_tdefs[] = { + { .T=-1, .default_val=4, .desc="MGCP response timeout" }, + { .T=-2, .default_val=30, .desc="RTP stream establishing timeout" }, + {} +}; + /* Initialize the bare minimum of struct gsm_network, minimizing required dependencies. * This part is shared among the thin programs in osmo-bsc/src/utils/. * osmo-bsc requires further initialization that pulls in more dependencies (see bsc_network_init()). */ @@ -81,5 +87,8 @@ net->T_defs = gsm_network_T_defs; osmo_tdefs_reset(net->T_defs); + net->mgw.tdefs = g_mgw_tdefs; + osmo_tdefs_reset(net->mgw.tdefs); + return net; } diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 65618fd..2d5d4ae 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -19,7 +19,8 @@ * */ -#include +#include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_lcls.c b/src/osmo-bsc/osmo_bsc_lcls.c index 98c74c7..a01c02e 100644 --- a/src/osmo-bsc/osmo_bsc_lcls.c +++ b/src/osmo-bsc/osmo_bsc_lcls.c @@ -29,8 +29,8 @@ #include #include #include -#include -#include +#include +#include struct value_string lcls_event_names[] = { { LCLS_EV_UPDATE_CFG_CSC, "UPDATE_CFG_CSC" }, @@ -277,7 +277,7 @@ { mgcp_pick_codec(mdcx_info, conn->lchan, false); - mgw_endpoint_ci_request(conn->user_plane.mgw_endpoint_ci_msc, MGCP_VERB_MDCX, mdcx_info, + osmo_mgcpc_ep_ci_request(conn->user_plane.mgw_endpoint_ci_msc, MGCP_VERB_MDCX, mdcx_info, NULL, 0, 0, NULL); } @@ -647,7 +647,7 @@ return; } - other_mgw_info = mgwep_ci_get_rtp_info(conn_other->user_plane.mgw_endpoint_ci_msc); + other_mgw_info = osmo_mgcpc_ep_ci_get_rtp_info(conn_other->user_plane.mgw_endpoint_ci_msc); if (!other_mgw_info) { LOGPFSML(fi, LOGL_ERROR, "Cannot enable LCLS without RTP port info of MSC-side" " -- missing CRCX?\n"); diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 08bb40d..0e0e8ca 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -54,6 +53,8 @@ #include #include +#include + #include #include #include @@ -849,7 +850,6 @@ lchan_fsm_init(); bsc_subscr_conn_fsm_init(); assignment_fsm_init(); - mgw_endpoint_fsm_init(bsc_gsmnet->T_defs); handover_fsm_init(); /* Read the config */ diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 40ecf54..56aea50 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -34,7 +34,7 @@ handover_test_LDFLAGS = \ -Wl,--wrap=abis_rsl_sendmsg \ - -Wl,--wrap=mgw_endpoint_ci_request \ + -Wl,--wrap=osmo_mgcpc_ep_ci_request \ $(NULL) handover_test_LDADD = \ @@ -64,7 +64,6 @@ $(top_builddir)/src/osmo-bsc/lchan_rtp_fsm.o \ $(top_builddir)/src/osmo-bsc/lchan_select.o \ $(top_builddir)/src/osmo-bsc/meas_rep.o \ - $(top_builddir)/src/osmo-bsc/mgw_endpoint_fsm.o \ $(top_builddir)/src/osmo-bsc/neighbor_ident.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(top_builddir)/src/osmo-bsc/osmo_bsc_lcls.o \ diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index cd3b749..a8a77be 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -45,7 +45,6 @@ #include #include #include -#include #include #include @@ -53,14 +52,14 @@ struct gsm_network *bsc_gsmnet; -/* override, requires '-Wl,--wrap=mgw_endpoint_ci_request'. +/* override, requires '-Wl,--wrap=osmo_mgcpc_ep_ci_request'. * Catch modification of an MGCP connection. */ -void __real_mgw_endpoint_ci_request(struct mgwep_ci *ci, +void __real_osmo_mgcpc_ep_ci_request(struct osmo_mgcpc_ep_ci *ci, enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info, struct osmo_fsm_inst *notify, uint32_t event_success, uint32_t event_failure, void *notify_data); -void __wrap_mgw_endpoint_ci_request(struct mgwep_ci *ci, +void __wrap_osmo_mgcpc_ep_ci_request(struct osmo_mgcpc_ep_ci *ci, enum mgcp_verb verb, const struct mgcp_conn_peer *verb_info, struct osmo_fsm_inst *notify, uint32_t event_success, uint32_t event_failure, @@ -234,9 +233,11 @@ conn = bsc_subscr_con_allocate(net); - conn->user_plane.mgw_endpoint = mgw_endpoint_alloc(conn->fi, + conn->user_plane.mgw_endpoint = osmo_mgcpc_ep_alloc(conn->fi, GSCON_EV_FORGET_MGW_ENDPOINT, - fake_mgcp_client, "test", + fake_mgcp_client, + net->mgw.tdefs, + "test", "fake endpoint"); conn->sccp.msc = &fake_msc_data; @@ -1432,7 +1433,6 @@ ts_fsm_init(); lchan_fsm_init(); - mgw_endpoint_fsm_init(bsc_gsmnet->T_defs); bsc_subscr_conn_fsm_init(); handover_fsm_init(); -- To view, visit https://gerrit.osmocom.org/13796 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I03e6b48d9b0a5370310d5f56809259ff7909cf9d Gerrit-Change-Number: 13796 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 07:20:25 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 30 Apr 2019 07:20:25 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Unify the lua script into a single one In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/13804 ) Change subject: virtual: Unify the lua script into a single one ...................................................................... virtual: Unify the lua script into a single one In the quest to support multiple testcases we will use a single script. Parts can be enabled/disabled depending on which tests we want/need to run. Change-Id: I8a093671173976eba9215c00a7aea0f6cab467c6 --- R src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl M src/osmo_ms_driver/location_update_test.py M src/osmo_ms_driver/starter.py 3 files changed, 10 insertions(+), 2 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/templates/osmo-mobile-lu.lua.tmpl b/src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl similarity index 73% rename from src/osmo_gsm_tester/templates/osmo-mobile-lu.lua.tmpl rename to src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl index c25d799..0adb895 100644 --- a/src/osmo_gsm_tester/templates/osmo-mobile-lu.lua.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-mobile.lua.tmpl @@ -2,13 +2,20 @@ event = require('ms_support') send = 1 -function mm_cb(new_state, new_substate, old_substate) + +function lu_test_mm_cb(new_state, new_substate, old_substate) if new_state == 19 and new_substate == 1 and send == 1 then send = 0 event.send({lu_done=1}) end end +function mm_cb(new_state, new_substate, old_substate) +% if test.run_lu_test: + lu_test_mm_cb(new_state, new_substate, old_substate) +% endif +end + local cbs = { Mm=mm_cb } diff --git a/src/osmo_ms_driver/location_update_test.py b/src/osmo_ms_driver/location_update_test.py index 5ff2199..82c1cb3 100644 --- a/src/osmo_ms_driver/location_update_test.py +++ b/src/osmo_ms_driver/location_update_test.py @@ -59,7 +59,7 @@ decides how quickly to start them and a timeout. """ - TEMPLATE_LUA = "osmo-mobile-lu.lua" + TEMPLATE_LUA = "osmo-mobile.lua" TEMPLATE_CFG = "osmo-mobile.cfg" def __init__(self, name, options, cdf_function, diff --git a/src/osmo_ms_driver/starter.py b/src/osmo_ms_driver/starter.py index 010947b..20977d6 100644 --- a/src/osmo_ms_driver/starter.py +++ b/src/osmo_ms_driver/starter.py @@ -91,6 +91,7 @@ 'test': { 'event_path': self._ev_server_path, 'lua_support': lua_support, + 'run_lu_test': True, } } lua_cfg_file = os.path.join(self._tmp_dir, "lua_" + self._name_number + ".lua") -- To view, visit https://gerrit.osmocom.org/13804 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8a093671173976eba9215c00a7aea0f6cab467c6 Gerrit-Change-Number: 13804 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 07:20:29 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 30 Apr 2019 07:20:29 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Have a single result class that can store data In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/13805 ) Change subject: virtual: Have a single result class that can store data ...................................................................... virtual: Have a single result class that can store data We want to have LU, SMS and other tests run at the same time. Begin by creating a single result where testcases can store additional data. Move the stats code into the UL test case handling and out of the suite. Change-Id: Ie99351bee1515de8cf6870467f08256a53701907 --- M src/osmo_gsm_tester/ms_driver.py M src/osmo_ms_driver/location_update_test.py M src/osmo_ms_driver/test_support.py M suites/nitb_netreg_mass/register_default_mass.py 4 files changed, 69 insertions(+), 37 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/ms_driver.py b/src/osmo_gsm_tester/ms_driver.py index 96b907a..3cfcad6 100644 --- a/src/osmo_gsm_tester/ms_driver.py +++ b/src/osmo_gsm_tester/ms_driver.py @@ -130,6 +130,12 @@ """ return self._test_case.get_result_values() + def lus_less_than(self, acceptable_delay): + """ + Returns the results that completed their LU within the acceptable delay. + """ + return self._test_case.lus_less_than(acceptable_delay) + def cleanup(self): """ Cleans up the driver (e.g. AF_UNIX files). diff --git a/src/osmo_ms_driver/location_update_test.py b/src/osmo_ms_driver/location_update_test.py index 82c1cb3..29abf73 100644 --- a/src/osmo_ms_driver/location_update_test.py +++ b/src/osmo_ms_driver/location_update_test.py @@ -19,32 +19,39 @@ from copy import copy from osmo_gsm_tester import log from .starter import OsmoVirtPhy, OsmoMobile -from .test_support import Results +from .test_support import ResultStore from datetime import timedelta import collections import time -class LUResult(Results): - """Representation of a Location Updating Result.""" +# Key used for the result dictionary +LU_RESULT_NAME = 'lu_time' - def __init__(self, name): - super().__init__(name) - self._time_of_lu = None +def has_lu_time(result): + """ + Returns true if a LU occurred. + """ + return result.has_result(LU_RESULT_NAME) - def set_lu_time(self, time): - assert self._time_of_lu is None - self._time_of_lu = time +def lu_time(result): + """ + Returns the time of the LU occurrence. + """ + return result.get_result(LU_RESULT_NAME, default=0) - def has_lu_time(self): - return self._time_of_lu is not None +def lu_delay(result): + """ + Returns the delay from LU success to MS start time. + """ + return lu_time(result) - result.start_time() - def lu_time(self): - return self._time_of_lu or 0 - - def lu_delay(self): - return self.lu_time() - self.start_time() +def set_lu_time(result, time): + """ + Sets/Overrides the time of the LU success for this MS. + """ + result.set_result(LU_RESULT_NAME, time) LUStats = collections.namedtuple("LUStats", ["num_attempted", "num_completed", @@ -106,7 +113,7 @@ self.TEMPLATE_CFG, self._subscribers[i], phy.phy_filename(), self._event_server.server_path()) - self._results[ms_name] = LUResult(ms_name) + self._results[ms_name] = ResultStore(ms_name) self._mobiles.append(launcher) self._unstarted = copy(self._mobiles) @@ -204,10 +211,10 @@ elif data['type'] == 'event': if data['data']['lu_done'] == 1: ms = self._results[data['ms']] - if not ms.has_lu_time(): + if not has_lu_time(ms): self._outstanding = self._outstanding - 1 - ms.set_lu_time(time) - self.log("MS performed LU ", ms=ms, at=time, lu_delay=ms.lu_delay()) + set_lu_time(ms, time) + self.log("MS performed LU ", ms=ms, at=time, lu_delay=lu_delay(ms)) else: print(time, data) raise Exception("Unknown event type..:" + _data.decode()) @@ -219,10 +226,10 @@ def find_min_max(self, results): min_value = max_value = None for result in results: - if min_value is None or result.lu_delay() < min_value: - min_value = result.lu_delay() - if max_value is None or result.lu_delay() > max_value: - max_value = result.lu_delay() + if min_value is None or lu_delay(result) < min_value: + min_value = lu_delay(result) + if max_value is None or lu_delay(result) > max_value: + max_value = lu_delay(result) return min_value, max_value def get_result_values(self): @@ -237,7 +244,7 @@ """ attempted = len(self._subscribers) completed = attempted - self._outstanding - min_latency, max_latency = self.find_min_max(filter(lambda x: x.has_lu_time(), self._results.values())) + min_latency, max_latency = self.find_min_max(filter(lambda x: has_lu_time(x), self._results.values())) return LUStats(attempted, completed, min_latency, max_latency) def print_stats(self): @@ -246,3 +253,16 @@ self.log("Tests done", all_completed=all_completed, min=stats.min_latency, max=stats.max_latency) + + def lus_less_than(self, acceptable_delay): + """ + Returns LUs that completed within the acceptable delay. + """ + res = [] + for result in self._results.values(): + if not has_lu_time(result): + continue + if timedelta(seconds=lu_delay(result)) >= acceptable_delay: + continue + res.append(result) + return res diff --git a/src/osmo_ms_driver/test_support.py b/src/osmo_ms_driver/test_support.py index f1c34fb..670d795 100644 --- a/src/osmo_ms_driver/test_support.py +++ b/src/osmo_ms_driver/test_support.py @@ -26,15 +26,17 @@ yield ("%.15d" % n, "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00") n += 1 -class Results(log.Origin): +class ResultStore(log.Origin): """ - A base class to collect results from tests. + The class for results. There should be one result class per test subject. + Specific tests can use add_result to add their outcome to this object. """ def __init__(self, name): super().__init__(log.C_RUN, name) self._time_of_registration = None self._time_of_launch = None + self._results = {} def set_start_time(self, time): assert self._time_of_registration is None @@ -49,3 +51,15 @@ def launch_time(self): return self._time_of_launch or 0 + + def set_result(self, key, value): + """Sets a result with the given key and value.""" + self._results[key] = value + + def get_result(self, key, default=None): + """Returns the result for the given key or default.""" + return self._results.get(key, default) + + def has_result(self, key): + """Returns true if there is a value for the key.""" + return self._results.get(key) is not None diff --git a/suites/nitb_netreg_mass/register_default_mass.py b/suites/nitb_netreg_mass/register_default_mass.py index 306eb81..f4e5e80 100644 --- a/suites/nitb_netreg_mass/register_default_mass.py +++ b/suites/nitb_netreg_mass/register_default_mass.py @@ -46,15 +46,7 @@ # Check how many results are below our threshold. acceptable_delay = timedelta(seconds=30) -results = ms_driver.get_result_values() -quick_enough = 0 -for result in results: - if not result.has_lu_time(): - continue - if timedelta(seconds=result.lu_delay()) >= acceptable_delay: - continue - quick_enough = quick_enough + 1 - -latency_ratio = quick_enough / len(results) +quick_enough = len(ms_driver.lus_less_than(acceptable_delay)) +latency_ratio = quick_enough / stats.num_attempted if latency_ratio < 0.99: raise Exception("Latency ratio of %f%% lower than threshold." % (latency_ratio * 100.0)) -- To view, visit https://gerrit.osmocom.org/13805 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie99351bee1515de8cf6870467f08256a53701907 Gerrit-Change-Number: 13805 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 08:18:58 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 30 Apr 2019 08:18:58 +0000 Subject: Change in osmo-ci[master]: OBS: add links to job description In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13693 ) Change subject: OBS: add links to job description ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/13693 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idbc7ccd0156d9c3eb6d30059384686849a36f49f Gerrit-Change-Number: 13693 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 30 Apr 2019 08:18:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 08:19:02 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 30 Apr 2019 08:19:02 +0000 Subject: Change in osmo-ci[master]: OBS: add links to job description In-Reply-To: References: Message-ID: osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/13693 ) Change subject: OBS: add links to job description ...................................................................... OBS: add links to job description Add the links that the obsolete Osmocom_nightly_packages job has, before we remove it. Also link to the binary packages wiki page. Change-Id: Idbc7ccd0156d9c3eb6d30059384686849a36f49f --- M jobs/osmocom-obs.yml 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved osmith: Verified diff --git a/jobs/osmocom-obs.yml b/jobs/osmocom-obs.yml index 3682d0b..84a4710 100644 --- a/jobs/osmocom-obs.yml +++ b/jobs/osmocom-obs.yml @@ -11,7 +11,13 @@ name: 'Osmocom_OBS_{type}' project-type: freestyle defaults: global - description: 'Generated by job-builder' + description: | + + (Generated by job-builder) node: obs builders: - shell: -- To view, visit https://gerrit.osmocom.org/13693 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Idbc7ccd0156d9c3eb6d30059384686849a36f49f Gerrit-Change-Number: 13693 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 08:26:04 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 30 Apr 2019 08:26:04 +0000 Subject: Change in osmo-ttcn3-hacks[master]: TC_rach_content(): log successful allocations In-Reply-To: References: Message-ID: osmith has abandoned this change. ( https://gerrit.osmocom.org/13128 ) Change subject: TC_rach_content(): log successful allocations ...................................................................... Abandoned Abandoning, as requested by Max -- To view, visit https://gerrit.osmocom.org/13128 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Iaeadb4866a0d30a447fda9ef22be050889bc0cee Gerrit-Change-Number: 13128 Gerrit-PatchSet: 2 Gerrit-Owner: Max Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: dexter Gerrit-Reviewer: osmith Gerrit-CC: Max Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 09:14:13 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 30 Apr 2019 09:14:13 +0000 Subject: Change in osmo-sgsn[master]: Echo XID-Field of Type L3_PAR even when zero length In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/13811 ) Change subject: Echo XID-Field of Type L3_PAR even when zero length ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/13811/1/src/gprs/gprs_sndcp.c File src/gprs/gprs_sndcp.c: https://gerrit.osmocom.org/#/c/13811/1/src/gprs/gprs_sndcp.c at 1122 PS1, Line 1122: > Better to do here an `if (xid_field_indication->data_len == 0) gprs_llc_copy_xid()` and add a commen [?] after 2 hours, I still cannot figure out what I would pass to gprs_llc_copy_xid() at this point. :(( -- To view, visit https://gerrit.osmocom.org/13811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 Gerrit-Change-Number: 13811 Gerrit-PatchSet: 1 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 30 Apr 2019 09:14:13 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 09:46:27 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 30 Apr 2019 09:46:27 +0000 Subject: Change in osmo-sgsn[master]: Echo XID-Field of Type L3_PAR even when zero length In-Reply-To: References: Message-ID: Hello lynxis lazus, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13811 to look at the new patch set (#2). Change subject: Echo XID-Field of Type L3_PAR even when zero length ...................................................................... Echo XID-Field of Type L3_PAR even when zero length After Activate PDP Context request, Motorola KRZR sends a zero length XID-Field of Type L3 Parameters If this is not echoed back, the phone will send Deactivate PDP Context request with SM Cause: LLC or SNDCP failure(A/Gb only) (25) Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 --- M src/gprs/gprs_llc.c M src/gprs/gprs_sndcp.c 2 files changed, 15 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/11/13811/2 -- To view, visit https://gerrit.osmocom.org/13811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 Gerrit-Change-Number: 13811 Gerrit-PatchSet: 2 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 09:47:38 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 30 Apr 2019 09:47:38 +0000 Subject: Change in osmo-sgsn[master]: Echo XID-Field of Type L3_PAR even when zero length In-Reply-To: References: Message-ID: Hello lynxis lazus, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13811 to look at the new patch set (#3). Change subject: Echo XID-Field of Type L3_PAR even when zero length ...................................................................... Echo XID-Field of Type L3_PAR even when zero length After Activate PDP Context request, Motorola KRZR sends a zero length XID-Field of Type L3 Parameters If this is not echoed back, the phone will send Deactivate PDP Context request with SM Cause: LLC or SNDCP failure(A/Gb only) (25) Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 --- M src/gprs/gprs_sndcp.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/11/13811/3 -- To view, visit https://gerrit.osmocom.org/13811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 Gerrit-Change-Number: 13811 Gerrit-PatchSet: 3 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 09:51:14 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 30 Apr 2019 09:51:14 +0000 Subject: Change in osmo-sgsn[master]: Echo XID-Field of Type L3_PAR even when zero length In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/13811 ) Change subject: Echo XID-Field of Type L3_PAR even when zero length ...................................................................... Patch Set 3: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/13811/3/src/gprs/gprs_sndcp.c File src/gprs/gprs_sndcp.c: https://gerrit.osmocom.org/#/c/13811/3/src/gprs/gprs_sndcp.c at 1125 PS3, Line 1125: xid_field_response = gprs_llc_dup_xid_field(lle->llme, xid_field_indication); this doesn't work as I don't know how to get this value back to caller. https://gerrit.osmocom.org/#/c/13811/3/src/gprs/gprs_sndcp.c at 1126 PS3, Line 1126: // xid_field_response->list = gprs_llc_copy_xid(lle->llme, &xid_field_indication->list); this would seem to my mind to be going in the right direction, but it doesn't compile, because I don't know C. @lynxis, can you help me out? -- To view, visit https://gerrit.osmocom.org/13811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 Gerrit-Change-Number: 13811 Gerrit-PatchSet: 3 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 30 Apr 2019 09:51:14 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 10:56:07 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 30 Apr 2019 10:56:07 +0000 Subject: Change in osmo-sgsn[master]: Echo XID-Field of Type L3_PAR even when zero length In-Reply-To: References: Message-ID: Hello lynxis lazus, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13811 to look at the new patch set (#4). Change subject: Echo XID-Field of Type L3_PAR even when zero length ...................................................................... Echo XID-Field of Type L3_PAR even when zero length After Activate PDP Context request, Motorola KRZR sends a zero length XID-Field of Type L3 Parameters If this is not echoed back, the phone will send Deactivate PDP Context request with SM Cause: LLC or SNDCP failure(A/Gb only) (25) Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 --- M src/gprs/gprs_sndcp.c 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/11/13811/4 -- To view, visit https://gerrit.osmocom.org/13811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 Gerrit-Change-Number: 13811 Gerrit-PatchSet: 4 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 10:56:42 2019 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 30 Apr 2019 10:56:42 +0000 Subject: Change in osmo-sgsn[master]: Echo XID-Field of Type L3_PAR even when zero length In-Reply-To: References: Message-ID: Keith Whyte has posted comments on this change. ( https://gerrit.osmocom.org/13811 ) Change subject: Echo XID-Field of Type L3_PAR even when zero length ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/13811/4/src/gprs/gprs_sndcp.c File src/gprs/gprs_sndcp.c: https://gerrit.osmocom.org/#/c/13811/4/src/gprs/gprs_sndcp.c at 1125 PS4, Line 1125: xid_field_response->type = GPRS_LLC_XID_T_L3_PAR; Would this be acceptable? -- To view, visit https://gerrit.osmocom.org/13811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 Gerrit-Change-Number: 13811 Gerrit-PatchSet: 4 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 30 Apr 2019 10:56:42 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 11:28:13 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 11:28:13 +0000 Subject: Change in osmo-sgsn[master]: Echo XID-Field of Type L3_PAR even when zero length In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13811 ) Change subject: Echo XID-Field of Type L3_PAR even when zero length ...................................................................... Patch Set 4: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/13811/4/src/gprs/gprs_sndcp.c File src/gprs/gprs_sndcp.c: https://gerrit.osmocom.org/#/c/13811/4/src/gprs/gprs_sndcp.c at 1125 PS4, Line 1125: xid_field_response->type = GPRS_LLC_XID_T_L3_PAR; > Would this be acceptable? if it works? It looks quite sane to me. thanks. -- To view, visit https://gerrit.osmocom.org/13811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibd75f7b943c84ed7264481fa2e4bc3cb2f6745d4 Gerrit-Change-Number: 13811 Gerrit-PatchSet: 4 Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 30 Apr 2019 11:28:13 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 15:26:24 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 30 Apr 2019 15:26:24 +0000 Subject: Change in osmo-ci[master]: update-osmo-ci: disable admin2-deb{8, 9}build Message-ID: osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13820 Change subject: update-osmo-ci: disable admin2-deb{8,9}build ...................................................................... update-osmo-ci: disable admin2-deb{8,9}build Both hosts are currently offline. Disable the update-osmo-ci-on-slaves job for them, because it waits until all configured hosts are finished, and will currently never finish due to the offline hosts. Change-Id: Ic062cafd58f77d40042c9b467814257576c23027 --- M jobs/update-osmo-ci-on-slaves.yml 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/20/13820/1 diff --git a/jobs/update-osmo-ci-on-slaves.yml b/jobs/update-osmo-ci-on-slaves.yml index d1bc893..5c507e4 100644 --- a/jobs/update-osmo-ci-on-slaves.yml +++ b/jobs/update-osmo-ci-on-slaves.yml @@ -6,8 +6,9 @@ type: slave name: label values: - - admin2-deb8build - - admin2-deb9build + # These hosts are currently offline. Make sure to update them, once they get online again! + # - admin2-deb8build + # - admin2-deb9build - host2-deb8build-ansible - host2-deb9build-ansible - build2-deb8build-ansible -- To view, visit https://gerrit.osmocom.org/13820 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic062cafd58f77d40042c9b467814257576c23027 Gerrit-Change-Number: 13820 Gerrit-PatchSet: 1 Gerrit-Owner: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 15:29:33 2019 From: gerrit-no-reply at lists.osmocom.org (osmith) Date: Tue, 30 Apr 2019 15:29:33 +0000 Subject: Change in osmo-ci[master]: update-osmo-ci: disable admin2-deb{8, 9}build In-Reply-To: References: Message-ID: osmith has posted comments on this change. ( https://gerrit.osmocom.org/13820 ) Change subject: update-osmo-ci: disable admin2-deb{8,9}build ...................................................................... Patch Set 1: Verified+1 I have rolled the change out and canceled the running job, so the ones in the queue can run through. -- To view, visit https://gerrit.osmocom.org/13820 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic062cafd58f77d40042c9b467814257576c23027 Gerrit-Change-Number: 13820 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 30 Apr 2019 15:29:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:40:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:40:21 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Add Iu related tests for most existing 2G tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/13753 to look at the new patch set (#6). Change subject: msc: Add Iu related tests for most existing 2G tests ...................................................................... msc: Add Iu related tests for most existing 2G tests This might look a bit like copy+paste programming for our testcases. However, we actually want the Iu related tests show up as separate 'testscase' in the TTCN-3 sense, so there's no way that's more elegant than this :/ Change-Id: I3b56e17487c9df839e67ed390a1ff89979683e8e --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn A msc/MSC_Tests_Iu.ttcn 3 files changed, 590 insertions(+), 58 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/53/13753/6 -- To view, visit https://gerrit.osmocom.org/13753 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3b56e17487c9df839e67ed390a1ff89979683e8e Gerrit-Change-Number: 13753 Gerrit-PatchSet: 6 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:40:22 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:40:22 +0000 Subject: Change in osmo-ttcn3-hacks[master]: regen-makefile: Use '-U 5' to split C++ files in multiple chunks Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13821 Change subject: regen-makefile: Use '-U 5' to split C++ files in multiple chunks ...................................................................... regen-makefile: Use '-U 5' to split C++ files in multiple chunks Particularly the C++ files generated for the rather comprehensive 3GPP asn.1 specified protocols like MAP, RANAP, ... result in very large source files and subsequently g++ processes that consume well into the multiple gigabyte range of memory. Let's use the '-U 5' option to ask the ttcn3_compiler to split all c++ files into 5 chunks, resulting in more files to compile, but smaller individual files. I also tested '-U type' before, but it was still grinding my 16GB RAM laptop to unusable deep-swapping state when running 'make -j8' for the IuCS extended MSC test suite. Change-Id: I013b623e98d58a39dd7bb2b0db4a911725028535 --- M regen-makefile.sh 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/21/13821/1 diff --git a/regen-makefile.sh b/regen-makefile.sh index 77fcb6c..d2b747e 100755 --- a/regen-makefile.sh +++ b/regen-makefile.sh @@ -24,7 +24,7 @@ USE_CCACHE=1 fi -ttcn3_makefilegen -p -l -f $* +ttcn3_makefilegen -p -l -U 5 -f $* TITAN_VERSION=$(ttcn3_makefilegen -v 2>&1 |grep "Product number" |cut --delimiter="/" -f 2-| sed -e "s/[A-Z ]//g") @@ -60,5 +60,5 @@ sed -i -e 's/^CXX = g++ $/CXX = env CCACHE_SLOPPINESS=time_macros ccache g++/' Makefile # Append the -D option to compiler flags. This option disables timestamps # inside comments in the generated C++ code which interfere with ccache. - sed -i -e 's/^COMPILER_FLAGS = \(.*\)/&-D/' Makefile + sed -i -e 's/^COMPILER_FLAGS = \(.*\)/& -D/' Makefile fi -- To view, visit https://gerrit.osmocom.org/13821 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I013b623e98d58a39dd7bb2b0db4a911725028535 Gerrit-Change-Number: 13821 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:41:09 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:41:09 +0000 Subject: Change in osmo-ttcn3-hacks[master]: regen-makefile: Use '-U 5' to split C++ files in multiple chunks In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13821 ) Change subject: regen-makefile: Use '-U 5' to split C++ files in multiple chunks ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13821 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I013b623e98d58a39dd7bb2b0db4a911725028535 Gerrit-Change-Number: 13821 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-CC: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 30 Apr 2019 20:41:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:41:17 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:41:17 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Add RANAP to msc tests In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13751 ) Change subject: msc: Add RANAP to msc tests ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13751 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idfa54b7607ad6e7016ed9411b0cc5330c901ea34 Gerrit-Change-Number: 13751 Gerrit-PatchSet: 6 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 30 Apr 2019 20:41:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:41:28 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:41:28 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Introduce f_cl3_or_initial_ue as replacement for f_bssap_compl_l3() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13752 ) Change subject: msc: Introduce f_cl3_or_initial_ue as replacement for f_bssap_compl_l3() ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13752 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia27afa265d441d1a0cbb40cc2d938aff46fa25f9 Gerrit-Change-Number: 13752 Gerrit-PatchSet: 6 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 30 Apr 2019 20:41:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:41:48 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:41:48 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Add Iu related tests for most existing 2G tests In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13753 ) Change subject: msc: Add Iu related tests for most existing 2G tests ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/13753 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3b56e17487c9df839e67ed390a1ff89979683e8e Gerrit-Change-Number: 13753 Gerrit-PatchSet: 6 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Comment-Date: Tue, 30 Apr 2019 20:41:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:41:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:41:54 +0000 Subject: Change in osmo-ttcn3-hacks[master]: regen-makefile: Use '-U 5' to split C++ files in multiple chunks In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13821 ) Change subject: regen-makefile: Use '-U 5' to split C++ files in multiple chunks ...................................................................... regen-makefile: Use '-U 5' to split C++ files in multiple chunks Particularly the C++ files generated for the rather comprehensive 3GPP asn.1 specified protocols like MAP, RANAP, ... result in very large source files and subsequently g++ processes that consume well into the multiple gigabyte range of memory. Let's use the '-U 5' option to ask the ttcn3_compiler to split all c++ files into 5 chunks, resulting in more files to compile, but smaller individual files. I also tested '-U type' before, but it was still grinding my 16GB RAM laptop to unusable deep-swapping state when running 'make -j8' for the IuCS extended MSC test suite. Change-Id: I013b623e98d58a39dd7bb2b0db4a911725028535 --- M regen-makefile.sh 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/regen-makefile.sh b/regen-makefile.sh index 77fcb6c..d2b747e 100755 --- a/regen-makefile.sh +++ b/regen-makefile.sh @@ -24,7 +24,7 @@ USE_CCACHE=1 fi -ttcn3_makefilegen -p -l -f $* +ttcn3_makefilegen -p -l -U 5 -f $* TITAN_VERSION=$(ttcn3_makefilegen -v 2>&1 |grep "Product number" |cut --delimiter="/" -f 2-| sed -e "s/[A-Z ]//g") @@ -60,5 +60,5 @@ sed -i -e 's/^CXX = g++ $/CXX = env CCACHE_SLOPPINESS=time_macros ccache g++/' Makefile # Append the -D option to compiler flags. This option disables timestamps # inside comments in the generated C++ code which interfere with ccache. - sed -i -e 's/^COMPILER_FLAGS = \(.*\)/&-D/' Makefile + sed -i -e 's/^COMPILER_FLAGS = \(.*\)/& -D/' Makefile fi -- To view, visit https://gerrit.osmocom.org/13821 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I013b623e98d58a39dd7bb2b0db4a911725028535 Gerrit-Change-Number: 13821 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:41:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:41:54 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Add RANAP to msc tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13751 ) Change subject: msc: Add RANAP to msc tests ...................................................................... msc: Add RANAP to msc tests Integrate RANAP to MSC_Tests.ttcn Related: OS#2856 Change-Id: Idfa54b7607ad6e7016ed9411b0cc5330c901ea34 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.default M msc/MSC_Tests.ttcn M msc/gen_links.sh M msc/regen_makefile.sh 5 files changed, 319 insertions(+), 78 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 11baf2a..e603035 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -10,6 +10,12 @@ import from RAN_Emulation all; import from BSSMAP_Templates all; +import from RANAP_Constants all; +import from RANAP_IEs all; +import from RANAP_PDU_Contents all; +import from RANAP_PDU_Descriptions all; +import from RANAP_Templates all; + import from GSUP_Types all; import from GSUP_Emulation all; @@ -76,9 +82,29 @@ boolean sgsap_enable, boolean gsup_enable, integer ran_idx, - boolean use_umts_aka + boolean use_umts_aka, + boolean ran_is_geran }; +private function imsi_hex2oct(hexstring imsi) return octetstring { + var hexstring tmp := ''H; + var octetstring ret; + var integer i; + + /* swap nibbles and pad with F if insufficient input nibbles */ + for (i := 0; i < lengthof(imsi); i := i+1) { + if (i+1 < lengthof(imsi)) { + tmp := tmp & imsi[i+1]; + } else { + tmp := tmp & 'F'H; + } + tmp := tmp & imsi[i]; + i := i+1; + } + ret := hex2oct(tmp); + return ret; +} + /* get a one-octet bitmaks of supported algorithms based on Classmark information */ function f_alg_mask_from_cm(BSSMAP_IE_ClassmarkInformationType2 cm2) return OCT1 { var BIT8 res := '00000001'B; /* A5/0 always supported */ @@ -174,10 +200,31 @@ return resp; } +private function RncUnitdataCallback(RANAP_PDU ranap) +runs on RAN_Emulation_CT return template RANAP_PDU { + var template RANAP_PDU resp := omit; + + log("RANAP_RncUnitdataCallback"); + /* answer all RESET with RESET ACK */ + if (match(ranap, tr_RANAP_Reset)) { + log("RANAP_RncUnitdataCallback: Responding to RESET with RESET-ACK"); + var CN_DomainIndicator dom; + dom := ranap.initiatingMessage.value_.Reset.protocolIEs[1].value_.cN_DomainIndicator; + resp := ts_RANAP_ResetAck(dom); + } + + /* FIXME: Handle paging, etc. */ + return resp; +} + + const RanOps BSC_RanOps := { /* Create call-back for inbound connections from MSC (hand-over) */ create_cb := refers(RAN_Emulation.ExpectedCreateCallback), unitdata_cb := refers(BscUnitdataCallback), + ranap_create_cb := refers(RAN_Emulation.RanapExpectedCreateCallback), + ranap_unitdata_cb := refers(RncUnitdataCallback), + ps_domain := false, decode_dtap := true, role_ms := true, protocol := RAN_PROTOCOL_BSSAP, @@ -215,6 +262,55 @@ } } +/* generate Iu LAI from BSSAP CGI */ +private function f_IuLAI_from_BssmapCI(BSSMAP_IE_CellIdentifier ci) return LAI { + var LAI lai; + if (ischosen(ci.cellIdentification.cI_CGI)) { + lai.pLMNidentity := ci.cellIdentification.cI_CGI.mcc_mnc; + lai.lAC := ci.cellIdentification.cI_CGI.lac; + } else if (ischosen(ci.cellIdentification.cI_SAI)) { + lai.pLMNidentity := ci.cellIdentification.cI_SAI.mcc_mnc; + lai.lAC := ci.cellIdentification.cI_SAI.lac; + } else if (ischosen(ci.cellIdentification.ci_LAC_RNC_CI)) { + lai.pLMNidentity := ci.cellIdentification.ci_LAC_RNC_CI.mcc_mnc; + lai.lAC := ci.cellIdentification.ci_LAC_RNC_CI.lac; + } else { + mtc.stop; + } + lai.iE_Extensions := omit; + return lai; +} + +/* like f_bssap_compl_l3() but for 3G */ +function f_ranap_initial_ue(PDU_ML3_MS_NW l3) +runs on BSC_ConnHdlr { + log("Sending InitialUE: ", l3); + var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3); + var RANAP_PDU ranap; + var LAI lai := f_IuLAI_from_BssmapCI(g_pars.cell_id); + var SAI sai := { + pLMNidentity := lai.pLMNidentity, + lAC := lai.lAC, + sAC := '0000'O, /* FIXME */ + iE_Extensions := omit + }; + var IuSignallingConnectionIdentifier sigc_id := int2bit(23, 24); + var GlobalRNC_ID grnc_id := { + pLMNidentity := lai.pLMNidentity, + rNC_ID := 2342 /* FIXME */ + }; + + ranap := valueof(ts_RANAP_initialUE_CS(lai, sai, l3_enc, sigc_id, grnc_id)); + BSSAP.send(ts_RANAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, ranap)); + alt { + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {} + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + setverdict(fail, "DISC.ind from SCCP"); + mtc.stop; + } + } +} + type enumerated EstablishType { EST_TYPE_MO_CALL, EST_TYPE_EMERG_CALL, @@ -255,7 +351,11 @@ } /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_info); + if (g_pars.ran_is_geran) { + f_bssap_compl_l3(l3_info); + } else { + f_ranap_initial_ue(l3_info); + } f_mm_common(); if (g_pars.net.expect_ciph) { @@ -329,21 +429,51 @@ function f_mm_common() runs on BSC_ConnHdlr { f_mm_auth(); - if (g_pars.net.expect_ciph) { - var OCT1 a5_net := f_alg_mask_from_cm(g_pars.cm2); - var OCT1 a5_intersect := g_pars.net.kc_support and4b a5_net; - alt { - [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(a5_intersect, g_pars.vec.kc)) { - var OCT1 a5_chosen := f_best_alg_from_mask(a5_intersect); - var integer a5_nr := f_alg_from_mask(a5_chosen); - BSSAP.send(ts_BSSMAP_CipherModeCompl(int2oct(a5_nr+1, 1))); + if (g_pars.ran_is_geran) { + if (g_pars.net.expect_ciph) { + var OCT1 a5_net := f_alg_mask_from_cm(g_pars.cm2); + var OCT1 a5_intersect := g_pars.net.kc_support and4b a5_net; + alt { + [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(a5_intersect, g_pars.vec.kc)) { + var OCT1 a5_chosen := f_best_alg_from_mask(a5_intersect); + var integer a5_nr := f_alg_from_mask(a5_chosen); + BSSAP.send(ts_BSSMAP_CipherModeCompl(int2oct(a5_nr+1, 1))); + } + [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)) { + setverdict(fail, "Wrong ciphering algorithm mask in CiphModCmd"); + mtc.stop; + } } - [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)) { - setverdict(fail, "Wrong ciphering algorithm mask in CiphModCmd"); + /* FIXME: Send the best available algorithm */ + } + } else { /* UTRAN */ + alt { + [g_pars.net.expect_ciph] BSSAP.receive(tr_RANAP_SecurityModeCmdEnc(uia_algs := ?, + uia_key := oct2bit(g_pars.vec.ik), + key_sts := ?, + uea_algs := ?, + uea_key := oct2bit(g_pars.vec.ck))) { + var IntegrityProtectionAlgorithm uia_chosen := 0; /*standard_UMTS_integrity_algorithm_UIA1*/ + var EncryptionAlgorithm uea_chosen := 1; /*standard_UMTS_encryption_algorith_UEA1*/ + BSSAP.send(ts_RANAP_SecurityModeCompleteEnc(uia_chosen, uea_chosen)); + BSSAP.receive(tr_RANAP_CommonId(imsi_hex2oct(g_pars.imsi))); + } + [g_pars.net.expect_ciph] BSSAP.receive(tr_RANAP_SecurityModeCmdEnc(?,?,?,?,?)) { + setverdict(fail, "Invalid SecurityModeCommand (ciphering case)"); + mtc.stop; + } + [not g_pars.net.expect_ciph] BSSAP.receive(tr_RANAP_SecurityModeCmd(uia_algs := ?, + uia_key := oct2bit(g_pars.vec.ik), + key_sts := ?)) { + var IntegrityProtectionAlgorithm uia_chosen := 0; /*standard_UMTS_integrity_algorithm_UIA1;*/ + BSSAP.send(ts_RANAP_SecurityModeComplete(uia_chosen)); + BSSAP.receive(tr_RANAP_CommonId(imsi_hex2oct(g_pars.imsi))); + } + [not g_pars.net.expect_ciph] BSSAP.receive(tr_RANAP_SecurityModeCmd(?,?,?)) { + setverdict(fail, "Invalid SecurityModeCommand (non-ciphering case)"); mtc.stop; } } - /* FIXME: Send the best available algorithm */ } } @@ -362,10 +492,13 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); - - if (g_pars.send_early_cm) { - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (g_pars.ran_is_geran) { + f_bssap_compl_l3(l3_lu); + if (g_pars.send_early_cm) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } + } else { + f_ranap_initial_ue(l3_lu); } f_mm_common(); @@ -544,27 +677,44 @@ MGCP.send(mgcp_resp); } - var BSSMAP_IE_AoIP_TransportLayerAddress tla_ass := - valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.mgw_rtp_ip_bss),cpars.mgw_rtp_port_bss)); - interleave { - /* Second MGCP CRCX (this time for MSS/CN side) */ - [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { - var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); - MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); - /* MSC acknowledges the MNCC_CREATE to the MNCC handler */ - MNCC.receive(tr_MNCC_RTP_CREATE(cpars.mncc_callref)); + if (g_pars.ran_is_geran) { + var BSSMAP_IE_AoIP_TransportLayerAddress tla_ass := + valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.mgw_rtp_ip_bss),cpars.mgw_rtp_port_bss)); + + interleave { + /* Second MGCP CRCX (this time for MSS/CN side) */ + [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { + var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + /* MSC acknowledges the MNCC_CREATE to the MNCC handler */ + MNCC.receive(tr_MNCC_RTP_CREATE(cpars.mncc_callref)); + } + /* expect the MSC to trigger a BSSMAP ASSIGNMENT */ + [] BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass)) { + var BSSMAP_IE_AoIP_TransportLayerAddress tla; + var BSSMAP_IE_SpeechCodec codec; + + tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); + codec := valueof(ts_BSSMAP_IE_SpeechCodec({ts_CodecFR})); + + BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla, codec)); + } } + } else { + var template TransportLayerAddress rab_tla := ? /* FIXME: encode the mgw_rtp_ip_bss/mgw_rtp_port_bss */ + var template RAB_SetupOrModifyList rab_sml := tr_RAB_SML(rab_id := ?, tla := rab_tla, binding_id := ?); - /* expect the MSC to trigger a BSSMAP ASSIGNMENT */ - [] BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass)) { - var BSSMAP_IE_AoIP_TransportLayerAddress tla; - var BSSMAP_IE_SpeechCodec codec; - - tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); - codec := valueof(ts_BSSMAP_IE_SpeechCodec({ts_CodecFR})); - - BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla, codec)); + interleave { + [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { + var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + /* MSC acknowledges the MNCC_CREATE to the MNCC handler */ + MNCC.receive(tr_MNCC_RTP_CREATE(cpars.mncc_callref)); + } + [] BSSAP.receive(tr_RANAP_RabAssReq(rab_sml)) { + //BSSAP.send(ts_RANAP_RabAssResp(rab_sml)); FIXME + } } } @@ -575,7 +725,11 @@ function f_expect_paging(boolean by_tmsi := true) runs on BSC_ConnHdlr { - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + if (g_pars.ran_is_geran) { + BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + } else { + BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi), ?)); + } } function f_mt_call_establish(inout CallParameters cpars) @@ -649,27 +803,51 @@ } } - var BSSMAP_IE_AoIP_TransportLayerAddress tla_ass := - valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.mgw_rtp_ip_bss),cpars.mgw_rtp_port_bss)); - interleave { - /* Second MGCP CRCX (this time for MSS/CN side) */ - [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { - var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); - MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + if (g_pars.ran_is_geran) { + var BSSMAP_IE_AoIP_TransportLayerAddress tla_ass := + valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.mgw_rtp_ip_bss),cpars.mgw_rtp_port_bss)); - /* Alerting */ - MNCC.send(ts_MNCC_ALERT_req(cpars.mncc_callref)); - } + interleave { + /* Second MGCP CRCX (this time for MSS/CN side) */ + [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { + var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); - [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(cpars.transaction_id))) { + /* Alerting */ + MNCC.send(ts_MNCC_ALERT_req(cpars.mncc_callref)); + } + + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(cpars.transaction_id))) { + } + /* expect AoIP IP/Port to match what we returned in CRCX_ACK above */ + [] BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass)) { + var BSSMAP_IE_AoIP_TransportLayerAddress tla; + var BSSMAP_IE_SpeechCodec codec; + tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); + codec := valueof(ts_BSSMAP_IE_SpeechCodec({ts_CodecFR})); + BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla, codec)); + } } - /* expect AoIP IP/Port to match what we returned in CRCX_ACK above */ - [] BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass)) { - var BSSMAP_IE_AoIP_TransportLayerAddress tla; - var BSSMAP_IE_SpeechCodec codec; - tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); - codec := valueof(ts_BSSMAP_IE_SpeechCodec({ts_CodecFR})); - BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla, codec)); + } else { + var template TransportLayerAddress rab_tla := ?; /* FIXME: encode the mgw_rtp_ip_bss/mgw_rtp_port_bss */ + var template RAB_SetupOrModifyList rab_sml := tr_RAB_SML(rab_id := ?, tla := rab_tla, binding_id := ?); + + interleave { + /* Second MGCP CRCX (this time for MSS/CN side) */ + [] MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { + var SDP_Message sdp := valueof(ts_SDP_CRCX_CN(cpars)); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + + /* Alerting */ + MNCC.send(ts_MNCC_ALERT_req(cpars.mncc_callref)); + } + + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(cpars.transaction_id))) { + } + + [] BSSAP.receive(tr_RANAP_RabAssReq(rab_sml)) { + //BSSAP.send(ts_RANAP_RabAssResp(rab_sml)); FIXME + } } } @@ -688,12 +866,6 @@ var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; var boolean respond_to_dlcx; - var template PDU_BSSAP t_clear := tr_BSSMAP_ClearCommand; - - if (is_csfb) { - t_clear := tr_BSSMAP_ClearCommandCSFB; - } - MNCC.send(ts_MNCC_DISC_req(cpars.mncc_callref, valueof(ts_MNCC_cause(23)))); BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(cpars.transaction_id))); @@ -711,18 +883,43 @@ respond_to_dlcx := not (isbound(cpars.mgw_drop_dlcx) and valueof(cpars.mgw_drop_dlcx)); - /* clearing of radio channel */ - interleave { - [] BSSAP.receive(t_clear) { - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + /* clearing of radio channel */ + if (g_pars.ran_is_geran) { + var template PDU_BSSAP t_clear := tr_BSSMAP_ClearCommand; + if (is_csfb) { + t_clear := tr_BSSMAP_ClearCommandCSFB; } - [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { - if (respond_to_dlcx) { - /* TODO: For one or all connections on EP? */ - MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); - f_create_mgcp_delete_ep(cpars.mgcp_ep); + + interleave { + [] BSSAP.receive(t_clear) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + } + [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { + if (respond_to_dlcx) { + /* TODO: For one or all connections on EP? */ + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); + f_create_mgcp_delete_ep(cpars.mgcp_ep); + } + } } + } else { + var template RANAP_PDU t_iurel := tr_RANAP_IuReleaseCommand(?); + if (is_csfb) { + /* FIXME! */ + } + interleave { + [] BSSAP.receive(t_iurel) { + BSSAP.send(ts_RANAP_IuReleaseComplete); + BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + } + [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { + if (respond_to_dlcx) { + /* TODO: For one or all connections on EP? */ + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); + f_create_mgcp_delete_ep(cpars.mgcp_ep); + } + } } } @@ -809,6 +1006,7 @@ setverdict(pass); } + /* expect a clear command */ altstep as_clear_cmd_compl_disc(float t := 5.0) runs on BSC_ConnHdlr { var PDU_BSSAP bssap; @@ -830,12 +1028,34 @@ } } +/* expect a IuReleaseCommand; Confirm that; expect SCCP-level N-DISCONNET.ind */ +altstep as_iu_release_compl_disc(float t := 5.0) runs on BSC_ConnHdlr { + var RANAP_PDU ranap; + [] BSSAP.receive(tr_RANAP_IuReleaseCommand(?)) { + BSSAP.send(ts_RANAP_IuReleaseComplete); + alt { + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + setverdict(pass); + } + [] BSSAP.receive { + setverdict(fail, "Unexpected RANAP while waiting for SCCP Release "); + mtc.stop; + } + } + } + [] BSSAP.receive(RANAP_PDU:?) -> value ranap{ + setverdict(fail, "Unexpected RANAP while waiting for IuReleaseCommand", ranap); + mtc.stop; + } +} + function f_expect_clear(float t := 5.0) runs on BSC_ConnHdlr { timer T := t; T.start; alt { - [] as_clear_cmd_compl_disc(t) { } + [g_pars.ran_is_geran] as_clear_cmd_compl_disc(t) { } + [not g_pars.ran_is_geran] as_iu_release_compl_disc(t) { } [] T.timeout { setverdict(fail, "Timeout waiting for ClearCommand/Release"); mtc.stop; diff --git a/msc/MSC_Tests.default b/msc/MSC_Tests.default index a24fa38..98bf299 100644 --- a/msc/MSC_Tests.default +++ b/msc/MSC_Tests.default @@ -48,6 +48,17 @@ peer_ssn := 254, sio := '83'O, rctx := 1 + }, + { + transport := RANAP_TRANSPORT_IuCS, + sccp_service_type := "mtp3_itu", + sctp_addr := { 23908, "127.0.0.1", 2905, "127.0.0.1" }, + own_pc := 195, + own_ssn := 142, + peer_pc := 185, + peer_ssn := 142, + sio := '83'O, + rctx := 2 } }; diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index b2503b7..110c165 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -65,7 +65,7 @@ import from TCCConversion_Functions all; -const integer NUM_BSC := 2; +const integer NUM_BSC := 3; type record of RAN_Configuration RAN_Configurations; /* Needed for SGsAP SMS */ @@ -485,7 +485,8 @@ type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; /* FIXME: move into BSC_ConnectionHandler? */ -function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup := true, integer ran_idx := 0) +function f_init_pars(integer imsi_suffix, boolean sgsap := false, boolean gsup := true, integer ran_idx := 0, + boolean ran_is_geran := true) runs on MTC_CT return BSC_ConnHdlrPars { var BSC_ConnHdlrNetworkPars net_pars := { kc_support := '0A'O, /* A5/1 and A5/3 enabled */ @@ -514,7 +515,8 @@ sgsap_enable := sgsap, gsup_enable := gsup, ran_idx := ran_idx, - use_umts_aka := false + use_umts_aka := false, + ran_is_geran := ran_is_geran }; return pars; } @@ -553,8 +555,9 @@ return vc_conn; } -function f_start_handler(void_fn fn, integer imsi_suffix, integer ran_idx := 0) runs on MTC_CT return BSC_ConnHdlr { - return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix, ran_idx := ran_idx)); +function f_start_handler(void_fn fn, integer imsi_suffix, integer ran_idx := 0, boolean ran_is_geran := true) +runs on MTC_CT return BSC_ConnHdlr { + return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix, ran_idx := ran_idx, ran_is_geran := ran_is_geran)); } private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { diff --git a/msc/gen_links.sh b/msc/gen_links.sh index e4e142b..7ba190a 100755 --- a/msc/gen_links.sh +++ b/msc/gen_links.sh @@ -85,6 +85,11 @@ FILES="SGsAP_Types.ttcn" gen_links $DIR $FILES +DIR=../library/ranap +FILES="RANAP_CommonDataTypes.asn RANAP_Constants.asn RANAP_Containers.asn RANAP_IEs.asn RANAP_PDU_Contents.asn RANAP_PDU_Descriptions.asn " +FILES+="RANAP_Types.ttcn RANAP_Templates.ttcn RANAP_CodecPort.ttcn RANAP_EncDec.cc " +gen_links $DIR $FILES + DIR=../library FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc " FILES+="IPA_Types.ttcn IPA_Emulation.ttcnpp IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc GSUP_Types.ttcn GSUP_Emulation.ttcn " diff --git a/msc/regen_makefile.sh b/msc/regen_makefile.sh index 091faf8..e89daa6 100755 --- a/msc/regen_makefile.sh +++ b/msc/regen_makefile.sh @@ -1,7 +1,9 @@ #!/bin/sh -FILES="*.ttcn *.ttcnpp SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc Native_FunctionDefs.cc SMPP_EncDec.cc SMPP_CodecPort_CtrlFunctDef.cc MAP_EncDec.cc SS_EncDec.cc TCCEncoding.cc SGsAP_CodecPort_CtrlFunctDef.cc *.c *.asn" +FILES="*.ttcn *.ttcnpp SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc Native_FunctionDefs.cc SMPP_EncDec.cc SMPP_CodecPort_CtrlFunctDef.cc MAP_EncDec.cc SS_EncDec.cc TCCEncoding.cc SGsAP_CodecPort_CtrlFunctDef.cc RANAP_EncDec.cc *.c *.asn" -export CPPFLAGS_TTCN3="-DIPA_EMULATION_MGCP -DIPA_EMULATION_GSUP -DIPA_EMULATION_SCCP -DRAN_EMULATION_BSSAP -DRAN_EMULATION_MGCP -DUSE_MTP3_DISTRIBUTOR" +export CPPFLAGS_TTCN3="-DIPA_EMULATION_MGCP -DIPA_EMULATION_GSUP -DIPA_EMULATION_SCCP -DRAN_EMULATION_BSSAP -DRAN_EMULATION_MGCP -DRAN_EMULATION_RANAP -DUSE_MTP3_DISTRIBUTOR" ../regen-makefile.sh MSC_Tests.ttcn $FILES + +sed -i -e 's/^LINUX_LIBS = -lxml2/LINUX_LIBS = -lxml2 -lfftranscode/' Makefile -- To view, visit https://gerrit.osmocom.org/13751 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Idfa54b7607ad6e7016ed9411b0cc5330c901ea34 Gerrit-Change-Number: 13751 Gerrit-PatchSet: 6 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:41:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:41:54 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Introduce f_cl3_or_initial_ue as replacement for f_bssap_compl_l3() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13752 ) Change subject: msc: Introduce f_cl3_or_initial_ue as replacement for f_bssap_compl_l3() ...................................................................... msc: Introduce f_cl3_or_initial_ue as replacement for f_bssap_compl_l3() The new function will check the RAN type and dispath to f_bssap_compl_l3() in case of 2G/GERAN and to f_ranap_initial_ue() on case of 3G/UTRAN. Change-Id: Ia27afa265d441d1a0cbb40cc2d938aff46fa25f9 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 33 insertions(+), 27 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index e603035..1fd02aa 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -311,6 +311,16 @@ } } +/* Send BSSMAP Complete L3 or RANAP Initial UE depending on 2G/3G RAN type */ +function f_cl3_or_initial_ue(PDU_ML3_MS_NW l3) +runs on BSC_ConnHdlr { + if (g_pars.ran_is_geran) { + f_bssap_compl_l3(l3); + } else { + f_ranap_initial_ue(l3); + } +} + type enumerated EstablishType { EST_TYPE_MO_CALL, EST_TYPE_EMERG_CALL, @@ -351,11 +361,7 @@ } /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - if (g_pars.ran_is_geran) { - f_bssap_compl_l3(l3_info); - } else { - f_ranap_initial_ue(l3_info); - } + f_cl3_or_initial_ue(l3_info); f_mm_common(); if (g_pars.net.expect_ciph) { diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 110c165..af654a3 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -592,7 +592,7 @@ var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); f_create_gsup_expect(hex2str(g_pars.imsi)); - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); GSUP.send(ts_GSUP_UL_ERR(g_pars.imsi, 23)); alt { @@ -619,7 +619,7 @@ var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); f_create_gsup_expect(hex2str(g_pars.imsi)); - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); /* Normally the HLR would need to respond here, but we decide to force a timeout here */ alt { @@ -682,7 +682,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_info); + f_cl3_or_initial_ue(l3_info); timer T := 10.0; T.start; @@ -742,7 +742,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -773,7 +773,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -804,7 +804,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -847,7 +847,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -878,7 +878,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -911,7 +911,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -959,7 +959,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); + f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); /* Send Early Classmark, just for the fun of it? */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -982,7 +982,7 @@ var MobileIdentityLV mi := valueof(ts_MI_TMSI_LV('01020304'O)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); + f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); /* Send Early Classmark, just for the fun of it? */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -1005,7 +1005,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); + f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); /* Send Early Classmark, just for the fun of it? */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -1037,7 +1037,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); - f_bssap_compl_l3(l3_info); + f_cl3_or_initial_ue(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O))); f_expect_clear(); } @@ -1074,7 +1074,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VGCS, mi)); - f_bssap_compl_l3(l3_info); + f_cl3_or_initial_ue(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); f_expect_clear(); } @@ -1095,7 +1095,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VBS, mi)); - f_bssap_compl_l3(l3_info); + f_cl3_or_initial_ue(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); f_expect_clear(); } @@ -1116,7 +1116,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_LCS, mi)); - f_bssap_compl_l3(l3_info); + f_cl3_or_initial_ue(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); f_expect_clear(); } @@ -1137,7 +1137,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_REEST_REQ(0, mi)); - f_bssap_compl_l3(l3_info); + f_cl3_or_initial_ue(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); f_expect_clear(); } @@ -1159,7 +1159,7 @@ f_create_gsup_expect(hex2str(g_pars.imsi)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); @@ -1624,7 +1624,7 @@ /* Follow-up transactions should fail */ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); - f_bssap_compl_l3(l3_info); + f_cl3_or_initial_ue(l3_info); alt { [] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { } [] BSSAP.receive { @@ -1691,7 +1691,7 @@ /* cannot use f_perform_lu() as we expect a reject */ var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); f_create_gsup_expect(hex2str(g_pars.imsi)); - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); if (pars.send_early_cm) { BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); } else { @@ -1766,7 +1766,7 @@ /* cannot use f_perform_lu() as we expect a reject */ var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); f_create_gsup_expect(hex2str(g_pars.imsi)); - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); f_mm_auth(); alt { @@ -3502,7 +3502,7 @@ /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) - f_bssap_compl_l3(l3_lu); + f_cl3_or_initial_ue(l3_lu); f_mm_auth(); -- To view, visit https://gerrit.osmocom.org/13752 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia27afa265d441d1a0cbb40cc2d938aff46fa25f9 Gerrit-Change-Number: 13752 Gerrit-PatchSet: 6 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:41:55 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:41:55 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Add Iu related tests for most existing 2G tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13753 ) Change subject: msc: Add Iu related tests for most existing 2G tests ...................................................................... msc: Add Iu related tests for most existing 2G tests This might look a bit like copy+paste programming for our testcases. However, we actually want the Iu related tests show up as separate 'testscase' in the TTCN-3 sense, so there's no way that's more elegant than this :/ Change-Id: I3b56e17487c9df839e67ed390a1ff89979683e8e --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn A msc/MSC_Tests_Iu.ttcn 3 files changed, 590 insertions(+), 58 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 1fd02aa..b1a0491 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -86,7 +86,7 @@ boolean ran_is_geran }; -private function imsi_hex2oct(hexstring imsi) return octetstring { +function imsi_hex2oct(hexstring imsi) return octetstring { var hexstring tmp := ''H; var octetstring ret; var integer i; diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index af654a3..d4be96b 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -1,5 +1,7 @@ module MSC_Tests { +friend module MSC_Tests_Iu; + import from General_Types all; import from Osmocom_Types all; @@ -41,6 +43,7 @@ import from BSSMAP_Templates all; import from RAN_Emulation all; import from BSC_ConnectionHandler all; +import from RANAP_Templates all; import from SGsAP_Templates all; import from SGsAP_Types all; @@ -518,6 +521,10 @@ use_umts_aka := false, ran_is_geran := ran_is_geran }; + if (not ran_is_geran) { + pars.use_umts_aka := true; + pars.net.expect_auth := true; + } return pars; } @@ -587,7 +594,7 @@ } /* Do LU by IMSI, refuse it on GSUP and expect LU REJ back to MS */ -private function f_tc_lu_imsi_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_lu_imsi_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); @@ -613,8 +620,10 @@ vc_conn.done; } + + /* Do LU by IMSI, timeout on GSUP */ -private function f_tc_lu_imsi_timeout_gsup(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_lu_imsi_timeout_gsup(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); @@ -641,6 +650,7 @@ vc_conn.done; } + private function f_tc_lu_imsi_auth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { pars.net.expect_auth := true; f_init_handler(pars); @@ -655,7 +665,8 @@ vc_conn.done; } -private function f_tc_lu_imsi_auth3g_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + +friend function f_tc_lu_imsi_auth3g_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { pars.net.expect_auth := true; pars.use_umts_aka := true; f_init_handler(pars); @@ -670,8 +681,9 @@ vc_conn.done; } + /* Send CM SERVICE REQ for IMSI that has never performed LU before */ -private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) +friend function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); @@ -712,7 +724,8 @@ vc_conn.done; } -private function f_tc_lu_and_mo_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + +friend function f_tc_lu_and_mo_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); cpars.bss_rtp_port := 1110; @@ -731,8 +744,9 @@ vc_conn.done; } + /* Test LU (with authentication enabled), where HLR times out sending SAI response */ -private function f_tc_lu_auth_sai_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_lu_auth_sai_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) @@ -745,7 +759,9 @@ f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); /* The HLR would normally return an auth vector here, but we fail to do so. */ @@ -762,8 +778,9 @@ vc_conn.done; } + /* Test LU (with authentication enabled), where HLR rejects sending SAI error */ -private function f_tc_lu_auth_sai_err(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_lu_auth_sai_err(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) @@ -776,7 +793,9 @@ f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); GSUP.send(ts_GSUP_SAI_ERR(g_pars.imsi, 13)); @@ -793,6 +812,7 @@ vc_conn.done; } + /* Test LU but BSC will send a clear request in the middle */ private function f_tc_lu_clear_request(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); @@ -837,7 +857,7 @@ } /* Test LU but BSC will send a clear request in the middle */ -private function f_tc_lu_disconnect(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_lu_disconnect(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) @@ -850,7 +870,9 @@ f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } f_sleep(1.0); /* send clear request in the middle of the LU */ @@ -866,9 +888,8 @@ vc_conn.done; } - /* Test LU but with illegal mobile identity type = IMEI */ -private function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imei(g_pars.imei) @@ -881,7 +902,9 @@ f_cl3_or_initial_ue(l3_lu); /* Send Early Classmark, just for the fun of it */ - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } /* wait for LU reject, ignore any ID REQ */ alt { [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } @@ -898,6 +921,7 @@ vc_conn.done; } + /* Test LU by TMSI with unknown TMSI, expect (and answer) ID REQ. */ private function f_tc_lu_tmsi_noauth_unknown(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { /* We piggyback a test for an MSC crash on overlong IMSI (OS#2864) onto this test. */ @@ -953,7 +977,7 @@ /* Test IMSI DETACH (MI=IMSI) */ -private function f_tc_imsi_detach_by_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_imsi_detach_by_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); @@ -962,7 +986,9 @@ f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); /* Send Early Classmark, just for the fun of it? */ - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } /* wait for normal teardown */ f_expect_clear(); @@ -975,8 +1001,9 @@ vc_conn.done; } + /* Test IMSI DETACH (MI=TMSI) */ -private function f_tc_imsi_detach_by_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_imsi_detach_by_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var MobileIdentityLV mi := valueof(ts_MI_TMSI_LV('01020304'O)); @@ -985,7 +1012,9 @@ f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); /* Send Early Classmark, just for the fun of it? */ - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } /* wait for normal teardown */ f_expect_clear(); @@ -998,8 +1027,9 @@ vc_conn.done; } + /* Test IMSI DETACH (MI=IMEI), which is illegal */ -private function f_tc_imsi_detach_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_imsi_detach_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); @@ -1008,7 +1038,9 @@ f_cl3_or_initial_ue(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); /* Send Early Classmark, just for the fun of it? */ - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } /* wait for normal teardown */ f_expect_clear(); @@ -1032,7 +1064,7 @@ } /* establish an emergency call by IMEI, no SIM inserted (and hence no IMSI) */ -private function f_tc_emerg_call_imei_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_emerg_call_imei_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); @@ -1049,8 +1081,9 @@ vc_conn.done; } + /* establish an emergency call by IMSI, SIM inserted (and hence IMSI) */ -private function f_tc_emerg_call_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_emerg_call_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); /* First perform location update to ensure subscriber is known */ f_perform_lu(); @@ -1065,6 +1098,7 @@ vc_conn.done; } + /* CM Service Request for VGCS -> reject */ private function f_tc_cm_serv_req_vgcs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); @@ -1276,7 +1310,7 @@ } /* Test Complete L3 with random payload */ -private function f_tc_establish_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_establish_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); f_perform_lu(); @@ -1292,8 +1326,9 @@ vc_conn.done; } + /* Test MO Call SETUP with no response from MNCC */ -private function f_tc_mo_setup_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_mo_setup_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars, 190.0); var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); @@ -1322,8 +1357,9 @@ vc_conn.done; } + /* Test MO Call with no response to RAN-side CRCX */ -private function f_tc_mo_crcx_ran_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_mo_crcx_ran_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); var MNCC_PDU mncc; @@ -1361,8 +1397,9 @@ vc_conn.done; } + /* Test MO Call with reject to RAN-side CRCX */ -private function f_tc_mo_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_mo_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); var MNCC_PDU mncc; @@ -1475,7 +1512,7 @@ } /* Test MT Call */ -private function f_tc_mt_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_mt_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); var MNCC_PDU mncc; @@ -1544,8 +1581,9 @@ } + /* Test MT Call T310 timer */ -private function f_tc_mt_t310(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_mt_t310(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars, 200.0); var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); var MNCC_PDU mncc; @@ -1596,8 +1634,9 @@ vc_conn.done; } + /* Perform successful LU + MO call, then GSUP LocationCancel. Subscriber must be denied CM SERV */ -private function f_tc_gsup_cancel(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_gsup_cancel(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); cpars.bss_rtp_port := 1110; @@ -1644,6 +1683,7 @@ vc_conn.done; } + /* A5/1 only permitted on network side, and MS capable to do it */ private function f_tc_lu_imsi_auth_tmsi_encr_1_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { pars.net.expect_auth := true; @@ -1900,7 +1940,7 @@ } /* Test MO Call with no response to RAN-side CRCX or DTAP Release */ -private function f_tc_mo_release_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_mo_release_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); var MNCC_PDU mncc; @@ -1983,12 +2023,20 @@ setverdict(pass); } +/* Two BSSMAP resets from two different BSCs plus one IuCS RANAP Reset */ +testcase TC_reset_two_1iu() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_sleep(2.0); + setverdict(pass); +} + /*********************************************************************** * SMS Testing ***********************************************************************/ /* LU followed by MO SMS */ -private function f_tc_lu_and_mo_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_lu_and_mo_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { var SmsParameters spars := valueof(t_SmsPars); f_init_handler(pars); @@ -2010,6 +2058,7 @@ vc_conn.done; } + private function f_vty_sms_send(charstring imsi, charstring msisdn, charstring text) runs on BSC_ConnHdlr { f_vty_transceive(MSCVTY, "subscriber imsi "&imsi&" sms sender msisdn "&msisdn&" send "&text); @@ -2023,7 +2072,7 @@ } /* LU followed by MT SMS */ -private function f_tc_lu_and_mt_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_lu_and_mt_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { var SmsParameters spars := valueof(t_SmsPars); var OCT4 tmsi; @@ -2062,8 +2111,9 @@ vc_conn.done; } + /* Paging for MT SMS but no response */ -private function f_tc_lu_and_mt_sms_paging_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_lu_and_mt_sms_paging_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { var SmsParameters spars := valueof(t_SmsPars); var OCT4 tmsi; f_init_handler(pars, 150.0); @@ -2082,18 +2132,22 @@ f_vty_sms_send(hex2str(pars.imsi), "2342", "Hello SMS"); /* Expect the MSC to page exactly once */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { }; + f_expect_paging(); /* Wait some time to make sure the MSC is not delivering any further * paging messages or anything else that could be unexpected. */ timer T := 20.0; T.start alt { - [] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) + [pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { setverdict(fail, "paging seems not to stop!"); mtc.stop; } + [not pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi), ?)) { + setverdict(fail, "paging seems not to stop!"); + mtc.stop; + } [] BSSAP.receive { setverdict(fail, "unexpected BSSAP message received"); self.stop; @@ -2116,8 +2170,9 @@ vc_conn.done; } + /* mobile originated SMS from MS/BTS/BSC side to SMPP */ -private function f_tc_smpp_mo_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_smpp_mo_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { var SmsParameters spars := valueof(t_SmsPars); f_init_handler(pars); @@ -2175,8 +2230,9 @@ f_vty_config2(MSCVTY, { "smpp", "esme msc_tester"}, "no default-route"); } + /* Test MO-SMS from MS/BTS/BSC towards HLR (via GSUP) */ -private function f_tc_gsup_mo_sms(charstring id, BSC_ConnHdlrPars pars) +friend function f_tc_gsup_mo_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { var SmsParameters spars := valueof(t_SmsPars); var GSUP_PDU gsup_msg_rx; @@ -2244,8 +2300,9 @@ f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); } + /* Test MO-SMMA from MS/BTS/BSC towards HLR (via GSUP) */ -private function f_tc_gsup_mo_smma(charstring id, BSC_ConnHdlrPars pars) +friend function f_tc_gsup_mo_smma(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { var SmsParameters spars := valueof(t_SmsPars); var GSUP_PDU gsup_msg_rx; @@ -2300,6 +2357,7 @@ f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); } + /* Helper for sending MT SMS over GSUP */ private function f_gsup_forwardSM_req(SmsParameters spars, OCT1 mms := '00'O) runs on BSC_ConnHdlr { @@ -2319,7 +2377,7 @@ } /* Test successful MT-SMS (RP-ACK) over GSUP */ -private function f_tc_gsup_mt_sms_ack(charstring id, BSC_ConnHdlrPars pars) +friend function f_tc_gsup_mt_sms_ack(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { var SmsParameters spars := valueof(t_SmsPars); @@ -2381,8 +2439,9 @@ f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); } + /* Test rejected MT-SMS (RP-ERROR) over GSUP */ -private function f_tc_gsup_mt_sms_err(charstring id, BSC_ConnHdlrPars pars) +friend function f_tc_gsup_mt_sms_err(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { var SmsParameters spars := valueof(t_SmsPars); var OCT1 sm_rp_cause := '78'O; /* dummy RP-Cause value */ @@ -2447,8 +2506,9 @@ f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); } + /* Test SM-RP-MR assignment for MT-SMS over GSUP */ -private function f_tc_gsup_mt_sms_rp_mr(charstring id, BSC_ConnHdlrPars pars) +friend function f_tc_gsup_mt_sms_rp_mr(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { var SmsParameters spars1 := valueof(t_SmsPars); /* 1st SMS */ var SmsParameters spars2 := valueof(t_SmsPars); /* 2nd SMS */ @@ -2559,8 +2619,9 @@ f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); } + /* Test SM-RP-MR assignment for MT-SMS over GSUP */ -private function f_tc_gsup_mo_mt_sms_rp_mr(charstring id, BSC_ConnHdlrPars pars) +friend function f_tc_gsup_mo_mt_sms_rp_mr(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { var SmsParameters spars_mo := valueof(t_SmsPars); /* MO SMMA */ var SmsParameters spars_mt := valueof(t_SmsPars); /* MT SMS */ @@ -2663,6 +2724,7 @@ f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); } + /* Test multi-part MT-SMS over GSUP */ private function f_tc_gsup_mt_multi_part_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -2696,7 +2758,7 @@ /* Expect Paging Request and Establish connection */ if (i == 3) { /* ... only once! */ - BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + f_expect_paging(); f_establish_fully(EST_TYPE_PAG_RESP); } @@ -2902,7 +2964,7 @@ } /* LU followed by MO USSD request */ -private function f_tc_lu_and_mo_ussd_single_request(charstring id, BSC_ConnHdlrPars pars) +friend function f_tc_lu_and_mo_ussd_single_request(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); @@ -2978,8 +3040,9 @@ vc_conn.done; } + /* LU followed by MT USSD notification */ -private function f_tc_lu_and_mt_ussd_notification(charstring id, BSC_ConnHdlrPars pars) +friend function f_tc_lu_and_mt_ussd_notification(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); @@ -3021,7 +3084,10 @@ /* Send it to MSC and expect Paging Request */ GSUP.send(gsup_req); alt { - [] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { + [pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { + setverdict(pass); + } + [not pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi), ?)) { setverdict(pass); } /* We don't expect anything else */ @@ -3081,8 +3147,9 @@ vc_conn.done; } + /* LU followed by MT call and MO USSD request during this call */ -private function f_tc_lu_and_mo_ussd_during_mt_call(charstring id, BSC_ConnHdlrPars pars) +friend function f_tc_lu_and_mo_ussd_during_mt_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); @@ -3168,7 +3235,7 @@ } /* BSSMAP Clear Request in the middle of a call, see OS#3062 */ -private function f_tc_mo_cc_bssmap_clear(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +friend function f_tc_mo_cc_bssmap_clear(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); var MNCC_PDU mncc; @@ -3192,15 +3259,28 @@ MGCP.receive(tr_CRCX); f_sleep(1.0); - BSSAP.send(ts_BSSMAP_ClearRequest(0)); + if (pars.ran_is_geran) { + BSSAP.send(ts_BSSMAP_ClearRequest(0)); + } else { + BSSAP.send(ts_RANAP_IuReleaseRequest(ts_RanapCause_om_intervention)); + } var default ccrel := activate(as_optional_cc_rel(cpars)); - interleave { - [] MNCC.receive(tr_MNCC_REL_ind(?, ?)) { }; - [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + if (pars.ran_is_geran) { + interleave { + [] MNCC.receive(tr_MNCC_REL_ind(?, ?)) { }; + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { BSSAP.send(ts_BSSMAP_ClearComplete); - }; + }; + } + } else { + interleave { + [] MNCC.receive(tr_MNCC_REL_ind(?, ?)) { }; + [] BSSAP.receive(tr_RANAP_IuReleaseCommand(?)) { + BSSAP.send(ts_RANAP_IuReleaseComplete); + }; + } } deactivate(ccrel); @@ -3215,8 +3295,9 @@ vc_conn.done; } + /* LU followed by MT call and MT USSD request during this call */ -private function f_tc_lu_and_mt_ussd_during_mt_call(charstring id, BSC_ConnHdlrPars pars) +friend function f_tc_lu_and_mt_ussd_during_mt_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); @@ -3317,8 +3398,9 @@ vc_conn.done; } + /* LU followed by MO USSD request and MO Release during transaction */ -private function f_tc_lu_and_mo_ussd_mo_release(charstring id, BSC_ConnHdlrPars pars) +friend function f_tc_lu_and_mo_ussd_mo_release(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); @@ -3414,8 +3496,9 @@ vc_conn.done; } + /* LU followed by MO USSD request and MT Release due to timeout */ -private function f_tc_lu_and_ss_session_timeout(charstring id, BSC_ConnHdlrPars pars) +friend function f_tc_lu_and_ss_session_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); @@ -3486,6 +3569,7 @@ f_vty_config(MSCVTY, "msc", "ncss guard-timeout 0"); } + /* A5/1 only permitted on network side; attempt an invalid CIPHER MODE COMPLETE with A5/3 which MSC should reject. */ private function f_tc_cipher_complete_with_invalid_cipher(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { pars.net.expect_auth := true; @@ -3571,6 +3655,10 @@ * too long / short TLV values */ +/*********************************************************************** + * SGsAP Testing + ***********************************************************************/ + /* Check if a subscriber exists in the VLR */ private function f_ctrl_subscr_in_vlr(charstring imsi_or_msisdn) runs on BSC_ConnHdlr return boolean { @@ -3603,7 +3691,10 @@ f_vty_transceive(MSCVTY, "subscriber imsi " & hex2str(g_pars.imsi) & " paging"); alt { - [] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); { + [g_pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); { + setverdict(pass); + } + [not g_pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi), ?)) { setverdict(pass); } [] SGsAP.receive { diff --git a/msc/MSC_Tests_Iu.ttcn b/msc/MSC_Tests_Iu.ttcn new file mode 100644 index 0000000..991c9b8 --- /dev/null +++ b/msc/MSC_Tests_Iu.ttcn @@ -0,0 +1,441 @@ +module MSC_Tests_Iu { + +import from General_Types all; +import from Osmocom_Types all; + +import from BSC_ConnectionHandler all; +import from MSC_Tests all; + +import from Osmocom_VTY_Functions all; + +import from GSUP_Emulation all; +import from RAN_Emulation all; + +import from RANAP_Templates all; + +import from MobileL3_Types all; +import from MobileL3_CommonIE_Types all; +import from MobileL3_SMS_Types all; +import from L3_Templates all; +import from L3_Common all; + + + +testcase TC_iu_lu_imsi_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_reject), 1003, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_lu_imsi_timeout_gsup() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_timeout_gsup), 1004, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_lu_imsi_auth3g_tmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_vty_config(MSCVTY, "network", "authentication required"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth3g_tmsi), 1005, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_cmserv_imsi_unknown() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), 1006, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_lu_and_mo_call() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), 1007, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_lu_auth_sai_timeout() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_vty_config(MSCVTY, "network", "authentication required"); + + vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), 1008, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_lu_auth_sai_err() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_vty_config(MSCVTY, "network", "authentication required"); + + vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), 1009, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +/* Test LU but RNC will send a Iu Release request in the middle */ +private function f_tc_iu_lu_release_request(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + f_init_handler(pars); + + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_cl3_or_initial_ue(l3_lu); + + f_sleep(1.0); + /* send release request in the middle of the LU */ + BSSAP.send(ts_RANAP_IuReleaseRequest(ts_RanapCause_om_intervention)); + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { repeat; } + [] BSSAP.receive(tr_RANAP_IuReleaseCommand(?)) {} + } + BSSAP.send(ts_RANAP_IuReleaseComplete); + alt { + /* See https://osmocom.org/issues/2862 */ + [] BSSAP.receive(tr_RANAP_IuReleaseCommand(?)) { + setverdict(fail, "Got a second Iu Release Command, only one expected"); + mtc.stop; + repeat; + } + [] BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} + } + setverdict(pass); +} +testcase TC_iu_lu_release_request() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_iu_lu_release_request), 1010, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_lu_disconnect() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_lu_disconnect), 1011, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_lu_by_imei() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_lu_by_imei), 1012, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_imsi_detach_by_imsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imsi), 1014, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_imsi_detach_by_tmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_tmsi), 1015, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_imsi_detach_by_imei() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imei), 1016, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_emerg_call_imei_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_emerg_call_imei_reject), 1017, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_emerg_call_imsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), 1018, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_establish_and_nothing() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_establish_and_nothing), 1027, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_mo_setup_and_nothing() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_mo_setup_and_nothing), 1028, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_mo_crcx_ran_timeout() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_mo_crcx_ran_timeout), 1029, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_mo_crcx_ran_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_mo_crcx_ran_reject), 1030, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_mt_crcx_ran_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_mt_crcx_ran_reject), 1031, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_mt_t310() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_mt_t310), 1032, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_gsup_cancel() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_gsup_cancel), 1033, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_mo_release_timeout() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_mo_release_timeout), 1040, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_lu_and_mo_sms() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_sms), 1042, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_lu_and_mt_sms() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(3); + pars := f_init_pars(1043, ran_idx := 2, ran_is_geran := false); + vc_conn := f_start_handler_with_pars(refers(f_tc_lu_and_mt_sms), pars); + vc_conn.done; +} + +testcase TC_iu_lu_and_mt_sms_paging_and_nothing() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(3); + pars := f_init_pars(101843, ran_idx := 2, ran_is_geran := false); + vc_conn := f_start_handler_with_pars(refers(f_tc_lu_and_mt_sms_paging_and_nothing), pars); + vc_conn.done; +} + +testcase TC_iu_smpp_mo_sms() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_vty_config2(MSCVTY, { "smpp", "esme msc_tester"}, "default-route"); + vc_conn := f_start_handler(refers(f_tc_smpp_mo_sms), 1044, ran_idx := 2, ran_is_geran := false); + vc_conn.done; + f_vty_config2(MSCVTY, { "smpp", "esme msc_tester"}, "no default-route"); +} + +testcase TC_iu_gsup_mo_sms() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_vty_config(MSCVTY, "msc", "sms-over-gsup"); + vc_conn := f_start_handler(refers(f_tc_gsup_mo_sms), 1088, ran_idx := 2, ran_is_geran := false); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); +} + +testcase TC_iu_gsup_mo_smma() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_vty_config(MSCVTY, "msc", "sms-over-gsup"); + vc_conn := f_start_handler(refers(f_tc_gsup_mo_smma), 1089, ran_idx := 2, ran_is_geran := false); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); +} + +testcase TC_iu_gsup_mt_sms_ack() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(3); + pars := f_init_pars(1090, ran_idx := 2, ran_is_geran := false); + f_vty_config(MSCVTY, "msc", "sms-over-gsup"); + vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mt_sms_ack), pars); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); +} + +testcase TC_iu_gsup_mt_sms_err() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(3); + pars := f_init_pars(1091, ran_idx := 2, ran_is_geran := false); + f_vty_config(MSCVTY, "msc", "sms-over-gsup"); + vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mt_sms_err), pars); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); +} + +testcase TC_iu_gsup_mt_sms_rp_mr() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(3); + pars := f_init_pars(1092, ran_idx := 2, ran_is_geran := false); + f_vty_config(MSCVTY, "msc", "sms-over-gsup"); + vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mt_sms_rp_mr), pars); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); +} + +testcase TC_iu_gsup_mo_mt_sms_rp_mr() runs on MTC_CT { + var BSC_ConnHdlrPars pars; + var BSC_ConnHdlr vc_conn; + f_init(3); + pars := f_init_pars(1093, ran_idx := 2, ran_is_geran := false); + f_vty_config(MSCVTY, "msc", "sms-over-gsup"); + vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mo_mt_sms_rp_mr), pars); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "no sms-over-gsup"); +} + +testcase TC_iu_lu_and_mo_ussd_single_request() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_ussd_single_request), 1046, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_lu_and_mt_ussd_notification() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + vc_conn := f_start_handler(refers(f_tc_lu_and_mt_ussd_notification), 1047, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_lu_and_mo_ussd_during_mt_call() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_ussd_during_mt_call), 1048, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_mo_cc_iu_release() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + + vc_conn := f_start_handler(refers(f_tc_mo_cc_bssmap_clear), 1043, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_lu_and_mt_ussd_during_mt_call() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + vc_conn := f_start_handler(refers(f_tc_lu_and_mt_ussd_during_mt_call), 1049, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_lu_and_mo_ussd_mo_release() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_ussd_mo_release), 1050, ran_idx := 2, ran_is_geran := false); + vc_conn.done; +} + +testcase TC_iu_lu_and_ss_session_timeout() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(3); + f_vty_config(MSCVTY, "msc", "ncss guard-timeout 3"); + vc_conn := f_start_handler(refers(f_tc_lu_and_ss_session_timeout), 1051, ran_idx := 2, ran_is_geran := false); + vc_conn.done; + f_vty_config(MSCVTY, "msc", "ncss guard-timeout 0"); +} + +control { + execute( TC_iu_lu_imsi_reject() ); + execute( TC_iu_lu_imsi_timeout_gsup() ); + execute( TC_iu_lu_imsi_auth3g_tmsi() ); + execute( TC_iu_cmserv_imsi_unknown() ); + execute( TC_iu_lu_and_mo_call() ); + execute( TC_iu_lu_auth_sai_timeout() ); + execute( TC_iu_lu_auth_sai_err() ); + execute( TC_iu_lu_release_request() ); + execute( TC_iu_lu_disconnect() ); + execute( TC_iu_lu_by_imei() ); + execute( TC_iu_imsi_detach_by_imsi() ); + execute( TC_iu_imsi_detach_by_tmsi() ); + execute( TC_iu_imsi_detach_by_imei() ); + execute( TC_iu_emerg_call_imei_reject() ); + execute( TC_iu_emerg_call_imsi() ); + execute( TC_iu_establish_and_nothing() ); + execute( TC_iu_mo_setup_and_nothing() ); + execute( TC_iu_mo_crcx_ran_timeout() ); + execute( TC_iu_mo_crcx_ran_reject() ); + execute( TC_iu_mt_crcx_ran_reject() ); + execute( TC_iu_gsup_cancel() ); + execute( TC_iu_mo_release_timeout() ); + execute( TC_reset_two_1iu() ); + + execute( TC_iu_lu_and_mo_sms() ); + execute( TC_iu_lu_and_mt_sms() ); + execute( TC_iu_lu_and_mt_sms_paging_and_nothing() ); + execute( TC_iu_smpp_mo_sms() ); + + execute( TC_iu_gsup_mo_sms() ); + execute( TC_iu_gsup_mo_smma() ); + execute( TC_iu_gsup_mt_sms_ack() ); + execute( TC_iu_gsup_mt_sms_err() ); + execute( TC_iu_gsup_mt_sms_rp_mr() ); + execute( TC_iu_gsup_mo_mt_sms_rp_mr() ); + + execute( TC_iu_lu_and_mo_ussd_single_request() ); + execute( TC_iu_lu_and_mt_ussd_notification() ); + execute( TC_iu_lu_and_mo_ussd_during_mt_call() ); + execute( TC_iu_lu_and_mt_ussd_during_mt_call() ); + execute( TC_iu_lu_and_mo_ussd_mo_release() ); + execute( TC_iu_lu_and_ss_session_timeout() ); + + /* TODO: Iu + SGsAP related tests, e.g. paging on IuCS */ + + /* Run this last: at the time of writing this test crashes the MSC */ + execute( TC_mo_cc_iu_release() ); +} + + +} -- To view, visit https://gerrit.osmocom.org/13753 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3b56e17487c9df839e67ed390a1ff89979683e8e Gerrit-Change-Number: 13753 Gerrit-PatchSet: 6 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:43:32 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:43:32 +0000 Subject: Change in osmo-ci[master]: update-osmo-ci: disable admin2-deb{8, 9}build In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13820 ) Change subject: update-osmo-ci: disable admin2-deb{8,9}build ...................................................................... Patch Set 1: I just brought them back online. The memtest didn't indicate anything wrong with that host. -- To view, visit https://gerrit.osmocom.org/13820 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic062cafd58f77d40042c9b467814257576c23027 Gerrit-Change-Number: 13820 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: osmith Gerrit-Comment-Date: Tue, 30 Apr 2019 20:43:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:44:54 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:44:54 +0000 Subject: Change in libosmocore[master]: GSUP: add inter-MSC handover related msgs and IEs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/12860 ) Change subject: GSUP: add inter-MSC handover related msgs and IEs ...................................................................... GSUP: add inter-MSC handover related msgs and IEs Based on a draft created by Neels, which is the result of reading a MAP trace of two MSCs negotiating inter-MSC handovers, and of reading the TS 29.002, TS 29.010 and related specs: https://lists.osmocom.org/pipermail/openbsc/2019-January/012653.html I figured out that the "Handover Number" mentioned in the specifications is the same as the MSISDN IE that we already have, so we can use that instead of creating a new IE (example usage in tests/gsup/gsup_test.c). Create a new OSMO_GSUP_MSGT_E_ROUTING_ERROR message type, which the GSUP server uses to tell a client that its message could not be forwarded to the destination (see [1]). MAP has no related message. [1]: Change-Id: Ia4f345abc877baaf0a8f73b8988e6514d9589bf5 (osmo-hlr.git) Related: OS#3774 Change-Id: Ic00b0601eacff6d72927cea51767801142ee75db --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c M tests/gsup/gsup_test.c M tests/gsup/gsup_test.err M tests/gsup/gsup_test.ok 5 files changed, 540 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 7f304a3..1374e0e 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -42,7 +42,9 @@ #include #include #include +#include #include +#include #include #define OSMO_GSUP_PORT 4222 @@ -103,6 +105,14 @@ OSMO_GSUP_IMEI_IE = 0x50, OSMO_GSUP_IMEI_RESULT_IE = 0x51, + /* Inter-MSC handover related */ + OSMO_GSUP_SOURCE_NAME_IE = 0x60, + OSMO_GSUP_DESTINATION_NAME_IE = 0x61, + OSMO_GSUP_AN_APDU_IE = 0x62, + OSMO_GSUP_CAUSE_RR_IE = 0x63, + OSMO_GSUP_CAUSE_BSSAP_IE = 0x64, + OSMO_GSUP_CAUSE_SM_IE = 0x65, + _OSMO_GSUP_IEI_END_MARKER }; @@ -164,6 +174,26 @@ OSMO_GSUP_MSGT_CHECK_IMEI_REQUEST = 0b00110000, OSMO_GSUP_MSGT_CHECK_IMEI_ERROR = 0b00110001, OSMO_GSUP_MSGT_CHECK_IMEI_RESULT = 0b00110010, + + OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_REQUEST = 0b00110100, + OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_ERROR = 0b00110101, + OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_RESULT = 0b00110110, + + OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_REQUEST = 0b00111000, + OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_ERROR = 0b00111001, + OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_RESULT = 0b00111010, + + OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_REQUEST = 0b00111100, + OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_ERROR = 0b00111101, + OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_RESULT = 0b00111110, + + OSMO_GSUP_MSGT_E_PROCESS_ACCESS_SIGNALLING_REQUEST = 0b01000000, + OSMO_GSUP_MSGT_E_FORWARD_ACCESS_SIGNALLING_REQUEST = 0b01000100, + + OSMO_GSUP_MSGT_E_CLOSE = 0b01000111, + OSMO_GSUP_MSGT_E_ABORT = 0b01001011, + + OSMO_GSUP_MSGT_E_ROUTING_ERROR = 0b01001110, }; #define OSMO_GSUP_IS_MSGT_REQUEST(msgt) (((msgt) & 0b00000011) == 0b00) @@ -190,6 +220,12 @@ OSMO_GSUP_IMEI_RESULT_NACK = 2, /* on wire: 1 */ }; +/* 3GPP 29.002 AccessNetworkProtocolId */ +enum osmo_gsup_access_network_protocol { + OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_48006 = 1, + OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_25413 = 2, +}; + /*! TCAP-like session state */ enum osmo_gsup_session_state { /*! Undefined session state */ @@ -245,6 +281,14 @@ static inline const char *osmo_gsup_message_class_name(enum osmo_gsup_message_class val) { return get_value_string(osmo_gsup_message_class_names, val); } +/*! AccessNetworkSignalInfo as in 3GPP TS 29.002. */ +struct osmo_gsup_an_apdu { + /* AccessNetworkProtocolId as in 3GPP TS 29.002. */ + enum osmo_gsup_access_network_protocol access_network_proto; + const uint8_t *data; + size_t data_len; +}; + /*! parsed/decoded GSUP protocol message */ struct osmo_gsup_message { enum osmo_gsup_message_type message_type; @@ -307,6 +351,28 @@ * Inter-MSC messages are *required* to set a class = OSMO_GSUP_MESSAGE_CLASS_INTER_MSC. For older message classes, this may * be omitted (for backwards compatibility only -- if in doubt, include it). */ enum osmo_gsup_message_class message_class; + + /*! For messages routed via another GSUP entity (via HLR), the IPA name of the entity that sent this message. */ + const uint8_t *source_name; + /*! Number of bytes in source_name. */ + size_t source_name_len; + /*! For messages routed via another GSUP entity (via HLR), the IPA name of the entity that should ultimately + * receive this message. */ + const uint8_t *destination_name; + /*! Number of bytes in destination_name. */ + size_t destination_name_len; + + /*! inter-MSC AN-APDU. */ + struct osmo_gsup_an_apdu an_apdu; + + uint8_t cause_rr; /*!< 0 is a valid cause */ + bool cause_rr_set; /*!< whether cause_rr is set */ + + enum gsm0808_cause cause_bssap; /*!< 0 is a valid cause */ + bool cause_bssap_set; /*!< whether cause_bssap is set */ + + /*! Session Management cause as of 3GPP TS 24.008 10.5.6.6 / Table 10.5.157. */ + enum gsm48_gsm_cause cause_sm; }; int osmo_gsup_decode(const uint8_t *data, size_t data_len, diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 71dbbe1..a3d9eef 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -83,6 +83,26 @@ OSMO_VALUE_STRING(OSMO_GSUP_MSGT_CHECK_IMEI_ERROR), OSMO_VALUE_STRING(OSMO_GSUP_MSGT_CHECK_IMEI_RESULT), + OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_REQUEST), + OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_ERROR), + OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_RESULT), + + OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_REQUEST), + OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_ERROR), + OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_RESULT), + + OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_REQUEST), + OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_ERROR), + OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_RESULT), + + OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_PROCESS_ACCESS_SIGNALLING_REQUEST), + OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_FORWARD_ACCESS_SIGNALLING_REQUEST), + + OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_CLOSE), + OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_ABORT), + + OSMO_VALUE_STRING(OSMO_GSUP_MSGT_E_ROUTING_ERROR), + { 0, NULL } }; @@ -247,6 +267,26 @@ return -1; } +/*! Decode AN-apdu (see 3GPP TS 29.002 7.6.9.1). + * \param[out] gsup_msg abstract GSUP message structure + * \param[in] data pointer to the raw IE payload + * \param[in] data_len length of IE pointed by \ref data + * \returns 0 in case of success, negative in case of error + */ +int osmo_gsup_decode_an_apdu(struct osmo_gsup_message *gsup_msg, const uint8_t *data, size_t data_len) +{ + if (data_len < 1) { + LOGP(DLGSUP, LOGL_ERROR, "Corrupted an_apdu message (length must be >= 1)\n"); + return -EINVAL; + } + + gsup_msg->an_apdu.access_network_proto = data[0]; + gsup_msg->an_apdu.data_len = data_len -1; + gsup_msg->an_apdu.data = data + 1; + + return 0; +} + /*! Decode (parse) a GSUP message * \param[in] const_data input data to be parsed * \param[in] data_len length of input (\a const_data) @@ -481,6 +521,36 @@ gsup_msg->message_class = value[0]; break; + case OSMO_GSUP_SOURCE_NAME_IE: + gsup_msg->source_name = value; + gsup_msg->source_name_len = value_len; + break; + + case OSMO_GSUP_DESTINATION_NAME_IE: + gsup_msg->destination_name = value; + gsup_msg->destination_name_len = value_len; + break; + + case OSMO_GSUP_AN_APDU_IE: + rc = osmo_gsup_decode_an_apdu(gsup_msg, value, value_len); + if (rc) + return rc; + break; + + case OSMO_GSUP_CAUSE_RR_IE: + gsup_msg->cause_rr = value[0]; + gsup_msg->cause_rr_set = true; + break; + + case OSMO_GSUP_CAUSE_BSSAP_IE: + gsup_msg->cause_bssap = value[0]; + gsup_msg->cause_bssap_set = true; + break; + + case OSMO_GSUP_CAUSE_SM_IE: + gsup_msg->cause_sm = value[0]; + break; + default: LOGP(DLGSUP, LOGL_NOTICE, "GSUP IE type %d unknown\n", iei); @@ -568,6 +638,35 @@ *len_field = msgb_length(msg) - old_len; } +/*! Encode AN-apdu (see 3GPP TS 29.002 7.6.9.1). + * \param[out] msg target message buffer (caller-allocated) + * \param[in] gsup_msg abstract GSUP message structure + * \returns 0 in case of success, negative in case of error + */ +int osmo_gsup_encode_an_apdu(struct msgb *msg, const struct osmo_gsup_message *gsup_msg) +{ + const struct osmo_gsup_an_apdu an_apdu = gsup_msg->an_apdu; + + if (msgb_tailroom(msg) < 2 + an_apdu.data_len) { + LOGP(DLGSUP, LOGL_ERROR, "Not enough tailroom in msg to encode an_apdu:" + " IE header (2) + an_apdu.data_len (%zu) == %zu, msgb tailroom == %d\n", + an_apdu.data_len, an_apdu.data_len + 2, msgb_tailroom(msg)); + return -ENOMEM; + } + + /* Tag and total length */ + msgb_tv_put(msg, OSMO_GSUP_AN_APDU_IE, 1 + an_apdu.data_len); + + /* Put access_network_proto */ + msgb_v_put(msg, an_apdu.access_network_proto); + + /* Put data */ + uint8_t *buf = msgb_put(msg, an_apdu.data_len); + memcpy(buf, an_apdu.data, an_apdu.data_len); + + return 0; +} + /*! Encode a GSUP message * \param[out] msg message buffer to which encoded message is written * \param[in] gsup_msg \ref osmo_gsup_message data to be encoded @@ -727,6 +826,34 @@ msgb_tlv_put(msg, OSMO_GSUP_MESSAGE_CLASS_IE, sizeof(u8), &u8); } + if (gsup_msg->source_name) + msgb_tlv_put(msg, OSMO_GSUP_SOURCE_NAME_IE, gsup_msg->source_name_len, gsup_msg->source_name); + + if (gsup_msg->destination_name) + msgb_tlv_put(msg, OSMO_GSUP_DESTINATION_NAME_IE, gsup_msg->destination_name_len, + gsup_msg->destination_name); + + if (gsup_msg->an_apdu.access_network_proto || gsup_msg->an_apdu.data_len) { + rc = osmo_gsup_encode_an_apdu(msg, gsup_msg); + if (rc) { + LOGP(DLGSUP, LOGL_ERROR, "Failed to encode AN-apdu IE \n"); + return -EINVAL; + } + } + + if (gsup_msg->cause_rr_set) { + u8 = gsup_msg->cause_rr; + msgb_tlv_put(msg, OSMO_GSUP_CAUSE_RR_IE, sizeof(u8), &u8); + } + + if (gsup_msg->cause_bssap_set) { + u8 = gsup_msg->cause_bssap; + msgb_tlv_put(msg, OSMO_GSUP_CAUSE_BSSAP_IE, sizeof(u8), &u8); + } + + if ((u8 = gsup_msg->cause_sm)) + msgb_tlv_put(msg, OSMO_GSUP_CAUSE_SM_IE, sizeof(u8), &u8); + return 0; } diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c index 0631a51..b84c88f 100644 --- a/tests/gsup/gsup_test.c +++ b/tests/gsup/gsup_test.c @@ -9,9 +9,16 @@ /* Tests for osmo_gsup_messages.c */ +/* Complete IEs used multiple times (sorted alphabetically) + * 1st byte: IEI from osmo_gsup_iei, 2nd byte: length */ #define TEST_IMSI_IE 0x01, 0x08, 0x21, 0x43, 0x65, 0x87, 0x09, 0x21, 0x43, 0xf5 #define TEST_IMSI_STR "123456789012345" #define TEST_CLASS_SUBSCR_IE 0xa, 0x1, 0x1 +#define TEST_CLASS_INTER_MSC_IE 0xa, 0x1, 0x4 +#define TEST_MSISDN_IE 0x08, 0x07, 0x91, 0x94, 0x61, 0x46, 0x32, 0x24, 0x43 +#define TEST_AN_APDU_IE 0x62, 0x05, 0x01, 0x42, 0x42, 0x42, 0x42 +#define TEST_SOURCE_NAME_IE 0x60, 0x05, 'M', 'S', 'C', '-', 'A' +#define TEST_DESTINATION_NAME_IE 0x61, 0x05, 'M', 'S', 'C', '-', 'B' static void test_gsup_messages_dec_enc(void) { @@ -66,8 +73,7 @@ static const uint8_t update_location_res[] = { 0x06, TEST_IMSI_IE, - 0x08, 0x07, /* MSISDN of the subscriber */ - 0x91, 0x94, 0x61, 0x46, 0x32, 0x24, 0x43, + TEST_MSISDN_IE, 0x09, 0x07, /* HLR-Number of the subscriber */ 0x91, 0x83, 0x52, 0x38, 0x48, 0x83, 0x93, 0x04, 0x00, /* PDP info complete */ @@ -312,6 +318,217 @@ 0x00, /* OSMO_GSUP_IMEI_RESULT_ACK */ }; + /* Handover related test messages. Oftentimes they only differ in the + * AN_APDU_IE, which is mostly a blob in GSUP. To give a better example + * of how the messages can be used, I've added the information an_apdu + * holds in brackets (see osmo-msc.git's doc/interMSC_HO_GSUP_msgs.txt). + * The session states are from the ASCII art in this e-mail: + * https://lists.osmocom.org/pipermail/openbsc/2019-January/012653.html */ + static const uint8_t send_e_prepare_handover_req[] = { + 0x34, /* OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_REQUEST */ + TEST_IMSI_IE, + + /* Session ID and state (begin) */ + 0x30, 0x04, 0xde, 0xad, 0xbe, 0xef, + 0x31, 0x01, 0x01, + + TEST_CLASS_INTER_MSC_IE, + TEST_SOURCE_NAME_IE, + TEST_DESTINATION_NAME_IE, + TEST_AN_APDU_IE, /* (Handover Request) */ + }; + + static const uint8_t send_e_prepare_handover_err[] = { + 0x35, /* OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_ERROR */ + TEST_IMSI_IE, + + /* Session ID and state (continue) */ + 0x30, 0x04, 0xde, 0xad, 0xbe, 0xef, + 0x31, 0x01, 0x02, + + TEST_CLASS_INTER_MSC_IE, + TEST_SOURCE_NAME_IE, + TEST_DESTINATION_NAME_IE, + + /* cause_bssap */ + 0x64, 0x01, + 0x51, /* GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS */ + }; + + static const uint8_t send_e_prepare_handover_res[] = { + 0x36, /* OSMO_GSUP_MSGT_E_PREPARE_HANDOVER_RESULT */ + TEST_IMSI_IE, + TEST_MSISDN_IE, /* (Handover Number) */ + + /* Session ID and state (continue) */ + 0x30, 0x04, 0xde, 0xad, 0xbe, 0xef, + 0x31, 0x01, 0x02, + + TEST_CLASS_INTER_MSC_IE, + TEST_SOURCE_NAME_IE, + TEST_DESTINATION_NAME_IE, + TEST_AN_APDU_IE, /* (Handover Request Ack) */ + }; + + static const uint8_t send_e_prepare_subsequent_handover_req[] = { + 0x38, /* OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_REQUEST */ + TEST_IMSI_IE, + + /* Session ID and state (begin) */ + 0x30, 0x04, 0xde, 0xad, 0xbe, 0xef, + 0x31, 0x01, 0x01, + + TEST_CLASS_INTER_MSC_IE, + TEST_SOURCE_NAME_IE, + TEST_DESTINATION_NAME_IE, + TEST_AN_APDU_IE, /* (Handover Required) */ + }; + + static const uint8_t send_e_prepare_subsequent_handover_err[] = { + 0x39, /* OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_ERROR */ + TEST_IMSI_IE, + + /* Session ID and state (continue) */ + 0x30, 0x04, 0xde, 0xad, 0xbe, 0xef, + 0x31, 0x01, 0x02, + + TEST_CLASS_INTER_MSC_IE, + TEST_SOURCE_NAME_IE, + TEST_DESTINATION_NAME_IE, + + /* cause_bssap */ + 0x64, 0x01, + 0x51, /* GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS */ + }; + + static const uint8_t send_e_prepare_subsequent_handover_res[] = { + 0x3A, /* OSMO_GSUP_MSGT_E_PREPARE_SUBSEQUENT_HANDOVER_RESULT */ + TEST_IMSI_IE, + + /* Session ID and state (continue) */ + 0x30, 0x04, 0xde, 0xad, 0xbe, 0xef, + 0x31, 0x01, 0x02, + + TEST_CLASS_INTER_MSC_IE, + TEST_SOURCE_NAME_IE, + TEST_DESTINATION_NAME_IE, + TEST_AN_APDU_IE, /* (Handover Request Ack) */ + }; + + static const uint8_t send_e_send_end_signal_req[] = { + 0x3C, /* OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_REQUEST */ + TEST_IMSI_IE, + + /* Session ID and state (end) */ + 0x30, 0x04, 0xde, 0xad, 0xbe, 0xef, + 0x31, 0x01, 0x03, + + TEST_CLASS_INTER_MSC_IE, + TEST_SOURCE_NAME_IE, + TEST_DESTINATION_NAME_IE, + TEST_AN_APDU_IE, /* (Handover Complete) */ + }; + + static const uint8_t send_e_send_end_signal_err[] = { + 0x3D, /* OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_ERROR */ + TEST_IMSI_IE, + + /* Session ID and state (continue) */ + 0x30, 0x04, 0xde, 0xad, 0xbe, 0xef, + 0x31, 0x01, 0x02, + + TEST_CLASS_INTER_MSC_IE, + TEST_SOURCE_NAME_IE, + TEST_DESTINATION_NAME_IE, + + /* cause_bssap */ + 0x64, 0x01, + 0x51, /* GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS */ + }; + + static const uint8_t send_e_process_access_signalling_req[] = { + 0x40, /* OSMO_GSUP_MSGT_E_PROCESS_ACCESS_SIGNALLING_REQUEST */ + TEST_IMSI_IE, + + /* Session ID and state (continue) */ + 0x30, 0x04, 0xde, 0xad, 0xbe, 0xef, + 0x31, 0x01, 0x02, + + TEST_CLASS_INTER_MSC_IE, + TEST_SOURCE_NAME_IE, + TEST_DESTINATION_NAME_IE, + TEST_AN_APDU_IE, /* (Handover Detect) */ + }; + + static const uint8_t send_e_send_end_signal_res[] = { + 0x3E, /* OSMO_GSUP_MSGT_E_SEND_END_SIGNAL_RESULT */ + TEST_IMSI_IE, + + /* Session ID and state (end) */ + 0x30, 0x04, 0xde, 0xad, 0xbe, 0xef, + 0x31, 0x01, 0x03, + + TEST_CLASS_INTER_MSC_IE, + TEST_SOURCE_NAME_IE, + TEST_DESTINATION_NAME_IE, + TEST_AN_APDU_IE, /* (Handover Complete) */ + }; + + static const uint8_t send_e_forward_access_signalling_req [] = { + 0x44, /* OSMO_GSUP_MSGT_E_FORWARD_ACCESS_SIGNALLING_REQUEST */ + TEST_IMSI_IE, + + /* Session ID and state (continue) */ + 0x30, 0x04, 0xde, 0xad, 0xbe, 0xef, + 0x31, 0x01, 0x02, + + TEST_CLASS_INTER_MSC_IE, + TEST_SOURCE_NAME_IE, + TEST_DESTINATION_NAME_IE, + TEST_AN_APDU_IE, /* (DTAP, e.g. CC, SMS, ...) */ + }; + + static const uint8_t send_e_close[] = { + 0x47, /* OSMO_GSUP_MSGT_E_CLOSE */ + TEST_IMSI_IE, + + /* Session ID and state (end) */ + 0x30, 0x04, 0xde, 0xad, 0xbe, 0xef, + 0x31, 0x01, 0x03, + + TEST_CLASS_INTER_MSC_IE, + TEST_SOURCE_NAME_IE, + TEST_DESTINATION_NAME_IE, + }; + + static const uint8_t send_e_abort[] = { + 0x4B, /* OSMO_GSUP_MSGT_E_ABORT */ + TEST_IMSI_IE, + + /* Session ID and state (end) */ + 0x30, 0x04, 0xde, 0xad, 0xbe, 0xef, + 0x31, 0x01, 0x03, + + TEST_CLASS_INTER_MSC_IE, + + /* cause_bssap */ + 0x64, 0x01, + 0x51, /* GSM0808_CAUSE_INVALID_MESSAGE_CONTENTS */ + }; + + static const uint8_t send_e_routing_error[] = { + 0x4E, /* OSMO_GSUP_MSGT_E_ROUTING_ERROR */ + TEST_IMSI_IE, + + /* Session ID and state (end) */ + 0x30, 0x04, 0xde, 0xad, 0xbe, 0xef, + 0x31, 0x01, 0x03, + + TEST_CLASS_INTER_MSC_IE, + TEST_SOURCE_NAME_IE, + TEST_DESTINATION_NAME_IE, + }; + static const struct test { char *name; const uint8_t *data; @@ -367,6 +584,34 @@ send_check_imei_err, sizeof(send_check_imei_err)}, {"Check IMEI Result", send_check_imei_res, sizeof(send_check_imei_res)}, + {"E Prepare Handover Request", + send_e_prepare_handover_req, sizeof(send_e_prepare_handover_req)}, + {"E Prepare Handover Error", + send_e_prepare_handover_err, sizeof(send_e_prepare_handover_err)}, + {"E Prepare Handover Result", + send_e_prepare_handover_res, sizeof(send_e_prepare_handover_res)}, + {"E Prepare Subsequent Handover Request", + send_e_prepare_subsequent_handover_req, sizeof(send_e_prepare_subsequent_handover_req)}, + {"E Prepare Subsequent Handover Error", + send_e_prepare_subsequent_handover_err, sizeof(send_e_prepare_subsequent_handover_err)}, + {"E Prepare Subsequent Handover Result", + send_e_prepare_subsequent_handover_res, sizeof(send_e_prepare_subsequent_handover_res)}, + {"E Send End Signal Request", + send_e_send_end_signal_req, sizeof(send_e_send_end_signal_req)}, + {"E Send End Signal Error", + send_e_send_end_signal_err, sizeof(send_e_send_end_signal_err)}, + {"E Send End Signal Result", + send_e_send_end_signal_res, sizeof(send_e_send_end_signal_res)}, + {"E Process Access Signalling Request", + send_e_process_access_signalling_req, sizeof(send_e_process_access_signalling_req)}, + {"E Forward Access Signalling Request", + send_e_forward_access_signalling_req, sizeof(send_e_forward_access_signalling_req)}, + {"E Close", + send_e_close, sizeof(send_e_close)}, + {"E Abort", + send_e_abort, sizeof(send_e_abort)}, + {"E Routing Error", + send_e_routing_error, sizeof(send_e_routing_error)}, }; printf("Test GSUP message decoding/encoding\n"); diff --git a/tests/gsup/gsup_test.err b/tests/gsup/gsup_test.err index 9283823..e5fe6ee 100644 --- a/tests/gsup/gsup_test.err +++ b/tests/gsup/gsup_test.err @@ -73,6 +73,48 @@ generated message: 32 01 08 21 43 65 87 09 21 43 f5 51 01 00 original message: 32 01 08 21 43 65 87 09 21 43 f5 51 01 00 IMSI: 123456789012345 + generated message: 34 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 01 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + original message: 34 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 01 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + IMSI: 123456789012345 + generated message: 35 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 02 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 64 01 51 + original message: 35 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 02 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 64 01 51 + IMSI: 123456789012345 + generated message: 36 01 08 21 43 65 87 09 21 43 f5 08 07 91 94 61 46 32 24 43 30 04 de ad be ef 31 01 02 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + original message: 36 01 08 21 43 65 87 09 21 43 f5 08 07 91 94 61 46 32 24 43 30 04 de ad be ef 31 01 02 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + IMSI: 123456789012345 + generated message: 38 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 01 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + original message: 38 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 01 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + IMSI: 123456789012345 + generated message: 39 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 02 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 64 01 51 + original message: 39 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 02 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 64 01 51 + IMSI: 123456789012345 + generated message: 3a 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 02 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + original message: 3a 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 02 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + IMSI: 123456789012345 + generated message: 3c 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 03 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + original message: 3c 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 03 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + IMSI: 123456789012345 + generated message: 3d 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 02 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 64 01 51 + original message: 3d 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 02 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 64 01 51 + IMSI: 123456789012345 + generated message: 3e 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 03 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + original message: 3e 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 03 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + IMSI: 123456789012345 + generated message: 40 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 02 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + original message: 40 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 02 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + IMSI: 123456789012345 + generated message: 44 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 02 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + original message: 44 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 02 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 62 05 01 42 42 42 42 + IMSI: 123456789012345 + generated message: 47 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 03 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 + original message: 47 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 03 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 + IMSI: 123456789012345 + generated message: 4b 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 03 0a 01 04 64 01 51 + original message: 4b 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 03 0a 01 04 64 01 51 + IMSI: 123456789012345 + generated message: 4e 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 03 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 + original message: 4e 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 03 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42 + IMSI: 123456789012345 message 0: tested 14 truncations, 13 parse failures message 1: tested 14 truncations, 13 parse failures message 2: tested 83 truncations, 81 parse failures @@ -98,19 +140,33 @@ message 22: tested 22 truncations, 21 parse failures message 23: tested 14 truncations, 13 parse failures message 24: tested 14 truncations, 13 parse failures + message 25: tested 44 truncations, 38 parse failures + message 26: tested 40 truncations, 34 parse failures + message 27: tested 53 truncations, 46 parse failures + message 28: tested 44 truncations, 38 parse failures + message 29: tested 40 truncations, 34 parse failures + message 30: tested 44 truncations, 38 parse failures + message 31: tested 44 truncations, 38 parse failures + message 32: tested 40 truncations, 34 parse failures + message 33: tested 44 truncations, 38 parse failures + message 34: tested 44 truncations, 38 parse failures + message 35: tested 44 truncations, 38 parse failures + message 36: tested 37 truncations, 32 parse failures + message 37: tested 26 truncations, 22 parse failures + message 38: tested 37 truncations, 32 parse failures DLGSUP Stopping DLGSUP logging message 0: tested 3584 modifications, 771 parse failures message 1: tested 3584 modifications, 770 parse failures message 2: tested 21248 modifications, 2575 parse failures message 3: tested 2816 modifications, 510 parse failures message 4: tested 3584 modifications, 770 parse failures - message 5: tested 20736 modifications, 4022 parse failures + message 5: tested 20736 modifications, 4023 parse failures message 6: tested 3584 modifications, 771 parse failures message 7: tested 3584 modifications, 770 parse failures message 8: tested 2816 modifications, 510 parse failures message 9: tested 2816 modifications, 510 parse failures message 10: tested 3584 modifications, 770 parse failures - message 11: tested 3328 modifications, 769 parse failures + message 11: tested 3328 modifications, 770 parse failures message 12: tested 54016 modifications, 4626 parse failures message 13: tested 11520 modifications, 1026 parse failures message 14: tested 5120 modifications, 1030 parse failures @@ -124,3 +180,17 @@ message 22: tested 5632 modifications, 771 parse failures message 23: tested 3584 modifications, 770 parse failures message 24: tested 3584 modifications, 771 parse failures + message 25: tested 11264 modifications, 2058 parse failures + message 26: tested 10240 modifications, 2060 parse failures + message 27: tested 13568 modifications, 2313 parse failures + message 28: tested 11264 modifications, 2058 parse failures + message 29: tested 10240 modifications, 2060 parse failures + message 30: tested 11264 modifications, 2058 parse failures + message 31: tested 11264 modifications, 2057 parse failures + message 32: tested 10240 modifications, 2060 parse failures + message 33: tested 11264 modifications, 2057 parse failures + message 34: tested 11264 modifications, 2058 parse failures + message 35: tested 11264 modifications, 2058 parse failures + message 36: tested 9472 modifications, 1803 parse failures + message 37: tested 6656 modifications, 1546 parse failures + message 38: tested 9472 modifications, 1803 parse failures diff --git a/tests/gsup/gsup_test.ok b/tests/gsup/gsup_test.ok index 70f723c..db8bc2f 100644 --- a/tests/gsup/gsup_test.ok +++ b/tests/gsup/gsup_test.ok @@ -49,4 +49,32 @@ Check IMEI Error OK Testing Check IMEI Result Check IMEI Result OK + Testing E Prepare Handover Request + E Prepare Handover Request OK + Testing E Prepare Handover Error + E Prepare Handover Error OK + Testing E Prepare Handover Result + E Prepare Handover Result OK + Testing E Prepare Subsequent Handover Request + E Prepare Subsequent Handover Request OK + Testing E Prepare Subsequent Handover Error + E Prepare Subsequent Handover Error OK + Testing E Prepare Subsequent Handover Result + E Prepare Subsequent Handover Result OK + Testing E Send End Signal Request + E Send End Signal Request OK + Testing E Send End Signal Error + E Send End Signal Error OK + Testing E Send End Signal Result + E Send End Signal Result OK + Testing E Process Access Signalling Request + E Process Access Signalling Request OK + Testing E Forward Access Signalling Request + E Forward Access Signalling Request OK + Testing E Close + E Close OK + Testing E Abort + E Abort OK + Testing E Routing Error + E Routing Error OK Done. -- To view, visit https://gerrit.osmocom.org/12860 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic00b0601eacff6d72927cea51767801142ee75db Gerrit-Change-Number: 12860 Gerrit-PatchSet: 10 Gerrit-Owner: osmith Gerrit-Reviewer: Daniel Willmann Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: osmith -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:45:00 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:45:00 +0000 Subject: Change in libosmocore[master]: BSSMAP: tweaks In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13577 ) Change subject: BSSMAP: tweaks ...................................................................... BSSMAP: tweaks Change two instances of Speech Version values to enum gsm0808_permitted_speech. It is often not trivial to find the right values for a uint8_t member, giving the enum name makes it a lot easier/safer to use. In gsm0808_create_handover_required(), use msgb_tv_put() so that the enum's storage size doesn't matter. (Already used for handover_performed) Fix typo in doc of gsm0808_create_handover_required(). Change-Id: I6387836bab76e1fa42daa0f42ab94fc14b70b112 --- M TODO-RELEASE M include/osmocom/gsm/gsm0808.h M src/gsm/gsm0808.c 3 files changed, 6 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve diff --git a/TODO-RELEASE b/TODO-RELEASE index 7c81e32..db3be49 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -19,3 +19,5 @@ osmo_quote_str_buf() truncated string. This is no longer the case. e.g. a string 'truncated' in a 9-char buffer used to print '"trunca"\0', which now becomes '"truncat\0'. libosmocore osmo_quote_str_buf2() New function signature similar to snprintf(), for use with OSMO_STRBUF_APPEND(). +libosmogsm gsm0808_handover_required Storage size changed, speech_version_used now an enum. + gsm0808_handover_performed Storage size changed, speech_version_chosen now an enum. diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h index a1345c3..0f2bf1f 100644 --- a/include/osmocom/gsm/gsm0808.h +++ b/include/osmocom/gsm/gsm0808.h @@ -133,7 +133,7 @@ uint8_t current_channel_type_1; bool speech_version_used_present; - uint8_t speech_version_used; + enum gsm0808_permitted_speech speech_version_used; bool old_bss_to_new_bss_info_present; struct gsm0808_old_bss_to_new_bss_info old_bss_to_new_bss_info; @@ -196,7 +196,7 @@ uint8_t chosen_encr_alg; bool speech_version_chosen_present; - uint8_t speech_version_chosen; + enum gsm0808_permitted_speech speech_version_chosen; bool speech_codec_chosen_present; struct gsm0808_speech_codec speech_codec_chosen; diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index 4873076..3307a5d 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -822,7 +822,7 @@ /*! Create BSSMAP HANDOVER REQUIRED message. * \param[in] params All information to be encoded. - * \returns newly allocated msgb with BSSMAP REQUIRED message. */ + * \returns newly allocated msgb with BSSMAP HANDOVER REQUIRED message. */ struct msgb *gsm0808_create_handover_required(const struct gsm0808_handover_required *params) { struct msgb *msg; @@ -846,7 +846,7 @@ /* Speech Version (Used), 3.2.2.51 */ if (params->speech_version_used_present) - msgb_tv_fixed_put(msg, GSM0808_IE_SPEECH_VERSION, 1, ¶ms->speech_version_used); + msgb_tv_put(msg, GSM0808_IE_SPEECH_VERSION, params->speech_version_used); if (params->old_bss_to_new_bss_info_present) put_old_bss_to_new_bss_information(msg, ¶ms->old_bss_to_new_bss_info); -- To view, visit https://gerrit.osmocom.org/13577 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6387836bab76e1fa42daa0f42ab94fc14b70b112 Gerrit-Change-Number: 13577 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:46:48 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:46:48 +0000 Subject: Change in osmo-trx[master]: cosmetic: uhd: Move smpl_buf out of UHDDevice, move UHDDevice class d... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13809 ) Change subject: cosmetic: uhd: Move smpl_buf out of UHDDevice, move UHDDevice class definition to .h ...................................................................... Patch Set 1: I've added @tnt as reviewer. pespin: Please make sure to add him to any "SDR related" osmoTRX patches where his review would be very valuable to get. I assume he doesn't typically notice what happens on gerrit, so adding him as explicit reviewer to related patches should help. -- To view, visit https://gerrit.osmocom.org/13809 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib4594320da9bb7f6e9f52e7d70d11ecd11106aae Gerrit-Change-Number: 13809 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: tnt Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 30 Apr 2019 20:46:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:48:21 2019 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Apr 2019 20:48:21 +0000 Subject: Change in osmo-trx[master]: cosmetic: uhd: Move smpl_buf out of UHDDevice, move UHDDevice class d... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13809 ) Change subject: cosmetic: uhd: Move smpl_buf out of UHDDevice, move UHDDevice class definition to .h ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/13809 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib4594320da9bb7f6e9f52e7d70d11ecd11106aae Gerrit-Change-Number: 13809 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: tnt Gerrit-Comment-Date: Tue, 30 Apr 2019 20:48:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:53:54 2019 From: gerrit-no-reply at lists.osmocom.org (tnt) Date: Tue, 30 Apr 2019 20:53:54 +0000 Subject: Change in osmo-trx[master]: cosmetic: uhd: Move smpl_buf out of UHDDevice, move UHDDevice class d... In-Reply-To: References: Message-ID: tnt has posted comments on this change. ( https://gerrit.osmocom.org/13809 ) Change subject: cosmetic: uhd: Move smpl_buf out of UHDDevice, move UHDDevice class definition to .h ...................................................................... Patch Set 1: Code-Review+1 I would probably have directly moved it to some common directory, even though yes, it still have a couple of minor UHD deps. but I'm assuming getting rid of those is the very next step (call the .to_tick directly from UHDDevice). -- To view, visit https://gerrit.osmocom.org/13809 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib4594320da9bb7f6e9f52e7d70d11ecd11106aae Gerrit-Change-Number: 13809 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: tnt Gerrit-Comment-Date: Tue, 30 Apr 2019 20:53:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 20:56:33 2019 From: gerrit-no-reply at lists.osmocom.org (tnt) Date: Tue, 30 Apr 2019 20:56:33 +0000 Subject: Change in osmo-bsc[master]: assignment_fsm: Properly support assigning signalling mode TCH/x In-Reply-To: References: Message-ID: tnt has posted comments on this change. ( https://gerrit.osmocom.org/13818 ) Change subject: assignment_fsm: Properly support assigning signalling mode TCH/x ...................................................................... Patch Set 1: Code-Review+1 Yeah fix seems obviously correct :) Not sure what's up with the build error, it's not related to anything changed in this patch ... -- To view, visit https://gerrit.osmocom.org/13818 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7513d2cbe8b695ba6f031ad11560c63a6535cf2d Gerrit-Change-Number: 13818 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: tnt Gerrit-Comment-Date: Tue, 30 Apr 2019 20:56:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:13:53 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 30 Apr 2019 21:13:53 +0000 Subject: Change in osmo-gsm-tester[master]: ms_driver: Catch up with the new MS baseclass Message-ID: Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/13822 Change subject: ms_driver: Catch up with the new MS baseclass ...................................................................... ms_driver: Catch up with the new MS baseclass Change-Id: Id8de8b3ee76b515c49e5ea52acaa326a2283b0e1 --- M src/osmo_ms_driver/__main__.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/22/13822/1 diff --git a/src/osmo_ms_driver/__main__.py b/src/osmo_ms_driver/__main__.py index 24acd61..d753897 100644 --- a/src/osmo_ms_driver/__main__.py +++ b/src/osmo_ms_driver/__main__.py @@ -23,7 +23,7 @@ from .starter import BinaryOptions from .test_support import imsi_ki_gen from osmo_gsm_tester import log, util -from osmo_gsm_tester import ms +from osmo_gsm_tester import ms_osmo_mobile # System modules from datetime import timedelta @@ -97,7 +97,7 @@ 'ki': ki, 'auth_algo': 'comp128v1', } - test.subscriber_add(ms.MS("ms_%d" % i, conf)) + test.subscriber_add(ms_osmo_mobile.MSOsmoMobile("ms_%d" % i, conf)) atexit.register(test.stop_all) -- To view, visit https://gerrit.osmocom.org/13822 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id8de8b3ee76b515c49e5ea52acaa326a2283b0e1 Gerrit-Change-Number: 13822 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:13:53 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 30 Apr 2019 21:13:53 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Separate starting virtphy/mobile from the test Message-ID: Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/13823 Change subject: virtual: Separate starting virtphy/mobile from the test ...................................................................... virtual: Separate starting virtphy/mobile from the test Move the starting code out of the Update Location "test". In the mid term we can have a SMS test run in addition to waiting the Update Location tests. A mass-test testcase will have a life-cycle of: * Creation * Configure (number of subscribers, probably all subs) * Pre-Start trigger (same as configure so it can be omitted) * Post-Start (all processes run) * Query if the test has completed The next step is an actual implementation to send SMS. Change-Id: Ie15f5123775d11dd44243b2741d047ed93f318f9 --- M src/osmo_gsm_tester/ms_driver.py M src/osmo_ms_driver/__main__.py M src/osmo_ms_driver/location_update_test.py 3 files changed, 114 insertions(+), 79 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/23/13823/1 diff --git a/src/osmo_gsm_tester/ms_driver.py b/src/osmo_gsm_tester/ms_driver.py index 3cfcad6..329662a 100644 --- a/src/osmo_gsm_tester/ms_driver.py +++ b/src/osmo_gsm_tester/ms_driver.py @@ -20,7 +20,7 @@ from osmo_ms_driver.cdf import cdfs from osmo_ms_driver.event_server import EventServer from osmo_ms_driver.simple_loop import SimpleLoop -from osmo_ms_driver.location_update_test import MassUpdateLocationTest +from osmo_ms_driver.location_update_test import MassUpdateLocationTest, MobileTestStarter from osmo_ms_driver.starter import BinaryOptions import os.path @@ -92,14 +92,18 @@ self._ev_server = EventServer("ev_server", event_server_path) self._ev_server.listen(self._loop) + self._results = {} options = self.build_binary_options() - self._test_case = MassUpdateLocationTest("mass", options, self._cdf, - self._ev_server, - util.Dir(self.event_server_sk_tmp_dir), - suite_run=self._suite_run) + self._starter = MobileTestStarter("mass", options, self._cdf, + self._ev_server, + util.Dir(self.event_server_sk_tmp_dir), + self._results, suite_run=self._suite_run) + self._test_case = MassUpdateLocationTest("mass", self._ev_server, self._results) for sub in self._subscribers: - self._test_case.subscriber_add(sub) + self._starter.subscriber_add(sub) + + self._test_case.configure(len(self._subscribers)) self._configured = True def run_test(self): @@ -110,7 +114,8 @@ """ if not self._configured: self.configure() - self._test_case.run_test(self._loop, self._test_duration) + deadline = self._starter.start_all(self._loop, self._test_duration) + self._test_case.wait_for_test(self._loop, deadline) def print_stats(self): """ diff --git a/src/osmo_ms_driver/__main__.py b/src/osmo_ms_driver/__main__.py index d753897..642002f 100644 --- a/src/osmo_ms_driver/__main__.py +++ b/src/osmo_ms_driver/__main__.py @@ -18,7 +18,7 @@ # Local modules from .event_server import EventServer from .simple_loop import SimpleLoop -from .location_update_test import MassUpdateLocationTest +from .location_update_test import MassUpdateLocationTest, MobileTestStarter from .cdf import cdfs from .starter import BinaryOptions from .test_support import imsi_ki_gen @@ -86,7 +86,9 @@ # Just a single test for now. options = BinaryOptions("virtphy", "mobile", os.environ) - test = MassUpdateLocationTest("lu_test", options, cdf, ev_server, tmp_dir) + result = {} + starter = MobileTestStarter("lu_test", options, cdf, ev_server, tmp_dir, result) + test = MassUpdateLocationTest("lu_test", ev_server, result) # Add subscribers to the test. imsi_gen = imsi_ki_gen() @@ -97,12 +99,14 @@ 'ki': ki, 'auth_algo': 'comp128v1', } - test.subscriber_add(ms_osmo_mobile.MSOsmoMobile("ms_%d" % i, conf)) + starter.subscriber_add(ms_osmo_mobile.MSOsmoMobile("ms_%d" % i, conf)) + test.configure(args.num_ms) - atexit.register(test.stop_all) + atexit.register(starter.stop_all) # Run until everything has been launched - test.run_test(loop, timedelta(seconds=args.test_duration)) + deadline = starter.start_all(loop, timedelta(seconds=args.test_duration)) + test.wait_for_test(loop, deadline) # Print stats test.print_stats() diff --git a/src/osmo_ms_driver/location_update_test.py b/src/osmo_ms_driver/location_update_test.py index 29abf73..efb161e 100644 --- a/src/osmo_ms_driver/location_update_test.py +++ b/src/osmo_ms_driver/location_update_test.py @@ -24,6 +24,7 @@ from datetime import timedelta import collections +import json import time # Key used for the result dictionary @@ -58,6 +59,85 @@ "min_latency", "max_latency"]) class MassUpdateLocationTest(log.Origin): + def __init__(self, name, event_server, results): + super().__init__(log.C_RUN, name) + self._event_server = event_server + self._event_server.register(self.handle_msg) + self._results = results + + def configure(self, num_subscribers): + self._num_subscribers = num_subscribers + self._outstanding = num_subscribers + + def handle_msg(self, _data, addr, time): + data = json.loads(_data.decode()) + + if data['type'] == 'event': + if data['data']['lu_done'] == 1: + ms = self._results[data['ms']] + if not has_lu_time(ms): + self._outstanding = self._outstanding - 1 + set_lu_time(ms, time) + self.log("MS performed LU ", ms=ms, at=time, lu_delay=lu_delay(ms)) + + def all_completed(self): + return self._outstanding == 0 + + def wait_for_test(self, loop, deadline): + """Waits up to the absolute deadline for the test to complete.""" + while not self.all_completed(): + now_time = time.clock_gettime(time.CLOCK_MONOTONIC) + sleep_time = deadline - now_time + if sleep_time < 0: + break + loop.schedule_timeout(sleep_time) + loop.select() + + def find_min_max(self, results): + min_value = max_value = None + for result in results: + if min_value is None or lu_delay(result) < min_value: + min_value = lu_delay(result) + if max_value is None or lu_delay(result) > max_value: + max_value = lu_delay(result) + return min_value, max_value + + def get_result_values(self): + """ + Returns the raw result values of the test run in any order. + """ + return self._results.values() + + def get_stats(self): + """ + Returns a statistical summary of the test. + """ + attempted = self._num_subscribers + completed = attempted - self._outstanding + min_latency, max_latency = self.find_min_max(filter(lambda x: has_lu_time(x), self._results.values())) + return LUStats(attempted, completed, min_latency, max_latency) + + def print_stats(self): + stats = self.get_stats() + all_completed = stats.num_attempted == stats.num_completed + + self.log("Tests done", all_completed=all_completed, + min=stats.min_latency, max=stats.max_latency) + + def lus_less_than(self, acceptable_delay): + """ + Returns LUs that completed within the acceptable delay. + """ + res = [] + for result in self._results.values(): + if not has_lu_time(result): + continue + if timedelta(seconds=lu_delay(result)) >= acceptable_delay: + continue + res.append(result) + return res + +class MobileTestStarter(log.Origin): """ A test to launch a configurable amount of MS and make them execute a Location Updating Procedure. @@ -70,22 +150,23 @@ TEMPLATE_CFG = "osmo-mobile.cfg" def __init__(self, name, options, cdf_function, - event_server, tmp_dir, suite_run=None): + event_server, tmp_dir, results, suite_run=None): super().__init__(log.C_RUN, name) self._binary_options = options self._cdf = cdf_function self._suite_run = suite_run self._tmp_dir = tmp_dir + self._event_server = event_server + self._results = results self._unstarted = [] self._mobiles = [] self._phys = [] - self._results = {} - self._event_server = event_server - self._event_server.register(self.handle_msg) self._started = [] self._subscribers = [] + self._event_server.register(self.handle_msg) + def subscriber_add(self, subscriber): """ Adds a subscriber to the list of subscribers. @@ -179,28 +260,31 @@ return current_time + step_size, sleep_time - def run_test(self, loop, test_duration): + def start_all(self, loop, test_duration): + """ + Starts all processes according to the schedule set by the CDF. + """ self.prepare(loop) - to_complete_time = self._start_time + test_duration.total_seconds() + self._to_complete_time = self._start_time + test_duration.total_seconds() tick_time = self._start_time - while not self.all_completed(): + while len(self._unstarted) > 0: tick_time, sleep_time = self.step_once(loop, tick_time) now_time = time.clock_gettime(time.CLOCK_MONOTONIC) if sleep_time is None: - sleep_time = to_complete_time - now_time + sleep_time = self._to_complete_time - now_time if sleep_time < 0: break loop.schedule_timeout(sleep_time) loop.select() + return self._to_complete_time def stop_all(self): for launcher in self._started: launcher.terminate() def handle_msg(self, _data, addr, time): - import json data = json.loads(_data.decode()) if data['type'] == 'register': @@ -208,61 +292,3 @@ ms.set_start_time(time) launch_delay = ms.start_time() - ms.launch_time() self.log("MS start registered ", ms=ms, at=time, delay=launch_delay) - elif data['type'] == 'event': - if data['data']['lu_done'] == 1: - ms = self._results[data['ms']] - if not has_lu_time(ms): - self._outstanding = self._outstanding - 1 - set_lu_time(ms, time) - self.log("MS performed LU ", ms=ms, at=time, lu_delay=lu_delay(ms)) - else: - print(time, data) - raise Exception("Unknown event type..:" + _data.decode()) - - - def all_completed(self): - return self._outstanding == 0 - - def find_min_max(self, results): - min_value = max_value = None - for result in results: - if min_value is None or lu_delay(result) < min_value: - min_value = lu_delay(result) - if max_value is None or lu_delay(result) > max_value: - max_value = lu_delay(result) - return min_value, max_value - - def get_result_values(self): - """ - Returns the raw result values of the test run in any order. - """ - return self._results.values() - - def get_stats(self): - """ - Returns a statistical summary of the test. - """ - attempted = len(self._subscribers) - completed = attempted - self._outstanding - min_latency, max_latency = self.find_min_max(filter(lambda x: has_lu_time(x), self._results.values())) - return LUStats(attempted, completed, min_latency, max_latency) - - def print_stats(self): - stats = self.get_stats() - all_completed = stats.num_attempted == stats.num_completed - - self.log("Tests done", all_completed=all_completed, - min=stats.min_latency, max=stats.max_latency) - - def lus_less_than(self, acceptable_delay): - """ - Returns LUs that completed within the acceptable delay. - """ - res = [] - for result in self._results.values(): - if not has_lu_time(result): - continue - if timedelta(seconds=lu_delay(result)) >= acceptable_delay: - continue - res.append(result) - return res -- To view, visit https://gerrit.osmocom.org/13823 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie15f5123775d11dd44243b2741d047ed93f318f9 Gerrit-Change-Number: 13823 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:13:53 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 30 Apr 2019 21:13:53 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Move the starter code into the starter module Message-ID: Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/13824 Change subject: virtual: Move the starter code into the starter module ...................................................................... virtual: Move the starter code into the starter module There is nothing location update specific in the file. Let's move it into the starter file. Change-Id: I0cd5705eaf53a14523feacece9446331a53b3e59 --- M src/osmo_gsm_tester/ms_driver.py M src/osmo_ms_driver/__main__.py M src/osmo_ms_driver/location_update_test.py M src/osmo_ms_driver/starter.py 4 files changed, 167 insertions(+), 164 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/24/13824/1 diff --git a/src/osmo_gsm_tester/ms_driver.py b/src/osmo_gsm_tester/ms_driver.py index 329662a..d35f02e 100644 --- a/src/osmo_gsm_tester/ms_driver.py +++ b/src/osmo_gsm_tester/ms_driver.py @@ -20,8 +20,8 @@ from osmo_ms_driver.cdf import cdfs from osmo_ms_driver.event_server import EventServer from osmo_ms_driver.simple_loop import SimpleLoop -from osmo_ms_driver.location_update_test import MassUpdateLocationTest, MobileTestStarter -from osmo_ms_driver.starter import BinaryOptions +from osmo_ms_driver.location_update_test import MassUpdateLocationTest +from osmo_ms_driver.starter import BinaryOptions, MobileTestStarter import os.path import shutil diff --git a/src/osmo_ms_driver/__main__.py b/src/osmo_ms_driver/__main__.py index 642002f..c3da49d 100644 --- a/src/osmo_ms_driver/__main__.py +++ b/src/osmo_ms_driver/__main__.py @@ -18,9 +18,9 @@ # Local modules from .event_server import EventServer from .simple_loop import SimpleLoop -from .location_update_test import MassUpdateLocationTest, MobileTestStarter +from .location_update_test import MassUpdateLocationTest from .cdf import cdfs -from .starter import BinaryOptions +from .starter import BinaryOptions, MobileTestStarter from .test_support import imsi_ki_gen from osmo_gsm_tester import log, util from osmo_gsm_tester import ms_osmo_mobile diff --git a/src/osmo_ms_driver/location_update_test.py b/src/osmo_ms_driver/location_update_test.py index efb161e..125ee02 100644 --- a/src/osmo_ms_driver/location_update_test.py +++ b/src/osmo_ms_driver/location_update_test.py @@ -16,11 +16,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from copy import copy -from osmo_gsm_tester import log -from .starter import OsmoVirtPhy, OsmoMobile -from .test_support import ResultStore - from datetime import timedelta import collections @@ -137,158 +132,3 @@ res.append(result) return res -class MobileTestStarter(log.Origin): - """ - A test to launch a configurable amount of MS and make them - execute a Location Updating Procedure. - - Configure the number of MS to be tested and a function that - decides how quickly to start them and a timeout. - """ - - TEMPLATE_LUA = "osmo-mobile.lua" - TEMPLATE_CFG = "osmo-mobile.cfg" - - def __init__(self, name, options, cdf_function, - event_server, tmp_dir, results, suite_run=None): - super().__init__(log.C_RUN, name) - self._binary_options = options - self._cdf = cdf_function - self._suite_run = suite_run - self._tmp_dir = tmp_dir - self._event_server = event_server - self._results = results - self._unstarted = [] - self._mobiles = [] - self._phys = [] - - self._started = [] - self._subscribers = [] - - self._event_server.register(self.handle_msg) - - def subscriber_add(self, subscriber): - """ - Adds a subscriber to the list of subscribers. - - Must be called before starting the testcase. - """ - self._subscribers.append(subscriber) - - def configure_tasks(self): - """Sets up the test run.""" - - self._cdf.set_target(len(self._subscribers)) - self._outstanding = len(self._subscribers) - for i in range(0, self._outstanding): - ms_name = "%.5d" % i - - phy = OsmoVirtPhy(self._binary_options.virtphy, - self._binary_options.env, - ms_name, self._tmp_dir) - self._phys.append(phy) - - launcher = OsmoMobile(self._binary_options.mobile, - self._binary_options.env, - ms_name, self._tmp_dir, self.TEMPLATE_LUA, - self.TEMPLATE_CFG, self._subscribers[i], - phy.phy_filename(), - self._event_server.server_path()) - self._results[ms_name] = ResultStore(ms_name) - self._mobiles.append(launcher) - self._unstarted = copy(self._mobiles) - - def pre_launch(self, loop): - """ - We need the virtphy's be ready when the lua script in the - mobile comes and kicks-off the test. In lua we don't seem to - be able to just stat/check if a file/socket exists so we need - to do this from here. - """ - self.log("Pre-launching all virtphy's") - for phy in self._phys: - phy.start(loop, self._suite_run) - - self.log("Checking if sockets are in the filesystem") - for phy in self._phys: - phy.verify_ready() - - def prepare(self, loop): - self.log("Starting testcase") - - self.configure_tasks() - self.pre_launch(loop) - - self._start_time = time.clock_gettime(time.CLOCK_MONOTONIC) - self._end_time = self._start_time + \ - self._cdf.duration().total_seconds() + \ - timedelta(seconds=120).total_seconds() - - self._started = [] - self._too_slow = 0 - - def step_once(self, loop, current_time): - if len(self._unstarted) <= 0: - return current_time, None - - step_size = self._cdf.step_size().total_seconds() - - # Start - self._cdf.step_once() - - # Check for timeout - # start pending MS - while len(self._started) < self._cdf.current_scaled_value() and len(self._unstarted) > 0: - ms = self._unstarted.pop(0) - ms.start(loop, self._suite_run) - launch_time = time.clock_gettime(time.CLOCK_MONOTONIC) - self._results[ms.name_number()].set_launch_time(launch_time) - self._started.append(ms) - - now_time = time.clock_gettime(time.CLOCK_MONOTONIC) - sleep_time = (current_time + step_size) - now_time - if sleep_time <= 0: - self.log("Starting too slowly. Moving on", - target=(current_time + step_size), now=now_time, sleep=sleep_time) - self._too_slow += 1 - sleep_time = 0 - - if len(self._unstarted) == 0: - end_time = time.clock_gettime(time.CLOCK_MONOTONIC) - self.log("All started...", too_slow=self._too_slow, duration=end_time - self._start_time) - return current_time, None - - return current_time + step_size, sleep_time - - def start_all(self, loop, test_duration): - """ - Starts all processes according to the schedule set by the CDF. - """ - self.prepare(loop) - - self._to_complete_time = self._start_time + test_duration.total_seconds() - tick_time = self._start_time - - while len(self._unstarted) > 0: - tick_time, sleep_time = self.step_once(loop, tick_time) - now_time = time.clock_gettime(time.CLOCK_MONOTONIC) - if sleep_time is None: - sleep_time = self._to_complete_time - now_time - if sleep_time < 0: - break - loop.schedule_timeout(sleep_time) - loop.select() - return self._to_complete_time - - def stop_all(self): - for launcher in self._started: - launcher.terminate() - - def handle_msg(self, _data, addr, time): - data = json.loads(_data.decode()) - - if data['type'] == 'register': - ms = self._results[data['ms']] - ms.set_start_time(time) - launch_delay = ms.start_time() - ms.launch_time() - self.log("MS start registered ", ms=ms, at=time, delay=launch_delay) diff --git a/src/osmo_ms_driver/starter.py b/src/osmo_ms_driver/starter.py index 20977d6..61d3bb0 100644 --- a/src/osmo_ms_driver/starter.py +++ b/src/osmo_ms_driver/starter.py @@ -18,7 +18,13 @@ from osmo_gsm_tester import log, process, template +from .test_support import ResultStore + +from copy import copy +from datetime import timedelta + import collections +import json import os import os.path import time @@ -133,3 +139,160 @@ """Clean up things.""" if self._omob_proc: self._omob_proc.terminate() + + +class MobileTestStarter(log.Origin): + """ + A test to launch a configurable amount of MS and make them + execute a Location Updating Procedure. + + Configure the number of MS to be tested and a function that + decides how quickly to start them and a timeout. + """ + + TEMPLATE_LUA = "osmo-mobile.lua" + TEMPLATE_CFG = "osmo-mobile.cfg" + + def __init__(self, name, options, cdf_function, + event_server, tmp_dir, results, suite_run=None): + super().__init__(log.C_RUN, name) + self._binary_options = options + self._cdf = cdf_function + self._suite_run = suite_run + self._tmp_dir = tmp_dir + self._event_server = event_server + self._results = results + self._unstarted = [] + self._mobiles = [] + self._phys = [] + + self._started = [] + self._subscribers = [] + + self._event_server.register(self.handle_msg) + + def subscriber_add(self, subscriber): + """ + Adds a subscriber to the list of subscribers. + + Must be called before starting the testcase. + """ + self._subscribers.append(subscriber) + + def configure_tasks(self): + """Sets up the test run.""" + + self._cdf.set_target(len(self._subscribers)) + self._outstanding = len(self._subscribers) + for i in range(0, self._outstanding): + ms_name = "%.5d" % i + + phy = OsmoVirtPhy(self._binary_options.virtphy, + self._binary_options.env, + ms_name, self._tmp_dir) + self._phys.append(phy) + + launcher = OsmoMobile(self._binary_options.mobile, + self._binary_options.env, + ms_name, self._tmp_dir, self.TEMPLATE_LUA, + self.TEMPLATE_CFG, self._subscribers[i], + phy.phy_filename(), + self._event_server.server_path()) + self._results[ms_name] = ResultStore(ms_name) + self._mobiles.append(launcher) + self._unstarted = copy(self._mobiles) + + def pre_launch(self, loop): + """ + We need the virtphy's be ready when the lua script in the + mobile comes and kicks-off the test. In lua we don't seem to + be able to just stat/check if a file/socket exists so we need + to do this from here. + """ + self.log("Pre-launching all virtphy's") + for phy in self._phys: + phy.start(loop, self._suite_run) + + self.log("Checking if sockets are in the filesystem") + for phy in self._phys: + phy.verify_ready() + + def prepare(self, loop): + self.log("Starting testcase") + + self.configure_tasks() + self.pre_launch(loop) + + self._start_time = time.clock_gettime(time.CLOCK_MONOTONIC) + self._end_time = self._start_time + \ + self._cdf.duration().total_seconds() + \ + timedelta(seconds=120).total_seconds() + + self._started = [] + self._too_slow = 0 + + def step_once(self, loop, current_time): + if len(self._unstarted) <= 0: + return current_time, None + + step_size = self._cdf.step_size().total_seconds() + + # Start + self._cdf.step_once() + + # Check for timeout + # start pending MS + while len(self._started) < self._cdf.current_scaled_value() and len(self._unstarted) > 0: + ms = self._unstarted.pop(0) + ms.start(loop, self._suite_run) + launch_time = time.clock_gettime(time.CLOCK_MONOTONIC) + self._results[ms.name_number()].set_launch_time(launch_time) + self._started.append(ms) + + now_time = time.clock_gettime(time.CLOCK_MONOTONIC) + sleep_time = (current_time + step_size) - now_time + if sleep_time <= 0: + self.log("Starting too slowly. Moving on", + target=(current_time + step_size), now=now_time, sleep=sleep_time) + self._too_slow += 1 + sleep_time = 0 + + if len(self._unstarted) == 0: + end_time = time.clock_gettime(time.CLOCK_MONOTONIC) + self.log("All started...", too_slow=self._too_slow, duration=end_time - self._start_time) + return current_time, None + + return current_time + step_size, sleep_time + + def start_all(self, loop, test_duration): + """ + Starts all processes according to the schedule set by the CDF. + """ + self.prepare(loop) + + self._to_complete_time = self._start_time + test_duration.total_seconds() + tick_time = self._start_time + + while len(self._unstarted) > 0: + tick_time, sleep_time = self.step_once(loop, tick_time) + now_time = time.clock_gettime(time.CLOCK_MONOTONIC) + if sleep_time is None: + sleep_time = self._to_complete_time - now_time + if sleep_time < 0: + break + loop.schedule_timeout(sleep_time) + loop.select() + return self._to_complete_time + + def stop_all(self): + for launcher in self._started: + launcher.terminate() + + def handle_msg(self, _data, addr, time): + data = json.loads(_data.decode()) + + if data['type'] == 'register': + ms = self._results[data['ms']] + ms.set_start_time(time) + launch_delay = ms.start_time() - ms.launch_time() + self.log("MS start registered ", ms=ms, at=time, delay=launch_delay) -- To view, visit https://gerrit.osmocom.org/13824 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0cd5705eaf53a14523feacece9446331a53b3e59 Gerrit-Change-Number: 13824 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:13:54 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 30 Apr 2019 21:13:54 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Introduce a base class for test cases Message-ID: Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/13825 Change subject: virtual: Introduce a base class for test cases ...................................................................... virtual: Introduce a base class for test cases Introduce a base class with the intended life cycle and use it. Change-Id: I97968fb02436d5ac8248fc8020539e1af547b030 --- M src/osmo_gsm_tester/ms_driver.py M src/osmo_ms_driver/location_update_test.py M src/osmo_ms_driver/test_support.py 3 files changed, 38 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/25/13825/1 diff --git a/src/osmo_gsm_tester/ms_driver.py b/src/osmo_gsm_tester/ms_driver.py index d35f02e..dddedf7 100644 --- a/src/osmo_gsm_tester/ms_driver.py +++ b/src/osmo_gsm_tester/ms_driver.py @@ -114,7 +114,9 @@ """ if not self._configured: self.configure() + self._test_case.before_start() deadline = self._starter.start_all(self._loop, self._test_duration) + self._test_case.after_start() self._test_case.wait_for_test(self._loop, deadline) def print_stats(self): diff --git a/src/osmo_ms_driver/location_update_test.py b/src/osmo_ms_driver/location_update_test.py index 125ee02..1a33f09 100644 --- a/src/osmo_ms_driver/location_update_test.py +++ b/src/osmo_ms_driver/location_update_test.py @@ -18,6 +18,8 @@ from datetime import timedelta +from .test_support import TestBase + import collections import json import time @@ -53,12 +55,10 @@ LUStats = collections.namedtuple("LUStats", ["num_attempted", "num_completed", "min_latency", "max_latency"]) -class MassUpdateLocationTest(log.Origin): +class MassUpdateLocationTest(TestBase): def __init__(self, name, event_server, results): - super().__init__(log.C_RUN, name) - self._event_server = event_server + super().__init__(name, event_server, results) self._event_server.register(self.handle_msg) - self._results = results def configure(self, num_subscribers): self._num_subscribers = num_subscribers @@ -75,12 +75,12 @@ set_lu_time(ms, time) self.log("MS performed LU ", ms=ms, at=time, lu_delay=lu_delay(ms)) - def all_completed(self): + def has_completed(self): return self._outstanding == 0 def wait_for_test(self, loop, deadline): """Waits up to the absolute deadline for the test to complete.""" - while not self.all_completed(): + while not self.has_completed(): now_time = time.clock_gettime(time.CLOCK_MONOTONIC) sleep_time = deadline - now_time if sleep_time < 0: diff --git a/src/osmo_ms_driver/test_support.py b/src/osmo_ms_driver/test_support.py index 670d795..cbfd444 100644 --- a/src/osmo_ms_driver/test_support.py +++ b/src/osmo_ms_driver/test_support.py @@ -15,6 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +from abc import ABCMeta from osmo_gsm_tester import log def imsi_ki_gen(): @@ -63,3 +64,32 @@ def has_result(self, key): """Returns true if there is a value for the key.""" return self._results.get(key) is not None + + +class TestBase(log.Origin, metaclass=ABCMeta): + """Base class for all mass test cases.""" + + def __init__(self, name, event_server, results): + super().__init__(log.C_RUN, name) + self._event_server = event_server + self._results = results + + def configure(self, num_subscribers): + """Configures the test given the (number) of subscribers.""" + pass + + def before_start(self): + """Prepares the test for starting.""" + pass + + def after_start(self): + """Finishes the test after starting.""" + pass + + def has_completed(self): + """Returns true if the test has completed.""" + pass + + def print_stats(self): + """Prints statistics/results of the test.""" + pass -- To view, visit https://gerrit.osmocom.org/13825 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I97968fb02436d5ac8248fc8020539e1af547b030 Gerrit-Change-Number: 13825 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:13:54 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 30 Apr 2019 21:13:54 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Make it possible to add tests to the ms driver Message-ID: Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/13826 Change subject: virtual: Make it possible to add tests to the ms driver ...................................................................... virtual: Make it possible to add tests to the ms driver Introduce an Executor that forwards all testcase related methods to a list of testcases. Allow to instantiate them by name and use the result to access the statistics. Change-Id: Ia65ee53987e92b24e6b8c40e1376bc74dc260180 --- M src/osmo_gsm_tester/ms_driver.py M src/osmo_ms_driver/test_support.py M suites/nitb_netreg_mass/register_default_mass.py 3 files changed, 82 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/26/13826/1 diff --git a/src/osmo_gsm_tester/ms_driver.py b/src/osmo_gsm_tester/ms_driver.py index dddedf7..355a03e 100644 --- a/src/osmo_gsm_tester/ms_driver.py +++ b/src/osmo_gsm_tester/ms_driver.py @@ -22,6 +22,7 @@ from osmo_ms_driver.simple_loop import SimpleLoop from osmo_ms_driver.location_update_test import MassUpdateLocationTest from osmo_ms_driver.starter import BinaryOptions, MobileTestStarter +from osmo_ms_driver.test_support import TestExecutor import os.path import shutil @@ -39,14 +40,20 @@ self._test_duration = timedelta(seconds=120) self._cdf = cdfs["ease_in_out"](self._time_start, self._time_step) self._loop = SimpleLoop() - self._test_case = None + self._executor = TestExecutor() self.event_server_sk_tmp_dir = None self._subscribers = [] self._configured = False + self._results = {} - if len(self.event_server_path().encode()) > 107: + # Set-up and start the event server + event_server_path = self.event_server_path() + if len(event_server_path.encode()) > 107: raise log.Error('Path for event_server socket is longer than max allowed len for unix socket path (107):', self.event_server_path()) + self._ev_server = EventServer("ev_server", event_server_path) + self._ev_server.listen(self._loop) + def event_server_path(self): if self.event_server_sk_tmp_dir is None: self.event_server_sk_tmp_dir = tempfile.mkdtemp('', 'ogteventserversk') @@ -83,27 +90,39 @@ """Adds a subscriber to the list of subscribers.""" self._subscribers.append(subscriber) + def add_test(self, test_name, **kwargs): + """ + Instantiates and returns a test for the given name. + + The instance created and added will be returned. + """ + if test_name == 'update_location': + test = MassUpdateLocationTest("mass", + self._ev_server, self._results) + + # Verify that a test was instantiated. + if test_name is None: + raise Exception("Unknown test_name: " + test_name) + + # Add it to the executor and return it. + self._executor.add_test(test) + return test + def configure(self): """ Configures the subscribers, tests and registration server. Needs to be called after the complete configuration of this driver. """ - event_server_path = self.event_server_path() - - self._ev_server = EventServer("ev_server", event_server_path) - self._ev_server.listen(self._loop) - self._results = {} options = self.build_binary_options() self._starter = MobileTestStarter("mass", options, self._cdf, self._ev_server, util.Dir(self.event_server_sk_tmp_dir), self._results, suite_run=self._suite_run) - self._test_case = MassUpdateLocationTest("mass", self._ev_server, self._results) for sub in self._subscribers: self._starter.subscriber_add(sub) - self._test_case.configure(len(self._subscribers)) + self._executor.configure(len(self._subscribers)) self._configured = True def run_test(self): @@ -114,34 +133,16 @@ """ if not self._configured: self.configure() - self._test_case.before_start() + self._executor.before_start() deadline = self._starter.start_all(self._loop, self._test_duration) - self._test_case.after_start() - self._test_case.wait_for_test(self._loop, deadline) + self._executor.after_start() + self._executor.wait_for_test(self._loop, deadline) def print_stats(self): """ Prints statistics about the test run. """ - self._test_case.print_stats() - - def get_stats(self): - """ - Returns a statistical summary of the test. - """ - return self._test_case.get_stats() - - def get_result_values(self): - """ - Returns the raw result values of the test run in any order. - """ - return self._test_case.get_result_values() - - def lus_less_than(self, acceptable_delay): - """ - Returns the results that completed their LU within the acceptable delay. - """ - return self._test_case.lus_less_than(acceptable_delay) + self._executor.print_stats() def cleanup(self): """ diff --git a/src/osmo_ms_driver/test_support.py b/src/osmo_ms_driver/test_support.py index cbfd444..f7910dd 100644 --- a/src/osmo_ms_driver/test_support.py +++ b/src/osmo_ms_driver/test_support.py @@ -18,6 +18,8 @@ from abc import ABCMeta from osmo_gsm_tester import log +import time + def imsi_ki_gen(): """ Generate IMSIs and KIs to be used by test. @@ -93,3 +95,48 @@ def print_stats(self): """Prints statistics/results of the test.""" pass + + +class TestExecutor(log.Origin): + """Execute/Wait for a list of tests to complete.""" + + def __init__(self): + super().__init__(log.C_RUN, "executor") + self._tests = [] + + def add_test(self, test): + self._tests.append(test) + + def configure(self, num_subscriber): + for test in self._tests: + test.configure(num_subscriber) + + def before_start(self): + for test in self._tests: + test.before_start() + + def after_start(self): + for test in self._tests: + test.after_start() + + def print_stats(self): + """Prints statistics/results of the test.""" + for test in self._tests: + test.print_stats() + + def all_tests_completed(self): + """Returns true if all tests completed.""" + for test in self._tests: + if not test.has_completed(): + return False + return True + + def wait_for_test(self, loop, deadline): + """Waits up to the absolute deadline for all tests to complete.""" + while not self.all_tests_completed(): + now_time = time.clock_gettime(time.CLOCK_MONOTONIC) + sleep_time = deadline - now_time + if sleep_time < 0: + break + loop.schedule_timeout(sleep_time) + loop.select() diff --git a/suites/nitb_netreg_mass/register_default_mass.py b/suites/nitb_netreg_mass/register_default_mass.py index f4e5e80..d6782e7 100644 --- a/suites/nitb_netreg_mass/register_default_mass.py +++ b/suites/nitb_netreg_mass/register_default_mass.py @@ -10,6 +10,7 @@ nitb = suite.nitb() bts = suite.bts() ms_driver = suite.ms_driver() +ul = ms_driver.add_test('update_location') modems = suite.all_resources(suite.modem) print('Launching a simple network') @@ -35,7 +36,7 @@ # # 99% of LUs should complete # 99% of successful LUs should complete within 10s. -stats = ms_driver.get_stats() +stats = ul.get_stats() if len(modems) > 0 and stats.num_completed < 1: raise Exception("No run completed.") completion_ratio = stats.num_completed / stats.num_attempted @@ -46,7 +47,7 @@ # Check how many results are below our threshold. acceptable_delay = timedelta(seconds=30) -quick_enough = len(ms_driver.lus_less_than(acceptable_delay)) +quick_enough = len(ul.lus_less_than(acceptable_delay)) latency_ratio = quick_enough / stats.num_attempted if latency_ratio < 0.99: raise Exception("Latency ratio of %f%% lower than threshold." % (latency_ratio * 100.0)) -- To view, visit https://gerrit.osmocom.org/13826 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia65ee53987e92b24e6b8c40e1376bc74dc260180 Gerrit-Change-Number: 13826 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:13:54 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 30 Apr 2019 21:13:54 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Make mass tests be able to activate themselves Message-ID: Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/13827 Change subject: virtual: Make mass tests be able to activate themselves ...................................................................... virtual: Make mass tests be able to activate themselves We will need to enable/disable generation of lua script code depending on the subscriber and mass test. Change-Id: Ide4d788543d910356efe9f61e789b3975f7bc558 --- M src/osmo_gsm_tester/ms_driver.py M src/osmo_ms_driver/location_update_test.py M src/osmo_ms_driver/starter.py M src/osmo_ms_driver/test_support.py 4 files changed, 37 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/27/13827/1 diff --git a/src/osmo_gsm_tester/ms_driver.py b/src/osmo_gsm_tester/ms_driver.py index 355a03e..34915f7 100644 --- a/src/osmo_gsm_tester/ms_driver.py +++ b/src/osmo_gsm_tester/ms_driver.py @@ -122,7 +122,7 @@ for sub in self._subscribers: self._starter.subscriber_add(sub) - self._executor.configure(len(self._subscribers)) + self._executor.configure(self._subscribers, self._starter.mobiles()) self._configured = True def run_test(self): diff --git a/src/osmo_ms_driver/location_update_test.py b/src/osmo_ms_driver/location_update_test.py index 1a33f09..73f4d8c 100644 --- a/src/osmo_ms_driver/location_update_test.py +++ b/src/osmo_ms_driver/location_update_test.py @@ -60,9 +60,13 @@ super().__init__(name, event_server, results) self._event_server.register(self.handle_msg) - def configure(self, num_subscribers): - self._num_subscribers = num_subscribers - self._outstanding = num_subscribers + def configure(self, subscribers, mobiles): + # Enable the LU test script in each mobile + for mobile in mobiles: + mobile.setitem('run_lu_test', True) + + self._num_subscribers = len(subscribers) + self._outstanding = self._num_subscribers def handle_msg(self, _data, addr, time): data = json.loads(_data.decode()) diff --git a/src/osmo_ms_driver/starter.py b/src/osmo_ms_driver/starter.py index 61d3bb0..3a13034 100644 --- a/src/osmo_ms_driver/starter.py +++ b/src/osmo_ms_driver/starter.py @@ -85,23 +85,32 @@ self._ki = subscriber.ki() self._omob_proc = None + lua_support = os.path.join(os.path.dirname(__file__), 'lua') + self._cfg = { + 'test': { + 'event_path': self._ev_server_path, + 'lua_support': lua_support, + } + } + def imsi(self): return self._imsi def ki(self): return self._ki + def setitem(self, key, value): + """ + Sets `key` to `value` inside the test dictionary. + + Used by testcases to pass per MS settings into the lua script + generator. + """ + self._cfg['test'][key] = value + def write_lua_cfg(self): - lua_support = os.path.join(os.path.dirname(__file__), 'lua') - cfg = { - 'test': { - 'event_path': self._ev_server_path, - 'lua_support': lua_support, - 'run_lu_test': True, - } - } lua_cfg_file = os.path.join(self._tmp_dir, "lua_" + self._name_number + ".lua") - lua_script = template.render(self._lua_template, cfg) + lua_script = template.render(self._lua_template, self._cfg) with open(lua_cfg_file, 'w') as w: w.write(lua_script) return lua_cfg_file @@ -140,6 +149,10 @@ if self._omob_proc: self._omob_proc.terminate() + def mobiles(self): + """Returns the list of mobiles configured.""" + return self._mobiles + class MobileTestStarter(log.Origin): """ diff --git a/src/osmo_ms_driver/test_support.py b/src/osmo_ms_driver/test_support.py index f7910dd..97f1313 100644 --- a/src/osmo_ms_driver/test_support.py +++ b/src/osmo_ms_driver/test_support.py @@ -76,8 +76,13 @@ self._event_server = event_server self._results = results - def configure(self, num_subscribers): - """Configures the test given the (number) of subscribers.""" + def configure(self, subscribers, mobiles): + """ + Configures the test given the subscribers. + + The subscriber at index _i_ belongs to the mobile at the + same index. subscribers[i] == mobiles[i].subscriber(). + """ pass def before_start(self): -- To view, visit https://gerrit.osmocom.org/13827 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ide4d788543d910356efe9f61e789b3975f7bc558 Gerrit-Change-Number: 13827 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:23:48 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 30 Apr 2019 21:23:48 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Make mass tests be able to activate themselves In-Reply-To: References: Message-ID: Holger Freyther has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/13827 ) Change subject: virtual: Make mass tests be able to activate themselves ...................................................................... virtual: Make mass tests be able to activate themselves We will need to enable/disable generation of lua script code depending on the subscriber and mass test. Change-Id: Ide4d788543d910356efe9f61e789b3975f7bc558 --- M src/osmo_gsm_tester/ms_driver.py M src/osmo_ms_driver/location_update_test.py M src/osmo_ms_driver/starter.py M src/osmo_ms_driver/test_support.py 4 files changed, 37 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/27/13827/2 -- To view, visit https://gerrit.osmocom.org/13827 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ide4d788543d910356efe9f61e789b3975f7bc558 Gerrit-Change-Number: 13827 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:29:54 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 30 Apr 2019 21:29:54 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Make mass tests be able to activate themselves In-Reply-To: References: Message-ID: Holger Freyther has uploaded a new patch set (#3). ( https://gerrit.osmocom.org/13827 ) Change subject: virtual: Make mass tests be able to activate themselves ...................................................................... virtual: Make mass tests be able to activate themselves We will need to enable/disable generation of lua script code depending on the subscriber and mass test. Change-Id: Ide4d788543d910356efe9f61e789b3975f7bc558 --- M src/osmo_gsm_tester/ms_driver.py M src/osmo_ms_driver/location_update_test.py M src/osmo_ms_driver/starter.py M src/osmo_ms_driver/test_support.py 4 files changed, 39 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/27/13827/3 -- To view, visit https://gerrit.osmocom.org/13827 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ide4d788543d910356efe9f61e789b3975f7bc558 Gerrit-Change-Number: 13827 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:50:13 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Apr 2019 21:50:13 +0000 Subject: Change in osmo-trx[master]: uhd: smpl_buf: Use TIMESTAMP type in str_status Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13828 Change subject: uhd: smpl_buf: Use TIMESTAMP type in str_status ...................................................................... uhd: smpl_buf: Use TIMESTAMP type in str_status Other related functions use "TIMESTAMP timestamp" so let's use same stuff in that function. Change-Id: I016b1a7f8db379caebc1409ca11e5ae8b759d2d4 --- M Transceiver52M/device/uhd/smpl_buf.cpp M Transceiver52M/device/uhd/smpl_buf.h 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/28/13828/1 diff --git a/Transceiver52M/device/uhd/smpl_buf.cpp b/Transceiver52M/device/uhd/smpl_buf.cpp index 54ac10e..7f2f820 100644 --- a/Transceiver52M/device/uhd/smpl_buf.cpp +++ b/Transceiver52M/device/uhd/smpl_buf.cpp @@ -114,11 +114,11 @@ return len; } -std::string smpl_buf::str_status(size_t ts) const +std::string smpl_buf::str_status(TIMESTAMP timestamp) const { std::ostringstream ost("Sample buffer: "); - ost << "timestamp = " << ts; + ost << "timestamp = " << timestamp; ost << ", length = " << buf_len; ost << ", time_start = " << time_start; ost << ", time_end = " << time_end; diff --git a/Transceiver52M/device/uhd/smpl_buf.h b/Transceiver52M/device/uhd/smpl_buf.h index 95df825..067ac1a 100644 --- a/Transceiver52M/device/uhd/smpl_buf.h +++ b/Transceiver52M/device/uhd/smpl_buf.h @@ -52,7 +52,7 @@ /** Buffer status string @return a formatted string describing internal buffer state */ - std::string str_status(size_t ts) const; + std::string str_status(TIMESTAMP timestamp) const; /** Formatted error string @param code an error code -- To view, visit https://gerrit.osmocom.org/13828 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I016b1a7f8db379caebc1409ca11e5ae8b759d2d4 Gerrit-Change-Number: 13828 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:50:13 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Apr 2019 21:50:13 +0000 Subject: Change in osmo-trx[master]: cosmetic: uhd: Use loglevel ERROR instead of ERR Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13829 Change subject: cosmetic: uhd: Use loglevel ERROR instead of ERR ...................................................................... cosmetic: uhd: Use loglevel ERROR instead of ERR ERR is osmo-trx legacy level, which actually converts to osmocom's ERROR, so let's use that one directly. Change-Id: I82f6f89a725bea7f7acfa455c20cf922cc3f8a00 --- M Transceiver52M/device/uhd/UHDDevice.cpp 1 file changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/29/13829/1 diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp index 40ef2a0..34ffd57 100644 --- a/Transceiver52M/device/uhd/UHDDevice.cpp +++ b/Transceiver52M/device/uhd/UHDDevice.cpp @@ -149,7 +149,7 @@ LOGC(DDEV, WARNING) << msg; break; case uhd::msg::error: - LOGC(DDEV, ERR) << msg; + LOGC(DDEV, ERROR) << msg; break; case uhd::msg::fastpath: break; @@ -601,7 +601,7 @@ LOGC(DDEV, INFO) << "Starting USRP..."; if (started) { - LOGC(DDEV, ERR) << "Device already started"; + LOGC(DDEV, ERROR) << "Device already started"; return false; } @@ -652,7 +652,7 @@ int uhd_device::check_rx_md_err(uhd::rx_metadata_t &md, ssize_t num_smpls) { if (!num_smpls) { - LOGC(DDEV, ERR) << str_code(md); + LOGC(DDEV, ERROR) << str_code(md); switch (md.error_code) { case uhd::rx_metadata_t::ERROR_CODE_TIMEOUT: @@ -715,8 +715,8 @@ // Check that timestamp is valid rc = rx_buffers[0]->avail_smpls(timestamp); if (rc < 0) { - LOGC(DDEV, ERR) << rx_buffers[0]->str_code(rc); - LOGC(DDEV, ERR) << rx_buffers[0]->str_status(timestamp); + LOGC(DDEV, ERROR) << rx_buffers[0]->str_code(rc); + LOGC(DDEV, ERROR) << rx_buffers[0]->str_status(timestamp); return 0; } @@ -763,8 +763,8 @@ // Continue on local overrun, exit on other errors if ((rc < 0)) { - LOGC(DDEV, ERR) << rx_buffers[i]->str_code(rc); - LOGC(DDEV, ERR) << rx_buffers[i]->str_status(timestamp); + LOGC(DDEV, ERROR) << rx_buffers[i]->str_code(rc); + LOGC(DDEV, ERROR) << rx_buffers[i]->str_status(timestamp); if (rc != smpl_buf::ERROR_OVERFLOW) return 0; } @@ -775,8 +775,8 @@ for (size_t i = 0; i < rx_buffers.size(); i++) { rc = rx_buffers[i]->read(bufs[i], len, timestamp); if ((rc < 0) || (rc != len)) { - LOGC(DDEV, ERR) << rx_buffers[i]->str_code(rc); - LOGC(DDEV, ERR) << rx_buffers[i]->str_status(timestamp); + LOGC(DDEV, ERROR) << rx_buffers[i]->str_code(rc); + LOGC(DDEV, ERROR) << rx_buffers[i]->str_status(timestamp); return 0; } } @@ -797,7 +797,7 @@ // No control packets if (isControl) { - LOGC(DDEV, ERR) << "Control packets not supported"; + LOGC(DDEV, ERROR) << "Control packets not supported"; return 0; } @@ -1110,7 +1110,7 @@ if ((md.event_code != uhd::async_metadata_t::EVENT_CODE_UNDERFLOW) && (md.event_code != uhd::async_metadata_t::EVENT_CODE_TIME_ERROR)) { - LOGC(DDEV, ERR) << str_code(md); + LOGC(DDEV, ERROR) << str_code(md); } } -- To view, visit https://gerrit.osmocom.org/13829 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I82f6f89a725bea7f7acfa455c20cf922cc3f8a00 Gerrit-Change-Number: 13829 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:50:14 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Apr 2019 21:50:14 +0000 Subject: Change in osmo-trx[master]: uhd: Avoid reallocation of buffers every read Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13830 Change subject: uhd: Avoid reallocation of buffers every read ...................................................................... uhd: Avoid reallocation of buffers every read Buffer size is based on num of chans and rxBuffer size is based on num of chans and rx_spp, and both are available and set during open(), so no need to waste time allocating and freeing them everytime we read from the device. Change-Id: I8c881c9c303c80f323825d85a924d74b76d2ce47 --- M Transceiver52M/device/uhd/UHDDevice.cpp M Transceiver52M/device/uhd/UHDDevice.h 2 files changed, 10 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/30/13830/1 diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp index 34ffd57..6214666 100644 --- a/Transceiver52M/device/uhd/UHDDevice.cpp +++ b/Transceiver52M/device/uhd/UHDDevice.cpp @@ -516,6 +516,11 @@ for (size_t i = 0; i < rx_buffers.size(); i++) rx_buffers[i] = new smpl_buf(buf_len, rx_rate); + // Create vector buffer + pkt_bufs = std::vector >(chans, std::vector(2 * rx_spp)); + for (size_t i = 0; i < pkt_bufs.size(); i++) + pkt_ptrs.push_back(&pkt_bufs[i].front()); + // Initialize and shadow gain values init_gains(); @@ -549,13 +554,6 @@ size_t num_smpls; float timeout = UHD_RESTART_TIMEOUT; - std::vector > - pkt_bufs(chans, std::vector(2 * rx_spp)); - - std::vector pkt_ptrs; - for (size_t i = 0; i < pkt_bufs.size(); i++) - pkt_ptrs.push_back(&pkt_bufs[i].front()); - ts_initial = 0; while (!ts_initial || (num_pkts-- > 0)) { num_smpls = rx_stream->recv(pkt_ptrs, rx_spp, md, @@ -720,14 +718,6 @@ return 0; } - // Create vector buffer - std::vector > - pkt_bufs(chans, std::vector(2 * rx_spp)); - - std::vector pkt_ptrs; - for (size_t i = 0; i < pkt_bufs.size(); i++) - pkt_ptrs.push_back(&pkt_bufs[i].front()); - // Receive samples from the usrp until we have enough while (rx_buffers[0]->avail_smpls(timestamp) < len) { thread_enable_cancel(false); diff --git a/Transceiver52M/device/uhd/UHDDevice.h b/Transceiver52M/device/uhd/UHDDevice.h index 93a9660..2a73a2b 100644 --- a/Transceiver52M/device/uhd/UHDDevice.h +++ b/Transceiver52M/device/uhd/UHDDevice.h @@ -143,6 +143,11 @@ TIMESTAMP ts_initial, ts_offset; std::vector rx_buffers; + /* Sample buffers used to receive samples from UHD: */ + std::vector > pkt_bufs; + /* Used to call UHD API: Buffer pointer of each elem in pkt_ptrs will + point to corresponding buffer of vector pkt_bufs. */ + std::vector pkt_ptrs; void init_gains(); void set_channels(bool swap); -- To view, visit https://gerrit.osmocom.org/13830 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8c881c9c303c80f323825d85a924d74b76d2ce47 Gerrit-Change-Number: 13830 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:50:14 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Apr 2019 21:50:14 +0000 Subject: Change in osmo-trx[master]: Move smpl_buf out of uhd dir to re-use it in other devices Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13831 Change subject: Move smpl_buf out of uhd dir to re-use it in other devices ...................................................................... Move smpl_buf out of uhd dir to re-use it in other devices Change-Id: I39ac8435072cff8d4dac786b31ff4af9b61a77fe --- M Transceiver52M/device/Makefile.am R Transceiver52M/device/smpl_buf.cpp R Transceiver52M/device/smpl_buf.h M Transceiver52M/device/uhd/Makefile.am 4 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/31/13831/1 diff --git a/Transceiver52M/device/Makefile.am b/Transceiver52M/device/Makefile.am index 1a2d077..e653a9e 100644 --- a/Transceiver52M/device/Makefile.am +++ b/Transceiver52M/device/Makefile.am @@ -1,6 +1,6 @@ include $(top_srcdir)/Makefile.common -noinst_HEADERS = radioDevice.h +noinst_HEADERS = radioDevice.h smpl_buf.h SUBDIRS = diff --git a/Transceiver52M/device/uhd/smpl_buf.cpp b/Transceiver52M/device/smpl_buf.cpp similarity index 100% rename from Transceiver52M/device/uhd/smpl_buf.cpp rename to Transceiver52M/device/smpl_buf.cpp diff --git a/Transceiver52M/device/uhd/smpl_buf.h b/Transceiver52M/device/smpl_buf.h similarity index 100% rename from Transceiver52M/device/uhd/smpl_buf.h rename to Transceiver52M/device/smpl_buf.h diff --git a/Transceiver52M/device/uhd/Makefile.am b/Transceiver52M/device/uhd/Makefile.am index 4fcc0d7..11b380e 100644 --- a/Transceiver52M/device/uhd/Makefile.am +++ b/Transceiver52M/device/uhd/Makefile.am @@ -3,8 +3,8 @@ AM_CPPFLAGS = -Wall $(STD_DEFINES_AND_INCLUDES) -I${srcdir}/.. AM_CXXFLAGS = -lpthread $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(UHD_CFLAGS) -noinst_HEADERS = UHDDevice.h smpl_buf.h +noinst_HEADERS = UHDDevice.h noinst_LTLIBRARIES = libdevice.la -libdevice_la_SOURCES = UHDDevice.cpp smpl_buf.cpp +libdevice_la_SOURCES = UHDDevice.cpp ../smpl_buf.cpp -- To view, visit https://gerrit.osmocom.org/13831 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I39ac8435072cff8d4dac786b31ff4af9b61a77fe Gerrit-Change-Number: 13831 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:50:14 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Apr 2019 21:50:14 +0000 Subject: Change in osmo-trx[master]: device: Drop unused numberRead/numberWritten APIs Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13832 Change subject: device: Drop unused numberRead/numberWritten APIs ...................................................................... device: Drop unused numberRead/numberWritten APIs It's really not used, so let's drop unused code and simplify work for new to come device drivers implementation. Change-Id: I0d18f9c2584771e2f7b3d5c6b016e764e02855ff --- M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/lms/LMSDevice.h M Transceiver52M/device/radioDevice.h M Transceiver52M/device/uhd/UHDDevice.cpp M Transceiver52M/device/uhd/UHDDevice.h M Transceiver52M/device/usrp1/USRPDevice.cpp M Transceiver52M/device/usrp1/USRPDevice.h 7 files changed, 1 insertion(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/32/13832/1 diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index 7071589..be51a12 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -238,8 +238,6 @@ goto out_close; } - samplesRead = 0; - samplesWritten = 0; started = false; return NORMAL; @@ -630,8 +628,6 @@ thread_enable_cancel(true); } - samplesRead += rc; - if (((TIMESTAMP) rx_metadata.timestamp) < timestamp) rc = 0; @@ -678,8 +674,6 @@ thread_enable_cancel(true); } - samplesWritten += rc; - return rc; } diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h index 225839d..b0ff03b 100644 --- a/Transceiver52M/device/lms/LMSDevice.h +++ b/Transceiver52M/device/lms/LMSDevice.h @@ -55,9 +55,6 @@ double actualSampleRate; ///< the actual USRP sampling rate - unsigned long long samplesRead; ///< number of samples read from LMS - unsigned long long samplesWritten; ///< number of samples sent to LMS - bool started; ///< flag indicates LMS has started bool skipRx; ///< set if LMS is transmit-only. @@ -203,12 +200,6 @@ inline double getSampleRate() { return actualSampleRate; } - inline double numberRead() { - return samplesRead; - } - inline double numberWritten() { - return samplesWritten; - } }; #endif // _LMS_DEVICE_H_ diff --git a/Transceiver52M/device/radioDevice.h b/Transceiver52M/device/radioDevice.h index 5d001fb..30e0f43 100644 --- a/Transceiver52M/device/radioDevice.h +++ b/Transceiver52M/device/radioDevice.h @@ -161,8 +161,6 @@ virtual double getTxFreq(size_t chan = 0) = 0; virtual double getRxFreq(size_t chan = 0) = 0; virtual double getSampleRate()=0; - virtual double numberRead()=0; - virtual double numberWritten()=0; protected: size_t tx_sps, rx_sps; diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp index 6214666..79e5855 100644 --- a/Transceiver52M/device/uhd/UHDDevice.cpp +++ b/Transceiver52M/device/uhd/UHDDevice.cpp @@ -165,7 +165,7 @@ tx_gain_min(0.0), tx_gain_max(0.0), rx_gain_min(0.0), rx_gain_max(0.0), tx_spp(0), rx_spp(0), - started(false), aligned(false), rx_pkt_cnt(0), drop_cnt(0), + started(false), aligned(false), drop_cnt(0), prev_ts(0,0), ts_initial(0), ts_offset(0), async_event_thrd(NULL) { } @@ -725,8 +725,6 @@ metadata, 0.1, true); thread_enable_cancel(true); - rx_pkt_cnt++; - // Check for errors rc = check_rx_md_err(metadata, num_smpls); switch (rc) { diff --git a/Transceiver52M/device/uhd/UHDDevice.h b/Transceiver52M/device/uhd/UHDDevice.h index 2a73a2b..2a9fc02 100644 --- a/Transceiver52M/device/uhd/UHDDevice.h +++ b/Transceiver52M/device/uhd/UHDDevice.h @@ -103,8 +103,6 @@ GSM::Time minLatency(); inline double getSampleRate() { return tx_rate; } - inline double numberRead() { return rx_pkt_cnt; } - inline double numberWritten() { return 0; } /** Receive and process asynchronous message @return true if message received or false on timeout or error @@ -137,7 +135,6 @@ bool started; bool aligned; - size_t rx_pkt_cnt; size_t drop_cnt; uhd::time_spec_t prev_ts; diff --git a/Transceiver52M/device/usrp1/USRPDevice.cpp b/Transceiver52M/device/usrp1/USRPDevice.cpp index 2343fb6..b1d6c56 100644 --- a/Transceiver52M/device/usrp1/USRPDevice.cpp +++ b/Transceiver52M/device/usrp1/USRPDevice.cpp @@ -173,8 +173,6 @@ m_dbTx = m_uTx->selected_subdev(txSubdevSpec); m_dbRx = m_uRx->selected_subdev(rxSubdevSpec); - samplesRead = 0; - samplesWritten = 0; started = false; return NORMAL; @@ -505,7 +503,6 @@ gettimeofday(&lastReadTime,NULL); firstRead = true; } - samplesRead += numSamples; return numSamples; #endif @@ -555,14 +552,12 @@ } m_uTx->write((const void*) outPkt,sizeof(uint32_t)*128*numPkts,NULL); - samplesWritten += len/2/sizeof(short); writeLock.unlock(); return len/2/sizeof(short); #else int retVal = len; memcpy(loopbackBuffer+loopbackBufferSize,buf,sizeof(short)*2*len); - samplesWritten += retVal; loopbackBufferSize += retVal*2; return retVal; diff --git a/Transceiver52M/device/usrp1/USRPDevice.h b/Transceiver52M/device/usrp1/USRPDevice.h index 521d81d..c02e58c 100644 --- a/Transceiver52M/device/usrp1/USRPDevice.h +++ b/Transceiver52M/device/usrp1/USRPDevice.h @@ -51,9 +51,6 @@ double actualSampleRate; ///< the actual USRP sampling rate unsigned int decimRate; ///< the USRP decimation rate - unsigned long long samplesRead; ///< number of samples read from USRP - unsigned long long samplesWritten; ///< number of samples sent to USRP - bool started; ///< flag indicates USRP has started static const unsigned int currDataSize_log2 = 21; @@ -201,8 +198,6 @@ inline double getTxFreq(size_t chan = 0) { return 0; } inline double getRxFreq(size_t chan = 0) { return 0; } inline double getSampleRate() { return actualSampleRate; } - inline double numberRead() { return samplesRead; } - inline double numberWritten() { return samplesWritten; } }; #endif // _USRP_DEVICE_H_ -- To view, visit https://gerrit.osmocom.org/13832 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0d18f9c2584771e2f7b3d5c6b016e764e02855ff Gerrit-Change-Number: 13832 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:50:14 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Apr 2019 21:50:14 +0000 Subject: Change in osmo-trx[master]: uhd: No need to use dynamic mem for rx_buffers Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13833 Change subject: uhd: No need to use dynamic mem for rx_buffers ...................................................................... uhd: No need to use dynamic mem for rx_buffers This way we don't need to free explicitly and we simplify code. Change-Id: I39b293c24053298256626fa78344102032fc2104 --- M Transceiver52M/device/uhd/UHDDevice.cpp M Transceiver52M/device/uhd/UHDDevice.h 2 files changed, 12 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/33/13833/1 diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp index 79e5855..3e53111 100644 --- a/Transceiver52M/device/uhd/UHDDevice.cpp +++ b/Transceiver52M/device/uhd/UHDDevice.cpp @@ -173,9 +173,6 @@ uhd_device::~uhd_device() { stop(); - - for (size_t i = 0; i < rx_buffers.size(); i++) - delete rx_buffers[i]; } void uhd_device::init_gains() @@ -459,7 +456,6 @@ rx_freqs.resize(chans); tx_gains.resize(chans); rx_gains.resize(chans); - rx_buffers.resize(chans); switch (ref) { case REF_INTERNAL: @@ -513,8 +509,7 @@ // Create receive buffer size_t buf_len = SAMPLE_BUF_SZ / sizeof(uint32_t); - for (size_t i = 0; i < rx_buffers.size(); i++) - rx_buffers[i] = new smpl_buf(buf_len, rx_rate); + rx_buffers = std::vector(chans, smpl_buf(buf_len, rx_rate)); // Create vector buffer pkt_bufs = std::vector >(chans, std::vector(2 * rx_spp)); @@ -711,15 +706,15 @@ LOGC(DDEV, DEBUG) << "Requested timestamp = " << ts.get_real_secs(); // Check that timestamp is valid - rc = rx_buffers[0]->avail_smpls(timestamp); + rc = rx_buffers[0].avail_smpls(timestamp); if (rc < 0) { - LOGC(DDEV, ERROR) << rx_buffers[0]->str_code(rc); - LOGC(DDEV, ERROR) << rx_buffers[0]->str_status(timestamp); + LOGC(DDEV, ERROR) << rx_buffers[0].str_code(rc); + LOGC(DDEV, ERROR) << rx_buffers[0].str_status(timestamp); return 0; } // Receive samples from the usrp until we have enough - while (rx_buffers[0]->avail_smpls(timestamp) < len) { + while (rx_buffers[0].avail_smpls(timestamp) < len) { thread_enable_cancel(false); size_t num_smpls = rx_stream->recv(pkt_ptrs, rx_spp, metadata, 0.1, true); @@ -745,14 +740,14 @@ LOGC(DDEV, DEBUG) << "Received timestamp = " << ts.get_real_secs(); for (size_t i = 0; i < rx_buffers.size(); i++) { - rc = rx_buffers[i]->write((short *) &pkt_bufs[i].front(), + rc = rx_buffers[i].write((short *) &pkt_bufs[i].front(), num_smpls, metadata.time_spec.to_ticks(rx_rate)); // Continue on local overrun, exit on other errors if ((rc < 0)) { - LOGC(DDEV, ERROR) << rx_buffers[i]->str_code(rc); - LOGC(DDEV, ERROR) << rx_buffers[i]->str_status(timestamp); + LOGC(DDEV, ERROR) << rx_buffers[i].str_code(rc); + LOGC(DDEV, ERROR) << rx_buffers[i].str_status(timestamp); if (rc != smpl_buf::ERROR_OVERFLOW) return 0; } @@ -761,10 +756,10 @@ // We have enough samples for (size_t i = 0; i < rx_buffers.size(); i++) { - rc = rx_buffers[i]->read(bufs[i], len, timestamp); + rc = rx_buffers[i].read(bufs[i], len, timestamp); if ((rc < 0) || (rc != len)) { - LOGC(DDEV, ERROR) << rx_buffers[i]->str_code(rc); - LOGC(DDEV, ERROR) << rx_buffers[i]->str_status(timestamp); + LOGC(DDEV, ERROR) << rx_buffers[i].str_code(rc); + LOGC(DDEV, ERROR) << rx_buffers[i].str_status(timestamp); return 0; } } diff --git a/Transceiver52M/device/uhd/UHDDevice.h b/Transceiver52M/device/uhd/UHDDevice.h index 2a9fc02..5d7e4bd 100644 --- a/Transceiver52M/device/uhd/UHDDevice.h +++ b/Transceiver52M/device/uhd/UHDDevice.h @@ -139,7 +139,7 @@ uhd::time_spec_t prev_ts; TIMESTAMP ts_initial, ts_offset; - std::vector rx_buffers; + std::vector rx_buffers; /* Sample buffers used to receive samples from UHD: */ std::vector > pkt_bufs; /* Used to call UHD API: Buffer pointer of each elem in pkt_ptrs will -- To view, visit https://gerrit.osmocom.org/13833 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I39b293c24053298256626fa78344102032fc2104 Gerrit-Change-Number: 13833 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:54:47 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 30 Apr 2019 21:54:47 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Make mass tests be able to activate themselves In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/13827 ) Change subject: virtual: Make mass tests be able to activate themselves ...................................................................... Patch Set 4: This change is ready for review. -- To view, visit https://gerrit.osmocom.org/13827 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ide4d788543d910356efe9f61e789b3975f7bc558 Gerrit-Change-Number: 13827 Gerrit-PatchSet: 4 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Comment-Date: Tue, 30 Apr 2019 21:54:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 21:55:48 2019 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 30 Apr 2019 21:55:48 +0000 Subject: Change in osmo-gsm-tester[master]: virtual: Make mass tests be able to activate themselves In-Reply-To: References: Message-ID: Holger Freyther has uploaded a new patch set (#5). ( https://gerrit.osmocom.org/13827 ) Change subject: virtual: Make mass tests be able to activate themselves ...................................................................... virtual: Make mass tests be able to activate themselves We will need to enable/disable generation of lua script code depending on the subscriber and mass test. Change-Id: Ide4d788543d910356efe9f61e789b3975f7bc558 --- M src/osmo_gsm_tester/ms_driver.py M src/osmo_ms_driver/__main__.py M src/osmo_ms_driver/location_update_test.py M src/osmo_ms_driver/starter.py M src/osmo_ms_driver/test_support.py 5 files changed, 42 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/27/13827/5 -- To view, visit https://gerrit.osmocom.org/13827 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ide4d788543d910356efe9f61e789b3975f7bc558 Gerrit-Change-Number: 13827 Gerrit-PatchSet: 5 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 22:20:15 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Apr 2019 22:20:15 +0000 Subject: Change in osmo-trx[master]: uhd: smpl_buf: Drop UHD specifics out back to UHDDevice In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13810 ) Change subject: uhd: smpl_buf: Drop UHD specifics out back to UHDDevice ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/13810 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I94061328d46a550d4147121d85baffa29c700c45 Gerrit-Change-Number: 13810 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: tnt Gerrit-Comment-Date: Tue, 30 Apr 2019 22:20:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Apr 30 22:20:57 2019 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Apr 2019 22:20:57 +0000 Subject: Change in osmo-trx[master]: cosmetic: uhd: Move smpl_buf out of UHDDevice, move UHDDevice class d... In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/13809 ) Change subject: cosmetic: uhd: Move smpl_buf out of UHDDevice, move UHDDevice class definition to .h ...................................................................... Patch Set 1: Did that during my flight back, see next patches :) -- To view, visit https://gerrit.osmocom.org/13809 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib4594320da9bb7f6e9f52e7d70d11ecd11106aae Gerrit-Change-Number: 13809 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: tnt Gerrit-Comment-Date: Tue, 30 Apr 2019 22:20:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: